1: /* $Header: a2p.h,v 1.0.1.1 88/01/26 09:52:30 root Exp $
   2:  *
   3:  * $Log:	a2p.h,v $
   4:  * Revision 1.0.1.1  88/01/26  09:52:30  root
   5:  * patch 5: a2p didn't use config.h.
   6:  *
   7:  * Revision 1.0  87/12/18  13:06:58  root
   8:  * Initial revision
   9:  *
  10:  */
  11: 
  12: #define VOIDUSED 1
  13: #include "../config.h"
  14: 
  15: #ifndef BCOPY
  16: #   define bcopy(s1,s2,l) memcpy(s2,s1,l);
  17: #   define bzero(s,l) memset(s,0,l);
  18: #endif
  19: 
  20: #include "handy.h"
  21: #define Nullop 0
  22: 
  23: #define OPROG       1
  24: #define OJUNK       2
  25: #define OHUNKS      3
  26: #define ORANGE      4
  27: #define OPAT        5
  28: #define OHUNK       6
  29: #define OPPAREN     7
  30: #define OPANDAND    8
  31: #define OPOROR      9
  32: #define OPNOT       10
  33: #define OCPAREN     11
  34: #define OCANDAND    12
  35: #define OCOROR      13
  36: #define OCNOT       14
  37: #define ORELOP      15
  38: #define ORPAREN     16
  39: #define OMATCHOP    17
  40: #define OMPAREN     18
  41: #define OCONCAT     19
  42: #define OASSIGN     20
  43: #define OADD        21
  44: #define OSUB        22
  45: #define OMULT       23
  46: #define ODIV        24
  47: #define OMOD        25
  48: #define OPOSTINCR   26
  49: #define OPOSTDECR   27
  50: #define OPREINCR    28
  51: #define OPREDECR    29
  52: #define OUMINUS     30
  53: #define OUPLUS      31
  54: #define OPAREN      32
  55: #define OGETLINE    33
  56: #define OSPRINTF    34
  57: #define OSUBSTR     35
  58: #define OSTRING     36
  59: #define OSPLIT      37
  60: #define OSNEWLINE   38
  61: #define OINDEX      39
  62: #define ONUM        40
  63: #define OSTR        41
  64: #define OVAR        42
  65: #define OFLD        43
  66: #define ONEWLINE    44
  67: #define OCOMMENT    45
  68: #define OCOMMA      46
  69: #define OSEMICOLON  47
  70: #define OSCOMMENT   48
  71: #define OSTATES     49
  72: #define OSTATE      50
  73: #define OPRINT      51
  74: #define OPRINTF     52
  75: #define OBREAK      53
  76: #define ONEXT       54
  77: #define OEXIT       55
  78: #define OCONTINUE   56
  79: #define OREDIR      57
  80: #define OIF     58
  81: #define OWHILE      59
  82: #define OFOR        60
  83: #define OFORIN      61
  84: #define OVFLD       62
  85: #define OBLOCK      63
  86: #define OREGEX      64
  87: #define OLENGTH     65
  88: #define OLOG        66
  89: #define OEXP        67
  90: #define OSQRT       68
  91: #define OINT        69
  92: 
  93: #ifdef DOINIT
  94: char *opname[] = {
  95:     "0",
  96:     "PROG",
  97:     "JUNK",
  98:     "HUNKS",
  99:     "RANGE",
 100:     "PAT",
 101:     "HUNK",
 102:     "PPAREN",
 103:     "PANDAND",
 104:     "POROR",
 105:     "PNOT",
 106:     "CPAREN",
 107:     "CANDAND",
 108:     "COROR",
 109:     "CNOT",
 110:     "RELOP",
 111:     "RPAREN",
 112:     "MATCHOP",
 113:     "MPAREN",
 114:     "CONCAT",
 115:     "ASSIGN",
 116:     "ADD",
 117:     "SUB",
 118:     "MULT",
 119:     "DIV",
 120:     "MOD",
 121:     "POSTINCR",
 122:     "POSTDECR",
 123:     "PREINCR",
 124:     "PREDECR",
 125:     "UMINUS",
 126:     "UPLUS",
 127:     "PAREN",
 128:     "GETLINE",
 129:     "SPRINTF",
 130:     "SUBSTR",
 131:     "STRING",
 132:     "SPLIT",
 133:     "SNEWLINE",
 134:     "INDEX",
 135:     "NUM",
 136:     "STR",
 137:     "VAR",
 138:     "FLD",
 139:     "NEWLINE",
 140:     "COMMENT",
 141:     "COMMA",
 142:     "SEMICOLON",
 143:     "SCOMMENT",
 144:     "STATES",
 145:     "STATE",
 146:     "PRINT",
 147:     "PRINTF",
 148:     "BREAK",
 149:     "NEXT",
 150:     "EXIT",
 151:     "CONTINUE",
 152:     "REDIR",
 153:     "IF",
 154:     "WHILE",
 155:     "FOR",
 156:     "FORIN",
 157:     "VFLD",
 158:     "BLOCK",
 159:     "REGEX",
 160:     "LENGTH",
 161:     "LOG",
 162:     "EXP",
 163:     "SQRT",
 164:     "INT",
 165:     "70"
 166: };
 167: #else
 168: extern char *opname[];
 169: #endif
 170: 
 171: union {
 172:     int ival;
 173:     char *cval;
 174: } ops[50000];       /* hope they have 200k to spare */
 175: 
 176: EXT int mop INIT(1);
 177: 
 178: #define DEBUGGING
 179: 
 180: #include <stdio.h>
 181: #include <ctype.h>
 182: #include <setjmp.h>
 183: #include <sys/types.h>
 184: #include <sys/stat.h>
 185: #include <time.h>
 186: #include <sys/times.h>
 187: 
 188: typedef struct string STR;
 189: typedef struct htbl HASH;
 190: 
 191: #include "str.h"
 192: #include "hash.h"
 193: 
 194: /* A string is TRUE if not "" or "0". */
 195: #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
 196: EXT char *Yes INIT("1");
 197: EXT char *No INIT("");
 198: 
 199: #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
 200: 
 201: #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
 202: #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
 203: #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
 204: EXT STR *Str;
 205: 
 206: #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
 207: 
 208: STR *str_new();
 209: 
 210: char *scanpat();
 211: char *scannum();
 212: 
 213: void str_free();
 214: 
 215: EXT int line INIT(0);
 216: 
 217: EXT FILE *rsfp;
 218: EXT char buf[1024];
 219: EXT char *bufptr INIT(buf);
 220: 
 221: EXT STR *linestr INIT(Nullstr);
 222: 
 223: EXT char tokenbuf[256];
 224: EXT int expectterm INIT(TRUE);
 225: 
 226: #ifdef DEBUGGING
 227: EXT int debug INIT(0);
 228: EXT int dlevel INIT(0);
 229: #define YYDEBUG;
 230: extern int yydebug;
 231: #endif
 232: 
 233: EXT STR *freestrroot INIT(Nullstr);
 234: 
 235: EXT STR str_no;
 236: EXT STR str_yes;
 237: 
 238: EXT bool do_split INIT(FALSE);
 239: EXT bool split_to_array INIT(FALSE);
 240: EXT bool set_array_base INIT(FALSE);
 241: EXT bool saw_RS INIT(FALSE);
 242: EXT bool saw_OFS INIT(FALSE);
 243: EXT bool saw_ORS INIT(FALSE);
 244: EXT bool saw_line_op INIT(FALSE);
 245: EXT bool in_begin INIT(TRUE);
 246: EXT bool do_opens INIT(FALSE);
 247: EXT bool do_fancy_opens INIT(FALSE);
 248: EXT bool lval_field INIT(FALSE);
 249: EXT bool do_chop INIT(FALSE);
 250: EXT bool need_entire INIT(FALSE);
 251: EXT bool absmaxfld INIT(FALSE);
 252: 
 253: EXT char const_FS INIT(0);
 254: EXT char *namelist INIT(Nullch);
 255: EXT char fswitch INIT(0);
 256: 
 257: EXT int saw_FS INIT(0);
 258: EXT int maxfld INIT(0);
 259: EXT int arymax INIT(0);
 260: char *nameary[100];
 261: 
 262: EXT STR *opens;
 263: 
 264: EXT HASH *symtab;

