1: /*	@(#)tabify.c	2.1	SCCS id keyword	*/
   2: # include   <stdio.h>
   3: 
   4: # define    reg register
   5: 
   6: tabify(cp)
   7: reg char    *cp; {
   8: 
   9:     reg int     dcol, ocol;
  10: 
  11:     ocol = 0;
  12:     dcol = 0;
  13:     for (;;) {
  14:         switch (*cp) {
  15:           case ' ':
  16:             dcol++;
  17:             break;
  18:           case '\t':
  19:             dcol =+ 8;
  20:             dcol =& ~07;
  21:             break;
  22:           default:
  23:             while (((ocol + 8) &~ 07) <= dcol) {
  24:                 if (ocol + 1 == dcol)
  25:                     break;
  26:                 putchar('\t');
  27:                 ocol =+ 8;
  28:                 ocol =& ~07;
  29:             }
  30:             while (ocol < dcol) {
  31:                 putchar(' ');
  32:                 ocol++;
  33:             }
  34:             putchar(*cp);
  35:             ocol++;
  36:             dcol++;
  37:             break;
  38:           case '\0':
  39:             putchar('\n');
  40:             return;
  41:         }
  42:         cp++;
  43:     }
  44: }

Defined functions

tabify defined in line 6; never used

Defined macros

reg defined in line 4; used 2 times
  • in line 7-9(2)
Last modified: 1981-07-10
Generated: 2016-12-26
Generated by src2html V0.67
page hit count: 325
Valid CSS Valid XHTML 1.0 Strict