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

Defined variables

No defined in line 200; used 2 times
Str defined in line 207; used 18 times
Yes defined in line 199; never used
arymax defined in line 262; used 11 times
buf defined in line 221; used 7 times
bufptr defined in line 222; never used
const_FS defined in line 256; used 9 times
dlevel defined in line 231; never used
expectterm defined in line 227; never used
freestrroot defined in line 236; used 5 times
fswitch defined in line 258; used 5 times
line defined in line 218; never used
linestr defined in line 224; never used
maxfld defined in line 261; used 14 times
mop defined in line 179; never used
nameary defined in line 263; used 8 times
namelist defined in line 257; used 4 times
opens defined in line 265; used 13 times
opname declared in line 171; defined in line 97; used 1 times
saw_FS defined in line 260; used 5 times
str_no defined in line 238; never used
str_yes defined in line 239; never used
symtab defined in line 267; used 4 times
tokenbuf defined in line 226; used 57 times

Defined typedef's

HASH defined in line 192; used 12 times
STR defined in line 191; used 57 times

Defined macros

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

Usage of this include

Last modified: 2002-12-19
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 4823
Valid CSS Valid XHTML 1.0 Strict