Annotation of researchv9/cmd/dc/dc.h, revision 1.1.1.1

1.1       root        1: #define FATAL 0
                      2: #define NFATAL 1
                      3: #define BLK sizeof(struct blk)
                      4: #define PTRSZ sizeof(int *)
                      5: #define HEADSZ 1024
                      6: #define STKSZ 100
                      7: #define RDSKSZ 100
                      8: #define TBLSZ 256
                      9: #define ARRAYST 0241
                     10: #define MAXIND 2048
                     11: #define NL 1
                     12: #define NG 2
                     13: #define NE 3
                     14: #define length(p) ((p)->wt-(p)->beg)
                     15: #define rewind(p) (p)->rd=(p)->beg
                     16: #define create(p)      (p)->rd = (p)->wt = (p)->beg
                     17: #define fsfile(p)      (p)->rd = (p)->wt
                     18: #define truncate(p)    (p)->wt = (p)->rd
                     19: #define sfeof(p)       (((p)->rd==(p)->wt)?1:0)
                     20: #define sfbeg(p)       (((p)->rd==(p)->beg)?1:0)
                     21: #define sungetc(p,c)   *(--(p)->rd)=c
                     22: #ifdef interdata
                     23: #define NEGBYTE 0200
                     24: #define MASK (-1 & ~0377)
                     25: #define sgetc(p)       ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? ( *(p)->rd++ | MASK): *(p)->rd++ ))
                     26: #define slookc(p)      ( ((p)->rd==(p)->wt) ? EOF :( ((*(p)->rd & NEGBYTE) != 0) ? (*(p)->rd | MASK) : *(p)->rd ))
                     27: #define sbackc(p)      ( ((p)->rd==(p)->beg) ? EOF :( ((*(--(p)->rd) & NEGBYTE) != 0) ? (*(p)->rd | MASK): *(p)->rd ))
                     28: #endif
                     29: #ifndef interdata
                     30: #define sgetc(p)       (((p)->rd==(p)->wt)?EOF:*(p)->rd++)
                     31: #define slookc(p)      (((p)->rd==(p)->wt)?EOF:*(p)->rd)
                     32: #define sbackc(p)      (((p)->rd==(p)->beg)?EOF:*(--(p)->rd))
                     33: #endif
                     34: #define sputc(p,c)     {if((p)->wt==(p)->last)more(p); *(p)->wt++ = c; }
                     35: #define salterc(p,c)   {if((p)->rd==(p)->last)more(p); *(p)->rd++ = c; if((p)->rd>(p)->wt)(p)->wt=(p)->rd;}
                     36: #define sunputc(p)     (*( (p)->rd = --(p)->wt))
                     37: #define zero(p)        for(pp=(p)->beg;pp<(p)->last;)*pp++='\0'
                     38: #define OUTC(x) {putchar(x); if(--count == 0){printf("\\\n"); count=ll;} }
                     39: #define TEST2  {if((count -= 2) <=0){printf("\\\n");count=ll;}}
                     40: #define EMPTY if(stkerr != 0){printf("stack empty\n"); continue; }
                     41: #define EMPTYR(x) if(stkerr!=0){pushp(x);printf("stack empty\n");continue;}
                     42: #define EMPTYS if(stkerr != 0){printf("stack empty\n"); return(1);}
                     43: #define EMPTYSR(x) if(stkerr !=0){printf("stack empty\n");pushp(x);return(1);}
                     44: #define error(p)       {printf(p); continue; }
                     45: #define errorrt(p)     {printf(p); return(1); }
                     46: struct blk {
                     47:        char    *rd;
                     48:        char    *wt;
                     49:        char    *beg;
                     50:        char    *last;
                     51: };
                     52: struct blk *hfree;
                     53: struct blk *getwd();
                     54: struct blk *lookwd();
                     55: struct blk *getdec();
                     56: struct blk *morehd();
                     57: 
                     58: struct blk *arg1, *arg2;
                     59: int    svargc;
                     60: unsigned char  savk;
                     61: char   **svargv;
                     62: int    dbg;
                     63: int    ifile;
                     64: FILE   *curfile;
                     65: struct blk *scalptr, *basptr, *tenptr, *inbas;
                     66: struct blk *sqtemp, *chptr, *strptr, *divxyz;
                     67: struct blk *stack[STKSZ];
                     68: struct blk **stkptr,**stkbeg;
                     69: struct blk **stkend;
                     70: int    stkerr;
                     71: int    lastchar;
                     72: struct blk *readstk[RDSKSZ];
                     73: struct blk **readptr;
                     74: struct blk *rem;
                     75: int    k;
                     76: struct blk *irem;
                     77: int    skd,skr;
                     78: struct blk *pop(),*readin(),*add0(),*mult();
                     79: struct blk *scalint();
                     80: struct blk *removc();
                     81: struct blk *add(),*div(),*removr();
                     82: struct blk *exp();
                     83: struct blk *sqrt();
                     84: struct blk *salloc(),*copy();
                     85: struct blk *scale();
                     86: int    neg;
                     87: struct sym {
                     88:        struct  sym *next;
                     89:        struct  blk *val;
                     90: } symlst[TBLSZ];
                     91: struct sym *stable[TBLSZ];
                     92: struct sym *sptr,*sfree;
                     93: struct wblk {
                     94:        struct blk **rdw;
                     95:        struct blk **wtw;
                     96:        struct blk **begw;
                     97:        struct blk **lastw;
                     98: };
                     99: FILE   *fsave;
                    100: long   rel;
                    101: long   nbytes;
                    102: long   all;
                    103: long   headmor;
                    104: long   obase;
                    105: int    fw,fw1,ll;
                    106: int    (*outdit)();
                    107: int    bigot(),hexot();
                    108: int    logo;
                    109: int    log10;
                    110: int    count;
                    111: char   *pp;
                    112: int    (*signal())();
                    113: int    onintr();
                    114: char   *malloc();
                    115: char   *nalloc();
                    116: char   *realloc();
                    117: char   *dummy;

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.