AVR-LibC  2.2.0
Standard C library for AVR-GCC
 

AVR-LibC Documentation

Logo

AVR-LibC Development Pages

Main Page

User Manual

Library Reference

FAQ

Example Projects

File List

Loading...
Searching...
No Matches
ctype.h
Go to the documentation of this file.
1/* Copyright (c) 2002,2007 Michael Stumpf
2 All rights reserved.
3
4 Redistribution and use in source and binary forms, with or without
5 modification, are permitted provided that the following conditions are met:
6
7 * Redistributions of source code must retain the above copyright
8 notice, this list of conditions and the following disclaimer.
9
10 * Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
13 distribution.
14
15 * Neither the name of the copyright holders nor the names of
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
18
19 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 POSSIBILITY OF SUCH DAMAGE. */
30
31/* $Id$ */
32
33/*
34 ctype.h - character conversion macros and ctype macros
35
36 Author : Michael Stumpf
37 Michael.Stumpf@t-online.de
38*/
39
40#ifndef __CTYPE_H_
41#define __CTYPE_H_ 1
42
43#ifdef __cplusplus
44extern "C" {
45#endif
46
47/** \file */
48/** \defgroup ctype <ctype.h>: Character Operations
49 These functions perform various operations on characters.
50
51 \code #include <ctype.h>\endcode
52
53*/
54
55/** \name Character classification routines
56
57 These functions perform character classification. They return true or
58 false status depending whether the character passed to the function falls
59 into the function's classification (i.e. isdigit() returns true if its
60 argument is any value '0' though '9', inclusive). If the input is not
61 an unsigned char value, all of this function return false. */
62
63/**@{*/
64
65/** \ingroup ctype
66
67 Checks for an alphanumeric character. It is equivalent to <tt>(isalpha(c)
68 || isdigit(c))</tt>. */
69
70extern int isalnum(int __c);
71
72/** \ingroup ctype
73
74 Checks for an alphabetic character. It is equivalent to <tt>(isupper(c) ||
75 islower(c))</tt>. */
76
77extern int isalpha(int __c);
78
79/** \ingroup ctype
80
81 Checks whether \c c is a 7-bit unsigned char value that fits into the
82 ASCII character set. */
83
84extern int isascii(int __c);
85
86/** \ingroup ctype
87
88 Checks for a blank character, that is, a space or a tab. */
89
90extern int isblank(int __c);
91
92/** \ingroup ctype
93
94 Checks for a control character. */
95
96extern int iscntrl(int __c);
97
98/** \ingroup ctype
99
100 Checks for a digit (0 through 9). */
101
102extern int isdigit(int __c);
103
104/** \ingroup ctype
105
106 Checks for any printable character except space. */
107
108extern int isgraph(int __c);
109
110/** \ingroup ctype
111
112 Checks for a lower-case character. */
113
114extern int islower(int __c);
115
116/** \ingroup ctype
117
118 Checks for any printable character including space. */
119
120extern int isprint(int __c);
121
122/** \ingroup ctype
123
124 Checks for any printable character which is not a space or an alphanumeric
125 character. */
126
127extern int ispunct(int __c);
128
129/** \ingroup ctype
130
131 Checks for white-space characters. For the AVR-LibC library, these are:
132 space, form-feed ('\\f'), newline ('\\n'), carriage return ('\\r'),
133 horizontal tab ('\\t'), and vertical tab ('\\v'). */
134
135extern int isspace(int __c);
136
137/** \ingroup ctype
138
139 Checks for an uppercase letter. */
140
141extern int isupper(int __c);
142
143/** \ingroup ctype
144
145 Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 8 9 a b c d e
146 f A B C D E F. */
147
148extern int isxdigit(int __c);
149
150/**@}*/
151
152/** \name Character convertion routines
153
154 This realization permits all possible values of integer argument.
155 The toascii() function clears all highest bits. The tolower() and
156 toupper() functions return an input argument as is, if it is not an
157 unsigned char value. */
158
159/**@{*/
160
161/** \ingroup ctype
162
163 Converts \c c to a 7-bit unsigned char value that fits into the ASCII
164 character set, by clearing the high-order bits.
165
166 \warning Many people will be unhappy if you use this function. This
167 function will convert accented letters into random characters. */
168
169extern int toascii(int __c);
170
171/** \ingroup ctype
172
173 Converts the letter \c c to lower case, if possible. */
174
175extern int tolower(int __c);
176
177/** \ingroup ctype
178
179 Converts the letter \c c to upper case, if possible. */
180
181extern int toupper(int __c);
182
183/**@}*/
184
185#ifdef __cplusplus
186}
187#endif
188
189#endif
int isxdigit(int __c)
int isupper(int __c)
int isspace(int __c)
int toascii(int __c)
int isascii(int __c)
int isdigit(int __c)
int iscntrl(int __c)
int isalpha(int __c)
int toupper(int __c)
int tolower(int __c)
int isprint(int __c)
int ispunct(int __c)
int isblank(int __c)
int islower(int __c)
int isalnum(int __c)
int isgraph(int __c)