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
11 #include <_PDCLIB_int.h>
12 _PDCLIB_BEGIN_EXTERN_C
14 /* Character classification functions */
16 /* Note that there is a difference between "whitespace" (any printing, non-
17 graph character, like horizontal and vertical tab), and "blank" (the literal
20 There will be masking macros for each of these later on, but right now I
21 focus on the functions only.
24 /* Returns isalpha( c ) || isdigit( c ) */
27 /* Returns isupper( c ) || islower( c ) in the "C" locale.
28 In any other locale, also returns true for a locale-specific set of
29 alphabetic characters which are neither control characters, digits,
30 punctation, or whitespace.
34 /* Returns true if the character isspace() and used for seperating words within
35 a line of text. In the "C" locale, only ' ' and '\t' are considered blanks.
39 /* Returns true if the character is a control character. */
42 /* Returns true if the character is a decimal digit. Locale-independent. */
45 /* Returns true for every printing character except space (' '). */
48 /* Returns true for lowercase letters in the "C" locale.
49 In any other locale, also returns true for a locale-specific set of
50 characters which are neither control characters, digits, punctation, or
51 space (' '). In a locale other than the "C" locale, a character might test
52 true for both islower() and isupper().
56 /* Returns true for every printing character including space (' '). */
59 /* Returns true for every printing character that is neither whitespace
60 nor alphanumeric in the "C" locale. In any other locale, there might be
61 characters that are printing characters, but neither whitespace nor
66 /* Returns true for every standard whitespace character (' ', '\f', '\n', '\r',
67 '\t', '\v') in the "C" locale. In any other locale, also returns true for a
68 locale-specific set of characters for which isalnum() is false.
72 /* Returns true for uppercase letters in the "C" locale.
73 In any other locale, also returns true for a locale-specific set of
74 characters which are neither control characters, digits, punctation, or
75 space (' '). In a locale other than the "C" locale, a character might test
76 true for both islower() and isupper().
80 /* Returns true for any hexadecimal-digit character. Locale-independent. */
81 int isxdigit( int c );
83 /* Character case mapping functions */
85 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
86 is not an uppercase letter remains unchanged.
90 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
91 is not a lowercase letter remains unchanged.