plover/ascii-ctype.h
author J. Ali Harlow <ali@juiblex.co.uk>
Mon Aug 31 07:12:16 2020 +0100 (2020-08-31)
changeset 104 5cb36c12ac49
parent 81 734c6230e41f
permissions -rw-r--r--
Prepare to release 0.6
     1 /*
     2  * Copyright (C) 2016, 2018  J. Ali Harlow <ali@juiblex.co.uk>
     3  *
     4  * This program is free software; you can redistribute it and/or modify
     5  * it under the terms of the GNU General Public License as published by
     6  * the Free Software Foundation; either version 2 of the License, or
     7  * (at your option) any later version.
     8  *
     9  * This program is distributed in the hope that it will be useful,
    10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    12  * GNU General Public License for more details.
    13  *
    14  * You should have received a copy of the GNU General Public License along
    15  * with this program; if not, write to the Free Software Foundation, Inc.,
    16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
    17  */
    18 
    19 #ifndef __ASCII_CTYPE_H__
    20 #define __ASCII_CTYPE_H__
    21 
    22 /*
    23  * Avoid g_ascii_ family because of complications with static builds
    24  * of glib2 under Windows. The real problem is probably in how glib2
    25  * is packaged for cross-compiling in certain distributions, but it's
    26  * easy enough to work around.
    27  */
    28 
    29 #define ascii_islower(c) ((c) >= 'a' && (c) <= 'z')
    30 #define ascii_isupper(c) ((c) >= 'A' && (c) <= 'Z')
    31 #define ascii_isdigit(c) ((c) >= '0' && (c) <= '9')
    32 #define ascii_isalpha(c) (ascii_islower(c) || ascii_isupper(c))
    33 #define ascii_isalnum(c) (ascii_isalpha(c) || ascii_isdigit(c))
    34 
    35 #endif /* __ASCII_CTYPE_H__ */