compiler/clib: Do not call __arosc_get_ctype() for each call to a ctype.h macro.
[AROS.git] / compiler / clib / __ctype.c
blob974b85c238262c4a987bbf50bc4de21cae5eb8f2
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <aros/symbolsets.h>
7 #include <ctype.h>
9 #include "__arosc_privdata.h"
11 const unsigned short int __ctype_b_array[384] =
13 0, /* -128 */
14 0, /* -127 */
15 0, /* -126 */
16 0, /* -125 */
17 0, /* -124 */
18 0, /* -123 */
19 0, /* -122 */
20 0, /* -121 */
21 0, /* -120 */
22 0, /* -119 */
23 0, /* -118 */
24 0, /* -117 */
25 0, /* -116 */
26 0, /* -115 */
27 0, /* -114 */
28 0, /* -113 */
29 0, /* -112 */
30 0, /* -111 */
31 0, /* -110 */
32 0, /* -109 */
33 0, /* -108 */
34 0, /* -107 */
35 0, /* -106 */
36 0, /* -105 */
37 0, /* -104 */
38 0, /* -103 */
39 0, /* -102 */
40 0, /* CSI */
41 0, /* -100 */
42 0, /* -99 */
43 0, /* -98 */
44 0, /* -97 */
45 0, /* NBSpace */
46 0, /* ¡ */
47 0, /* ¢ */
48 0, /* £ */
49 0, /* ¤ */
50 0, /* ¥ */
51 0, /* ¦ */
52 0, /* § */
53 0, /* ¨ */
54 0, /* © */
55 0, /* ª */
56 0, /* « */
57 0, /* ¬ */
58 0, /* ­ */
59 0, /* ® */
60 0, /* ¯ */
61 0, /* ° */
62 0, /* ± */
63 0, /* ² */
64 0, /* ³ */
65 0, /* ´ */
66 0, /* µ */
67 0, /* ¶ */
68 0, /* · */
69 0, /* ¸ */
70 0, /* ¹ */
71 0, /* º */
72 0, /* » */
73 0, /* ¼ */
74 0, /* ½ */
75 0, /* ¾ */
76 0, /* ¿ */
77 0, /* À */
78 0, /* Á */
79 0, /* Â */
80 0, /* Ã */
81 0, /* Ä */
82 0, /* Å */
83 0, /* Æ */
84 0, /* Ç */
85 0, /* È */
86 0, /* É */
87 0, /* Ê */
88 0, /* Ë */
89 0, /* Ì */
90 0, /* Í */
91 0, /* Î */
92 0, /* Ï */
93 0, /* Ð */
94 0, /* Ñ */
95 0, /* Ò */
96 0, /* Ó */
97 0, /* Ô */
98 0, /* Õ */
99 0, /* Ö */
100 0, /* × */
101 0, /* Ø */
102 0, /* Ù */
103 0, /* Ú */
104 0, /* Û */
105 0, /* Ü */
106 0, /* Ý */
107 0, /* Þ */
108 0, /* ß */
109 0, /* à */
110 0, /* á */
111 0, /* â */
112 0, /* ã */
113 0, /* ä */
114 0, /* å */
115 0, /* æ */
116 0, /* ç */
117 0, /* è */
118 0, /* é */
119 0, /* ê */
120 0, /* ë */
121 0, /* ì */
122 0, /* í */
123 0, /* î */
124 0, /* ï */
125 0, /* ð */
126 0, /* ñ */
127 0, /* ò */
128 0, /* ó */
129 0, /* ô */
130 0, /* õ */
131 0, /* ö */
132 0, /* ÷ */
133 0, /* ø */
134 0, /* ù */
135 0, /* ú */
136 0, /* û */
137 0, /* ü */
138 0, /* ý */
139 0, /* þ */
140 0, /* ÿ */
141 _IScntrl, /* 0 */
142 _IScntrl, /* 1 */
143 _IScntrl, /* 2 */
144 _IScntrl, /* 3 */
145 _IScntrl, /* 4 */
146 _IScntrl, /* 5 */
147 _IScntrl, /* 6 */
148 _IScntrl, /* 7 */
149 _IScntrl, /* Backspace */
150 _ISblank|_IScntrl|_ISspace, /* 9 */
151 _IScntrl|_ISspace, /* LF */
152 _IScntrl|_ISspace, /* 11 */
153 _IScntrl|_ISspace, /* 12 */
154 _IScntrl|_ISspace, /* CR */
155 _IScntrl, /* 14 */
156 _IScntrl, /* 15 */
157 _IScntrl, /* 16 */
158 _IScntrl, /* 17 */
159 _IScntrl, /* 18 */
160 _IScntrl, /* 19 */
161 _IScntrl, /* 20 */
162 _IScntrl, /* 21 */
163 _IScntrl, /* 22 */
164 _IScntrl, /* 23 */
165 _IScntrl, /* 24 */
166 _IScntrl, /* 25 */
167 _IScntrl, /* 26 */
168 _IScntrl, /* ESC */
169 _IScntrl, /* 28 */
170 _IScntrl, /* 29 */
171 _IScntrl, /* 30 */
172 _IScntrl, /* 31 */
173 _ISblank|_ISprint|_ISspace, /* Space */
174 _ISgraph|_ISprint|_ISpunct, /* ! */
175 _ISgraph|_ISprint|_ISpunct, /* " */
176 _ISgraph|_ISprint|_ISpunct, /* # */
177 _ISgraph|_ISprint|_ISpunct, /* $ */
178 _ISgraph|_ISprint|_ISpunct, /* % */
179 _ISgraph|_ISprint|_ISpunct, /* & */
180 _ISgraph|_ISprint|_ISpunct, /* ' */
181 _ISgraph|_ISprint|_ISpunct, /* ( */
182 _ISgraph|_ISprint|_ISpunct, /* ) */
183 _ISgraph|_ISprint|_ISpunct, /* * */
184 _ISgraph|_ISprint|_ISpunct, /* + */
185 _ISgraph|_ISprint|_ISpunct, /* , */
186 _ISgraph|_ISprint|_ISpunct, /* - */
187 _ISgraph|_ISprint|_ISpunct, /* . */
188 _ISgraph|_ISprint|_ISpunct, /* / */
189 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 0 */
190 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 1 */
191 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 2 */
192 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 3 */
193 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 4 */
194 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 5 */
195 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 6 */
196 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 7 */
197 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 8 */
198 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 9 */
199 _ISgraph|_ISprint|_ISpunct, /* : */
200 _ISgraph|_ISprint|_ISpunct, /* ; */
201 _ISgraph|_ISprint|_ISpunct, /* < */
202 _ISgraph|_ISprint|_ISpunct, /* = */
203 _ISgraph|_ISprint|_ISpunct, /* > */
204 _ISgraph|_ISprint|_ISpunct, /* ? */
205 _ISgraph|_ISprint|_ISpunct, /* @ */
206 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* A */
207 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* B */
208 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* C */
209 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* D */
210 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* E */
211 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* F */
212 _ISupper|_ISalpha|_ISgraph|_ISprint, /* G */
213 _ISupper|_ISalpha|_ISgraph|_ISprint, /* H */
214 _ISupper|_ISalpha|_ISgraph|_ISprint, /* I */
215 _ISupper|_ISalpha|_ISgraph|_ISprint, /* J */
216 _ISupper|_ISalpha|_ISgraph|_ISprint, /* K */
217 _ISupper|_ISalpha|_ISgraph|_ISprint, /* L */
218 _ISupper|_ISalpha|_ISgraph|_ISprint, /* M */
219 _ISupper|_ISalpha|_ISgraph|_ISprint, /* N */
220 _ISupper|_ISalpha|_ISgraph|_ISprint, /* O */
221 _ISupper|_ISalpha|_ISgraph|_ISprint, /* P */
222 _ISupper|_ISalpha|_ISgraph|_ISprint, /* Q */
223 _ISupper|_ISalpha|_ISgraph|_ISprint, /* R */
224 _ISupper|_ISalpha|_ISgraph|_ISprint, /* S */
225 _ISupper|_ISalpha|_ISgraph|_ISprint, /* T */
226 _ISupper|_ISalpha|_ISgraph|_ISprint, /* U */
227 _ISupper|_ISalpha|_ISgraph|_ISprint, /* V */
228 _ISupper|_ISalpha|_ISgraph|_ISprint, /* W */
229 _ISupper|_ISalpha|_ISgraph|_ISprint, /* X */
230 _ISupper|_ISalpha|_ISgraph|_ISprint, /* Y */
231 _ISupper|_ISalpha|_ISgraph|_ISprint, /* Z */
232 _ISgraph|_ISprint|_ISpunct, /* [ */
233 _ISgraph|_ISprint|_ISpunct, /* \ */
234 _ISgraph|_ISprint|_ISpunct, /* ] */
235 _ISgraph|_ISprint|_ISpunct, /* ^ */
236 _ISgraph|_ISprint|_ISpunct, /* _ */
237 _ISgraph|_ISprint|_ISpunct, /* ` */
238 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* a */
239 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* b */
240 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* c */
241 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* d */
242 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* e */
243 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* f */
244 _ISlower|_ISalpha|_ISgraph|_ISprint, /* g */
245 _ISlower|_ISalpha|_ISgraph|_ISprint, /* h */
246 _ISlower|_ISalpha|_ISgraph|_ISprint, /* i */
247 _ISlower|_ISalpha|_ISgraph|_ISprint, /* j */
248 _ISlower|_ISalpha|_ISgraph|_ISprint, /* k */
249 _ISlower|_ISalpha|_ISgraph|_ISprint, /* l */
250 _ISlower|_ISalpha|_ISgraph|_ISprint, /* m */
251 _ISlower|_ISalpha|_ISgraph|_ISprint, /* n */
252 _ISlower|_ISalpha|_ISgraph|_ISprint, /* o */
253 _ISlower|_ISalpha|_ISgraph|_ISprint, /* p */
254 _ISlower|_ISalpha|_ISgraph|_ISprint, /* q */
255 _ISlower|_ISalpha|_ISgraph|_ISprint, /* r */
256 _ISlower|_ISalpha|_ISgraph|_ISprint, /* s */
257 _ISlower|_ISalpha|_ISgraph|_ISprint, /* t */
258 _ISlower|_ISalpha|_ISgraph|_ISprint, /* u */
259 _ISlower|_ISalpha|_ISgraph|_ISprint, /* v */
260 _ISlower|_ISalpha|_ISgraph|_ISprint, /* w */
261 _ISlower|_ISalpha|_ISgraph|_ISprint, /* x */
262 _ISlower|_ISalpha|_ISgraph|_ISprint, /* y */
263 _ISlower|_ISalpha|_ISgraph|_ISprint, /* z */
264 _ISgraph|_ISprint|_ISpunct, /* { */
265 _ISgraph|_ISprint|_ISpunct, /* | */
266 _ISgraph|_ISprint|_ISpunct, /* } */
267 _ISgraph|_ISprint|_ISpunct, /* ~ */
268 _IScntrl, /* Del */
269 0, /* 128 */
270 0, /* 129 */
271 0, /* 130 */
272 0, /* 131 */
273 0, /* 132 */
274 0, /* 133 */
275 0, /* 134 */
276 0, /* 135 */
277 0, /* 136 */
278 0, /* 137 */
279 0, /* 138 */
280 0, /* 139 */
281 0, /* 140 */
282 0, /* 141 */
283 0, /* 142 */
284 0, /* 143 */
285 0, /* 144 */
286 0, /* 145 */
287 0, /* 146 */
288 0, /* 147 */
289 0, /* 148 */
290 0, /* 149 */
291 0, /* 150 */
292 0, /* 151 */
293 0, /* 152 */
294 0, /* 153 */
295 0, /* 154 */
296 0, /* CSI */
297 0, /* 156 */
298 0, /* 157 */
299 0, /* 158 */
300 0, /* 159 */
301 0, /* NBSpace */
302 0, /* ¡ */
303 0, /* ¢ */
304 0, /* £ */
305 0, /* ¤ */
306 0, /* ¥ */
307 0, /* ¦ */
308 0, /* § */
309 0, /* ¨ */
310 0, /* © */
311 0, /* ª */
312 0, /* « */
313 0, /* ¬ */
314 0, /* ­ */
315 0, /* ® */
316 0, /* ¯ */
317 0, /* ° */
318 0, /* ± */
319 0, /* ² */
320 0, /* ³ */
321 0, /* ´ */
322 0, /* µ */
323 0, /* ¶ */
324 0, /* · */
325 0, /* ¸ */
326 0, /* ¹ */
327 0, /* º */
328 0, /* » */
329 0, /* ¼ */
330 0, /* ½ */
331 0, /* ¾ */
332 0, /* ¿ */
333 0, /* À */
334 0, /* Á */
335 0, /* Â */
336 0, /* Ã */
337 0, /* Ä */
338 0, /* Å */
339 0, /* Æ */
340 0, /* Ç */
341 0, /* È */
342 0, /* É */
343 0, /* Ê */
344 0, /* Ë */
345 0, /* Ì */
346 0, /* Í */
347 0, /* Î */
348 0, /* Ï */
349 0, /* Ð */
350 0, /* Ñ */
351 0, /* Ò */
352 0, /* Ó */
353 0, /* Ô */
354 0, /* Õ */
355 0, /* Ö */
356 0, /* × */
357 0, /* Ø */
358 0, /* Ù */
359 0, /* Ú */
360 0, /* Û */
361 0, /* Ü */
362 0, /* Ý */
363 0, /* Þ */
364 0, /* ß */
365 0, /* à */
366 0, /* á */
367 0, /* â */
368 0, /* ã */
369 0, /* ä */
370 0, /* å */
371 0, /* æ */
372 0, /* ç */
373 0, /* è */
374 0, /* é */
375 0, /* ê */
376 0, /* ë */
377 0, /* ì */
378 0, /* í */
379 0, /* î */
380 0, /* ï */
381 0, /* ð */
382 0, /* ñ */
383 0, /* ò */
384 0, /* ó */
385 0, /* ô */
386 0, /* õ */
387 0, /* ö */
388 0, /* ÷ */
389 0, /* ø */
390 0, /* ù */
391 0, /* ú */
392 0, /* û */
393 0, /* ü */
394 0, /* ý */
395 0, /* þ */
396 0, /* ÿ */
399 const int __ctype_toupper_array[384] =
401 /* -128 */
402 128,129,130,131, 132,133,134,135,
403 136,137,138,139, 140,141,142,143,
404 144,145,146,147, 148,149,150,151,
405 152,153,154,155, 156,157,158,159,
406 160,161,162,163, 164,165,166,167,
407 168,169,170,171, 172,173,174,175,
408 176,177,178,179, 180,181,182,183,
409 184,185,186,187, 188,189,190,191,
410 192,193,194,195, 196,197,198,199,
411 200,201,202,203, 204,205,206,207,
412 208,209,210,211, 212,213,214,215,
413 216,217,218,219, 220,221,222,223,
414 224,225,226,227, 228,229,230,231,
415 232,233,234,235, 236,237,238,239,
416 240,241,242,243, 244,245,246,247,
417 248,249,250,251, 252,253,254,255,
419 0, 1, 2, 3, 4, 5, 6, 7,
420 8, 9, 10, 11, 12, 13, 14, 15,
421 16, 17, 18, 19, 20, 21, 22, 23,
422 24, 25, 26, 27, 28, 29, 30, 31,
423 ' ','!','"','#', '$','%','&','\'',
424 '(',')','*','+', ',','-','.','/',
425 '0','1','2','3', '4','5','6','7',
426 '8','9',':',';', '<','=','>','?',
427 '@','A','B','C', 'D','E','F','G',
428 'H','I','J','K', 'L','M','N','O',
429 'P','Q','R','S', 'T','U','V','W',
430 'X','Y','Z','[', '\\',']','^','_',
431 '`','A','B','C', 'D','E','F','G',
432 'H','I','J','K', 'L','M','N','O',
433 'P','Q','R','S', 'T','U','V','W',
434 'X','Y','Z','{', '|','}','~',127,
436 128,129,130,131, 132,133,134,135,
437 136,137,138,139, 140,141,142,143,
438 144,145,146,147, 148,149,150,151,
439 152,153,154,155, 156,157,158,159,
440 160,161,162,163, 164,165,166,167,
441 168,169,170,171, 172,173,174,175,
442 176,177,178,179, 180,181,182,183,
443 184,185,186,187, 188,189,190,191,
444 192,193,194,195, 196,197,198,199,
445 200,201,202,203, 204,205,206,207,
446 208,209,210,211, 212,213,214,215,
447 216,217,218,219, 220,221,222,223,
448 224,225,226,227, 228,229,230,231,
449 232,233,234,235, 236,237,238,239,
450 240,241,242,243, 244,245,246,247,
451 248,249,250,251, 252,253,254,255,
454 const int __ctype_tolower_array[384] =
456 128,129,130,131, 132,133,134,135,
457 136,137,138,139, 140,141,142,143,
458 144,145,146,147, 148,149,150,151,
459 152,153,154,155, 156,157,158,159,
460 160,161,162,163, 164,165,166,167,
461 168,169,170,171, 172,173,174,175,
462 176,177,178,179, 180,181,182,183,
463 184,185,186,187, 188,189,190,191,
464 192,193,194,195, 196,197,198,199,
465 200,201,202,203, 204,205,206,207,
466 208,209,210,211, 212,213,214,215,
467 216,217,218,219, 220,221,222,223,
468 224,225,226,227, 228,229,230,231,
469 232,233,234,235, 236,237,238,239,
470 240,241,242,243, 244,245,246,247,
471 248,249,250,251, 252,253,254,255,
473 0, 1, 2, 3, 4, 5, 6, 7,
474 8, 9, 10, 11, 12, 13, 14, 15,
475 16, 17, 18, 19, 20, 21, 22, 23,
476 24, 25, 26, 27, 28, 29, 30, 31,
477 ' ','!','"','#', '$','%','&','\'',
478 '(',')','*','+', ',','-','.','/',
479 '0','1','2','3', '4','5','6','7',
480 '8','9',':',';', '<','=','>','?',
481 '@','a','b','c', 'd','e','f','g',
482 'h','i','j','k', 'l','m','n','o',
483 'p','q','r','s', 't','u','v','w',
484 'x','y','z','[', '\\',']','^','_',
485 '`','a','b','c', 'd','e','f','g',
486 'h','i','j','k', 'l','m','n','o',
487 'p','q','r','s', 't','u','v','w',
488 'x','y','z','{', '|','}','~',127,
490 128,129,130,131, 132,133,134,135,
491 136,137,138,139, 140,141,142,143,
492 144,145,146,147, 148,149,150,151,
493 152,153,154,155, 156,157,158,159,
494 160,161,162,163, 164,165,166,167,
495 168,169,170,171, 172,173,174,175,
496 176,177,178,179, 180,181,182,183,
497 184,185,186,187, 188,189,190,191,
498 192,193,194,195, 196,197,198,199,
499 200,201,202,203, 204,205,206,207,
500 208,209,210,211, 212,213,214,215,
501 216,217,218,219, 220,221,222,223,
502 224,225,226,227, 228,229,230,231,
503 232,233,234,235, 236,237,238,239,
504 240,241,242,243, 244,245,246,247,
505 248,249,250,251, 252,253,254,255,
508 #ifdef AROSC_SHARED
509 const struct arosc_ctype *__get_arosc_ctype(void)
511 return &__get_arosc_userdata()->acud_ctype;
514 static int __ctype_init(void)
516 struct arosc_userdata *acud = __get_arosc_userdata();
518 acud->acud_ctype.b = &__ctype_b_array[128];
519 acud->acud_ctype.toupper = &__ctype_toupper_array[128];
520 acud->acud_ctype.tolower = &__ctype_tolower_array[128];
522 return 1;
525 ADD2INIT(__ctype_init, 20);
526 #endif
528 /* Pointers have to be available both when in static linklib and
529 internally to arosc.library also
531 const unsigned short int * const __ctype_b = &__ctype_b_array[128];
532 const int * const __ctype_toupper = &__ctype_toupper_array[128];
533 const int * const __ctype_tolower = &__ctype_tolower_array[128];
535 /*****************************************************************************
537 NAME
538 #include <ctype.h>
540 int isupper (
542 SYNOPSIS
543 int c)
545 FUNCTION
546 Test if a character is uppercase. Works for all characters between
547 -128 and 255 inclusive both.
549 INPUTS
550 c - The character to test.
552 RESULT
553 != 0 if the character is uppercase, 0 otherwise.
555 NOTES
557 EXAMPLE
558 isupper ('A') -> true
559 isupper ('a') -> false
560 isupper ('0') -> false
561 isupper ('.') -> false
562 isupper ('\n') -> false
563 isupper ('\001') -> false
564 isupper (EOF) -> false
566 BUGS
568 SEE ALSO
570 INTERNALS
572 ******************************************************************************/
573 /*****************************************************************************
575 NAME
576 #include <ctype.h>
578 int islower (
580 SYNOPSIS
581 int c)
583 FUNCTION
584 Test if a character is lowercase. Works for all characters between
585 -128 and 255 inclusive both.
587 INPUTS
588 c - The character to test.
590 RESULT
591 != 0 if the character is lowercase, 0 otherwise.
593 NOTES
595 EXAMPLE
596 islower ('A') -> false
597 islower ('a') -> true
598 islower ('0') -> false
599 islower ('.') -> false
600 islower ('\n') -> false
601 islower ('\001') -> false
602 islower (EOF) -> false
604 BUGS
606 SEE ALSO
608 INTERNALS
610 ******************************************************************************/
611 /******************************************************************************
613 NAME
614 #include <ctype.h>
616 int isalpha (
618 SYNOPSIS
619 int c)
621 FUNCTION
622 Test if a character is an alphabetic character. Works for all
623 characters between -128 and 255 inclusive both.
625 INPUTS
626 c - The character to test.
628 RESULT
629 != 0 if the character is an alphabetic character, 0 otherwise.
631 NOTES
633 EXAMPLE
634 isalpha ('A') -> true
635 isalpha ('a') -> true
636 isalpha ('0') -> false
637 isalpha ('.') -> false
638 isalpha ('\n') -> false
639 isalpha ('\001') -> false
640 isalpha (EOF) -> false
642 BUGS
644 SEE ALSO
646 INTERNALS
648 ******************************************************************************/
649 /*****************************************************************************
651 NAME
652 #include <ctype.h>
654 int isalnum (
656 SYNOPSIS
657 int c)
659 FUNCTION
660 Test if a character is an alphabetic character or a digit. Works
661 for all characters between -128 and 255 inclusive both.
663 INPUTS
664 c - The character to test.
666 RESULT
667 != 0 if the character is alphabetic character or a digit, 0 otherwise.
669 NOTES
671 EXAMPLE
672 isalnum ('A') -> true
673 isalnum ('a') -> true
674 isalnum ('0') -> true
675 isalnum ('.') -> false
676 isalnum ('\n') -> false
677 isalnum ('\001') -> false
678 isalnum (EOF) -> false
680 BUGS
682 SEE ALSO
684 INTERNALS
686 ******************************************************************************/
687 /*****************************************************************************
689 NAME
690 #include <ctype.h>
692 int isascii (
694 SYNOPSIS
695 int c)
697 FUNCTION
698 Test if a character is an ascii character. Works for all characters
699 between -128 and 255 inclusive both.
701 INPUTS
702 c - The character to test.
704 RESULT
705 != 0 if the character is an ascii character, 0 otherwise.
707 NOTES
709 EXAMPLE
710 isascii ('A') -> true
711 isascii ('a') -> true
712 isascii ('0') -> true
713 isascii ('.') -> true
714 isascii ('\n') -> true
715 isascii ('\001') -> true
716 isascii (EOF) -> false
718 BUGS
720 SEE ALSO
722 INTERNALS
724 ******************************************************************************/
725 /*****************************************************************************
727 NAME
728 #include <ctype.h>
730 int isblank (
732 SYNOPSIS
733 int c)
735 FUNCTION
736 Test if a character is a space or a tab. Works for all characters
737 between -128 and 255 inclusive both.
739 INPUTS
740 c - The character to test.
742 RESULT
743 != 0 if the character is a space or tab, 0 otherwise.
745 NOTES
747 EXAMPLE
748 isblank ('A') -> false
749 isblank ('a') -> false
750 isblank ('0') -> false
751 isblank ('.') -> false
752 isblank (' ') -> true
753 isblank ('\n') -> false
754 isblank ('\001') -> false
755 isblank (EOF) -> false
757 BUGS
759 SEE ALSO
761 INTERNALS
763 ******************************************************************************/
764 /*****************************************************************************
766 NAME
767 #include <ctype.h>
769 int iscntrl (
771 SYNOPSIS
772 int c)
774 FUNCTION
775 Test if a character is a control character. Works for all
776 characters between -128 and 255 inclusive both.
778 INPUTS
779 c - The character to test.
781 RESULT
782 != 0 if the character is a control character, 0 otherwise.
784 NOTES
786 EXAMPLE
787 iscntrl ('A') -> false
788 iscntrl ('a') -> false
789 iscntrl ('0') -> false
790 iscntrl ('.') -> false
791 iscntrl ('\n') -> true
792 iscntrl ('\001') -> true
793 iscntrl (EOF) -> false
795 BUGS
797 SEE ALSO
799 INTERNALS
801 ******************************************************************************/
802 /*****************************************************************************
804 NAME
805 #include <ctype.h>
807 int isdigit (
809 SYNOPSIS
810 int c)
812 FUNCTION
813 Test if a character is a digit. Works for all characters between
814 -128 and 255 inclusive both.
816 INPUTS
817 c - The character to test.
819 RESULT
820 != 0 if the character is a digit, 0 otherwise.
822 NOTES
824 EXAMPLE
825 isdigit ('A') -> false
826 isdigit ('a') -> false
827 isdigit ('0') -> true
828 isdigit ('.') -> false
829 isdigit ('\n') -> false
830 isdigit ('\001') -> false
831 isdigit (EOF) -> false
833 BUGS
835 SEE ALSO
837 INTERNALS
839 ******************************************************************************/
840 /*****************************************************************************
842 NAME
843 #include <ctype.h>
845 int isgraph (
847 SYNOPSIS
848 int c)
850 FUNCTION
851 Test if a character is a printable character but no whitespace.
852 Works for all characters between -128 and 255 inclusive both.
854 INPUTS
855 c - The character to test.
857 RESULT
858 != 0 if the character is a printable character but no whitespace, 0
859 otherwise.
861 NOTES
863 EXAMPLE
864 isgraph ('A') -> true
865 isgraph ('a') -> true
866 isgraph ('0') -> true
867 isgraph ('.') -> true
868 isgraph ('\n') -> false
869 isgraph ('\001') -> false
870 isgraph (EOF) -> false
872 BUGS
874 SEE ALSO
876 INTERNALS
878 ******************************************************************************/
879 /*****************************************************************************
881 NAME
882 #include <ctype.h>
884 int isprint (
886 SYNOPSIS
887 int c)
889 FUNCTION
890 Test if a character is a printable character. Works for all
891 characters between -128 and 255 inclusive both.
893 INPUTS
894 c - The character to test.
896 RESULT
897 != 0 if the character is a printable character, 0 otherwise.
899 NOTES
901 EXAMPLE
902 isprint ('A') -> true
903 isprint ('a') -> true
904 isprint ('0') -> true
905 isprint ('.') -> true
906 isprint ('\n') -> true
907 isprint ('\001') -> false
908 isprint (EOF) -> false
910 BUGS
912 SEE ALSO
914 INTERNALS
916 ******************************************************************************/
917 /*****************************************************************************
919 NAME
920 #include <ctype.h>
922 int isspace (
924 SYNOPSIS
925 int c)
927 FUNCTION
928 Test if a character is whitespace. Works for all characters between
929 -128 and 255 inclusive both.
931 INPUTS
932 c - The character to test.
934 RESULT
935 != 0 if the character is whitespace, 0 otherwise.
937 NOTES
939 EXAMPLE
940 isspace ('A') -> false
941 isspace ('a') -> false
942 isspace ('0') -> false
943 isspace ('.') -> false
944 isspace ('\n') -> true
945 isspace ('\001') -> false
946 isspace (EOF) -> false
948 BUGS
950 SEE ALSO
952 INTERNALS
954 ******************************************************************************/
955 /*****************************************************************************
957 NAME
958 #include <ctype.h>
960 int ispunct (
962 SYNOPSIS
963 int c)
965 FUNCTION
966 Test if a character is printable but not alphanumeric. Works for
967 all characters between -128 and 255 inclusive both.
969 INPUTS
970 c - The character to test.
972 RESULT
973 != 0 if the character is printable but not alphanumeric, 0
974 otherwise.
976 NOTES
978 EXAMPLE
979 ispunct ('A') -> false
980 ispunct ('a') -> false
981 ispunct ('0') -> false
982 ispunct ('.') -> true
983 ispunct ('\n') -> false
984 ispunct ('\001') -> false
985 ispunct (EOF) -> false
987 BUGS
989 SEE ALSO
991 INTERNALS
993 ******************************************************************************/
994 /*****************************************************************************
996 NAME
997 #include <ctype.h>
999 int isxdigit (
1001 SYNOPSIS
1002 int c)
1004 FUNCTION
1005 Test if a character is a hexadecimal digit. Works for all
1006 characters between -128 and 255 inclusive both.
1008 INPUTS
1009 c - The character to test.
1011 RESULT
1012 != 0 if the character is a hexadecimal digit, 0 otherwise.
1014 NOTES
1016 EXAMPLE
1017 isxdigit ('A') -> true
1018 isxdigit ('a') -> true
1019 isxdigit ('x') -> false
1020 isxdigit ('0') -> true
1021 isxdigit ('.') -> false
1022 isxdigit ('\n') -> false
1023 isxdigit ('\001') -> false
1024 isxdigit (EOF) -> false
1026 BUGS
1028 SEE ALSO
1030 INTERNALS
1032 ******************************************************************************/