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

1.1       root        1: /* Copyright Bell Telephone Laboratories Whippany, N.J.
                      2: 
                      3:  *     /////////////////////////////////////
                      4:  *     /////////////////////////////////////
                      5:  *     ///////////// string.c //////////////
                      6:  *     /// J. P. Hawkins WH X4610 8C-001 ///
                      7:  *     ///// Thu Mar  5 07:48:24 1981 //////
                      8:  *     /////////////////////////////////////
                      9:  *     /////////////////////////////////////
                     10:  *     @(#) string.c: V1.1 3/5/81
                     11:  *
                     12:  * function string$(n,string)
                     13:  *     Where n repetitions of the first char in string are returned
                     14:  */
                     15: 
                     16: extern char    scratch[];
                     17: 
                     18: char   *
                     19: string(args)
                     20: char   args[];
                     21: {
                     22:        double  evalx();
                     23:        char    *prncpy();
                     24:        char    *holdptr;
                     25:        char    num[20];
                     26:        int     number;
                     27:        char    result[80];
                     28:        register        i;
                     29: 
                     30:        holdptr = args;
                     31:        holdptr = prncpy(num,args)+1;   /* get number */
                     32:        prncpy(result,holdptr);         /* get string */
                     33:        evals(result,scratch);
                     34:        number=(int)evalx(num); /* convert expr to integer */
                     35: 
                     36:        for(i=0; i<number; i++)
                     37:                result[i] = scratch[0];
                     38: 
                     39:        result[number] = '\0';
                     40:        return(result);
                     41: }

unix.superglobalmegacorp.com

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