xref: /csrg-svn/include/vis.h (revision 41753)
139285Smarc /*
239285Smarc  * Copyright (c) 1989 The Regents of the University of California.
339285Smarc  * All rights reserved.
439285Smarc  *
539285Smarc  * Redistribution and use in source and binary forms are permitted
639285Smarc  * provided that the above copyright notice and this paragraph are
739285Smarc  * duplicated in all such forms and that any documentation,
839285Smarc  * advertising materials, and other materials related to such
939285Smarc  * distribution and use acknowledge that the software was developed
1039285Smarc  * by the University of California, Berkeley.  The name of the
1139285Smarc  * University may not be used to endorse or promote products derived
1239285Smarc  * from this software without specific prior written permission.
1339285Smarc  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
1439285Smarc  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
1539285Smarc  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
1639285Smarc  *
17*41753Smarc  *	@(#)vis.h	5.2 (Berkeley) 05/11/90
1839285Smarc  */
1939285Smarc 
20*41753Smarc 
2139285Smarc /*
22*41753Smarc  * vis flags
2339285Smarc  */
2439285Smarc 
2539285Smarc /*
26*41753Smarc  * to select alternate encoding format
2739285Smarc  */
28*41753Smarc #define	VIS_OCTAL	0x01	/* use octal \ddd format */
29*41753Smarc #define	VIS_CSTYLE	0x02	/* use \[nrft...] where appropiate */
30*41753Smarc /*
31*41753Smarc  * to alter set of characters encoded
32*41753Smarc  * (default is to encode all non-graphic except space, tab, and newline)
33*41753Smarc  */
34*41753Smarc #define	VIS_TAB		0x04	/* also encode tab */
35*41753Smarc #define	VIS_WHITE	0x08	/* also encode space, tab, and newline */
36*41753Smarc #define	VIS_SAFE	0x10	/* only encode "unsafe" characters */
37*41753Smarc /*
38*41753Smarc  * other
39*41753Smarc  */
40*41753Smarc #define	VIS_NOSLASH	0x20	/* inhibit printing '\' */
41*41753Smarc #define	VIS_NEXTC	0x40	/* nextc character is valid */
4239285Smarc 
43*41753Smarc extern char *cvis();
44*41753Smarc 
4539285Smarc /*
46*41753Smarc  * unvis flags
4739285Smarc  */
4839285Smarc 
49*41753Smarc #define	UNVIS_HAT	0x01	/* treat ^ as special */
50*41753Smarc #define	UNVIS_END	0x02	/* reset decode machine */
51*41753Smarc 
52*41753Smarc /*
53*41753Smarc  * return codes
54*41753Smarc  */
55*41753Smarc #define	UNVIS_NEEDMORE	0	/* not done, feed another char */
56*41753Smarc #define	UNVIS_OK		1	/* done, character ready */
57*41753Smarc #define	UNVIS_OKPUSH	2	/* done, push back passed char */
58*41753Smarc #define	UNVIS_NOCHAR	3	/* done, no character ready (hidden newline) */
59*41753Smarc #define	UNVIS_SYNBAD	-1	/* unrecognized escape sequence */
60