1: /* $Header: perl.h,v 1.0.1.4 88/01/30 08:54:00 root Exp $
   2:  *
   3:  * $Log:	perl.h,v $
   4:  * Revision 1.0.1.4  88/01/30  08:54:00  root
   5:  * patch9: changed #define YYDEBUG; to #define YYDEBUG 1
   6:  *
   7:  * Revision 1.0.1.3  88/01/28  10:24:17  root
   8:  * patch8: added eval operator.
   9:  *
  10:  * Revision 1.0.1.2  88/01/24  03:53:47  root
  11:  * patch 2: hid str_peek() in #ifdef DEBUGGING.
  12:  *
  13:  * Revision 1.0.1.1  88/01/21  21:29:23  root
  14:  * No longer defines STDSTDIO--gets it from config.h now.
  15:  *
  16:  * Revision 1.0  87/12/18  13:05:38  root
  17:  * Initial revision
  18:  *
  19:  */
  20: 
  21: #define DEBUGGING
  22: 
  23: #define VOIDUSED 1
  24: #include "config.h"
  25: 
  26: #ifndef BCOPY
  27: #   define bcopy(s1,s2,l) memcpy(s2,s1,l);
  28: #   define bzero(s,l) memset(s,0,l);
  29: #endif
  30: 
  31: #include <stdio.h>
  32: #include <ctype.h>
  33: #include <setjmp.h>
  34: #include <sys/types.h>
  35: #include <sys/stat.h>
  36: 
  37: #ifdef TMINSYS
  38: #include <sys/time.h>
  39: #else
  40: #include <time.h>
  41: #endif
  42: 
  43: #include <sys/times.h>
  44: 
  45: typedef struct arg ARG;
  46: typedef struct cmd CMD;
  47: typedef struct formcmd FCMD;
  48: typedef struct scanpat SPAT;
  49: typedef struct stab STAB;
  50: typedef struct stio STIO;
  51: typedef struct string STR;
  52: typedef struct atbl ARRAY;
  53: typedef struct htbl HASH;
  54: 
  55: #include "str.h"
  56: #include "form.h"
  57: #include "stab.h"
  58: #include "spat.h"
  59: #include "arg.h"
  60: #include "cmd.h"
  61: #include "array.h"
  62: #include "hash.h"
  63: 
  64: #ifdef CHARSPRINTF
  65:     char *sprintf();
  66: #else
  67:     int sprintf();
  68: #endif
  69: 
  70: /* A string is TRUE if not "" or "0". */
  71: #define True(val) (tmps = (val), (*tmps && !(*tmps == '0' && !tmps[1])))
  72: EXT char *Yes INIT("1");
  73: EXT char *No INIT("");
  74: 
  75: #define str_true(str) (Str = (str), (Str->str_pok ? True(Str->str_ptr) : (Str->str_nok ? (Str->str_nval != 0.0) : 0 )))
  76: 
  77: #ifdef DEBUGGING
  78: #define str_peek(str) (Str = (str), (Str->str_pok ? Str->str_ptr : (Str->str_nok ? (sprintf(buf,"num(%g)",Str->str_nval),buf) : "" )))
  79: #endif
  80: 
  81: #define str_get(str) (Str = (str), (Str->str_pok ? Str->str_ptr : str_2ptr(Str)))
  82: #define str_gnum(str) (Str = (str), (Str->str_nok ? Str->str_nval : str_2num(Str)))
  83: EXT STR *Str;
  84: 
  85: #define GROWSTR(pp,lp,len) if (*(lp) < (len)) growstr(pp,lp,len)
  86: 
  87: CMD *add_label();
  88: CMD *block_head();
  89: CMD *append_line();
  90: CMD *make_acmd();
  91: CMD *make_ccmd();
  92: CMD *invert();
  93: CMD *addcond();
  94: CMD *addloop();
  95: CMD *wopt();
  96: 
  97: SPAT *stab_to_spat();
  98: 
  99: STAB *stabent();
 100: 
 101: ARG *stab_to_arg();
 102: ARG *op_new();
 103: ARG *make_op();
 104: ARG *make_lval();
 105: ARG *make_match();
 106: ARG *make_split();
 107: ARG *flipflip();
 108: 
 109: STR *arg_to_str();
 110: STR *str_new();
 111: STR *stab_str();
 112: STR *eval();        /* this evaluates expressions */
 113: STR *do_eval();     /* this evaluates eval operator */
 114: 
 115: FCMD *load_format();
 116: 
 117: char *scanpat();
 118: char *scansubst();
 119: char *scantrans();
 120: char *scanstr();
 121: char *scanreg();
 122: char *reg_get();
 123: char *str_append_till();
 124: char *str_gets();
 125: 
 126: bool do_match();
 127: bool do_open();
 128: bool do_close();
 129: bool do_print();
 130: 
 131: int do_subst();
 132: 
 133: void str_free();
 134: void freearg();
 135: 
 136: EXT int line INIT(0);
 137: EXT int arybase INIT(0);
 138: 
 139: struct outrec {
 140:     int o_lines;
 141:     char *o_str;
 142:     int o_len;
 143: };
 144: 
 145: EXT struct outrec outrec;
 146: EXT struct outrec toprec;
 147: 
 148: EXT STAB *last_in_stab INIT(Nullstab);
 149: EXT STAB *defstab INIT(Nullstab);
 150: EXT STAB *argvstab INIT(Nullstab);
 151: EXT STAB *envstab INIT(Nullstab);
 152: EXT STAB *sigstab INIT(Nullstab);
 153: EXT STAB *defoutstab INIT(Nullstab);
 154: EXT STAB *curoutstab INIT(Nullstab);
 155: EXT STAB *argvoutstab INIT(Nullstab);
 156: 
 157: EXT STR *freestrroot INIT(Nullstr);
 158: 
 159: EXT FILE *rsfp;
 160: EXT char buf[1024];
 161: EXT char *bufptr INIT(buf);
 162: 
 163: EXT STR *linestr INIT(Nullstr);
 164: 
 165: EXT char record_separator INIT('\n');
 166: EXT char *ofs INIT(Nullch);
 167: EXT char *ors INIT(Nullch);
 168: EXT char *ofmt INIT(Nullch);
 169: EXT char *inplace INIT(Nullch);
 170: 
 171: EXT char tokenbuf[256];
 172: EXT int expectterm INIT(TRUE);
 173: EXT int lex_newlines INIT(FALSE);
 174: EXT int in_eval INIT(FALSE);
 175: 
 176: FILE *popen();
 177: /* char *str_get(); */
 178: STR *interp();
 179: void free_arg();
 180: STIO *stio_new();
 181: 
 182: EXT struct stat statbuf;
 183: EXT struct tms timesbuf;
 184: 
 185: #ifdef DEBUGGING
 186: EXT int debug INIT(0);
 187: EXT int dlevel INIT(0);
 188: EXT char debname[40];
 189: EXT char debdelim[40];
 190: #define YYDEBUG 1
 191: extern int yydebug;
 192: #endif
 193: 
 194: EXT STR str_no;
 195: EXT STR str_yes;
 196: 
 197: /* runtime control stuff */
 198: 
 199: EXT struct loop {
 200:     char *loop_label;
 201:     jmp_buf loop_env;
 202: } loop_stack[32];
 203: 
 204: EXT int loop_ptr INIT(-1);
 205: 
 206: EXT jmp_buf top_env;
 207: EXT jmp_buf eval_env;
 208: 
 209: EXT char *goto_targ INIT(Nullch);   /* cmd_exec gets strange when set */
 210: 
 211: double atof();
 212: 
 213: #ifdef EUNICE
 214: #define UNLINK(f) while (unlink(f) >= 0)
 215: #else
 216: #define UNLINK unlink
 217: #endif

