Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / test / test_is.c
blob6d4f52c638d7484eedfed78e003da3385d06dca5
1 #include "test.h"
2 #include <ctype.h>
4 int setascii;
5 int setlower;
6 int setupper;
7 int myascii;
8 int mycntrl;
9 int myspace;
10 int myprint;
11 int myalnum;
12 int mydigit;
13 int myxdigit;
14 int myalpha;
15 int myupper;
16 int mylower;
17 int mygraph;
18 int mypunct;
20 void
21 test_is_single (int i)
23 setascii = 0;
24 setlower = 0;
25 setupper = 0;
27 myascii = 0;
28 mycntrl = 0;
29 myspace = 0;
30 myprint = 0;
31 myalnum = 0;
32 mydigit = 0;
33 myxdigit = 0;
34 myalpha = 0;
35 myupper = 0;
36 mylower = 0;
37 mygraph = 0;
38 mypunct = 0;
40 switch (i) {
41 case 0000:
42 myascii = 1;
43 mycntrl = 1;
44 setascii = 0;
45 setlower = 0;
46 setupper = 0;
47 break;
48 case 0001:
49 myascii = 1;
50 mycntrl = 1;
51 setascii = 1;
52 setlower = 1;
53 setupper = 1;
54 break;
55 case 0002:
56 myascii = 1;
57 mycntrl = 1;
58 setascii = 2;
59 setlower = 2;
60 setupper = 2;
61 break;
62 case 0003:
63 myascii = 1;
64 mycntrl = 1;
65 setascii = 3;
66 setlower = 3;
67 setupper = 3;
68 break;
69 case 0004:
70 myascii = 1;
71 mycntrl = 1;
72 setascii = 4;
73 setlower = 4;
74 setupper = 4;
75 break;
76 case 0005:
77 myascii = 1;
78 mycntrl = 1;
79 setascii = 5;
80 setlower = 5;
81 setupper = 5;
82 break;
83 case 0006:
84 myascii = 1;
85 mycntrl = 1;
86 setascii = 6;
87 setlower = 6;
88 setupper = 6;
89 break;
90 case 0007:
91 myascii = 1;
92 mycntrl = 1;
93 setascii = 7;
94 setlower = 7;
95 setupper = 7;
96 break;
97 case 0010:
98 myascii = 1;
99 mycntrl = 1;
100 setascii = 8;
101 setlower = 8;
102 setupper = 8;
103 break;
104 case 0011:
105 myascii = 1;
106 mycntrl = 1;
107 myspace = 1;
108 setascii = 9;
109 setlower = 9;
110 setupper = 9;
111 break;
112 case 0012:
113 myascii = 1;
114 mycntrl = 1;
115 myspace = 1;
116 setascii = 10;
117 setlower = 10;
118 setupper = 10;
119 break;
120 case 0013:
121 myascii = 1;
122 mycntrl = 1;
123 myspace = 1;
124 setascii = 11;
125 setlower = 11;
126 setupper = 11;
127 break;
128 case 0014:
129 myascii = 1;
130 mycntrl = 1;
131 myspace = 1;
132 setascii = 12;
133 setlower = 12;
134 setupper = 12;
135 break;
136 case 0015:
137 myascii = 1;
138 mycntrl = 1;
139 myspace = 1;
140 setascii = 13;
141 setlower = 13;
142 setupper = 13;
143 break;
144 case 0016:
145 myascii = 1;
146 mycntrl = 1;
147 setascii = 14;
148 setlower = 14;
149 setupper = 14;
150 break;
151 case 0017:
152 myascii = 1;
153 mycntrl = 1;
154 setascii = 15;
155 setlower = 15;
156 setupper = 15;
157 break;
158 case 0020:
159 myascii = 1;
160 mycntrl = 1;
161 setascii = 16;
162 setlower = 16;
163 setupper = 16;
164 break;
165 case 0021:
166 myascii = 1;
167 mycntrl = 1;
168 setascii = 17;
169 setlower = 17;
170 setupper = 17;
171 break;
172 case 0022:
173 myascii = 1;
174 mycntrl = 1;
175 setascii = 18;
176 setlower = 18;
177 setupper = 18;
178 break;
179 case 0023:
180 myascii = 1;
181 mycntrl = 1;
182 setascii = 19;
183 setlower = 19;
184 setupper = 19;
185 break;
186 case 0024:
187 myascii = 1;
188 mycntrl = 1;
189 setascii = 20;
190 setlower = 20;
191 setupper = 20;
192 break;
193 case 0025:
194 myascii = 1;
195 mycntrl = 1;
196 setascii = 21;
197 setlower = 21;
198 setupper = 21;
199 break;
200 case 0026:
201 myascii = 1;
202 mycntrl = 1;
203 setascii = 22;
204 setlower = 22;
205 setupper = 22;
206 break;
207 case 0027:
208 myascii = 1;
209 mycntrl = 1;
210 setascii = 23;
211 setlower = 23;
212 setupper = 23;
213 break;
214 case 0030:
215 myascii = 1;
216 mycntrl = 1;
217 setascii = 24;
218 setlower = 24;
219 setupper = 24;
220 break;
221 case 0031:
222 myascii = 1;
223 mycntrl = 1;
224 setascii = 25;
225 setlower = 25;
226 setupper = 25;
227 break;
228 case 0032:
229 myascii = 1;
230 mycntrl = 1;
231 setascii = 26;
232 setlower = 26;
233 setupper = 26;
234 break;
235 case 0033:
236 myascii = 1;
237 mycntrl = 1;
238 setascii = 27;
239 setlower = 27;
240 setupper = 27;
241 break;
242 case 0034:
243 myascii = 1;
244 mycntrl = 1;
245 setascii = 28;
246 setlower = 28;
247 setupper = 28;
248 break;
249 case 0035:
250 myascii = 1;
251 mycntrl = 1;
252 setascii = 29;
253 setlower = 29;
254 setupper = 29;
255 break;
256 case 0036:
257 myascii = 1;
258 mycntrl = 1;
259 setascii = 30;
260 setlower = 30;
261 setupper = 30;
262 break;
263 case 0037:
264 myascii = 1;
265 mycntrl = 1;
266 setascii = 31;
267 setlower = 31;
268 setupper = 31;
269 break;
270 case ' ':
271 myascii = 1;
272 myprint = 1;
273 myspace = 1;
274 setascii = 32;
275 setlower = 32;
276 setupper = 32;
277 break;
278 case '!':
279 myascii = 1;
280 mygraph = 1;
281 myprint = 1;
282 mypunct = 1;
283 setascii = 33;
284 setlower = 33;
285 setupper = 33;
286 break;
287 case '"':
288 myascii = 1;
289 mygraph = 1;
290 myprint = 1;
291 mypunct = 1;
292 setascii = 34;
293 setlower = 34;
294 setupper = 34;
295 break;
296 case '#':
297 myascii = 1;
298 mygraph = 1;
299 myprint = 1;
300 mypunct = 1;
301 setascii = 35;
302 setlower = 35;
303 setupper = 35;
304 break;
305 case '$':
306 myascii = 1;
307 mygraph = 1;
308 myprint = 1;
309 mypunct = 1;
310 setascii = 36;
311 setlower = 36;
312 setupper = 36;
313 break;
314 case '%':
315 myascii = 1;
316 mygraph = 1;
317 myprint = 1;
318 mypunct = 1;
319 setascii = 37;
320 setlower = 37;
321 setupper = 37;
322 break;
323 case '&':
324 myascii = 1;
325 mygraph = 1;
326 myprint = 1;
327 mypunct = 1;
328 setascii = 38;
329 setlower = 38;
330 setupper = 38;
331 break;
332 case '\'':
333 myascii = 1;
334 mygraph = 1;
335 myprint = 1;
336 mypunct = 1;
337 setascii = 39;
338 setlower = 39;
339 setupper = 39;
340 break;
341 case '\(':
342 myascii = 1;
343 mygraph = 1;
344 myprint = 1;
345 mypunct = 1;
346 setascii = 40;
347 setlower = 40;
348 setupper = 40;
349 break;
350 case ')':
351 myascii = 1;
352 mygraph = 1;
353 myprint = 1;
354 mypunct = 1;
355 setascii = 41;
356 setlower = 41;
357 setupper = 41;
358 break;
359 case '*':
360 myascii = 1;
361 mygraph = 1;
362 myprint = 1;
363 mypunct = 1;
364 setascii = 42;
365 setlower = 42;
366 setupper = 42;
367 break;
368 case '+':
369 myascii = 1;
370 mygraph = 1;
371 myprint = 1;
372 mypunct = 1;
373 setascii = 43;
374 setlower = 43;
375 setupper = 43;
376 break;
377 case ',':
378 myascii = 1;
379 mygraph = 1;
380 myprint = 1;
381 mypunct = 1;
382 setascii = 44;
383 setlower = 44;
384 setupper = 44;
385 break;
386 case '-':
387 myascii = 1;
388 mygraph = 1;
389 myprint = 1;
390 mypunct = 1;
391 setascii = 45;
392 setlower = 45;
393 setupper = 45;
394 break;
395 case '.':
396 myascii = 1;
397 mygraph = 1;
398 myprint = 1;
399 mypunct = 1;
400 setascii = 46;
401 setlower = 46;
402 setupper = 46;
403 break;
404 case '/':
405 myascii = 1;
406 mygraph = 1;
407 myprint = 1;
408 mypunct = 1;
409 setascii = 47;
410 setlower = 47;
411 setupper = 47;
412 break;
413 case '0':
414 myalnum = 1;
415 myascii = 1;
416 mydigit = 1;
417 mygraph = 1;
418 myprint = 1;
419 myxdigit = 1;
420 setascii = 48;
421 setlower = 48;
422 setupper = 48;
423 break;
424 case '1':
425 myalnum = 1;
426 myascii = 1;
427 mydigit = 1;
428 mygraph = 1;
429 myprint = 1;
430 myxdigit = 1;
431 setascii = 49;
432 setlower = 49;
433 setupper = 49;
434 break;
435 case '2':
436 myalnum = 1;
437 myascii = 1;
438 mydigit = 1;
439 mygraph = 1;
440 myprint = 1;
441 myxdigit = 1;
442 setascii = 50;
443 setlower = 50;
444 setupper = 50;
445 break;
446 case '3':
447 myalnum = 1;
448 myascii = 1;
449 mydigit = 1;
450 mygraph = 1;
451 myprint = 1;
452 myxdigit = 1;
453 setascii = 51;
454 setlower = 51;
455 setupper = 51;
456 break;
457 case '4':
458 myalnum = 1;
459 myascii = 1;
460 mydigit = 1;
461 mygraph = 1;
462 myprint = 1;
463 myxdigit = 1;
464 setascii = 52;
465 setlower = 52;
466 setupper = 52;
467 break;
468 case '5':
469 myalnum = 1;
470 myascii = 1;
471 mydigit = 1;
472 mygraph = 1;
473 myprint = 1;
474 myxdigit = 1;
475 setascii = 53;
476 setlower = 53;
477 setupper = 53;
478 break;
479 case '6':
480 myalnum = 1;
481 myascii = 1;
482 mydigit = 1;
483 mygraph = 1;
484 myprint = 1;
485 myxdigit = 1;
486 setascii = 54;
487 setlower = 54;
488 setupper = 54;
489 break;
490 case '7':
491 myalnum = 1;
492 myascii = 1;
493 mydigit = 1;
494 mygraph = 1;
495 myprint = 1;
496 myxdigit = 1;
497 setascii = 55;
498 setlower = 55;
499 setupper = 55;
500 break;
501 case '8':
502 myalnum = 1;
503 myascii = 1;
504 mydigit = 1;
505 mygraph = 1;
506 myprint = 1;
507 myxdigit = 1;
508 setascii = 56;
509 setlower = 56;
510 setupper = 56;
511 break;
512 case '9':
513 myalnum = 1;
514 myascii = 1;
515 mydigit = 1;
516 mygraph = 1;
517 myprint = 1;
518 myxdigit = 1;
519 setascii = 57;
520 setlower = 57;
521 setupper = 57;
522 break;
523 case ':':
524 myascii = 1;
525 mygraph = 1;
526 myprint = 1;
527 mypunct = 1;
528 setascii = 58;
529 setlower = 58;
530 setupper = 58;
531 break;
532 case ';':
533 myascii = 1;
534 mygraph = 1;
535 myprint = 1;
536 mypunct = 1;
537 setascii = 59;
538 setlower = 59;
539 setupper = 59;
540 break;
541 case '<':
542 myascii = 1;
543 mygraph = 1;
544 myprint = 1;
545 mypunct = 1;
546 setascii = 60;
547 setlower = 60;
548 setupper = 60;
549 break;
550 case '=':
551 myascii = 1;
552 mygraph = 1;
553 myprint = 1;
554 mypunct = 1;
555 setascii = 61;
556 setlower = 61;
557 setupper = 61;
558 break;
559 case '>':
560 myascii = 1;
561 mygraph = 1;
562 myprint = 1;
563 mypunct = 1;
564 setascii = 62;
565 setlower = 62;
566 setupper = 62;
567 break;
568 case '?':
569 myascii = 1;
570 mygraph = 1;
571 myprint = 1;
572 mypunct = 1;
573 setascii = 63;
574 setlower = 63;
575 setupper = 63;
576 break;
577 case '@':
578 myascii = 1;
579 mygraph = 1;
580 myprint = 1;
581 mypunct = 1;
582 setascii = 64;
583 setlower = 64;
584 setupper = 64;
585 break;
586 case 'A':
587 myalnum = 1;
588 myalpha = 1;
589 myascii = 1;
590 mygraph = 1;
591 myprint = 1;
592 myupper = 1;
593 myxdigit = 1;
594 setascii = 65;
595 setlower = 97;
596 setupper = 65;
597 break;
598 case 'B':
599 myalnum = 1;
600 myalpha = 1;
601 myascii = 1;
602 mygraph = 1;
603 myprint = 1;
604 myupper = 1;
605 myxdigit = 1;
606 setascii = 66;
607 setlower = 98;
608 setupper = 66;
609 break;
610 case 'C':
611 myalnum = 1;
612 myalpha = 1;
613 myascii = 1;
614 mygraph = 1;
615 myprint = 1;
616 myupper = 1;
617 myxdigit = 1;
618 setascii = 67;
619 setlower = 99;
620 setupper = 67;
621 break;
622 case 'D':
623 myalnum = 1;
624 myalpha = 1;
625 myascii = 1;
626 mygraph = 1;
627 myprint = 1;
628 myupper = 1;
629 myxdigit = 1;
630 setascii = 68;
631 setlower = 100;
632 setupper = 68;
633 break;
634 case 'E':
635 myalnum = 1;
636 myalpha = 1;
637 myascii = 1;
638 mygraph = 1;
639 myprint = 1;
640 myupper = 1;
641 myxdigit = 1;
642 setascii = 69;
643 setlower = 101;
644 setupper = 69;
645 break;
646 case 'F':
647 myalnum = 1;
648 myalpha = 1;
649 myascii = 1;
650 mygraph = 1;
651 myprint = 1;
652 myupper = 1;
653 myxdigit = 1;
654 setascii = 70;
655 setlower = 102;
656 setupper = 70;
657 break;
658 case 'G':
659 myalnum = 1;
660 myalpha = 1;
661 myascii = 1;
662 mygraph = 1;
663 myprint = 1;
664 myupper = 1;
665 setascii = 71;
666 setlower = 103;
667 setupper = 71;
668 break;
669 case 'H':
670 myalnum = 1;
671 myalpha = 1;
672 myascii = 1;
673 mygraph = 1;
674 myprint = 1;
675 myupper = 1;
676 setascii = 72;
677 setlower = 104;
678 setupper = 72;
679 break;
680 case 'I':
681 myalnum = 1;
682 myalpha = 1;
683 myascii = 1;
684 mygraph = 1;
685 myprint = 1;
686 myupper = 1;
687 setascii = 73;
688 setlower = 105;
689 setupper = 73;
690 break;
691 case 'J':
692 myalnum = 1;
693 myalpha = 1;
694 myascii = 1;
695 mygraph = 1;
696 myprint = 1;
697 myupper = 1;
698 setascii = 74;
699 setlower = 106;
700 setupper = 74;
701 break;
702 case 'K':
703 myalnum = 1;
704 myalpha = 1;
705 myascii = 1;
706 mygraph = 1;
707 myprint = 1;
708 myupper = 1;
709 setascii = 75;
710 setlower = 107;
711 setupper = 75;
712 break;
713 case 'L':
714 myalnum = 1;
715 myalpha = 1;
716 myascii = 1;
717 mygraph = 1;
718 myprint = 1;
719 myupper = 1;
720 setascii = 76;
721 setlower = 108;
722 setupper = 76;
723 break;
724 case 'M':
725 myalnum = 1;
726 myalpha = 1;
727 myascii = 1;
728 mygraph = 1;
729 myprint = 1;
730 myupper = 1;
731 setascii = 77;
732 setlower = 109;
733 setupper = 77;
734 break;
735 case 'N':
736 myalnum = 1;
737 myalpha = 1;
738 myascii = 1;
739 mygraph = 1;
740 myprint = 1;
741 myupper = 1;
742 setascii = 78;
743 setlower = 110;
744 setupper = 78;
745 break;
746 case 'O':
747 myalnum = 1;
748 myalpha = 1;
749 myascii = 1;
750 mygraph = 1;
751 myprint = 1;
752 myupper = 1;
753 setascii = 79;
754 setlower = 111;
755 setupper = 79;
756 break;
757 case 'P':
758 myalnum = 1;
759 myalpha = 1;
760 myascii = 1;
761 mygraph = 1;
762 myprint = 1;
763 myupper = 1;
764 setascii = 80;
765 setlower = 112;
766 setupper = 80;
767 break;
768 case 'Q':
769 myalnum = 1;
770 myalpha = 1;
771 myascii = 1;
772 mygraph = 1;
773 myprint = 1;
774 myupper = 1;
775 setascii = 81;
776 setlower = 113;
777 setupper = 81;
778 break;
779 case 'R':
780 myalnum = 1;
781 myalpha = 1;
782 myascii = 1;
783 mygraph = 1;
784 myprint = 1;
785 myupper = 1;
786 setascii = 82;
787 setlower = 114;
788 setupper = 82;
789 break;
790 case 'S':
791 myalnum = 1;
792 myalpha = 1;
793 myascii = 1;
794 mygraph = 1;
795 myprint = 1;
796 myupper = 1;
797 setascii = 83;
798 setlower = 115;
799 setupper = 83;
800 break;
801 case 'T':
802 myalnum = 1;
803 myalpha = 1;
804 myascii = 1;
805 mygraph = 1;
806 myprint = 1;
807 myupper = 1;
808 setascii = 84;
809 setlower = 116;
810 setupper = 84;
811 break;
812 case 'U':
813 myalnum = 1;
814 myalpha = 1;
815 myascii = 1;
816 mygraph = 1;
817 myprint = 1;
818 myupper = 1;
819 setascii = 85;
820 setlower = 117;
821 setupper = 85;
822 break;
823 case 'V':
824 myalnum = 1;
825 myalpha = 1;
826 myascii = 1;
827 mygraph = 1;
828 myprint = 1;
829 myupper = 1;
830 setascii = 86;
831 setlower = 118;
832 setupper = 86;
833 break;
834 case 'W':
835 myalnum = 1;
836 myalpha = 1;
837 myascii = 1;
838 mygraph = 1;
839 myprint = 1;
840 myupper = 1;
841 setascii = 87;
842 setlower = 119;
843 setupper = 87;
844 break;
845 case 'X':
846 myalnum = 1;
847 myalpha = 1;
848 myascii = 1;
849 mygraph = 1;
850 myprint = 1;
851 myupper = 1;
852 setascii = 88;
853 setlower = 120;
854 setupper = 88;
855 break;
856 case 'Y':
857 myalnum = 1;
858 myalpha = 1;
859 myascii = 1;
860 mygraph = 1;
861 myprint = 1;
862 myupper = 1;
863 setascii = 89;
864 setlower = 121;
865 setupper = 89;
866 break;
867 case 'Z':
868 myalnum = 1;
869 myalpha = 1;
870 myascii = 1;
871 mygraph = 1;
872 myprint = 1;
873 myupper = 1;
874 setascii = 90;
875 setlower = 122;
876 setupper = 90;
877 break;
878 case '[':
879 myascii = 1;
880 mygraph = 1;
881 myprint = 1;
882 mypunct = 1;
883 setascii = 91;
884 setlower = 91;
885 setupper = 91;
886 break;
887 case '\\':
888 myascii = 1;
889 mygraph = 1;
890 myprint = 1;
891 mypunct = 1;
892 setascii = 92;
893 setlower = 92;
894 setupper = 92;
895 break;
896 case ']':
897 myascii = 1;
898 mygraph = 1;
899 myprint = 1;
900 mypunct = 1;
901 setascii = 93;
902 setlower = 93;
903 setupper = 93;
904 break;
905 case '^':
906 myascii = 1;
907 mygraph = 1;
908 myprint = 1;
909 mypunct = 1;
910 setascii = 94;
911 setlower = 94;
912 setupper = 94;
913 break;
914 case '_':
915 myascii = 1;
916 mygraph = 1;
917 myprint = 1;
918 mypunct = 1;
919 setascii = 95;
920 setlower = 95;
921 setupper = 95;
922 break;
923 case '`':
924 myascii = 1;
925 mygraph = 1;
926 myprint = 1;
927 mypunct = 1;
928 setascii = 96;
929 setlower = 96;
930 setupper = 96;
931 break;
932 case 'a':
933 myalnum = 1;
934 myalpha = 1;
935 myascii = 1;
936 mygraph = 1;
937 mylower = 1;
938 myprint = 1;
939 myxdigit = 1;
940 setascii = 97;
941 setlower = 97;
942 setupper = 65;
943 break;
944 case 'b':
945 myalnum = 1;
946 myalpha = 1;
947 myascii = 1;
948 mygraph = 1;
949 mylower = 1;
950 myprint = 1;
951 myxdigit = 1;
952 setascii = 98;
953 setlower = 98;
954 setupper = 66;
955 break;
956 case 'c':
957 myalnum = 1;
958 myalpha = 1;
959 myascii = 1;
960 mygraph = 1;
961 mylower = 1;
962 myprint = 1;
963 myxdigit = 1;
964 setascii = 99;
965 setlower = 99;
966 setupper = 67;
967 break;
968 case 'd':
969 myalnum = 1;
970 myalpha = 1;
971 myascii = 1;
972 mygraph = 1;
973 mylower = 1;
974 myprint = 1;
975 myxdigit = 1;
976 setascii = 100;
977 setlower = 100;
978 setupper = 68;
979 break;
980 case 'e':
981 myalnum = 1;
982 myalpha = 1;
983 myascii = 1;
984 mygraph = 1;
985 mylower = 1;
986 myprint = 1;
987 myxdigit = 1;
988 setascii = 101;
989 setlower = 101;
990 setupper = 69;
991 break;
992 case 'f':
993 myalnum = 1;
994 myalpha = 1;
995 myascii = 1;
996 mygraph = 1;
997 mylower = 1;
998 myprint = 1;
999 myxdigit = 1;
1000 setascii = 102;
1001 setlower = 102;
1002 setupper = 70;
1003 break;
1004 case 'g':
1005 myalnum = 1;
1006 myalpha = 1;
1007 myascii = 1;
1008 mygraph = 1;
1009 mylower = 1;
1010 myprint = 1;
1011 setascii = 103;
1012 setlower = 103;
1013 setupper = 71;
1014 break;
1015 case 'h':
1016 myalnum = 1;
1017 myalpha = 1;
1018 myascii = 1;
1019 mygraph = 1;
1020 mylower = 1;
1021 myprint = 1;
1022 setascii = 104;
1023 setlower = 104;
1024 setupper = 72;
1025 break;
1026 case 'i':
1027 myalnum = 1;
1028 myalpha = 1;
1029 myascii = 1;
1030 mygraph = 1;
1031 mylower = 1;
1032 myprint = 1;
1033 setascii = 105;
1034 setlower = 105;
1035 setupper = 73;
1036 break;
1037 case 'j':
1038 myalnum = 1;
1039 myalpha = 1;
1040 myascii = 1;
1041 mygraph = 1;
1042 mylower = 1;
1043 myprint = 1;
1044 setascii = 106;
1045 setlower = 106;
1046 setupper = 74;
1047 break;
1048 case 'k':
1049 myalnum = 1;
1050 myalpha = 1;
1051 myascii = 1;
1052 mygraph = 1;
1053 mylower = 1;
1054 myprint = 1;
1055 setascii = 107;
1056 setlower = 107;
1057 setupper = 75;
1058 break;
1059 case 'l':
1060 myalnum = 1;
1061 myalpha = 1;
1062 myascii = 1;
1063 mygraph = 1;
1064 mylower = 1;
1065 myprint = 1;
1066 setascii = 108;
1067 setlower = 108;
1068 setupper = 76;
1069 break;
1070 case 'm':
1071 myalnum = 1;
1072 myalpha = 1;
1073 myascii = 1;
1074 mygraph = 1;
1075 mylower = 1;
1076 myprint = 1;
1077 setascii = 109;
1078 setlower = 109;
1079 setupper = 77;
1080 break;
1081 case 'n':
1082 myalnum = 1;
1083 myalpha = 1;
1084 myascii = 1;
1085 mygraph = 1;
1086 mylower = 1;
1087 myprint = 1;
1088 setascii = 110;
1089 setlower = 110;
1090 setupper = 78;
1091 break;
1092 case 'o':
1093 myalnum = 1;
1094 myalpha = 1;
1095 myascii = 1;
1096 mygraph = 1;
1097 mylower = 1;
1098 myprint = 1;
1099 setascii = 111;
1100 setlower = 111;
1101 setupper = 79;
1102 break;
1103 case 'p':
1104 myalnum = 1;
1105 myalpha = 1;
1106 myascii = 1;
1107 mygraph = 1;
1108 mylower = 1;
1109 myprint = 1;
1110 setascii = 112;
1111 setlower = 112;
1112 setupper = 80;
1113 break;
1114 case 'q':
1115 myalnum = 1;
1116 myalpha = 1;
1117 myascii = 1;
1118 mygraph = 1;
1119 mylower = 1;
1120 myprint = 1;
1121 setascii = 113;
1122 setlower = 113;
1123 setupper = 81;
1124 break;
1125 case 'r':
1126 myalnum = 1;
1127 myalpha = 1;
1128 myascii = 1;
1129 mygraph = 1;
1130 mylower = 1;
1131 myprint = 1;
1132 setascii = 114;
1133 setlower = 114;
1134 setupper = 82;
1135 break;
1136 case 's':
1137 myalnum = 1;
1138 myalpha = 1;
1139 myascii = 1;
1140 mygraph = 1;
1141 mylower = 1;
1142 myprint = 1;
1143 setascii = 115;
1144 setlower = 115;
1145 setupper = 83;
1146 break;
1147 case 't':
1148 myalnum = 1;
1149 myalpha = 1;
1150 myascii = 1;
1151 mygraph = 1;
1152 mylower = 1;
1153 myprint = 1;
1154 setascii = 116;
1155 setlower = 116;
1156 setupper = 84;
1157 break;
1158 case 'u':
1159 myalnum = 1;
1160 myalpha = 1;
1161 myascii = 1;
1162 mygraph = 1;
1163 mylower = 1;
1164 myprint = 1;
1165 setascii = 117;
1166 setlower = 117;
1167 setupper = 85;
1168 break;
1169 case 'v':
1170 myalnum = 1;
1171 myalpha = 1;
1172 myascii = 1;
1173 mygraph = 1;
1174 mylower = 1;
1175 myprint = 1;
1176 setascii = 118;
1177 setlower = 118;
1178 setupper = 86;
1179 break;
1180 case 'w':
1181 myalnum = 1;
1182 myalpha = 1;
1183 myascii = 1;
1184 mygraph = 1;
1185 mylower = 1;
1186 myprint = 1;
1187 setascii = 119;
1188 setlower = 119;
1189 setupper = 87;
1190 break;
1191 case 'x':
1192 myalnum = 1;
1193 myalpha = 1;
1194 myascii = 1;
1195 mygraph = 1;
1196 mylower = 1;
1197 myprint = 1;
1198 setascii = 120;
1199 setlower = 120;
1200 setupper = 88;
1201 break;
1202 case 'y':
1203 myalnum = 1;
1204 myalpha = 1;
1205 myascii = 1;
1206 mygraph = 1;
1207 mylower = 1;
1208 myprint = 1;
1209 setascii = 121;
1210 setlower = 121;
1211 setupper = 89;
1212 break;
1213 case 'z':
1214 myalnum = 1;
1215 myalpha = 1;
1216 myascii = 1;
1217 mygraph = 1;
1218 mylower = 1;
1219 myprint = 1;
1220 setascii = 122;
1221 setlower = 122;
1222 setupper = 90;
1223 break;
1224 case '{':
1225 myascii = 1;
1226 mygraph = 1;
1227 myprint = 1;
1228 mypunct = 1;
1229 setascii = 123;
1230 setlower = 123;
1231 setupper = 123;
1232 break;
1233 case '|':
1234 myascii = 1;
1235 mygraph = 1;
1236 myprint = 1;
1237 mypunct = 1;
1238 setascii = 124;
1239 setlower = 124;
1240 setupper = 124;
1241 break;
1242 case '}':
1243 myascii = 1;
1244 mygraph = 1;
1245 myprint = 1;
1246 mypunct = 1;
1247 setascii = 125;
1248 setlower = 125;
1249 setupper = 125;
1250 break;
1251 case '~':
1252 myascii = 1;
1253 mygraph = 1;
1254 myprint = 1;
1255 mypunct = 1;
1256 setascii = 126;
1257 setlower = 126;
1258 setupper = 126;
1259 break;
1260 case 0177:
1261 myascii = 1;
1262 mycntrl = 1;
1263 setascii = 127;
1264 setlower = 127;
1265 setupper = 127;
1266 break;
1267 case 0200:
1268 setascii = 0;
1269 setlower = 128;
1270 setupper = 128;
1271 break;
1272 case 0201:
1273 setascii = 1;
1274 setlower = 129;
1275 setupper = 129;
1276 break;
1277 case 0202:
1278 setascii = 2;
1279 setlower = 130;
1280 setupper = 130;
1281 break;
1282 case 0203:
1283 setascii = 3;
1284 setlower = 131;
1285 setupper = 131;
1286 break;
1287 case 0204:
1288 setascii = 4;
1289 setlower = 132;
1290 setupper = 132;
1291 break;
1292 case 0205:
1293 setascii = 5;
1294 setlower = 133;
1295 setupper = 133;
1296 break;
1297 case 0206:
1298 setascii = 6;
1299 setlower = 134;
1300 setupper = 134;
1301 break;
1302 case 0207:
1303 setascii = 7;
1304 setlower = 135;
1305 setupper = 135;
1306 break;
1307 case 0210:
1308 setascii = 8;
1309 setlower = 136;
1310 setupper = 136;
1311 break;
1312 case 0211:
1313 setascii = 9;
1314 setlower = 137;
1315 setupper = 137;
1316 break;
1317 case 0212:
1318 setascii = 10;
1319 setlower = 138;
1320 setupper = 138;
1321 break;
1322 case 0213:
1323 setascii = 11;
1324 setlower = 139;
1325 setupper = 139;
1326 break;
1327 case 0214:
1328 setascii = 12;
1329 setlower = 140;
1330 setupper = 140;
1331 break;
1332 case 0215:
1333 setascii = 13;
1334 setlower = 141;
1335 setupper = 141;
1336 break;
1337 case 0216:
1338 setascii = 14;
1339 setlower = 142;
1340 setupper = 142;
1341 break;
1342 case 0217:
1343 setascii = 15;
1344 setlower = 143;
1345 setupper = 143;
1346 break;
1347 case 0220:
1348 setascii = 16;
1349 setlower = 144;
1350 setupper = 144;
1351 break;
1352 case 0221:
1353 setascii = 17;
1354 setlower = 145;
1355 setupper = 145;
1356 break;
1357 case 0222:
1358 setascii = 18;
1359 setlower = 146;
1360 setupper = 146;
1361 break;
1362 case 0223:
1363 setascii = 19;
1364 setlower = 147;
1365 setupper = 147;
1366 break;
1367 case 0224:
1368 setascii = 20;
1369 setlower = 148;
1370 setupper = 148;
1371 break;
1372 case 0225:
1373 setascii = 21;
1374 setlower = 149;
1375 setupper = 149;
1376 break;
1377 case 0226:
1378 setascii = 22;
1379 setlower = 150;
1380 setupper = 150;
1381 break;
1382 case 0227:
1383 setascii = 23;
1384 setlower = 151;
1385 setupper = 151;
1386 break;
1387 case 0230:
1388 setascii = 24;
1389 setlower = 152;
1390 setupper = 152;
1391 break;
1392 case 0231:
1393 setascii = 25;
1394 setlower = 153;
1395 setupper = 153;
1396 break;
1397 case 0232:
1398 setascii = 26;
1399 setlower = 154;
1400 setupper = 154;
1401 break;
1402 case 0233:
1403 setascii = 27;
1404 setlower = 155;
1405 setupper = 155;
1406 break;
1407 case 0234:
1408 setascii = 28;
1409 setlower = 156;
1410 setupper = 156;
1411 break;
1412 case 0235:
1413 setascii = 29;
1414 setlower = 157;
1415 setupper = 157;
1416 break;
1417 case 0236:
1418 setascii = 30;
1419 setlower = 158;
1420 setupper = 158;
1421 break;
1422 case 0237:
1423 setascii = 31;
1424 setlower = 159;
1425 setupper = 159;
1426 break;
1427 case 0240:
1428 setascii = 32;
1429 setlower = 160;
1430 setupper = 160;
1431 break;
1432 case 0241:
1433 setascii = 33;
1434 setlower = 161;
1435 setupper = 161;
1436 break;
1437 case 0242:
1438 setascii = 34;
1439 setlower = 162;
1440 setupper = 162;
1441 break;
1442 case 0243:
1443 setascii = 35;
1444 setlower = 163;
1445 setupper = 163;
1446 break;
1447 case 0244:
1448 setascii = 36;
1449 setlower = 164;
1450 setupper = 164;
1451 break;
1452 case 0245:
1453 setascii = 37;
1454 setlower = 165;
1455 setupper = 165;
1456 break;
1457 case 0246:
1458 setascii = 38;
1459 setlower = 166;
1460 setupper = 166;
1461 break;
1462 case 0247:
1463 setascii = 39;
1464 setlower = 167;
1465 setupper = 167;
1466 break;
1467 case 0250:
1468 setascii = 40;
1469 setlower = 168;
1470 setupper = 168;
1471 break;
1472 case 0251:
1473 setascii = 41;
1474 setlower = 169;
1475 setupper = 169;
1476 break;
1477 case 0252:
1478 setascii = 42;
1479 setlower = 170;
1480 setupper = 170;
1481 break;
1482 case 0253:
1483 setascii = 43;
1484 setlower = 171;
1485 setupper = 171;
1486 break;
1487 case 0254:
1488 setascii = 44;
1489 setlower = 172;
1490 setupper = 172;
1491 break;
1492 case 0255:
1493 setascii = 45;
1494 setlower = 173;
1495 setupper = 173;
1496 break;
1497 case 0256:
1498 setascii = 46;
1499 setlower = 174;
1500 setupper = 174;
1501 break;
1502 case 0257:
1503 setascii = 47;
1504 setlower = 175;
1505 setupper = 175;
1506 break;
1507 case 0260:
1508 setascii = 48;
1509 setlower = 176;
1510 setupper = 176;
1511 break;
1512 case 0261:
1513 setascii = 49;
1514 setlower = 177;
1515 setupper = 177;
1516 break;
1517 case 0262:
1518 setascii = 50;
1519 setlower = 178;
1520 setupper = 178;
1521 break;
1522 case 0263:
1523 setascii = 51;
1524 setlower = 179;
1525 setupper = 179;
1526 break;
1527 case 0264:
1528 setascii = 52;
1529 setlower = 180;
1530 setupper = 180;
1531 break;
1532 case 0265:
1533 setascii = 53;
1534 setlower = 181;
1535 setupper = 181;
1536 break;
1537 case 0266:
1538 setascii = 54;
1539 setlower = 182;
1540 setupper = 182;
1541 break;
1542 case 0267:
1543 setascii = 55;
1544 setlower = 183;
1545 setupper = 183;
1546 break;
1547 case 0270:
1548 setascii = 56;
1549 setlower = 184;
1550 setupper = 184;
1551 break;
1552 case 0271:
1553 setascii = 57;
1554 setlower = 185;
1555 setupper = 185;
1556 break;
1557 case 0272:
1558 setascii = 58;
1559 setlower = 186;
1560 setupper = 186;
1561 break;
1562 case 0273:
1563 setascii = 59;
1564 setlower = 187;
1565 setupper = 187;
1566 break;
1567 case 0274:
1568 setascii = 60;
1569 setlower = 188;
1570 setupper = 188;
1571 break;
1572 case 0275:
1573 setascii = 61;
1574 setlower = 189;
1575 setupper = 189;
1576 break;
1577 case 0276:
1578 setascii = 62;
1579 setlower = 190;
1580 setupper = 190;
1581 break;
1582 case 0277:
1583 setascii = 63;
1584 setlower = 191;
1585 setupper = 191;
1586 break;
1587 case 0300:
1588 setascii = 64;
1589 setlower = 192;
1590 setupper = 192;
1591 break;
1592 case 0301:
1593 setascii = 65;
1594 setlower = 193;
1595 setupper = 193;
1596 break;
1597 case 0302:
1598 setascii = 66;
1599 setlower = 194;
1600 setupper = 194;
1601 break;
1602 case 0303:
1603 setascii = 67;
1604 setlower = 195;
1605 setupper = 195;
1606 break;
1607 case 0304:
1608 setascii = 68;
1609 setlower = 196;
1610 setupper = 196;
1611 break;
1612 case 0305:
1613 setascii = 69;
1614 setlower = 197;
1615 setupper = 197;
1616 break;
1617 case 0306:
1618 setascii = 70;
1619 setlower = 198;
1620 setupper = 198;
1621 break;
1622 case 0307:
1623 setascii = 71;
1624 setlower = 199;
1625 setupper = 199;
1626 break;
1627 case 0310:
1628 setascii = 72;
1629 setlower = 200;
1630 setupper = 200;
1631 break;
1632 case 0311:
1633 setascii = 73;
1634 setlower = 201;
1635 setupper = 201;
1636 break;
1637 case 0312:
1638 setascii = 74;
1639 setlower = 202;
1640 setupper = 202;
1641 break;
1642 case 0313:
1643 setascii = 75;
1644 setlower = 203;
1645 setupper = 203;
1646 break;
1647 case 0314:
1648 setascii = 76;
1649 setlower = 204;
1650 setupper = 204;
1651 break;
1652 case 0315:
1653 setascii = 77;
1654 setlower = 205;
1655 setupper = 205;
1656 break;
1657 case 0316:
1658 setascii = 78;
1659 setlower = 206;
1660 setupper = 206;
1661 break;
1662 case 0317:
1663 setascii = 79;
1664 setlower = 207;
1665 setupper = 207;
1666 break;
1667 case 0320:
1668 setascii = 80;
1669 setlower = 208;
1670 setupper = 208;
1671 break;
1672 case 0321:
1673 setascii = 81;
1674 setlower = 209;
1675 setupper = 209;
1676 break;
1677 case 0322:
1678 setascii = 82;
1679 setlower = 210;
1680 setupper = 210;
1681 break;
1682 case 0323:
1683 setascii = 83;
1684 setlower = 211;
1685 setupper = 211;
1686 break;
1687 case 0324:
1688 setascii = 84;
1689 setlower = 212;
1690 setupper = 212;
1691 break;
1692 case 0325:
1693 setascii = 85;
1694 setlower = 213;
1695 setupper = 213;
1696 break;
1697 case 0326:
1698 setascii = 86;
1699 setlower = 214;
1700 setupper = 214;
1701 break;
1702 case 0327:
1703 setascii = 87;
1704 setlower = 215;
1705 setupper = 215;
1706 break;
1707 case 0330:
1708 setascii = 88;
1709 setlower = 216;
1710 setupper = 216;
1711 break;
1712 case 0331:
1713 setascii = 89;
1714 setlower = 217;
1715 setupper = 217;
1716 break;
1717 case 0332:
1718 setascii = 90;
1719 setlower = 218;
1720 setupper = 218;
1721 break;
1722 case 0333:
1723 setascii = 91;
1724 setlower = 219;
1725 setupper = 219;
1726 break;
1727 case 0334:
1728 setascii = 92;
1729 setlower = 220;
1730 setupper = 220;
1731 break;
1732 case 0335:
1733 setascii = 93;
1734 setlower = 221;
1735 setupper = 221;
1736 break;
1737 case 0336:
1738 setascii = 94;
1739 setlower = 222;
1740 setupper = 222;
1741 break;
1742 case 0337:
1743 setascii = 95;
1744 setlower = 223;
1745 setupper = 223;
1746 break;
1747 case 0340:
1748 setascii = 96;
1749 setlower = 224;
1750 setupper = 224;
1751 break;
1752 case 0341:
1753 setascii = 97;
1754 setlower = 225;
1755 setupper = 225;
1756 break;
1757 case 0342:
1758 setascii = 98;
1759 setlower = 226;
1760 setupper = 226;
1761 break;
1762 case 0343:
1763 setascii = 99;
1764 setlower = 227;
1765 setupper = 227;
1766 break;
1767 case 0344:
1768 setascii = 100;
1769 setlower = 228;
1770 setupper = 228;
1771 break;
1772 case 0345:
1773 setascii = 101;
1774 setlower = 229;
1775 setupper = 229;
1776 break;
1777 case 0346:
1778 setascii = 102;
1779 setlower = 230;
1780 setupper = 230;
1781 break;
1782 case 0347:
1783 setascii = 103;
1784 setlower = 231;
1785 setupper = 231;
1786 break;
1787 case 0350:
1788 setascii = 104;
1789 setlower = 232;
1790 setupper = 232;
1791 break;
1792 case 0351:
1793 setascii = 105;
1794 setlower = 233;
1795 setupper = 233;
1796 break;
1797 case 0352:
1798 setascii = 106;
1799 setlower = 234;
1800 setupper = 234;
1801 break;
1802 case 0353:
1803 setascii = 107;
1804 setlower = 235;
1805 setupper = 235;
1806 break;
1807 case 0354:
1808 setascii = 108;
1809 setlower = 236;
1810 setupper = 236;
1811 break;
1812 case 0355:
1813 setascii = 109;
1814 setlower = 237;
1815 setupper = 237;
1816 break;
1817 case 0356:
1818 setascii = 110;
1819 setlower = 238;
1820 setupper = 238;
1821 break;
1822 case 0357:
1823 setascii = 111;
1824 setlower = 239;
1825 setupper = 239;
1826 break;
1827 case 0360:
1828 setascii = 112;
1829 setlower = 240;
1830 setupper = 240;
1831 break;
1832 case 0361:
1833 setascii = 113;
1834 setlower = 241;
1835 setupper = 241;
1836 break;
1837 case 0362:
1838 setascii = 114;
1839 setlower = 242;
1840 setupper = 242;
1841 break;
1842 case 0363:
1843 setascii = 115;
1844 setlower = 243;
1845 setupper = 243;
1846 break;
1847 case 0364:
1848 setascii = 116;
1849 setlower = 244;
1850 setupper = 244;
1851 break;
1852 case 0365:
1853 setascii = 117;
1854 setlower = 245;
1855 setupper = 245;
1856 break;
1857 case 0366:
1858 setascii = 118;
1859 setlower = 246;
1860 setupper = 246;
1861 break;
1862 case 0367:
1863 setascii = 119;
1864 setlower = 247;
1865 setupper = 247;
1866 break;
1867 case 0370:
1868 setascii = 120;
1869 setlower = 248;
1870 setupper = 248;
1871 break;
1872 case 0371:
1873 setascii = 121;
1874 setlower = 249;
1875 setupper = 249;
1876 break;
1877 case 0372:
1878 setascii = 122;
1879 setlower = 250;
1880 setupper = 250;
1881 break;
1882 case 0373:
1883 setascii = 123;
1884 setlower = 251;
1885 setupper = 251;
1886 break;
1887 case 0374:
1888 setascii = 124;
1889 setlower = 252;
1890 setupper = 252;
1891 break;
1892 case 0375:
1893 setascii = 125;
1894 setlower = 253;
1895 setupper = 253;
1896 break;
1897 case 0376:
1898 setascii = 126;
1899 setlower = 254;
1900 setupper = 254;
1901 break;
1902 case 0377:
1903 setascii = 127;
1904 setlower = 255;
1905 setupper = 255;
1906 break;
1907 default:
1908 abort();
1915 int def_isascii (int i) { return isascii(i); }
1916 int def_iscntrl (int i) { return iscntrl(i); }
1917 int def_isspace (int i) { return isspace(i); }
1918 int def_isprint (int i) { return isprint(i); }
1919 int def_isalnum (int i) { return isalnum(i); }
1920 int def_isdigit (int i) { return isdigit(i); }
1921 int def_isxdigit (int i) { return isxdigit(i); }
1922 int def_isalpha (int i) { return isalpha(i); }
1923 int def_isupper (int i) { return isupper(i); }
1924 int def_islower (int i) { return islower(i); }
1925 int def_isgraph (int i) { return isgraph(i); }
1926 int def_ispunct (int i) { return ispunct(i); }
1927 int def_tolower (int i) { return tolower(i); }
1928 int def_toupper (int i) { return toupper(i); }
1929 int def_toascii (int i) { return toascii(i); }
1930 int def__tolower (int i) { return _tolower(i); }
1931 int def__toupper (int i) { return _toupper(i); }
1933 void
1934 test_is_set (int (*func)(),
1935 char *name,
1936 int *p)
1938 int i;
1939 newfunc(name);
1940 for (i = 0; i < 255; i++) {
1941 int r = func(i) != 0;
1942 line(i);
1943 test_is_single(i);
1944 if (*p != r)
1946 printf("%s:%d wrong result, is %d shouldbe %d\n", name, i, r,*p);
1947 inacc++;
1951 void
1952 test_to_set (int (*func)(),
1953 char *name,
1954 int *p,
1955 int low,
1956 int high)
1958 int i;
1959 newfunc(name);
1960 for (i = low; i <= high; i++) {
1961 int r = func(i) ;
1962 line(i);
1963 test_is_single(i);
1964 if (*p != r)
1966 printf("%s:%d wrong result, is %d shouldbe %d\n", name, i, r,*p);
1967 inacc++;
1973 #undef isascii
1974 #undef iscntrl
1975 #undef isspace
1976 #undef isprint
1977 #undef isalnum
1978 #undef isdigit
1979 #undef isxdigit
1980 #undef isalpha
1981 #undef isupper
1982 #undef islower
1983 #undef isgraph
1984 #undef ispunct
1985 #undef tolower
1986 #undef toupper
1987 #undef toascii
1988 #undef _tolower
1989 #undef _toupper
1991 void
1992 test_is (void)
1994 test_is_set(def_isalnum, "isalnum define", &myalnum);
1995 test_is_set(def_isalpha, "isalpha define", &myalpha);
1996 test_is_set(def_isascii, "isascii define", &myascii);
1997 test_is_set(def_iscntrl, "iscntrl define", &mycntrl);
1998 test_is_set(def_isdigit, "isdigit define", &mydigit);
1999 test_is_set(def_isgraph, "isgraph define", &mygraph);
2000 test_is_set(def_islower, "islower define", &mylower);
2001 test_is_set(def_isprint, "isprint define", &myprint);
2002 test_is_set(def_ispunct, "ispunct define", &mypunct);
2003 test_is_set(def_isspace, "isspace define", &myspace);
2004 test_is_set(def_isupper, "isupper define", &myupper);
2005 test_is_set(def_isxdigit, "isxdigit define", &myxdigit);
2006 test_is_set(isalnum, "isalnum function", &myalnum);
2007 test_is_set(isalpha, "isalpha function", &myalpha);
2008 test_is_set(isascii, "isascii function", &myascii);
2009 test_is_set(iscntrl, "iscntrl function", &mycntrl);
2010 test_is_set(isgraph, "isgraph function", &mygraph);
2011 test_is_set(islower, "islower function", &mylower);
2012 test_is_set(isprint, "isprint function", &myprint);
2013 test_is_set(ispunct, "ispunct function", &mypunct);
2014 test_is_set(isspace, "isspace function", &myspace);
2015 test_is_set(isupper, "isupper function", &myupper);
2016 test_is_set(isxdigit, "isxdigit function", &myxdigit);
2017 test_to_set(_tolower, "_tolower function", &setlower, 'A','Z');
2018 test_to_set(_toupper, "_toupper function", &setupper, 'a','z');
2019 test_to_set(def__tolower, "_tolower define", &setlower, 'A','Z');
2020 test_to_set(def__toupper, "_toupper define", &setupper, 'a','z');
2021 test_to_set(def_toascii, "toascii define", &setascii, 0,255);
2022 test_to_set(def_tolower, "tolower define", &setlower, 0,255);
2023 test_to_set(def_toupper, "toupper define", &setupper, 0,255);
2024 test_to_set(toascii, "toascii function", &setascii, 0,255);
2025 test_to_set(tolower, "tolower function", &setlower, 0,255);
2026 test_to_set(toupper, "toupper function", &setupper, 0,255);