|
|
1.1 ! root 1: # include <stdio.h> ! 2: # include <sccs.h> ! 3: ! 4: SCCSID(@(#)xputchar.c 8.1 12/31/84) ! 5: ! 6: /* ! 7: ** PUT CHARACTER ! 8: ** ! 9: ** This routine just calls putchar normally, unless the character ! 10: ** to be printed is a control character, in which case the octal ! 11: ** equivalent is printed out. Note that tab, newline, and so ! 12: ** forth are considered to be control characters. ! 13: ** ! 14: ** Parameters: ! 15: ** c -- the character to print. ! 16: ** ! 17: ** Returns: ! 18: ** nothing. ! 19: ** ! 20: ** Side Effects: ! 21: ** none ! 22: ** ! 23: ** Trace Flags: ! 24: ** none ! 25: */ ! 26: ! 27: ! 28: ! 29: xputchar(c) ! 30: register char c; ! 31: { ! 32: if (c < 040 || c >= 0177) ! 33: { ! 34: putc('\\', stdout); ! 35: putc(((c >> 6) & 03) | '0', stdout); ! 36: putc(((c >> 3) & 07) | '0', stdout); ! 37: putc((c & 07) | '0', stdout); ! 38: } ! 39: else ! 40: putc(c, stdout); ! 41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.