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

Defined functions

obj defined in line 113; used 72 times

Defined struct's

nd defined in line 73; used 6 times
val defined in line 34; used 2 times
  • in line 39(2)

Defined typedef's

cell defined in line 40; used 47 times
node defined in line 80; used 119 times

Defined macros

ARR defined in line 52; used 6 times
AWKFLOAT defined in line 4; used 1 times
  • in line 15
BFALSE defined in line 99; used 1 times
BOTCH defined in line 72; used 1 times
  • in line 78
BTRUE defined in line 98; used 2 times
CCON defined in line 95; used 3 times
CFLD defined in line 94; used 9 times
CNAME defined in line 92; never used
CON defined in line 51; used 3 times
CTEMP defined in line 91; used 2 times
CVAR defined in line 93; used 2 times
FEXP defined in line 62; used 1 times
FINT defined in line 64; used 1 times
FLD defined in line 50; used 24 times
FLENGTH defined in line 60; used 1 times
FLOG defined in line 63; used 1 times
FSQRT defined in line 61; used 1 times
HAT defined in line 134; used 8 times
JBREAK defined in line 104; used 2 times
JCONT defined in line 105; used 2 times
JEXIT defined in line 102; used 2 times
JNEXT defined in line 103; used 2 times
MAXSYM defined in line 133; used 6 times
NEXPR defined in line 110; used 4 times
NPA2 defined in line 111; used 2 times
NSTAT defined in line 109; used 5 times
NUM defined in line 49; used 23 times
NVALUE defined in line 108; used 2 times
OBOOL defined in line 87; used 3 times
OCELL defined in line 85; used 7 times
OEXPR defined in line 86; never used
OJUMP defined in line 88; used 6 times
STR defined in line 48; used 36 times
cantexec defined in line 117; used 1 times
dprintf defined in line 13; used 38 times
hack defined in line 3; used 5 times
isbreak defined in line 122; used 4 times
iscont defined in line 123; used 1 times
isexit defined in line 121; used 5 times
isexpr defined in line 119; used 1 times
isfld defined in line 128; used 2 times
isjump defined in line 120; used 2 times
isnext defined in line 124; used 4 times
isnull defined in line 8; used 2 times
isrec defined in line 129; never used
isstr defined in line 125; used 1 times
istemp defined in line 127; used 1 times
istrue defined in line 126; used 9 times
notlegal defined in line 118; used 1 times
strfree defined in line 6; used 9 times
xfree defined in line 5; used 8 times
yfree defined in line 7; used 3 times

Usage of this include

Last modified: 1987-02-08
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 3655
Valid CSS Valid XHTML 1.0 Strict