]> pd.if.org Git - pdclib/blob - includes/ctype.h
Add nothrow annotations where appropriate
[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 #include <_PDCLIB_int.h>
12 _PDCLIB_BEGIN_EXTERN_C
13
14 /* Character classification functions */
15
16 /* Note that there is a difference between "whitespace" (any printing, non-
17    graph character, like horizontal and vertical tab), and "blank" (the literal
18    ' ' space character).
19
20    There will be masking macros for each of these later on, but right now I
21    focus on the functions only.
22 */
23
24 /* Returns isalpha( c ) || isdigit( c ) */
25 int isalnum( int c ) _PDCLIB_nothrow;
26
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.
31 */
32 int isalpha( int c ) _PDCLIB_nothrow;
33
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.
36 */
37 int isblank( int c ) _PDCLIB_nothrow;
38
39 /* Returns true if the character is a control character. */
40 int iscntrl( int c ) _PDCLIB_nothrow;
41
42 /* Returns true if the character is a decimal digit. Locale-independent. */
43 int isdigit( int c ) _PDCLIB_nothrow;
44
45 /* Returns true for every printing character except space (' '). */
46 int isgraph( int c ) _PDCLIB_nothrow;
47
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().
53 */
54 int islower( int c ) _PDCLIB_nothrow;
55
56 /* Returns true for every printing character including space (' '). */
57 int isprint( int c ) _PDCLIB_nothrow;
58
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
62    alphanumeric.
63 */
64 int ispunct( int c ) _PDCLIB_nothrow;
65
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.
69 */ 
70 int isspace( int c ) _PDCLIB_nothrow;
71
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().
77 */
78 int isupper( int c ) _PDCLIB_nothrow;
79
80 /* Returns true for any hexadecimal-digit character. Locale-independent. */
81 int isxdigit( int c ) _PDCLIB_nothrow;
82
83 /* Character case mapping functions */
84
85 /* Converts an uppercase letter to a corresponding lowercase letter. Input that
86    is not an uppercase letter remains unchanged.
87 */
88 int tolower( int c ) _PDCLIB_nothrow;
89
90 /* Converts a lowercase letter to a corresponding uppercase letter. Input that
91    is not a lowercase letter remains unchanged.
92 */
93 int toupper( int c ) _PDCLIB_nothrow;
94
95 _PDCLIB_END_EXTERN_C
96 #endif