3 /* 7.4 Character handling <ctype.h>
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
9 #ifndef _PDCLIB_CTYPE_H
10 #define _PDCLIB_CTYPE_H _PDCLIB_CTYPE_H
12 /* Character classification functions */
14 /* Note that there is a difference between "whitespace" (any printing, non-
15 graph character, like horizontal and vertical tab), and "blank" (the literal
18 There will be masking macros for each of these later on, but right now I
19 focus on the functions only.
22 /* Returns isalpha( c ) || isdigit( c ) */
25 /* Returns isupper( c ) || islower( c ) in the "C" locale.
26 In any other locale, also returns true for a locale-specific set of
27 alphabetic characters which are neither control characters, digits,
28 punctation, or whitespace.
32 /* Returns true if the character is a whitespace. In the "C" locale, only ' '
33 and '\t' are considered whitespace.
37 /* Returns true if the character is a control character. */
40 /* Returns true if the character is a decimal digit. */
43 /* Returns true for every printing character except space (' '). */
46 /* Returns true for lowercase letters in the "C" locale.
47 In any other locale, also returns true for a locale-specific set of
48 characters which are neither control characters, digits, punctation, or
49 space (' '). In a locale other than the "C" locale, a character might test
50 true for both islower() and isupper().
54 /* Returns true for every printing character including space (' '). */
57 /* Returns true for every printing character that is neither whitespace
58 nor alphanumeric in the "C" locale. In any other locale, there might be
59 characters that are printing characters, but neither whitespace nor
64 /* Returns true for every standard whitespace character (' ', '\f', '\n', '\r',
65 '\t', '\v') in the "C" locale. In any other locale, also returns true for a
66 locale-specific set of characters for which isalnum() is false.
70 /* Returns true for uppercase letters in the "C" locale.
71 In any other locale, also returns true for a locale-specific set of
72 characters which are neither control characters, digits, punctation, or
73 space (' '). In a locale other than the "C" locale, a character might test
74 true for both islower() and isupper().
78 /* Returns true for any hexadecimal-digit character. */
79 int isxdigit( int c );
81 /* Character case mapping functions */
83 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
84 is not an uppercase letter remains unchanged.
88 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
89 is not a lowercase letter remains unchanged.