]> pd.if.org Git - pdclib/blob - includes/ctype.h
ctype
[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 #ifndef _PDCLIB_INT_H
13 #define _PDCLIB_INT_H _PDCLIB_INT_H
14 #include <_PDCLIB_int.h>
15 #endif
16
17 /* Character classification functions */
18
19 /* Note that there is a difference between "whitespace" (any printing, non-
20    graph character, like horizontal and vertical tab), and "blank" (the literal
21    ' ' space character).
22
23    There will be masking macros for each of these later on, but right now I
24    focus on the functions only.
25 */
26
27 /* Returns isalpha( c ) || isdigit( c ) */
28 int isalnum( int c );
29
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.
34 */
35 int isalpha( int c );
36
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.
39 */
40 int isblank( int c );
41
42 /* Returns true if the character is a control character. */
43 int iscntrl( int c );
44
45 /* Returns true if the character is a decimal digit. Locale-independent. */
46 int isdigit( int c );
47
48 /* Returns true for every printing character except space (' '). */
49 int isgraph( int c );
50
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().
56 */
57 int islower( int c );
58
59 /* Returns true for every printing character including space (' '). */
60 int isprint( int c );
61
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
65    alphanumeric.
66 */
67 int ispunct( int c );
68
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.
72 */ 
73 int isspace( int c );
74
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().
80 */
81 int isupper( int c );
82
83 /* Returns true for any hexadecimal-digit character. Locale-independent. */
84 int isxdigit( int c );
85
86 /* Character case mapping functions */
87
88 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
89    is not an uppercase letter remains unchanged.
90 */
91 int tolower( int c );
92
93 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
94    is not a lowercase letter remains unchanged.
95 */
96 int toupper( int c );
97
98 #endif