comparison ueda/uschem-print/pstring.c @ 0:cd92449fdb51

initial import of ueda and ifctf-part-lib from ifctfvax CVS
author Space Falcon <falcon@ivan.Harhan.ORG>
date Mon, 20 Jul 2015 00:24:37 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cd92449fdb51
1 /*
2 * Emitting PostScript strings, handling all special characters
3 */
4
5 #include <ctype.h>
6
7 emit_ps_string(str)
8 char *str;
9 {
10 register char *cp;
11 register int c;
12
13 putchar('(');
14 for (cp = str; c = *cp; cp++) {
15 if (!isprint(c)) {
16 printf("\\%03o", c);
17 continue;
18 }
19 if (c == '(' || c == ')' || c == '\\')
20 putchar('\\');
21 putchar(c);
22 }
23 putchar(')');
24 }