Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/feature_posix/sys/src/liblex/allprint.c – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#include	"/sys/src/cmd/lex/ldefs.h"
2
#include	<stdio.h>
3
 
4
extern	FILE*	yyout;
5
 
6
int
7
printable(int c)
8
{
9
	return 040 < c && c < 0177;
10
}
11
 
12
void
13
allprint(int c)
14
{
15
 
16
	switch(c) {
17
	case '\n':
18
		fprintf(yyout,"\\n");
19
		break;
20
	case '\t':
21
		fprintf(yyout,"\\t");
22
		break;
23
	case '\b':
24
		fprintf(yyout,"\\b");
25
		break;
26
	case ' ':
27
		fprintf(yyout,"\\\bb");
28
		break;
29
	default:
30
		if(!printable(c))
31
			fprintf(yyout,"\\%-3o",c);
32
		else 
33
			c = putc(c,yyout);
34
			USED(c);
35
		break;
36
	}
37
	return;
38
}