73 #define STR(x) vstring_str(x)
74 #define LEN(x) VSTRING_LEN(x)
84 for (cp = unquoted; (ch = *(
unsigned const char *) cp) != 0; cp++) {
85 if (ch !=
'+' && ch > 32 && ch < 127
86 && (*special == 0 || strchr(special, ch) == 0)) {
109 const unsigned char *cp;
112 for (cp = (
const unsigned char *) quoted; (ch = *cp) != 0; cp++) {
115 ch = (cp[1] -
'0') << 4;
116 else if (cp[1] >=
'a' && cp[1] <=
'f')
117 ch = (cp[1] -
'a' + 10) << 4;
118 else if (cp[1] >=
'A' && cp[1] <=
'F')
119 ch = (cp[1] -
'A' + 10) << 4;
124 else if (cp[2] >=
'a' && cp[2] <=
'f')
125 ch |= (cp[2] -
'a' + 10);
126 else if (cp[2] >=
'A' && cp[2] <=
'F')
127 ch |= (cp[2] -
'A' + 10);
165 int main(
int unused_argc,
char **unused_argv)
175 msg_warn(
"undetected error pattern 1");
177 msg_warn(
"undetected error pattern 2");
182 while ((len = read_buf(
VSTREAM_IN, unquoted)) > 0) {
186 if (
LEN(unquoted) != len)
188 (
long) len, (
long)
LEN(unquoted));
VSTRING * xtext_quote_append(VSTRING *quoted, const char *unquoted, const char *special)
int main(int argc, char **argv)
#define VSTRING_TERMINATE(vp)
#define VSTRING_ADDCH(vp, ch)
VSTRING * vstring_sprintf_append(VSTRING *vp, const char *format,...)
#define VSTRING_RESET(vp)
void msg_warn(const char *fmt,...)
VSTRING * vstring_alloc(ssize_t len)
#define vstring_avail(vp)
NORETURN msg_fatal(const char *fmt,...)
#define vstream_fread(v, b, n)
int vstream_fflush(VSTREAM *stream)
VSTRING * xtext_unquote(VSTRING *unquoted, const char *quoted)
#define vstream_fwrite(v, b, n)
VSTRING * vstring_free(VSTRING *vp)
#define VSTRING_AT_OFFSET(vp, offset)
VSTRING * xtext_quote(VSTRING *quoted, const char *unquoted, const char *special)
VSTRING * xtext_unquote_append(VSTRING *unquoted, const char *quoted)