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

1.1       root        1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
                      2: 
                      3:  *     ************************************
                      4:  *     ************************************
                      5:  *     *** Initiate Auto Line Numbering ***
                      6:  *     *** R. B. Drake WH 8C-005 X4163 ****
                      7:  *     ***** Sat Sep 22 17:58:51 1979 *****
                      8:  *     ************************************
                      9:  *     ************************************
                     10: 
                     11: */
                     12: /*   "@(#) auto.c:  V 1.1  12/21/80" */
                     13: 
                     14: int aut,inc,autflg;
                     15: autnum()
                     16: {
                     17:        extern char *expr;
                     18:        char *prncpy();
                     19:        char txtbuf[80]; /* temporary buffer */
                     20:        autflg = 1;
                     21:        if(!inc) inc = 10; /*default values */
                     22:        aut += inc;
                     23:        if(*expr == '\0') return(0); /* no expression keep the defaults */
                     24:        expr = prncpy(txtbuf,expr); /* copy to first comma if there is one */
                     25:        if(txtbuf[0] != '\0') /* if a start num was specified */
                     26:        aut = atoi(txtbuf);
                     27:        if(*expr++ == ',') /* if an increment has been specified */
                     28:        prncpy(txtbuf,expr);
                     29:        inc = atoi(txtbuf);
                     30:        return(0);
                     31: }

unix.superglobalmegacorp.com

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