Annotation of researchv10no/cmd/usgmake/defs, revision 1.1.1.1

1.1       root        1: /*      @(#)/usr/src/cmd/make/defs      3.2     */
                      2: 
                      3: /*      @(#)defs        3.1     */
                      4: 
                      5: #include <stdio.h>
                      6: 
                      7: #define NEWLINE '\n'
                      8: #define CNULL   '\0'
                      9: #define BLANK   ' '
                     10: #define TAB     '\t'
                     11: #define DOT     '.'
                     12: #define WIGGLE  '~'
                     13: #define AT      '@'
                     14: #define MINUS   '-'
                     15: #define EQUALS  '='
                     16: #define SLASH   '/'
                     17: #define STAR    '*'
                     18: #define LCURLY  '{'
                     19: #define RCURLY  '}'
                     20: #define LPAREN  '('
                     21: #define RPAREN  ')'
                     22: #define LSQUAR  '['
                     23: #define RSQUAR  ']'
                     24: #define QUESTN  '?'
                     25: #define KOLON   ':'
                     26: #define SKOLON  ';'
                     27: #define DOLLAR  '$'
                     28: #define GREATR  '>'
                     29: #define POUND   '#'
                     30: #define BACKSLASH       '\\'
                     31: 
                     32: 
                     33: /*
                     34:  *      Flags
                     35:  */
                     36: 
                     37: #define ALLOC(x) (struct x *) intalloc(sizeof(struct x))
                     38: 
                     39: 
                     40: #define TURNON(a)       (Mflags |= (a))
                     41: #define TURNOFF(a)      (Mflags &= (~(a)))
                     42: #define IS_ON(a)        (Mflags&(a))
                     43: #define IS_OFF(a)       (!(IS_ON(a)))
                     44: 
                     45: #define DBUG    0000001         /* debug flag */
                     46: #define ENVOVER 0000002         /* environ overides file defines */
                     47: #define EXPORT  0000004         /* put current variable in environ */
                     48: #define PRTR    0000010         /* set `-p' flag */
                     49: #define SIL     0000020         /* set `-s' flag */
                     50: #define NOEX    0000040         /* set `-n' flag */
                     51: #define INTRULE 0000100         /* use internal rules */
                     52: #define TOUCH   0000200         /* set `-t' flag */
                     53: #define GET     0000400         /* do a $(GET) if file not found */
                     54: #define QUEST   0001000         /* set `-q' flag */
                     55: #define INARGS  0002000         /* currently reading cmd args */
                     56: #define IGNERR  0004000         /* set `-i' flag */
                     57: #define KEEPGO  0010000         /* set `-k' flag */
                     58: #define GF_KEEP 0020000         /* keep auto get files */
                     59: #define MH_DEP  0040000         /* use old question about whether cmd exists */
                     60: #define MEMMAP  0100000         /* print memory map */
                     61: 
                     62: typedef char *CHARSTAR;
                     63: typedef int  *INTSTAR;
                     64: typedef long int TIMETYPE;
                     65: typedef struct gothead *GOTHEAD;
                     66: typedef struct gotf *GOTF;
                     67: typedef struct chain *CHAIN;
                     68: typedef struct opendir *OPENDIR;
                     69: typedef struct pattern *PATTERN;
                     70: typedef struct varblock *VARBLOCK;
                     71: typedef struct shblock *SHBLOCK;
                     72: typedef struct depblock *DEPBLOCK;
                     73: typedef struct lineblock *LINEBLOCK;
                     74: typedef struct nameblock *NAMEBLOCK;
                     75: 
                     76: extern CHARSTAR *environ;
                     77: extern int Mflags;
                     78: extern FILE *fin;
                     79: extern CHARSTAR *linesptr;
                     80: /*
                     81:  *      flags for get()
                     82:  */
                     83: #define CD      0
                     84: #define NOCD    1
                     85: 
                     86: 
                     87: #define max(a,b)        ((a)>(b)?(a):(b))
                     88: #define SHELLCOM "/bin/sh"
                     89: 
                     90: #ifdef unix
                     91: /*  to install metering, add a statement like */
                     92: /*******
                     93: #define METERFILE "/usr/sif/make/Meter"
                     94: ******/
                     95: /* to turn metering on, set external variable meteron to 1 */
                     96: #endif
                     97: 
                     98: /* define FSTATIC to be static on systems with C compilers
                     99:    supporting file-static; otherwise define it to be null
                    100: */
                    101: #define FSTATIC static
                    102: 
                    103: #define NO 0
                    104: #define YES 1
                    105: 
                    106: #define equal(a,b)      (a[0] == b[0] ? !strcmp((a),(b)) : NO )
                    107: #define HASHSIZE 1021
                    108: #define NLEFTS 512
                    109: #define NCHARS 500
                    110: #define NINTS  250
                    111: #define INMAX 5000
                    112: #define OUTMAX 5000
                    113: #define MAXODIR 10
                    114: 
                    115: #define ALLDEPS  1
                    116: #define SOMEDEPS 2
                    117: 
                    118: #define META 01
                    119: #define TERMINAL 02
                    120: extern char funny[128];
                    121: 
                    122: 
                    123: 
                    124: extern int sigivalue;
                    125: extern int sigqvalue;
                    126: extern int waitpid;
                    127: extern int ndocoms;
                    128: extern int okdel;
                    129: extern CHARSTAR prompt;
                    130: extern char junkname[ ];
                    131: extern char RELEASE[];
                    132: 
                    133: 
                    134: 
                    135: struct nameblock
                    136: {
                    137:         NAMEBLOCK nextname;             /* pointer to next nameblock */
                    138:         NAMEBLOCK backname;             /* pointer to predecessor */
                    139:         CHARSTAR namep;         /* ASCII name string */
                    140:         CHARSTAR alias;         /* ASCII alias (when namep translates to another
                    141:                                  * pathstring.
                    142:                                  */
                    143:         LINEBLOCK linep; /* pointer to dependents */
                    144:         int done:3;             /* flag used to tell when finished */
                    145:         int septype:3;          /* distinguishes between single and double : */
                    146:         int rundep:1;           /* flag indicating runtime translation done */
                    147:         TIMETYPE modtime;       /* set by exists() */
                    148: };
                    149: 
                    150: 
                    151: extern NAMEBLOCK mainname ;
                    152: extern NAMEBLOCK firstname;
                    153: 
                    154: struct lineblock
                    155: {
                    156:         LINEBLOCK nextline;
                    157:         DEPBLOCK depp;
                    158:         SHBLOCK shp;
                    159: };
                    160: 
                    161: extern LINEBLOCK sufflist;
                    162: 
                    163: struct depblock
                    164: {
                    165:         DEPBLOCK nextdep;
                    166:         NAMEBLOCK depname;
                    167: };
                    168: 
                    169: struct shblock
                    170: {
                    171:         SHBLOCK nextsh;
                    172:         CHARSTAR shbp;
                    173: };
                    174: 
                    175: struct varblock
                    176: {
                    177:         VARBLOCK nextvar;
                    178:         CHARSTAR varname;
                    179:         CHARSTAR varval;
                    180:         int noreset:1;
                    181:         int used:1;
                    182:         int envflg:1;
                    183:         int v_aflg:1;
                    184: };
                    185: 
                    186: extern VARBLOCK firstvar;
                    187: 
                    188: struct pattern
                    189: {
                    190:         PATTERN nextpattern;
                    191:         CHARSTAR patval;
                    192: };
                    193: 
                    194: extern PATTERN firstpat;
                    195: 
                    196: struct  opendir
                    197: {
                    198:         OPENDIR nextopendir;
                    199:         FILE * dirfc;
                    200:         CHARSTAR dirn;
                    201: };
                    202: extern OPENDIR firstod;
                    203: 
                    204: 
                    205: struct chain
                    206: {
                    207:         CHAIN nextchain;
                    208:         CHARSTAR datap;
                    209: };
                    210: 
                    211: /*
                    212:  *      The following two structures are used to cleanup after
                    213:  *      `make' does an automatic get of a file. See get() and
                    214:  *      cleanup().
                    215:  */
                    216: struct gotf                     /* list of files */
                    217: {
                    218:         GOTF gnextp;
                    219:         CHARSTAR gnamep;
                    220: };
                    221: 
                    222: struct gothead                  /* first member of list of files */
                    223: {
                    224:         GOTF gnextp;
                    225:         CHARSTAR gnamep;
                    226:         GOTF endp;
                    227: };
                    228: 
                    229: extern char Nullstr[];
                    230: extern CHARSTAR badptr;
                    231: CHARSTAR copys();
                    232: CHARSTAR copstr();
                    233: CHARSTAR concat();
                    234: CHARSTAR colontrans();
                    235: CHARSTAR dftrans();
                    236: CHARSTAR straightrans();
                    237: CHARSTAR mkqlist();
                    238: CHARSTAR findfl();
                    239: CHARSTAR addstars();
                    240: CHARSTAR strshift();
                    241: INTSTAR  intalloc();
                    242: VARBLOCK varptr();
                    243: VARBLOCK srchvar();
                    244: TIMETYPE prestime(), exists();
                    245: DEPBLOCK srchdir();
                    246: NAMEBLOCK srchname(), makename();
                    247: LINEBLOCK runtime();

unix.superglobalmegacorp.com

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