DBT.data is unsigned
[unix-history] / usr / src / include / vis.h
CommitLineData
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 *
ddb32bf4 7 * @(#)vis.h 5.8 (Berkeley) %G%
f8b55f57 8 */
f8b55f57
MT
9
10/*
11ac2e1d
MT
11 * to select alternate encoding format
12 */
13#define VIS_OCTAL 0x01 /* use octal \ddd format */
e7334347
MT
14#define VIS_CSTYLE 0x02 /* use \[nrft0..] where appropiate */
15
11ac2e1d 16/*
e7334347
MT
17 * to alter set of characters encoded (default is to encode all
18 * non-graphic except space, tab, and newline).
11ac2e1d 19 */
e7334347
MT
20#define VIS_SP 0x04 /* also encode space */
21#define VIS_TAB 0x08 /* also encode tab */
22#define VIS_NL 0x10 /* also encode newline */
23#define VIS_WHITE (VIS_SP | VIS_TAB | VIS_NL)
24#define VIS_SAFE 0x20 /* only encode "unsafe" characters */
25
11ac2e1d
MT
26/*
27 * other
f8b55f57 28 */
e7334347 29#define VIS_NOSLASH 0x40 /* inhibit printing '\' */
f8b55f57
MT
30
31/*
e7334347 32 * unvis return codes
f8b55f57 33 */
e7334347
MT
34#define UNVIS_VALID 1 /* character valid */
35#define UNVIS_VALIDPUSH 2 /* character valid, push back passed char */
36#define UNVIS_NOCHAR 3 /* valid sequence, no character produced */
37#define UNVIS_SYNBAD -1 /* unrecognized escape sequence */
38#define UNVIS_ERROR -2 /* decoder in unknown state (unrecoverable) */
11ac2e1d
MT
39
40/*
e7334347 41 * unvis flags
11ac2e1d 42 */
e7334347
MT
43#define UNVIS_END 1 /* no more characters */
44
9992a62a
KB
45#include <sys/cdefs.h>
46
47__BEGIN_DECLS
b51acce2 48char *vis __P((char *, char, int, char));
9992a62a
KB
49int strvis __P((char *, const char *, int));
50int strvisx __P((char *, const char *, size_t, int));
993000f1 51int strunvis __P((char *, const char *));
ddb32bf4 52int unvis __P((char *, char, int *, int));
9992a62a 53__END_DECLS