char *vis(char *dst, char c, int flag, char nextc);
char *nvis(char *dst, size_t dlen, int c, int flag, int nextc);
int strvis(char *dst, const char *src, int flag);
int stravis(char **dst, const char *src, int flag);
int strnvis(char *dst, size_t dlen, const char *src, int flag);
int strvisx(char *dst, const char *src, size_t len, int flag);
int strnvisx(char *dst, size_t dlen, const char *src, size_t len, int flag);
int strenvisx(char *dst, size_t dlen, const char *src, size_t len, int flag, int *cerr_ptr);
char *svis(char *dst, int c, int flag, int nextc, const char *extra);
char *snvis(char *dst, size_t dlen, int c, int flag, int nextc, const char *extra);
int strsvis(char *dst, const char *src, int flag, const char *extra);
int strsnvis(char *dst, size_t dlen, const char *src, int flag, const char *extra);
int strsvisx(char *dst, const char *src, size_t len, int flag, const char *extra);
int strsnvisx(char *dst, size_t dlen, const char *src, size_t len, int flag, const char *extra);
int strsenvisx(char *dst, size_t dlen, const char *src, size_t len, int flag, const char *extra, int *cerr_ptr);
There are two parameters that can be controlled: the range of characters
that are encoded (applies only to vis(), nvis(), strvis(), strnvis(),
strvisx(), and strnvisx()), and the type of representation used. By
default, all non-graphic characters, except space, tab, and newline are
Also encode the magic characters ('*', '?', '[' and '#') recognized by
Also encode space.
Also encode tab.
Also encode newline.
Synonym for VIS_SP | VIS_TAB | VIS_NL.
Only encode "unsafe" characters. Unsafe means control characters which may cause common terminals to perform unexpected functions. Currently this form allows space, tab, newline, backspace, bell, and return - in addition to all graphic characters - unencoded.
(The above flags have no effect for
There are four forms of encoding. All forms use the backslash character '\' to introduce a special sequence; two backslashes are used to repre- sent a real backslash, except VIS_HTTPSTYLE that uses '%', or VIS_MIMESTYLE that uses '='. These are the visual formats:
Use an 'M' to represent meta characters (characters with the 8th bit set), and use carat '^' to represent control characters (see
iscntrl()). The following formats are used:
Represents the control character 'C'. Spans characters '\000' through '\037', and '\177' (as '\^?').
Represents character 'C' with the 8th bit set. Spans characters '\241' through '\376'.
Represents control character 'C' with the 8th bit set. Spans characters '\200' through '\237', and '\377' (as '\M^?')
Represents ASCII space.
Use C-style backslash sequences to represent standard non-printable characters. The following sequences are used to represent the indicated characters:
\a BEL (007) \b BS (010) \f NP (014) \n NL (012) \r CR (015) \s SP (040) \t HT (011) \v VT (013) \0 NUL (000)
When using this format, the nextc parameter is looked at to determine if a null character chan be encoded as '\0' instead of '\000'. If nextc is an octal digit, the latter representation is used to avoid ambiguity.
Use a three digit octal sequence. The form is '\ddd' where d represents an octal digit.
Use URI encoding as described in RFC 1738. The form is '%xx' where x represents a lower case hexadecimal digit.
Use MIME Quoted-Printable encoding as described in RFC 2045, only don't break lines and don't handle CRLF. The form is '=XX' where X represents an upper case hexadecimal digit.
There is one additional flag, VIS_NOSLASH, which inhibits the doubling of backslashes and the backslash before the default format (that is, control characters are represented by '^C' and meta characters as 'M-C'). With this flag set, the encoding is ambiguous and non-invertible.
These functions support multibyte character input. The encoding conversion is influenced by the setting of the LC_CTYPE environment variable which defines the set of characters that can be copied without encoding.
When 8-bit data is present in the input, LC_CTYPE must be set to the cor- rect locale or to the C locale. If the locales of the data and the con- version are mismatched, multibyte character recognition may fail and encoding will be performed byte-by-byte instead.
As noted above, dst must be four times the number of bytes processed from src. But note that each multibyte character can be up to MB_LEN_MAX bytes so in terms of multibyte characters, dst must be four times MB_LEN_MAX times the number of characters processed from src.`
Is the buffer into which the result of the encoding is stored.
Size in characters of dst buffer.
Is the character to encode.
Is one or more of the flags listed in the DESCRIPTION section, bitwise-OR'd together.
Is the next character in the sequence, for use with VIS_CSTYLE is specified in flag.
Is the source string to be encoded.
Is the exact number of characters to be encoded.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.3 Documentation Build 39.