view ueda/uschem-print/pstring.c @ 95:f708e8a99f16

ifctf-part-lib/footprints/TAN-R-59XD.fp: created based on E-Sample and FCDEV3B versions
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 25 Sep 2019 20:13:49 +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(')');
}