/*
 * 5799-WZQ (C) COPYRIGHT = NONE
 * LICENSED MATERIALS - PROPERTY OF IBM
 */
/* $Header:allprint.c 12.0$ */
/* $ACIS:allprint.c 12.0$ */
/* $Source: /ibm/acis/usr/src/usr.lib/libln/RCS/allprint.c,v $ */

#ifndef lint
static char *rcsid = "$Header:allprint.c 12.0$";
#endif

/*	@(#)allprint.c	4.1	12/25/82	*/

# include <stdio.h>
allprint(c)
  char c; {
	extern FILE *yyout;
	switch(c){
		case '\n':
			fprintf(yyout,"\\n");
			break;
		case '\t':
			fprintf(yyout,"\\t");
			break;
		case '\b':
			fprintf(yyout,"\\b");
			break;
		case ' ':
			fprintf(yyout,"\\\bb");
			break;
		default:
			if(!printable(c))
				fprintf(yyout,"\\%-3o",c);
			else 
				putc(c,yyout);
			break;
		}
	return;
	}
sprint(s)
  char *s; {
	while(*s)
		allprint(*s++);
	return;
	}
printable(c)
  int c;
	{
	return(040 < c && c < 0177);
	}
