Commit | Line | Data |
---|---|---|
e7334347 MT |
1 | /*- |
2 | * Copyright (c) 1990 The Regents of the University of California. | |
f8b55f57 MT |
3 | * All rights reserved. |
4 | * | |
e7334347 | 5 | * %sccs.include.redist.c% |
f8b55f57 | 6 | * |
1096ea13 | 7 | * @(#)vis.h 5.10 (Berkeley) %G% |
f8b55f57 | 8 | */ |
f8b55f57 | 9 | |
b890cc7a KB |
10 | #ifndef _VIS_H_ |
11 | #define _VIS_H_ | |
12 | ||
f8b55f57 | 13 | /* |
11ac2e1d MT |
14 | * to select alternate encoding format |
15 | */ | |
16 | #define VIS_OCTAL 0x01 /* use octal \ddd format */ | |
e7334347 MT |
17 | #define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropiate */ |
18 | ||
11ac2e1d | 19 | /* |
e7334347 MT |
20 | * to alter set of characters encoded (default is to encode all |
21 | * non-graphic except space, tab, and newline). | |
11ac2e1d | 22 | */ |
e7334347 MT |
23 | #define VIS_SP 0x04 /* also encode space */ |
24 | #define VIS_TAB 0x08 /* also encode tab */ | |
25 | #define VIS_NL 0x10 /* also encode newline */ | |
26 | #define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL) | |
27 | #define VIS_SAFE 0x20 /* only encode "unsafe" characters */ | |
28 | ||
11ac2e1d MT |
29 | /* |
30 | * other | |
f8b55f57 | 31 | */ |
e7334347 | 32 | #define VIS_NOSLASH 0x40 /* inhibit printing '\' */ |
f8b55f57 MT |
33 | |
34 | /* | |
e7334347 | 35 | * unvis return codes |
f8b55f57 | 36 | */ |
e7334347 MT |
37 | #define UNVIS_VALID 1 /* character valid */ |
38 | #define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */ | |
39 | #define UNVIS_NOCHAR 3 /* valid sequence, no character produced */ | |
40 | #define UNVIS_SYNBAD -1 /* unrecognized escape sequence */ | |
41 | #define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */ | |
11ac2e1d MT |
42 | |
43 | /* | |
e7334347 | 44 | * unvis flags |
11ac2e1d | 45 | */ |
e7334347 MT |
46 | #define UNVIS_END 1 /* no more characters */ |
47 | ||
9992a62a KB |
48 | #include <sys/cdefs.h> |
49 | ||
50 | __BEGIN_DECLS | |
1096ea13 | 51 | char *vis __P((char *, int, int, int)); |
9992a62a KB |
52 | int strvis __P((char *, const char *, int)); |
53 | int strvisx __P((char *, const char *, size_t, int)); | |
993000f1 | 54 | int strunvis __P((char *, const char *)); |
1096ea13 | 55 | int unvis __P((char *, int, int *, int)); |
9992a62a | 56 | __END_DECLS |
b890cc7a KB |
57 | |
58 | #endif /* !_VIS_H_ */ |