Annotation of researchv10no/cmd/basic/bite/src/expunge.c, revision 1.1.1.1

1.1       root        1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
                      2: 
                      3:  *     /////////////////////////////////////
                      4:  *     /////////////////////////////////////
                      5:  *     /////// EXPUNGE all variables ///////
                      6:  *     /// J. P. Hawkins WH X4610 8C-001 ///
                      7:  *     ///// Sun Aug 26 05:56:08 1979 //////
                      8:  *     /////////////////////////////////////
                      9:  *     /////////////////////////////////////
                     10: 
                     11:  *
                     12:  * clear variable symbol tables and initialize core pointer
                     13:  * so that all variables are freed including subscripted vars.
                     14:  * and hicore points to top limit of txtbuf.
                     15:  *
                     16:  * This done on any invocation of the "run" command.
                     17:  * or "expunge" command.
                     18:  *
                     19:  * MOD,J.P.Hawkins, 4-FEB-81, to include string variable symbol table clr
                     20:  */
                     21: /*   "@(#) expunge.c:  V 1.3  3/1/81" */
                     22: #include       "bas.h"
                     23: extern char    *hicore;        /* highest free user location pointer */
                     24: extern char    txtbuf[];       /* user core */
                     25: extern char *symtab[26][11], *asymtab[26][11]; /* symbol table pointers */
                     26: #ifdef STRINGS
                     27: extern struct  FREELIST freelist[];
                     28: extern char *  ssymtab[26][11];
                     29: extern char *  sasymtab[26][11];
                     30: #endif
                     31: expunge()
                     32: {
                     33:        register i;
                     34:        clrtab(symtab);         /* initialize regular variable
                     35:                                    symbol table */
                     36: #ifdef STRINGS
                     37:        clrtab(ssymtab);        /* initialize string variable
                     38:                                        symbol table */
                     39:        clrtab(sasymtab);       /* initialize string array variable
                     40:                                        symbol table */
                     41:        for(i=0; i<MAXFREE; i++) /* cleanup string freelist */
                     42:                freelist[i].size = 0;
                     43: #endif
                     44:        clrtab(asymtab);        /* initialize subscripted variable
                     45:                                    symbol table */
                     46:        hicore = &txtbuf[PGSIZ*NMPAG]; /* point to top of user core */
                     47: }
                     48: 
                     49: /*
                     50:  * clear 26 rows, 11 columns
                     51:  * rows represent symbol letters a-z
                     52:  * columns represent no-number, then 0-9 = 11
                     53:  */
                     54: clrtab(table)
                     55: char * table[26][11];
                     56: {
                     57:        register        j,k;    /* row and column indicies */
                     58: 
                     59:        for(j=0; j<26; j++)
                     60:                for(k=0; k<11; k++)
                     61:                        table[j][k] = 0;
                     62: }

unix.superglobalmegacorp.com

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