Annotation of researchv10no/cmd/lcc/ph/defs.h, revision 1.1.1.1

1.1       root        1: /* As per your license agreement, your distribution is not to be moved or copied outside the Designated Site
                      2:  * without specific permission from Plum Hall Inc.
                      3:  */
                      4: 
                      5: #ifndef DEFS_H
                      6: #define DEFS_H
                      7: 
                      8: #include "flags.h"
                      9: 
                     10: /* In your flags.h, you should
                     11:  *  #define FREESTANDING 1
                     12:  * if you are testing a freestanding system
                     13:  */
                     14: 
                     15: #include "compil.h"
                     16: 
                     17: 
                     18: #ifdef __cplusplus
                     19: #define ANSI 1
                     20: #endif /* C++ impementations assumed also ANSI C except sometimes */
                     21: 
                     22: #if !ANSI || !LIB_TEST
                     23: #include "machin.h"
                     24: #endif
                     25: 
                     26: /* THE REMAINING DEFINITIONS SHOULD NOT BE MODIFIED */
                     27: #define TRUE 1
                     28: #define FALSE 0
                     29: /* Where possible, we will try to make the compiler have
                     30:  * as many registers as possible tied up.  This usually
                     31:  * forces more error-prone paths.
                     32:  */
                     33: #define REGISTERS register int r1,r2,r3,r4,r5;register char *r6,*r7,*r8,*r9,*r10
                     34: #define USEREGISTERS r1=r2=r3=r4=r5=0;r6=r7=r8=r9=r10=0
                     35: extern char *Filename; /* will always get set to the current source file */
                     36: 
                     37: #define ENTRY(s) entry_fn(s)
                     38: #if !VOID_OK
                     39: #define void char
                     40: #endif
                     41: 
                     42: #if !ANSI
                     43: #define const
                     44: #endif
                     45: 
                     46: #if HAS_PROTOTYPES
                     47: #define PARMS(x) x
                     48: #else
                     49: #define PARMS(X) ()
                     50: #endif /* HAS_PROTOTYPES */
                     51: 
                     52: int aequals PARMS((int, const void *, const void *));
                     53: char *arbhex PARMS((char *, const char *, int));
                     54: generic_ptr avalue PARMS((generic_ptr));
                     55: void begin_case PARMS((const char *));
                     56: int checkthat PARMS((int, int));
                     57: int complain PARMS((int));
                     58: double dabs PARMS((double));
                     59: void dbprint PARMS((const char *));
                     60: int dequals PARMS((int, double, double));
                     61: int do_nothing PARMS((void *, ...));
                     62: double dpowu PARMS((double, unsigned));
                     63: double dvalue PARMS((double));
                     64: void end_case PARMS((const char *));
                     65: void entry_fn PARMS((const char *));
                     66: int faequals PARMS((int, int (*)(), int (*)()));
                     67: int fequals PARMS((int, double, double));
                     68: float fvalue PARMS((double));
                     69: int iabs PARMS((int));
                     70: int iequals PARMS((int, int, int));
                     71: void ignore PARMS((const void *));
                     72: int inotequals PARMS((int, int, int));
                     73: int ivalue PARMS((int));
                     74: int ldequals PARMS((int, long double, long double));
                     75: int lequals PARMS((int, long, long));
                     76: char *ltostr PARMS((char *, long, unsigned));
                     77: long lvalue PARMS((long));
                     78: int mem_cmp PARMS((const void *, const void *, int));
                     79: void pr_err PARMS((const char *));
                     80: void pr_l PARMS((long, unsigned));
                     81: void pr_ok PARMS((const char *));
                     82: void pr_skip PARMS((const char *));
                     83: void pr_ul PARMS((ULONG, unsigned));
                     84: int report PARMS((const char *));
                     85: int scheck PARMS((int, int, int, int));
                     86: int stequals PARMS((int, const char*, const char*));
                     87: int st_ncmp PARMS(( const char *, const char *, int)); /* NOT str_n.. */
                     88: char *st_ncpy PARMS(( char *, const char *, int));     /* NOT str_n.. */
                     89: char *str_cat PARMS(( char *, const char *));
                     90: int str_cspn PARMS(( char *, char *));
                     91: int str_cmp PARMS((const char *, const char *));
                     92: char *str_cpye PARMS((char *, const char *));
                     93: int str_len PARMS((const char *));
                     94: char *str_rev PARMS((char *));
                     95: const char *str_str PARMS((const char *, const char *));
                     96: void trace PARMS((const char *, int));
                     97: int ulequals PARMS((int, ULONG, ULONG));
                     98: char *ultostr PARMS((char *, ULONG, unsigned));
                     99: 
                    100: #define ENTRY(s) entry_fn(s)
                    101: 
                    102: #define ieq(i1, i2)                    iequals(__LINE__, i1, i2)
                    103: #define inoteq(i1, i2)         inotequals(__LINE__, i1, i2)
                    104: #define aeq(a1, a2)                    aequals(__LINE__, a1, a2)
                    105: #define faeq(a1, a2)           faequals(__LINE__, a1, a2)
                    106: #define leq(L1, L2)                    lequals(__LINE__, L1, L2)
                    107: #define deq(d1, d2)                    dequals(__LINE__, d1, d2)
                    108: #define feq(d1, d2)                    fequals(__LINE__, d1, d2)
                    109: #define chk(i1)                                checkthat(__LINE__, i1)
                    110: #define steq(a1, a2)           stequals(__LINE__, a1, a2)
                    111: #define schk(i1, i2, i3)       scheck(__LINE__, i1, i2, i3)
                    112: #define boo()                          complain(__LINE__)
                    113: #define ldeq(ld1, ld2)         ldequals(__LINE__, ld1, ld2)
                    114: 
                    115: #if NEW_STYLE_FN_DEF
                    116: #define FN_DEF1(a1, d1) (d1)
                    117: #define FN_DEF1V(a1, d1) (d1, ...)
                    118: #define FN_DEF2(a1, a2, d1, d2) (d1, d2)
                    119: #define FN_DEF3(a1, a2, a3, d1, d2, d3) (d1, d2, d3)
                    120: #define FN_DEF4(a1, a2, a3, a4, d1, d2, d3, d4) (d1, d2, d3, d4)
                    121: #else /* !NEW_STYLE_FN_DEF */
                    122: #define FN_DEF1(a1, d1) (a1) d1;
                    123: #define FN_DEF1V(a1, d1) (a1) d1;
                    124: #define FN_DEF2(a1, a2, d1, d2) (a1, a2) d1; d2;
                    125: #define FN_DEF3(a1, a2, a3, d1, d2, d3) (a1, a2, a3) d1; d2; d3;
                    126: #define FN_DEF4(a1, a2, a3, a4, d1, d2, d3, d4) (a1, a2, a3, a4) d1; d2; d3; d4;
                    127: #endif /* NEW_STYLE_FN_DEF */
                    128: 
                    129: #if !ANSI
                    130: #ifndef DBL_DIG
                    131: #define DBL_DIG DIGITS_MAX
                    132: #endif
                    133: #ifndef FLT_DIG
                    134: #define FLT_DIG FDIGITS_MAX
                    135: #endif
                    136: #ifndef LDBL_DIG
                    137: #define LDBL_DIG DIGITS_MAX
                    138: #endif
                    139: #ifndef DBL_MAX_10_EXP
                    140: #define DBL_MAX_10_EXP 37      /* a portable minimum value */
                    141: #endif
                    142: #ifndef DBL_MIN_10_EXP
                    143: #define DBL_MIN_10_EXP -37     /* a portable minimum value */
                    144: #endif
                    145: #ifndef LDBL_MIN_10_EXP
                    146: #define LDBL_MIN_10_EXP -37    /* a portable minimum value */
                    147: #endif
                    148: #endif /* of !ANSI */
                    149: #endif  /* of DEFS_H */

unix.superglobalmegacorp.com

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