Manual Reference Pages - CSTRC (l)
cstrc, cstrd - convert between ANSI C-strings and strings
# include <begemot.h>
char * cstrc(char **pstr, char delim, size_t
char * cstrd(const char *str, char delim, size_t
cstrc function converts a string as specified in the ANSI C-standard to the usual internal
representation. All escape sequences are (hopefully) recognized. Setting
cstrwarn to any non-zero value enables some warning messages, which are emitted via
Pstr is the address of a pointer to the string to be parsed.
Delim is the character at which the parsing should stop. It should be
a single or a double quote character. Parsing stops also if a NUL character
is found. *
pstr is left pointing to the terminating character. At entry to the function *
pstr should point behind the initial delimiter.
plen will hold the number of bytes in the output string. The string
will be NUL termninated, but note, that it may contain embedded NULs.
Cstrd prints a string with non-printable characters converted to escape sequences.
delim is escaped in the output string (usually #146; or ").
The user is responsible the deallocate the memory returned by
cstrd. Both functions call
and therefor end in
if not enough memory is available.
Both functions return allocated memory that must be freed by the caller. They may
never return NULL.
|BEGEMOT ||CSTRC (l) ||9 Oct 1996 |
Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.