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
13 #define _PDCLIB_INT_H _PDCLIB_INT_H
14 #include <_PDCLIB_int.h>
17 /* Character classification functions */
19 /* Note that there is a difference between "whitespace" (any printing, non-
20 graph character, like horizontal and vertical tab), and "blank" (the literal
23 There will be masking macros for each of these later on, but right now I
24 focus on the functions only.
27 /* Returns isalpha( c ) || isdigit( c ) */
30 /* Returns isupper( c ) || islower( c ) in the "C" locale.
31 In any other locale, also returns true for a locale-specific set of
32 alphabetic characters which are neither control characters, digits,
33 punctation, or whitespace.
37 /* Returns true if the character isspace() and used for seperating words within
38 a line of text. In the "C" locale, only ' ' and '\t' are considered blanks.
42 /* Returns true if the character is a control character. */
45 /* Returns true if the character is a decimal digit. Locale-independent. */
48 /* Returns true for every printing character except space (' '). */
51 /* Returns true for lowercase letters in the "C" locale.
52 In any other locale, also returns true for a locale-specific set of
53 characters which are neither control characters, digits, punctation, or
54 space (' '). In a locale other than the "C" locale, a character might test
55 true for both islower() and isupper().
59 /* Returns true for every printing character including space (' '). */
62 /* Returns true for every printing character that is neither whitespace
63 nor alphanumeric in the "C" locale. In any other locale, there might be
64 characters that are printing characters, but neither whitespace nor
69 /* Returns true for every standard whitespace character (' ', '\f', '\n', '\r',
70 '\t', '\v') in the "C" locale. In any other locale, also returns true for a
71 locale-specific set of characters for which isalnum() is false.
75 /* Returns true for uppercase letters in the "C" locale.
76 In any other locale, also returns true for a locale-specific set of
77 characters which are neither control characters, digits, punctation, or
78 space (' '). In a locale other than the "C" locale, a character might test
79 true for both islower() and isupper().
83 /* Returns true for any hexadecimal-digit character. Locale-independent. */
84 int isxdigit( int c );
86 /* Character case mapping functions */
88 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
89 is not an uppercase letter remains unchanged.
93 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
94 is not a lowercase letter remains unchanged.