]> pd.if.org Git - pdclib/blob - includes/ctype.h
PDCLib includes with quotes, not <>.
[pdclib] / includes / ctype.h
1 /* Character handling <ctype.h>
2
3    This file is part of the Public Domain C Library (PDCLib).
4    Permission is granted to use, modify, and / or redistribute at will.
5 */
6
7 #ifndef _PDCLIB_CTYPE_H
8 #define _PDCLIB_CTYPE_H _PDCLIB_CTYPE_H
9 #include "_PDCLIB_int.h"
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif
14
15 /* Character classification functions */
16
17 /* Note that there is a difference between "whitespace" (any printing, non-
18    graph character, like horizontal and vertical tab), and "blank" (the literal
19    ' ' space character).
20
21    There will be masking macros for each of these later on, but right now I
22    focus on the functions only.
23 */
24
25 /* Returns isalpha( c ) || isdigit( c ) */
26 int isalnum( int c ) _PDCLIB_nothrow;
27
28 /* Returns isupper( c ) || islower( c ) in the "C" locale.
29    In any other locale, also returns true for a locale-specific set of
30    alphabetic characters which are neither control characters, digits,
31    punctation, or whitespace.
32 */
33 int isalpha( int c ) _PDCLIB_nothrow;
34
35 /* Returns true if the character isspace() and used for seperating words within
36    a line of text. In the "C" locale, only ' ' and '\t' are considered blanks.
37 */
38 int isblank( int c ) _PDCLIB_nothrow;
39
40 /* Returns true if the character is a control character. */
41 int iscntrl( int c ) _PDCLIB_nothrow;
42
43 /* Returns true if the character is a decimal digit. Locale-independent. */
44 int isdigit( int c ) _PDCLIB_nothrow;
45
46 /* Returns true for every printing character except space (' '). */
47 int isgraph( int c ) _PDCLIB_nothrow;
48
49 /* Returns true for lowercase letters in the "C" locale.
50    In any other locale, also returns true for a locale-specific set of
51    characters which are neither control characters, digits, punctation, or
52    space (' '). In a locale other than the "C" locale, a character might test
53    true for both islower() and isupper().
54 */
55 int islower( int c ) _PDCLIB_nothrow;
56
57 /* Returns true for every printing character including space (' '). */
58 int isprint( int c ) _PDCLIB_nothrow;
59
60 /* Returns true for every printing character that is neither whitespace
61    nor alphanumeric in the "C" locale. In any other locale, there might be
62    characters that are printing characters, but neither whitespace nor
63    alphanumeric.
64 */
65 int ispunct( int c ) _PDCLIB_nothrow;
66
67 /* Returns true for every standard whitespace character (' ', '\f', '\n', '\r',
68    '\t', '\v') in the "C" locale. In any other locale, also returns true for a
69    locale-specific set of characters for which isalnum() is false.
70 */ 
71 int isspace( int c ) _PDCLIB_nothrow;
72
73 /* Returns true for uppercase letters in the "C" locale.
74    In any other locale, also returns true for a locale-specific set of
75    characters which are neither control characters, digits, punctation, or
76    space (' '). In a locale other than the "C" locale, a character might test
77    true for both islower() and isupper().
78 */
79 int isupper( int c ) _PDCLIB_nothrow;
80
81 /* Returns true for any hexadecimal-digit character. Locale-independent. */
82 int isxdigit( int c ) _PDCLIB_nothrow;
83
84 /* Character case mapping functions */
85
86 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
87    is not an uppercase letter remains unchanged.
88 */
89 int tolower( int c ) _PDCLIB_nothrow;
90
91 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
92    is not a lowercase letter remains unchanged.
93 */
94 int toupper( int c ) _PDCLIB_nothrow;
95
96 #ifdef __cplusplus
97 }
98 #endif
99
100 #endif