Annotation of cci/usr/src/usr.bin/sf77/init.c, revision 1.1.1.1

1.1       root        1: #include "defs"
                      2: 
                      3: 
                      4: FILEP infile   = { stdin };
                      5: FILEP diagfile = { stderr };
                      6: 
                      7: FILEP textfile;
                      8: FILEP asmfile;
                      9: FILEP initfile;
                     10: long int headoffset;
                     11: 
                     12: char token[200];
                     13: int toklen;
                     14: int lineno;
                     15: char *infname;
                     16: int needkwd;
                     17: struct Labelblock *thislabel   = NULL;
                     18: flag nowarnflag        = NO;
                     19: flag ftn66flag = NO;
                     20: flag no66flag  = NO;
                     21: flag noextflag = NO;
                     22: flag profileflag       = NO;
                     23: flag optimflag = NO;
                     24: flag shiftcase = YES;
                     25: flag undeftype = NO;
                     26: flag shortsubs = YES;
                     27: flag onetripflag       = NO;
                     28: flag checksubs = NO;
                     29: flag debugflag = NO;
                     30: int nerr;
                     31: int nwarn;
                     32: int ndata;
                     33: 
                     34: flag saveall;
                     35: flag substars;
                     36: int parstate   = OUTSIDE;
                     37: flag headerdone        = NO;
                     38: int blklevel;
                     39: int impltype[26];
                     40: int implleng[26];
                     41: int implstg[26];
                     42: 
                     43: int tyint      = TYLONG ;
                     44: int tylogical  = TYLONG;
                     45: ftnint typesize[NTYPES]
                     46:        = { 1, SZADDR, SZSHORT, SZLONG, SZLONG, 2*SZLONG,
                     47:            2*SZLONG, 4*SZLONG, SZLONG, 1, 1, 1};
                     48: int typealign[NTYPES]
                     49:        = { 1, ALIADDR, ALISHORT, ALILONG, ALILONG, ALIDOUBLE,
                     50:            ALILONG, ALIDOUBLE, ALILONG, 1, 1, 1};
                     51: int procno;
                     52: int proctype   = TYUNKNOWN;
                     53: char *procname;
                     54: int rtvlabel[NTYPES];
                     55: int fudgelabel;
                     56: Addrp typeaddr;
                     57: Addrp retslot;
                     58: int cxslot     = -1;
                     59: int chslot     = -1;
                     60: int chlgslot   = -1;
                     61: int procclass  = CLUNKNOWN;
                     62: int nentry;
                     63: flag multitype;
                     64: ftnint procleng;
                     65: int lastlabno  = 10;
                     66: int lastvarno;
                     67: int lastargslot;
                     68: int argloc;
                     69: ftnint autoleng;
                     70: ftnint bssleng = 0;
                     71: int retlabel;
                     72: int ret0label;
                     73: 
                     74: int maxctl     = MAXCTL;
                     75: struct Ctlframe *ctls;
                     76: struct Ctlframe *ctlstack;
                     77: struct Ctlframe *lastctl;
                     78: 
                     79: Namep regnamep[MAXREGVAR];
                     80: int highregvar;
                     81: int nregvar;
                     82: 
                     83: int maxext     = MAXEXT;
                     84: struct Extsym *extsymtab;
                     85: struct Extsym *nextext;
                     86: struct Extsym *lastext;
                     87: 
                     88: int maxequiv   = MAXEQUIV;
                     89: struct Equivblock *eqvclass;
                     90: 
                     91: int maxhash    = MAXHASH;
                     92: struct Hashentry *hashtab;
                     93: struct Hashentry *lasthash;
                     94: 
                     95: int maxstno    = MAXSTNO;
                     96: struct Labelblock *labeltab;
                     97: struct Labelblock *labtabend;
                     98: struct Labelblock *highlabtab;
                     99: 
                    100: int maxdim     = MAXDIM;
                    101: struct Rplblock *rpllist       = NULL;
                    102: struct Chain *curdtp   = NULL;
                    103: flag toomanyinit;
                    104: ftnint curdtelt;
                    105: chainp templist        = NULL;
                    106: chainp holdtemps       = NULL;
                    107: int dorange    = 0;
                    108: struct Entrypoint *entries     = NULL;
                    109: 
                    110: chainp chains  = NULL;
                    111: 
                    112: flag inioctl;
                    113: Addrp ioblkp;
                    114: int iostmt;
                    115: int nioctl;
                    116: int nequiv     = 0;
                    117: int eqvstart   = 0;
                    118: int nintnames  = 0;
                    119: 
                    120: #ifdef SDB
                    121: int dbglabel   = 0;
                    122: flag sdbflag   = NO;
                    123: #endif
                    124: 
                    125: struct Literal litpool[MAXLITERALS];
                    126: int nliterals;
                    127: 
                    128: 
                    129: 
                    130: fileinit()
                    131: {
                    132: procno = 0;
                    133: lastlabno = 10;
                    134: lastvarno = 0;
                    135: nliterals = 0;
                    136: nerr = 0;
                    137: ndata = 0;
                    138: 
                    139: ctls = ALLOCN(maxctl, Ctlframe);
                    140: extsymtab = ALLOCN(maxext, Extsym);
                    141: eqvclass = ALLOCN(maxequiv, Equivblock);
                    142: hashtab = ALLOCN(maxhash, Hashentry);
                    143: labeltab = ALLOCN(maxstno, Labelblock);
                    144: 
                    145: ctlstack = ctls - 1;
                    146: lastctl = ctls + maxctl;
                    147: nextext = extsymtab;
                    148: lastext = extsymtab + maxext;
                    149: lasthash = hashtab + maxhash;
                    150: labtabend = labeltab + maxstno;
                    151: highlabtab = labeltab;
                    152: }
                    153: 
                    154: 
                    155: 
                    156: 
                    157: 
                    158: procinit()
                    159: {
                    160: register Namep p;
                    161: register struct Dimblock *q;
                    162: register struct Hashentry *hp;
                    163: register struct Labelblock *lp;
                    164: struct Chain *cp;
                    165: int i;
                    166: 
                    167: pruse(asmfile, USECONST);
                    168: #if FAMILY == PCC
                    169:        p2pass(USETEXT);
                    170: #endif
                    171: parstate = OUTSIDE;
                    172: headerdone = NO;
                    173: blklevel = 1;
                    174: saveall = NO;
                    175: substars = NO;
                    176: nwarn = 0;
                    177: thislabel = NULL;
                    178: needkwd = 0;
                    179: 
                    180: ++procno;
                    181: proctype = TYUNKNOWN;
                    182: procname = "MAIN_    ";
                    183: procclass = CLUNKNOWN;
                    184: nentry = 0;
                    185: multitype = NO;
                    186: typeaddr = NULL;
                    187: retslot = NULL;
                    188: cxslot = -1;
                    189: chslot = -1;
                    190: chlgslot = -1;
                    191: procleng = 0;
                    192: blklevel = 1;
                    193: lastargslot = 0;
                    194: #if TARGET==PDP11
                    195:        autoleng = 6;
                    196: #else
                    197: #if TARGET==TAHOE
                    198:        autoleng = 52;
                    199: #else
                    200:        autoleng = 0;
                    201: #endif
                    202: #endif
                    203: 
                    204: for(lp = labeltab ; lp < labtabend ; ++lp)
                    205:        lp->stateno = 0;
                    206: 
                    207: for(hp = hashtab ; hp < lasthash ; ++hp)
                    208:        if(p = hp->varp)
                    209:                {
                    210:                frexpr(p->vleng);
                    211:                if(q = p->vdim)
                    212:                        {
                    213:                        for(i = 0 ; i < q->ndim ; ++i)
                    214:                                {
                    215:                                frexpr(q->dims[i].dimsize);
                    216:                                frexpr(q->dims[i].dimexpr);
                    217:                                }
                    218:                        frexpr(q->nelt);
                    219:                        frexpr(q->baseoffset);
                    220:                        frexpr(q->basexpr);
                    221:                        free( (charptr) q);
                    222:                        }
                    223:                if(p->vclass == CLNAMELIST)
                    224:                        frchain( &(p->varxptr.namelist) );
                    225:                free( (charptr) p);
                    226:                hp->varp = NULL;
                    227:                }
                    228: nintnames = 0;
                    229: highlabtab = labeltab;
                    230: 
                    231: ctlstack = ctls - 1;
                    232: for(cp = templist ; cp ; cp = cp->nextp)
                    233:        free( (charptr) (cp->datap) );
                    234: frchain(&templist);
                    235: holdtemps = NULL;
                    236: dorange = 0;
                    237: nregvar = 0;
                    238: highregvar = 0;
                    239: entries = NULL;
                    240: rpllist = NULL;
                    241: inioctl = NO;
                    242: ioblkp = NULL;
                    243: eqvstart += nequiv;
                    244: nequiv = 0;
                    245: 
                    246: for(i = 0 ; i<NTYPES ; ++i)
                    247:        rtvlabel[i] = 0;
                    248: fudgelabel = 0;
                    249: 
                    250: if(undeftype)
                    251:        setimpl(TYUNKNOWN, (ftnint) 0, 'a', 'z');
                    252: else
                    253:        {
                    254:        setimpl(TYREAL, (ftnint) 0, 'a', 'z');
                    255:        setimpl(tyint,  (ftnint) 0, 'i', 'n');
                    256:        }
                    257: setimpl(-STGBSS, (ftnint) 0, 'a', 'z');        /* set class */
                    258: setlog();
                    259: }
                    260: 
                    261: 
                    262: 
                    263: 
                    264: setimpl(type, length, c1, c2)
                    265: int type;
                    266: ftnint length;
                    267: int c1, c2;
                    268: {
                    269: int i;
                    270: char buff[100];
                    271: 
                    272: if(c1==0 || c2==0)
                    273:        return;
                    274: 
                    275: if(c1 > c2)
                    276:        {
                    277:        sprintf(buff, "characters out of order in implicit:%c-%c", c1, c2);
                    278:        err(buff);
                    279:        }
                    280: else
                    281:        if(type < 0)
                    282:                for(i = c1 ; i<=c2 ; ++i)
                    283:                        implstg[i-'a'] = - type;
                    284:        else
                    285:                {
                    286:                type = lengtype(type, (int) length);
                    287:                if(type != TYCHAR)
                    288:                        length = 0;
                    289:                for(i = c1 ; i<=c2 ; ++i)
                    290:                        {
                    291:                        impltype[i-'a'] = type;
                    292:                        implleng[i-'a'] = length;
                    293:                        }
                    294:                }
                    295: }

unix.superglobalmegacorp.com

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