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

Defined variables

Str defined in line 57; used 18 times
Yes defined in line 49; used 10 times
argvoutstab defined in line 128; used 3 times
argvstab defined in line 123; never used
buf defined in line 133; used 41 times
bufptr defined in line 134; never used
defoutstab defined in line 126; used 10 times
dlevel defined in line 159; used 36 times
expectterm defined in line 145; never used
freestrroot defined in line 130; used 5 times
inplace defined in line 142; used 4 times
lex_newlines defined in line 146; never used
line defined in line 109; used 2 times
linestr defined in line 136; used 7 times
loop_ptr defined in line 176; used 24 times
ofmt defined in line 141; used 6 times
ofs defined in line 139; used 6 times
ors defined in line 140; used 8 times
outrec defined in line 118; used 2 times
statbuf defined in line 154; used 18 times
str_yes defined in line 167; used 4 times
timesbuf defined in line 155; used 5 times
top_env defined in line 178; used 1 times
toprec defined in line 119; used 3 times

Defined struct's

loop defined in line 171; never used
outrec defined in line 112; used 8 times

Defined typedef's

HASH defined in line 36; used 13 times
STIO defined in line 33; used 7 times
STR defined in line 34; used 163 times

Defined macros

True defined in line 48; used 1 times
  • in line 52
VOIDUSED defined in line 12; never used
YYDEBUG defined in line 162; never used
str_gnum defined in line 56; used 65 times

Usage of this include

Last modified: 1988-01-31
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 969
Valid CSS Valid XHTML 1.0 Strict