]> pd.if.org Git - pdclib/blob - includes/ctype.h
Started out on v0.6.
[pdclib] / includes / ctype.h
1 /* $Id$ */
2
3 /* 7.4 Character handling <ctype.h>
4
5    This file is part of the Public Domain C Library (PDCLib).
6    Permission is granted to use, modify, and / or redistribute at will.
7 */
8
9 #ifndef _PDCLIB_CTYPE_H
10 #define _PDCLIB_CTYPE_H _PDCLIB_CTYPE_H
11
12 /* Character classification functions */
13
14 /* Note that there is a difference between "whitespace" (any printing, non-
15    graph character, like horizontal and vertical tab), and "blank" (the literal
16    ' ' space character).
17
18    There will be masking macros for each of these later on, but right now I
19    focus on the functions only.
20 */
21
22 /* Returns isalpha( c ) || isdigit( c ) */
23 int isalnum( int c );
24
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.
29 */
30 int isalpha( int c );
31
32 /* Returns true if the character is a whitespace. In the "C" locale, only ' '
33    and '\t' are considered whitespace.
34 */
35 int isblank( int c );
36
37 /* Returns true if the character is a control character. */
38 int iscntrl( int c );
39
40 /* Returns true if the character is a decimal digit. */
41 int isdigit( int c );
42
43 /* Returns true for every printing character except space (' '). */
44 int isgraph( int c );
45
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().
51 */
52 int islower( int c );
53
54 /* Returns true for every printing character including space (' '). */
55 int isprint( int c );
56
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
60    alphanumeric.
61 */
62 int ispunct( int c );
63
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.
67 */ 
68 int isspace( int c );
69
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().
75 */
76 int isupper( int c );
77
78 /* Returns true for any hexadecimal-digit character. */
79 int isxdigit( int c );
80
81 /* Character case mapping functions */
82
83 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
84    is not an uppercase letter remains unchanged.
85 */
86 int tolower( c );
87
88 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
89    is not a lowercase letter remains unchanged.
90 */
91 int toupper( c );
92
93 #endif