Defined variables

Str defined in line 83; used 18 times
Yes defined in line 72; used 10 times
argvoutstab defined in line 155; used 3 times
argvstab defined in line 150; never used
buf defined in line 160; used 41 times
bufptr defined in line 161; never used
defoutstab defined in line 153; used 10 times
dlevel defined in line 187; used 37 times
eval_env defined in line 207; used 1 times
expectterm defined in line 172; never used
freestrroot defined in line 157; used 5 times
inplace defined in line 169; used 4 times
lex_newlines defined in line 173; never used
line defined in line 136; used 2 times
linestr defined in line 163; used 7 times
loop_ptr defined in line 204; used 24 times
ofmt defined in line 168; used 6 times
ofs defined in line 166; used 6 times
ors defined in line 167; used 8 times
outrec defined in line 145; used 2 times
statbuf defined in line 182; used 18 times
str_yes defined in line 195; used 4 times
timesbuf defined in line 183; used 5 times
top_env defined in line 206; used 1 times
toprec defined in line 146; used 3 times

Defined struct's

loop defined in line 199; never used
outrec defined in line 139; used 8 times

Defined typedef's

HASH defined in line 53; used 13 times
STIO defined in line 50; used 7 times
STR defined in line 51; used 165 times

Defined macros

True defined in line 71; used 1 times
  • in line 75
VOIDUSED defined in line 23; never used
YYDEBUG defined in line 190; never used
str_gnum defined in line 82; used 65 times

Usage of this include

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