1: int offset  0;
   2: 
   3: main(argc, argv)
   4: char *argv[];
   5: {
   6:     extern fin;
   7:     char line[64];
   8: 
   9:     if (argc<2 || ttyn(0)!='x') {
  10:         write(1, "goto error\n", 11);
  11:         seek(0, 0, 2);
  12:         return;
  13:     }
  14:     seek(0, 0, 0);
  15:     fin = dup(0);
  16: 
  17: loop:
  18:     if (getlin(line)) {
  19:         write(1, "label not found\n", 16);
  20:         return;
  21:         }
  22:     if (compar(line, argv[1])) goto loop;
  23:     seek(0, offset, 0);
  24: }
  25: 
  26: getlin(s)
  27: char s[];
  28: {
  29:     int ch, i;
  30: 
  31:     i = 0;
  32: l:
  33:     if ((ch=getc())=='\0') return(1);
  34:     if (ch!=':') {
  35:         while(ch!='\n' && ch!='\0')
  36:             ch = getc();
  37:         goto l;
  38:         }
  39:     while ((ch=getc())==' ');
  40:     while (ch!=' ' && ch!='\n' && ch!='\0') {
  41:         s[i++] = ch;
  42:         ch = getc();
  43:         }
  44:     while(ch != '\n')
  45:         ch = getc();
  46:     s[i] = '\0';
  47:     return(0);
  48: }
  49: 
  50: compar(s1, s2)
  51: char s1[], s2[];
  52: {
  53:     int c, i;
  54: 
  55:     i = 0;
  56: l:
  57:     if(s1[i] != s2[i]) return(1);
  58:     if (s1[i++] == '\0') return(0);
  59:     goto l;
  60: }
  61: 
  62: getc()
  63: {
  64: 
  65:     offset++;
  66:     return(getchar());
  67: }

Defined functions

compar defined in line 50; used 1 times
  • in line 22
getc defined in line 62; used 30 times
getlin defined in line 26; used 1 times
  • in line 18
main defined in line 3; never used

Defined variables

offset defined in line 1; used 2 times
Last modified: 1975-05-14
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 769
Valid CSS Valid XHTML 1.0 Strict