Defined variables

No defined in line 197; used 2 times
Str defined in line 204; used 18 times
Yes defined in line 196; never used
arymax defined in line 259; used 11 times
buf defined in line 218; used 7 times
bufptr defined in line 219; never used
const_FS defined in line 253; used 9 times
dlevel defined in line 228; never used
expectterm defined in line 224; never used
freestrroot defined in line 233; used 5 times
fswitch defined in line 255; used 5 times
line defined in line 215; never used
linestr defined in line 221; never used
maxfld defined in line 258; used 14 times
mop defined in line 176; never used
nameary defined in line 260; used 8 times
namelist defined in line 254; used 4 times
opens defined in line 262; used 13 times
opname declared in line 168; defined in line 94; used 1 times
saw_FS defined in line 257; used 5 times
str_no defined in line 235; never used
str_yes defined in line 236; never used
symtab defined in line 264; used 4 times
tokenbuf defined in line 223; used 57 times

Defined typedef's

HASH defined in line 189; used 12 times
STR defined in line 188; used 57 times

Defined macros

GROWSTR defined in line 206; used 11 times
Nullop defined in line 21; used 10 times
OADD defined in line 43; used 1 times
OASSIGN defined in line 42; used 1 times
OBREAK defined in line 75; used 1 times
OCANDAND defined in line 34; used 1 times
OCNOT defined in line 36; used 1 times
OCOMMA defined in line 68; used 2 times
OCOMMENT defined in line 67; used 2 times
OCONCAT defined in line 41; used 1 times
OCONTINUE defined in line 78; used 1 times
OCOROR defined in line 35; used 1 times
OCPAREN defined in line 33; used 1 times
ODIV defined in line 46; used 1 times
OEXIT defined in line 77; used 2 times
OEXP defined in line 89; never used
OFLD defined in line 65; used 2 times
OFOR defined in line 82; used 2 times
OFORIN defined in line 83; used 1 times
OGETLINE defined in line 55; used 1 times
OHUNK defined in line 28; used 3 times
OHUNKS defined in line 25; used 1 times
OINDEX defined in line 61; used 1 times
OINT defined in line 91; never used
OJUNK defined in line 24; used 2 times
OLENGTH defined in line 87; used 2 times
OLOG defined in line 88; never used
OMATCHOP defined in line 39; used 1 times
OMOD defined in line 47; used 1 times
OMPAREN defined in line 40; used 1 times
OMULT defined in line 45; used 1 times
ONEWLINE defined in line 66; used 2 times
ONEXT defined in line 76; used 1 times
ONUM defined in line 62; used 1 times
OPANDAND defined in line 30; used 1 times
OPAT defined in line 27; used 1 times
OPNOT defined in line 32; used 1 times
OPOROR defined in line 31; used 1 times
OPOSTDECR defined in line 49; used 1 times
OPOSTINCR defined in line 48; used 1 times
OPPAREN defined in line 29; used 1 times
OPREDECR defined in line 51; used 1 times
OPREINCR defined in line 50; used 1 times
OPROG defined in line 23; used 1 times
ORANGE defined in line 26; used 1 times
OREDIR defined in line 79; used 3 times
OREGEX defined in line 86; used 1 times
ORELOP defined in line 37; used 1 times
ORPAREN defined in line 38; used 1 times
OSCOMMENT defined in line 70; used 1 times
OSEMICOLON defined in line 69; used 3 times
OSNEWLINE defined in line 60; used 2 times
OSPLIT defined in line 59; used 2 times
OSPRINTF defined in line 56; used 1 times
OSQRT defined in line 90; never used
OSTATE defined in line 72; used 1 times
OSTATES defined in line 71; used 1 times
OSTR defined in line 63; used 3 times
OSTRING defined in line 58; never used
OSUB defined in line 44; used 1 times
OSUBSTR defined in line 57; used 2 times
OUMINUS defined in line 52; used 1 times
OUPLUS defined in line 53; used 1 times
OVFLD defined in line 84; used 2 times
OWHILE defined in line 81; used 1 times
True defined in line 195; used 1 times
VOIDUSED defined in line 12; never used
YYDEBUG defined in line 229; never used
bcopy defined in line 16; used 5 times
str_get defined in line 202; never used
str_gnum defined in line 203; never used
str_peek defined in line 201; never used
str_true defined in line 199; never used

Usage of this include

Last modified: 1988-02-03
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 5226
Valid CSS Valid XHTML 1.0 Strict