Annotation of researchv10no/cmd/lcc/ph/d43.c, revision 1.1.1.1

1.1       root        1: /* The Plum Hall Validation Suite for C
                      2:  * Unpublished copyright (c) 1986-1991, Chiron Systems Inc and Plum Hall Inc.
                      3:  * VERSION: 4
                      4:  * DATE: 1993-01-01
                      5:  * The "ANSI" mode of this suite corresponds to official ANSI C, X3.159-1989.
                      6:  * As per your license agreement, your distribution is not to be moved or copied outside the Designated Site
                      7:  * without specific permission from Plum Hall Inc.
                      8:  */
                      9: 
                     10: 
                     11: #include "flags.h"
                     12: #ifndef SKIP43
                     13: #define LIB_TEST 1
                     14: #include "defs.h"
                     15: 
                     16: void d4_3_1();
                     17: void d4_3_real();
                     18: 
                     19: /*
                     20:  * 4.3 - Character handling.
                     21:  * Note that these tests assume the "C" locale.
                     22:  */
                     23: void d4_3()
                     24:        {
                     25:        d4_3_1();
                     26:        d4_3_real();
                     27:        }
                     28: 
                     29: #if (!ANSI && !ALL_CTYPE_FNS)
                     30: #define isgraph(c) (isprint(c) && (c)!=' ')
                     31: #define toupper(c) (islower(c) ? (c)+('A'-'a') : (c))
                     32: #define tolower(c) (isupper(c) ? (c)+('a'-'A') : (c))
                     33: #endif
                     34: 
                     35: #include <stdio.h>
                     36: #include <ctype.h>
                     37: size_t strlen();
                     38: int in_set();
                     39: /*
                     40:  * 4.3.1 Character testing functions
                     41:  */
                     42: void d4_3_1()
                     43:        {
                     44: #include "d43h.h"
                     45:        }
                     46: 
                     47: 
                     48: 
                     49: 
                     50: 
                     51: 
                     52: 
                     53: /*
                     54:  * IN_SET - check that the character is in the set. We
                     55:  * won't try to use the string library functions.
                     56:  */
                     57: int in_set(i, string)
                     58:        int i;
                     59:        char *string;
                     60:        {
                     61:        while (*string)
                     62:                {
                     63:                if (*string == i)
                     64:                        return(TRUE);
                     65:                ++string;
                     66:                }
                     67:        return(FALSE);
                     68:        }
                     69: 
                     70: /* 
                     71:  * D4_3_REAL: undefine all of the macros and do the
                     72:  * same set of tests for the underlying functions.
                     73:  */
                     74: #undef isalpha
                     75: #undef isupper
                     76: #undef islower
                     77: #undef isdigit
                     78: #undef isxdigit
                     79: #undef isspace
                     80: #undef ispunct
                     81: #undef isalnum
                     82: #undef isprint
                     83: #undef isgraph
                     84: #undef iscntrl
                     85: #undef toupper
                     86: #undef tolower
                     87: void d4_3_real()
                     88:        {
                     89: #if ANSI
                     90: #include "d43h.h"
                     91: #endif
                     92:        }
                     93: 
                     94: #else /* if SKIP43 */
                     95: void d4_3() { pr_skip("d4_3: SKIPPED ENTIRELY\n"); }
                     96: #endif

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.