# 2.11BSD#431 - /usr/src/bin/adb/input.c

##### Functions

    eol               X
    getformat         X
    nextchar          X
    quotchar          X
    rdc               X
    readchar          X

##### Variables

    eof               X
    infile            X
    lastc             X
    line              X
    lp                X
    mkfault           X

       1: #include "defs.h"
       2:
       3:     int mkfault;
       4:     char    line[LINSIZ];
       5:     int infile;
       6:     char    *lp;
       7:     char    lastc = EOR;
       8:     int eof;
       9:
      10: /* input routines */
      11:
      12: eol(c)
      13:     char    c;
      14: {
      15:     return(c==EOR || c==';');
      16: }
      17:
      18: rdc()
      19: {   REP readchar();
      20:     PER lastc==SP ORF lastc==TB
      21:     DONE
      22:     return(lastc);
      23: }
      24:
      25: readchar()
      26: {
      27:     IF eof
      28:     THEN    lastc = '\0';
      29:     ELSE    IF lp==0
      30:         THEN    lp=line;
      31:             REP eof = read(infile,lp,1)==0;
      32:                 IF mkfault THEN error((char *)0); FI
      33:             PER eof==0 ANDF *lp++!=EOR DONE
      34:             *lp=0; lp=line;
      35:         FI
      36:         IF lastc = *lp THEN lp++; FI
      37:     FI
      38:     return(lastc);
      39: }
      40:
      41: nextchar()
      42: {
      43:     IF eol(rdc())
      44:     THEN lp--; return(0);
      45:     ELSE return(lastc);
      46:     FI
      47: }
      48:
      49: quotchar()
      50: {
      51:     IF readchar()=='\\'
      52:     THEN    return(readchar());
      53:     ELIF lastc=='\''
      54:     THEN    return(0);
      55:     ELSE    return(lastc);
      56:     FI
      57: }
      58:
      59: getformat(deformat)
      60:     char    *deformat;
      61: {
      62:     register char   *fptr;
      63:     register int    quote;
      64:
      65:     fptr=deformat; quote=FALSE;
      66:     WHILE (quote ? readchar()!=EOR : !eol(readchar()))
      67:     DO  IF (*fptr++ = lastc)=='"'
      68:         THEN quote = ~quote;
      69:         FI
      70:     OD
      71:     lp--;
      72:     IF fptr!=deformat THEN *fptr++ = '\0'; FI
      73: }

#### Defined functions

eol defined in line 12; used 3 times

- in line 43, 66
- in /usr/src/bin/adb/command.c line 66

getformat defined in line 59; used 1 times

- in /usr/src/bin/adb/command.c line 160

nextchar defined in line 41; used 2 times

- in /usr/src/bin/adb/command.c line 196-201(2)

quotchar defined in line 49; used 1 times

- in /usr/src/bin/adb/expr.c line 214

rdc defined in line 18; used 16 times

- in line 43
- in /usr/src/bin/adb/command.c line 61-66(2), 87, 94, 111, 176, 215
- in /usr/src/bin/adb/expr.c line 42, 204
- in /usr/src/bin/adb/format.c line 233
- in /usr/src/bin/adb/main.c line 140
- in /usr/src/bin/adb/pcs.c line 74
- in /usr/src/bin/adb/print.c line 90, 103
- in /usr/src/bin/adb/runpcs.c line 133

readchar defined in line 25; used 21 times

- in line 19, 51-52(2), 66(2)
- in /usr/src/bin/adb/expr.c line 47, 84, 123, 146, 158, 164-171(3), 182, 239, 292
- in /usr/src/bin/adb/pcs.c line 75
- in /usr/src/bin/adb/print.c line 85, 106, 391
- in /usr/src/bin/adb/runpcs.c line 140

#### Defined variables

eof defined in line 8; used 3 times

- in line 27-33(3)

infile defined in line 5; used 1 times

- in line 31

lastc defined in line 7; used 10 times

- in line 20-22(3), 28, 36-38(2), 45, 53-55(2), 67

line defined in line 4; used 2 times

- in line 30-34(2)

lp defined in line 6; used 10 times

- in line 29-36(8), 44, 71

mkfault defined in line 3; used 1 times

- in line 32

Last modified: 1993-12-31 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 798 |