Added missing version tags, clean-up
[AROS.git] / compiler / clib / __ctype.c
blob3aea70a06d86856550a37ef8d442d3a7d3219644
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 /* Move these symbols out of the way, because
7 * we're going to be using a slighty different
8 * definition of these for the static library
9 * (a const *)
11 #define __ctype_b __ctype_b_external
12 #define __ctype_toupper __ctype_toupper_external
13 #define __ctype_tolower __ctype_tolower_external
15 #include <aros/symbolsets.h>
16 #include <ctype.h>
18 #include "__arosc_privdata.h"
20 #undef __ctype_b
21 #undef __ctype_toupper
22 #undef __ctype_tolower
24 static const unsigned short int __ctype_b_array[256] =
26 _IScntrl, /* 0 */
27 _IScntrl, /* 1 */
28 _IScntrl, /* 2 */
29 _IScntrl, /* 3 */
30 _IScntrl, /* 4 */
31 _IScntrl, /* 5 */
32 _IScntrl, /* 6 */
33 _IScntrl, /* 7 */
34 _IScntrl, /* Backspace */
35 _ISblank|_IScntrl|_ISspace, /* 9 */
36 _IScntrl|_ISspace, /* LF */
37 _IScntrl|_ISspace, /* 11 */
38 _IScntrl|_ISspace, /* 12 */
39 _IScntrl|_ISspace, /* CR */
40 _IScntrl, /* 14 */
41 _IScntrl, /* 15 */
42 _IScntrl, /* 16 */
43 _IScntrl, /* 17 */
44 _IScntrl, /* 18 */
45 _IScntrl, /* 19 */
46 _IScntrl, /* 20 */
47 _IScntrl, /* 21 */
48 _IScntrl, /* 22 */
49 _IScntrl, /* 23 */
50 _IScntrl, /* 24 */
51 _IScntrl, /* 25 */
52 _IScntrl, /* 26 */
53 _IScntrl, /* ESC */
54 _IScntrl, /* 28 */
55 _IScntrl, /* 29 */
56 _IScntrl, /* 30 */
57 _IScntrl, /* 31 */
58 _ISblank|_ISprint|_ISspace, /* Space */
59 _ISgraph|_ISprint|_ISpunct, /* ! */
60 _ISgraph|_ISprint|_ISpunct, /* " */
61 _ISgraph|_ISprint|_ISpunct, /* # */
62 _ISgraph|_ISprint|_ISpunct, /* $ */
63 _ISgraph|_ISprint|_ISpunct, /* % */
64 _ISgraph|_ISprint|_ISpunct, /* & */
65 _ISgraph|_ISprint|_ISpunct, /* ' */
66 _ISgraph|_ISprint|_ISpunct, /* ( */
67 _ISgraph|_ISprint|_ISpunct, /* ) */
68 _ISgraph|_ISprint|_ISpunct, /* * */
69 _ISgraph|_ISprint|_ISpunct, /* + */
70 _ISgraph|_ISprint|_ISpunct, /* , */
71 _ISgraph|_ISprint|_ISpunct, /* - */
72 _ISgraph|_ISprint|_ISpunct, /* . */
73 _ISgraph|_ISprint|_ISpunct, /* / */
74 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 0 */
75 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 1 */
76 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 2 */
77 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 3 */
78 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 4 */
79 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 5 */
80 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 6 */
81 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 7 */
82 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 8 */
83 _ISdigit|_ISgraph|_ISprint|_ISxdigit, /* 9 */
84 _ISgraph|_ISprint|_ISpunct, /* : */
85 _ISgraph|_ISprint|_ISpunct, /* ; */
86 _ISgraph|_ISprint|_ISpunct, /* < */
87 _ISgraph|_ISprint|_ISpunct, /* = */
88 _ISgraph|_ISprint|_ISpunct, /* > */
89 _ISgraph|_ISprint|_ISpunct, /* ? */
90 _ISgraph|_ISprint|_ISpunct, /* @ */
91 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* A */
92 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* B */
93 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* C */
94 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* D */
95 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* E */
96 _ISupper|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* F */
97 _ISupper|_ISalpha|_ISgraph|_ISprint, /* G */
98 _ISupper|_ISalpha|_ISgraph|_ISprint, /* H */
99 _ISupper|_ISalpha|_ISgraph|_ISprint, /* I */
100 _ISupper|_ISalpha|_ISgraph|_ISprint, /* J */
101 _ISupper|_ISalpha|_ISgraph|_ISprint, /* K */
102 _ISupper|_ISalpha|_ISgraph|_ISprint, /* L */
103 _ISupper|_ISalpha|_ISgraph|_ISprint, /* M */
104 _ISupper|_ISalpha|_ISgraph|_ISprint, /* N */
105 _ISupper|_ISalpha|_ISgraph|_ISprint, /* O */
106 _ISupper|_ISalpha|_ISgraph|_ISprint, /* P */
107 _ISupper|_ISalpha|_ISgraph|_ISprint, /* Q */
108 _ISupper|_ISalpha|_ISgraph|_ISprint, /* R */
109 _ISupper|_ISalpha|_ISgraph|_ISprint, /* S */
110 _ISupper|_ISalpha|_ISgraph|_ISprint, /* T */
111 _ISupper|_ISalpha|_ISgraph|_ISprint, /* U */
112 _ISupper|_ISalpha|_ISgraph|_ISprint, /* V */
113 _ISupper|_ISalpha|_ISgraph|_ISprint, /* W */
114 _ISupper|_ISalpha|_ISgraph|_ISprint, /* X */
115 _ISupper|_ISalpha|_ISgraph|_ISprint, /* Y */
116 _ISupper|_ISalpha|_ISgraph|_ISprint, /* Z */
117 _ISgraph|_ISprint|_ISpunct, /* [ */
118 _ISgraph|_ISprint|_ISpunct, /* \ */
119 _ISgraph|_ISprint|_ISpunct, /* ] */
120 _ISgraph|_ISprint|_ISpunct, /* ^ */
121 _ISgraph|_ISprint|_ISpunct, /* _ */
122 _ISgraph|_ISprint|_ISpunct, /* ` */
123 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* a */
124 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* b */
125 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* c */
126 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* d */
127 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* e */
128 _ISlower|_ISalpha|_ISgraph|_ISprint|_ISxdigit, /* f */
129 _ISlower|_ISalpha|_ISgraph|_ISprint, /* g */
130 _ISlower|_ISalpha|_ISgraph|_ISprint, /* h */
131 _ISlower|_ISalpha|_ISgraph|_ISprint, /* i */
132 _ISlower|_ISalpha|_ISgraph|_ISprint, /* j */
133 _ISlower|_ISalpha|_ISgraph|_ISprint, /* k */
134 _ISlower|_ISalpha|_ISgraph|_ISprint, /* l */
135 _ISlower|_ISalpha|_ISgraph|_ISprint, /* m */
136 _ISlower|_ISalpha|_ISgraph|_ISprint, /* n */
137 _ISlower|_ISalpha|_ISgraph|_ISprint, /* o */
138 _ISlower|_ISalpha|_ISgraph|_ISprint, /* p */
139 _ISlower|_ISalpha|_ISgraph|_ISprint, /* q */
140 _ISlower|_ISalpha|_ISgraph|_ISprint, /* r */
141 _ISlower|_ISalpha|_ISgraph|_ISprint, /* s */
142 _ISlower|_ISalpha|_ISgraph|_ISprint, /* t */
143 _ISlower|_ISalpha|_ISgraph|_ISprint, /* u */
144 _ISlower|_ISalpha|_ISgraph|_ISprint, /* v */
145 _ISlower|_ISalpha|_ISgraph|_ISprint, /* w */
146 _ISlower|_ISalpha|_ISgraph|_ISprint, /* x */
147 _ISlower|_ISalpha|_ISgraph|_ISprint, /* y */
148 _ISlower|_ISalpha|_ISgraph|_ISprint, /* z */
149 _ISgraph|_ISprint|_ISpunct, /* { */
150 _ISgraph|_ISprint|_ISpunct, /* | */
151 _ISgraph|_ISprint|_ISpunct, /* } */
152 _ISgraph|_ISprint|_ISpunct, /* ~ */
153 _IScntrl, /* Del */
154 0, /* 128 */
155 0, /* 129 */
156 0, /* 130 */
157 0, /* 131 */
158 0, /* 132 */
159 0, /* 133 */
160 0, /* 134 */
161 0, /* 135 */
162 0, /* 136 */
163 0, /* 137 */
164 0, /* 138 */
165 0, /* 139 */
166 0, /* 140 */
167 0, /* 141 */
168 0, /* 142 */
169 0, /* 143 */
170 0, /* 144 */
171 0, /* 145 */
172 0, /* 146 */
173 0, /* 147 */
174 0, /* 148 */
175 0, /* 149 */
176 0, /* 150 */
177 0, /* 151 */
178 0, /* 152 */
179 0, /* 153 */
180 0, /* 154 */
181 0, /* CSI */
182 0, /* 156 */
183 0, /* 157 */
184 0, /* 158 */
185 0, /* 159 */
186 0, /* NBSpace */
187 0, /* ¡ */
188 0, /* ¢ */
189 0, /* £ */
190 0, /* ¤ */
191 0, /* ¥ */
192 0, /* ¦ */
193 0, /* § */
194 0, /* ¨ */
195 0, /* © */
196 0, /* ª */
197 0, /* « */
198 0, /* ¬ */
199 0, /* ­ */
200 0, /* ® */
201 0, /* ¯ */
202 0, /* ° */
203 0, /* ± */
204 0, /* ² */
205 0, /* ³ */
206 0, /* ´ */
207 0, /* µ */
208 0, /* ¶ */
209 0, /* · */
210 0, /* ¸ */
211 0, /* ¹ */
212 0, /* º */
213 0, /* » */
214 0, /* ¼ */
215 0, /* ½ */
216 0, /* ¾ */
217 0, /* ¿ */
218 0, /* À */
219 0, /* Á */
220 0, /* Â */
221 0, /* Ã */
222 0, /* Ä */
223 0, /* Å */
224 0, /* Æ */
225 0, /* Ç */
226 0, /* È */
227 0, /* É */
228 0, /* Ê */
229 0, /* Ë */
230 0, /* Ì */
231 0, /* Í */
232 0, /* Î */
233 0, /* Ï */
234 0, /* Ð */
235 0, /* Ñ */
236 0, /* Ò */
237 0, /* Ó */
238 0, /* Ô */
239 0, /* Õ */
240 0, /* Ö */
241 0, /* × */
242 0, /* Ø */
243 0, /* Ù */
244 0, /* Ú */
245 0, /* Û */
246 0, /* Ü */
247 0, /* Ý */
248 0, /* Þ */
249 0, /* ß */
250 0, /* à */
251 0, /* á */
252 0, /* â */
253 0, /* ã */
254 0, /* ä */
255 0, /* å */
256 0, /* æ */
257 0, /* ç */
258 0, /* è */
259 0, /* é */
260 0, /* ê */
261 0, /* ë */
262 0, /* ì */
263 0, /* í */
264 0, /* î */
265 0, /* ï */
266 0, /* ð */
267 0, /* ñ */
268 0, /* ò */
269 0, /* ó */
270 0, /* ô */
271 0, /* õ */
272 0, /* ö */
273 0, /* ÷ */
274 0, /* ø */
275 0, /* ù */
276 0, /* ú */
277 0, /* û */
278 0, /* ü */
279 0, /* ý */
280 0, /* þ */
281 0, /* ÿ */
284 static const unsigned char __ctype_toupper_array[256] =
286 0, 1, 2, 3, 4, 5, 6, 7,
287 8, 9, 10, 11, 12, 13, 14, 15,
288 16, 17, 18, 19, 20, 21, 22, 23,
289 24, 25, 26, 27, 28, 29, 30, 31,
290 ' ','!','"','#', '$','%','&','\'',
291 '(',')','*','+', ',','-','.','/',
292 '0','1','2','3', '4','5','6','7',
293 '8','9',':',';', '<','=','>','?',
294 '@','A','B','C', 'D','E','F','G',
295 'H','I','J','K', 'L','M','N','O',
296 'P','Q','R','S', 'T','U','V','W',
297 'X','Y','Z','[', '\\',']','^','_',
298 '`','A','B','C', 'D','E','F','G',
299 'H','I','J','K', 'L','M','N','O',
300 'P','Q','R','S', 'T','U','V','W',
301 'X','Y','Z','{', '|','}','~',127,
303 128,129,130,131, 132,133,134,135,
304 136,137,138,139, 140,141,142,143,
305 144,145,146,147, 148,149,150,151,
306 152,153,154,155, 156,157,158,159,
307 160,161,162,163, 164,165,166,167,
308 168,169,170,171, 172,173,174,175,
309 176,177,178,179, 180,181,182,183,
310 184,185,186,187, 188,189,190,191,
311 192,193,194,195, 196,197,198,199,
312 200,201,202,203, 204,205,206,207,
313 208,209,210,211, 212,213,214,215,
314 216,217,218,219, 220,221,222,223,
315 224,225,226,227, 228,229,230,231,
316 232,233,234,235, 236,237,238,239,
317 240,241,242,243, 244,245,246,247,
318 248,249,250,251, 252,253,254,255,
321 static const unsigned char __ctype_tolower_array[256] =
323 0, 1, 2, 3, 4, 5, 6, 7,
324 8, 9, 10, 11, 12, 13, 14, 15,
325 16, 17, 18, 19, 20, 21, 22, 23,
326 24, 25, 26, 27, 28, 29, 30, 31,
327 ' ','!','"','#', '$','%','&','\'',
328 '(',')','*','+', ',','-','.','/',
329 '0','1','2','3', '4','5','6','7',
330 '8','9',':',';', '<','=','>','?',
331 '@','a','b','c', 'd','e','f','g',
332 'h','i','j','k', 'l','m','n','o',
333 'p','q','r','s', 't','u','v','w',
334 'x','y','z','[', '\\',']','^','_',
335 '`','a','b','c', 'd','e','f','g',
336 'h','i','j','k', 'l','m','n','o',
337 'p','q','r','s', 't','u','v','w',
338 'x','y','z','{', '|','}','~',127,
340 128,129,130,131, 132,133,134,135,
341 136,137,138,139, 140,141,142,143,
342 144,145,146,147, 148,149,150,151,
343 152,153,154,155, 156,157,158,159,
344 160,161,162,163, 164,165,166,167,
345 168,169,170,171, 172,173,174,175,
346 176,177,178,179, 180,181,182,183,
347 184,185,186,187, 188,189,190,191,
348 192,193,194,195, 196,197,198,199,
349 200,201,202,203, 204,205,206,207,
350 208,209,210,211, 212,213,214,215,
351 216,217,218,219, 220,221,222,223,
352 224,225,226,227, 228,229,230,231,
353 232,233,234,235, 236,237,238,239,
354 240,241,242,243, 244,245,246,247,
355 248,249,250,251, 252,253,254,255,
358 #ifdef AROSC_SHARED
359 const unsigned short *__ctype_b = &__ctype_b_array[0];
360 const unsigned char *__ctype_toupper = &__ctype_toupper_array[0];
361 const unsigned char *__ctype_tolower = &__ctype_tolower_array[0];
363 const struct arosc_ctype *__get_arosc_ctype(void)
365 return &__get_arosc_userdata()->acud_ctype;
368 static int __ctype_init(struct ExecBase *SysBase)
370 struct arosc_userdata *acud = __get_arosc_userdata();
372 acud->acud_ctype.b = __ctype_b;
373 acud->acud_ctype.toupper = __ctype_toupper;
374 acud->acud_ctype.tolower = __ctype_tolower;
376 return 1;
379 ADD2INIT(__ctype_init, 20);
380 #else
381 const unsigned short * const __ctype_b = &__ctype_b_array[0];
382 const unsigned char * const __ctype_toupper = &__ctype_toupper_array[0];
383 const unsigned char * const __ctype_tolower = &__ctype_tolower_array[0];
384 #endif
386 /*****************************************************************************
388 NAME
389 #include <ctype.h>
391 int isupper (
393 SYNOPSIS
394 int c)
396 FUNCTION
397 Test if a character is uppercase. Works for all characters between
398 -128 and 255 inclusive both.
400 INPUTS
401 c - The character to test.
403 RESULT
404 != 0 if the character is uppercase, 0 otherwise.
406 NOTES
408 EXAMPLE
409 isupper ('A') -> true
410 isupper ('a') -> false
411 isupper ('0') -> false
412 isupper ('.') -> false
413 isupper ('\n') -> false
414 isupper ('\001') -> false
415 isupper (EOF) -> false
417 BUGS
419 SEE ALSO
421 INTERNALS
423 ******************************************************************************/
424 /*****************************************************************************
426 NAME
427 #include <ctype.h>
429 int islower (
431 SYNOPSIS
432 int c)
434 FUNCTION
435 Test if a character is lowercase. Works for all characters between
436 -128 and 255 inclusive both.
438 INPUTS
439 c - The character to test.
441 RESULT
442 != 0 if the character is lowercase, 0 otherwise.
444 NOTES
446 EXAMPLE
447 islower ('A') -> false
448 islower ('a') -> true
449 islower ('0') -> false
450 islower ('.') -> false
451 islower ('\n') -> false
452 islower ('\001') -> false
453 islower (EOF) -> false
455 BUGS
457 SEE ALSO
459 INTERNALS
461 ******************************************************************************/
462 /******************************************************************************
464 NAME
465 #include <ctype.h>
467 int isalpha (
469 SYNOPSIS
470 int c)
472 FUNCTION
473 Test if a character is an alphabetic character. Works for all
474 characters between -128 and 255 inclusive both.
476 INPUTS
477 c - The character to test.
479 RESULT
480 != 0 if the character is an alphabetic character, 0 otherwise.
482 NOTES
484 EXAMPLE
485 isalpha ('A') -> true
486 isalpha ('a') -> true
487 isalpha ('0') -> false
488 isalpha ('.') -> false
489 isalpha ('\n') -> false
490 isalpha ('\001') -> false
491 isalpha (EOF) -> false
493 BUGS
495 SEE ALSO
497 INTERNALS
499 ******************************************************************************/
500 /*****************************************************************************
502 NAME
503 #include <ctype.h>
505 int isalnum (
507 SYNOPSIS
508 int c)
510 FUNCTION
511 Test if a character is an alphabetic character or a digit. Works
512 for all characters between -128 and 255 inclusive both.
514 INPUTS
515 c - The character to test.
517 RESULT
518 != 0 if the character is alphabetic character or a digit, 0 otherwise.
520 NOTES
522 EXAMPLE
523 isalnum ('A') -> true
524 isalnum ('a') -> true
525 isalnum ('0') -> true
526 isalnum ('.') -> false
527 isalnum ('\n') -> false
528 isalnum ('\001') -> false
529 isalnum (EOF) -> false
531 BUGS
533 SEE ALSO
535 INTERNALS
537 ******************************************************************************/
538 /*****************************************************************************
540 NAME
541 #include <ctype.h>
543 int isascii (
545 SYNOPSIS
546 int c)
548 FUNCTION
549 Test if a character is an ascii character. Works for all characters
550 between -128 and 255 inclusive both.
552 INPUTS
553 c - The character to test.
555 RESULT
556 != 0 if the character is an ascii character, 0 otherwise.
558 NOTES
560 EXAMPLE
561 isascii ('A') -> true
562 isascii ('a') -> true
563 isascii ('0') -> true
564 isascii ('.') -> true
565 isascii ('\n') -> true
566 isascii ('\001') -> true
567 isascii (EOF) -> false
569 BUGS
571 SEE ALSO
573 INTERNALS
575 ******************************************************************************/
576 /*****************************************************************************
578 NAME
579 #include <ctype.h>
581 int isblank (
583 SYNOPSIS
584 int c)
586 FUNCTION
587 Test if a character is a space or a tab. Works for all characters
588 between -128 and 255 inclusive both.
590 INPUTS
591 c - The character to test.
593 RESULT
594 != 0 if the character is a space or tab, 0 otherwise.
596 NOTES
598 EXAMPLE
599 isblank ('A') -> false
600 isblank ('a') -> false
601 isblank ('0') -> false
602 isblank ('.') -> false
603 isblank (' ') -> true
604 isblank ('\n') -> false
605 isblank ('\001') -> false
606 isblank (EOF) -> false
608 BUGS
610 SEE ALSO
612 INTERNALS
614 ******************************************************************************/
615 /*****************************************************************************
617 NAME
618 #include <ctype.h>
620 int iscntrl (
622 SYNOPSIS
623 int c)
625 FUNCTION
626 Test if a character is a control character. Works for all
627 characters between -128 and 255 inclusive both.
629 INPUTS
630 c - The character to test.
632 RESULT
633 != 0 if the character is a control character, 0 otherwise.
635 NOTES
637 EXAMPLE
638 iscntrl ('A') -> false
639 iscntrl ('a') -> false
640 iscntrl ('0') -> false
641 iscntrl ('.') -> false
642 iscntrl ('\n') -> true
643 iscntrl ('\001') -> true
644 iscntrl (EOF) -> false
646 BUGS
648 SEE ALSO
650 INTERNALS
652 ******************************************************************************/
653 /*****************************************************************************
655 NAME
656 #include <ctype.h>
658 int isdigit (
660 SYNOPSIS
661 int c)
663 FUNCTION
664 Test if a character is a digit. Works for all characters between
665 -128 and 255 inclusive both.
667 INPUTS
668 c - The character to test.
670 RESULT
671 != 0 if the character is a digit, 0 otherwise.
673 NOTES
675 EXAMPLE
676 isdigit ('A') -> false
677 isdigit ('a') -> false
678 isdigit ('0') -> true
679 isdigit ('.') -> false
680 isdigit ('\n') -> false
681 isdigit ('\001') -> false
682 isdigit (EOF) -> false
684 BUGS
686 SEE ALSO
688 INTERNALS
690 ******************************************************************************/
691 /*****************************************************************************
693 NAME
694 #include <ctype.h>
696 int isgraph (
698 SYNOPSIS
699 int c)
701 FUNCTION
702 Test if a character is a printable character but no whitespace.
703 Works for all characters between -128 and 255 inclusive both.
705 INPUTS
706 c - The character to test.
708 RESULT
709 != 0 if the character is a printable character but no whitespace, 0
710 otherwise.
712 NOTES
714 EXAMPLE
715 isgraph ('A') -> true
716 isgraph ('a') -> true
717 isgraph ('0') -> true
718 isgraph ('.') -> true
719 isgraph ('\n') -> false
720 isgraph ('\001') -> false
721 isgraph (EOF) -> false
723 BUGS
725 SEE ALSO
727 INTERNALS
729 ******************************************************************************/
730 /*****************************************************************************
732 NAME
733 #include <ctype.h>
735 int isprint (
737 SYNOPSIS
738 int c)
740 FUNCTION
741 Test if a character is a printable character. Works for all
742 characters between -128 and 255 inclusive both.
744 INPUTS
745 c - The character to test.
747 RESULT
748 != 0 if the character is a printable character, 0 otherwise.
750 NOTES
752 EXAMPLE
753 isprint ('A') -> true
754 isprint ('a') -> true
755 isprint ('0') -> true
756 isprint ('.') -> true
757 isprint ('\n') -> true
758 isprint ('\001') -> false
759 isprint (EOF) -> false
761 BUGS
763 SEE ALSO
765 INTERNALS
767 ******************************************************************************/
768 /*****************************************************************************
770 NAME
771 #include <ctype.h>
773 int isspace (
775 SYNOPSIS
776 int c)
778 FUNCTION
779 Test if a character is whitespace. Works for all characters between
780 -128 and 255 inclusive both.
782 INPUTS
783 c - The character to test.
785 RESULT
786 != 0 if the character is whitespace, 0 otherwise.
788 NOTES
790 EXAMPLE
791 isspace ('A') -> false
792 isspace ('a') -> false
793 isspace ('0') -> false
794 isspace ('.') -> false
795 isspace ('\n') -> true
796 isspace ('\001') -> false
797 isspace (EOF) -> false
799 BUGS
801 SEE ALSO
803 INTERNALS
805 ******************************************************************************/
806 /*****************************************************************************
808 NAME
809 #include <ctype.h>
811 int ispunct (
813 SYNOPSIS
814 int c)
816 FUNCTION
817 Test if a character is printable but not alphanumeric. Works for
818 all characters between -128 and 255 inclusive both.
820 INPUTS
821 c - The character to test.
823 RESULT
824 != 0 if the character is printable but not alphanumeric, 0
825 otherwise.
827 NOTES
829 EXAMPLE
830 ispunct ('A') -> false
831 ispunct ('a') -> false
832 ispunct ('0') -> false
833 ispunct ('.') -> true
834 ispunct ('\n') -> false
835 ispunct ('\001') -> false
836 ispunct (EOF) -> false
838 BUGS
840 SEE ALSO
842 INTERNALS
844 ******************************************************************************/
845 /*****************************************************************************
847 NAME
848 #include <ctype.h>
850 int isxdigit (
852 SYNOPSIS
853 int c)
855 FUNCTION
856 Test if a character is a hexadecimal digit. Works for all
857 characters between -128 and 255 inclusive both.
859 INPUTS
860 c - The character to test.
862 RESULT
863 != 0 if the character is a hexadecimal digit, 0 otherwise.
865 NOTES
867 EXAMPLE
868 isxdigit ('A') -> true
869 isxdigit ('a') -> true
870 isxdigit ('x') -> false
871 isxdigit ('0') -> true
872 isxdigit ('.') -> false
873 isxdigit ('\n') -> false
874 isxdigit ('\001') -> false
875 isxdigit (EOF) -> false
877 BUGS
879 SEE ALSO
881 INTERNALS
883 ******************************************************************************/