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

Defined functions

eol defined in line 19; used 3 times
getformat defined in line 66; used 1 times
nextchar defined in line 48; used 2 times
quotchar defined in line 56; used 1 times
readchar defined in line 32; used 20 times
Last modified: 1982-02-07
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 764
Valid CSS Valid XHTML 1.0 Strict