1: #define xfree(a)    { if(a!=NULL) yfree(a); a=NULL;}
   2: #define yfree free
   3: #ifdef  DEBUG
   4: #	define    dprintf if(dbg)printf
   5: #else
   6: #	define    dprintf(x1, x2, x3, x4)
   7: #endif
   8: #define isnull(x)   ((x) == EMPTY || (x) == NULL)
   9: typedef double  awkfloat;
  10: 
  11: extern char **FS;
  12: extern char **RS;
  13: extern char **ORS;
  14: extern char **OFS;
  15: extern char **OFMT;
  16: extern awkfloat *NR;
  17: extern awkfloat *NF;
  18: extern char **FILENAME;
  19: 
  20: extern char record[];
  21: extern char EMPTY[];
  22: extern int  dbg;
  23: extern int  lineno;
  24: extern int  errorflag;
  25: extern int  donefld;    /* 1 if record broken into fields */
  26: extern int  donerec;    /* 1 if record is valid (no fld has changed */
  27: 
  28: typedef struct val {    /* general value during processing */
  29:     char    *nval;  /* name, for variables only */
  30:     char    *sval;  /* string value */
  31:     awkfloat    fval;   /* value as number */
  32:     unsigned    tval;   /* type info */
  33:     struct val  *nextval;   /* ptr to next if chained */
  34: } cell;
  35: extern cell *symtab[];
  36: cell    *setsymtab(), *lookup(), **makesymtab();
  37: 
  38: extern cell *recloc;    /* location of input record */
  39: extern cell *nrloc;     /* NR */
  40: extern cell *nfloc;     /* NF */
  41: 
  42: #define STR 01  /* string value is valid */
  43: #define NUM 02  /* number value is valid */
  44: #define FLD 04  /* FLD means don't free string space */
  45: #define CON 010 /* this is a constant */
  46: #define ARR 020 /* this is an array */
  47: 
  48: awkfloat setfval(), getfval();
  49: char    *setsval(), *getsval();
  50: char    *tostring(), *tokname(), *malloc();
  51: double  log(), sqrt(), exp(), atof();
  52: 
  53: /* function types */
  54: #define FLENGTH 1
  55: #define FSQRT   2
  56: #define FEXP    3
  57: #define FLOG    4
  58: #define FINT    5
  59: 
  60: typedef struct {
  61:     char otype;
  62:     char osub;
  63:     cell *optr;
  64: } obj;
  65: 
  66: #define BOTCH   1
  67: struct nd {
  68:     char ntype;
  69:     char subtype;
  70:     struct nd *nnext;
  71:     int nobj;
  72:     struct nd *narg[BOTCH]; /* C won't take a zero length array */
  73: };
  74: typedef struct nd node;
  75: extern node *winner;
  76: extern node *nullstat;
  77: 
  78: /* otypes */
  79: #define OCELL   0
  80: #define OEXPR   1
  81: #define OBOOL   2
  82: #define OJUMP   3
  83: 
  84: /* cell subtypes */
  85: #define CTEMP   4
  86: #define CNAME   3
  87: #define CVAR    2
  88: #define CFLD    1
  89: #define CCON    0
  90: 
  91: /* bool subtypes */
  92: #define BTRUE   1
  93: #define BFALSE  2
  94: 
  95: /* jump subtypes */
  96: #define JEXIT   1
  97: #define JNEXT   2
  98: #define JBREAK  3
  99: #define JCONT   4
 100: 
 101: /* node types */
 102: #define NVALUE  1
 103: #define NSTAT   2
 104: #define NEXPR   3
 105: #define NPA2    4
 106: 
 107: extern obj  (*proctab[])();
 108: extern obj  true, false;
 109: extern int  pairstack[], paircnt;
 110: 
 111: #define cantexec(n) (n->ntype == NVALUE)
 112: #define notlegal(n) (n <= FIRSTTOKEN || n >= LASTTOKEN || proctab[n-FIRSTTOKEN]== nullproc)
 113: #define isexpr(n)   (n->ntype == NEXPR)
 114: #define isjump(n)   (n.otype == OJUMP)
 115: #define isexit(n)   (n.otype == OJUMP && n.osub == JEXIT)
 116: #define isbreak(n)  (n.otype == OJUMP && n.osub == JBREAK)
 117: #define iscont(n)   (n.otype == OJUMP && n.osub == JCONT)
 118: #define isnext(n)   (n.otype == OJUMP && n.osub == JNEXT)
 119: #define isstr(n)    (n.optr->tval & STR)
 120: #define istrue(n)   (n.otype == OBOOL && n.osub == BTRUE)
 121: #define istemp(n)   (n.otype == OCELL && n.osub == CTEMP)
 122: #define isfld(n)    (!donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval==0)
 123: #define isrec(n)    (donefld && n.osub==CFLD && n.otype==OCELL && n.optr->nval!=0)
 124: obj nullproc();
 125: obj relop();
 126: 
 127: #define MAXSYM  16
 128: #define HAT 0177    /* matches ^ in regular expr */
 129:             /* watch out for mach dep */

Defined functions

obj defined in line 107; used 95 times

Defined struct's

nd defined in line 67; used 6 times
val defined in line 28; used 2 times
  • in line 33(2)

Defined typedef's

awkfloat defined in line 9; used 21 times
cell defined in line 34; used 47 times
node defined in line 74; used 120 times

Defined macros

ARR defined in line 46; used 6 times
BFALSE defined in line 93; used 1 times
BOTCH defined in line 66; used 1 times
  • in line 72
BTRUE defined in line 92; used 2 times
CCON defined in line 89; used 3 times
CFLD defined in line 88; used 9 times
CNAME defined in line 86; never used
CON defined in line 45; used 2 times
CTEMP defined in line 85; used 2 times
CVAR defined in line 87; used 2 times
FEXP defined in line 56; used 1 times
FINT defined in line 58; used 1 times
FLD defined in line 44; used 23 times
FLENGTH defined in line 54; used 1 times
FLOG defined in line 57; used 1 times
FSQRT defined in line 55; used 1 times
HAT defined in line 128; used 8 times
JBREAK defined in line 98; used 2 times
JCONT defined in line 99; used 2 times
JEXIT defined in line 96; used 2 times
JNEXT defined in line 97; used 2 times
MAXSYM defined in line 127; used 6 times
NEXPR defined in line 104; used 4 times
NPA2 defined in line 105; used 2 times
NSTAT defined in line 103; used 6 times
NUM defined in line 43; used 16 times
NVALUE defined in line 102; used 2 times
OBOOL defined in line 81; used 3 times
OCELL defined in line 79; used 7 times
OEXPR defined in line 80; never used
OJUMP defined in line 82; used 6 times
STR defined in line 42; used 31 times
cantexec defined in line 111; used 1 times
dprintf defined in line 6; used 39 times
isbreak defined in line 116; used 4 times
iscont defined in line 117; used 1 times
isexit defined in line 115; used 5 times
isexpr defined in line 113; used 1 times
isfld defined in line 122; used 2 times
isjump defined in line 114; used 2 times
isnext defined in line 118; used 4 times
isnull defined in line 8; used 2 times
isrec defined in line 123; never used
isstr defined in line 119; used 1 times
istemp defined in line 121; used 1 times
istrue defined in line 120; used 9 times
notlegal defined in line 112; used 1 times
xfree defined in line 1; used 20 times
yfree defined in line 2; used 2 times

Usage of this include

Last modified: 1983-12-11
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 1058
Valid CSS Valid XHTML 1.0 Strict