view ueda/uschem-print/pstring.c @ 102:921018d84161

SIM_Socket_473882001.fp: M1&M2 pads moved to pin numbers 4 & 8
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 30 Sep 2019 02:21:41 +0000
parents cd92449fdb51
children
line wrap: on
line source

/*
 * Emitting PostScript strings, handling all special characters
 */

#include <ctype.h>

emit_ps_string(str)
	char *str;
{
	register char *cp;
	register int c;

	putchar('(');
	for (cp = str; c = *cp; cp++) {
		if (!isprint(c)) {
			printf("\\%03o", c);
			continue;
		}
		if (c == '(' || c == ')' || c == '\\')
			putchar('\\');
		putchar(c);
	}
	putchar(')');
}