1: # include "../ingres.h"
   2: # include "../scanner.h"
   3: 
   4: /* TWO CHARACTER STACK FOR 'UNGETC' BACKUP */
   5: char    Pchar[2];
   6: int Pctr;
   7: 
   8: /*
   9: ** GTCHAR
  10: ** If 'Lcase' is set, all upper-case alphabetics are
  11: ** mapped into lower-case.
  12: ** The correct return is > 0; a return = 0 indicates end-of-file.
  13: */
  14: gtchar()
  15: {
  16:     extern int  yyline;
  17:     register char   chr;
  18: 
  19:     /* USE STACKED CHARACTERS IF POSSIBLE */
  20:     if (Pctr)
  21:         chr = Pchar[--Pctr];
  22:     else
  23:         chr = getscr(0);
  24: 
  25:     /* UPDATE LINE COUNTER */
  26:     if (chr == '\n')
  27:         yyline++;
  28: 
  29:     return ((Lcase && chr >= 'A' && chr <= 'Z') ? (chr + ('a' - 'A')) : chr);
  30: }
  31: 
  32: 
  33: /*
  34: ** BACKUP
  35: ** saves the character argument in the global stack 'Pchar'
  36: **/
  37: backup(chr)
  38: char    chr;
  39: {
  40:     extern int  yyline;
  41: 
  42:     if (Pctr == 2)
  43:         syserr("overflow in backup()");
  44:     Pchar[Pctr++] = chr;
  45:     if (chr == '\n')
  46:         yyline--;
  47: }

Defined functions

Defined variables

Pchar defined in line 5; used 2 times
Pctr defined in line 6; used 4 times
Last modified: 1980-12-17
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 2300
Valid CSS Valid XHTML 1.0 Strict