101 #define STR(x) vstring_str(x)
102 #define LEN(x) VSTRING_LEN(x)
103 #define CU_CHAR_PTR(x) ((const unsigned char *) (x))
108 VSTRING *token_buffer,
const char **ptr,
109 const char *user_specials,
int user_terminator)
111 ssize_t comment_level;
112 const unsigned char *cp;
124 if (user_specials == 0)
134 while ((ch = *cp) != 0 && (user_terminator != 0 || tok_count < token_len)) {
146 if (ch == user_terminator)
154 while ((ch = *cp) != 0) {
158 }
else if (ch ==
')') {
159 if (--comment_level == 0)
161 }
else if (ch ==
'\\') {
174 if (tok_count < token_len) {
175 token[tok_count].
u.
offset =
LEN(token_buffer);
178 while ((ch = *cp) != 0) {
183 if (tok_count < token_len) {
184 len =
LEN(token_buffer);
188 if (len <
LEN(token_buffer))
198 if (tok_count < token_len)
201 if (tok_count < token_len) {
211 if (strchr(user_specials, ch) ||
ISCNTRL(ch)) {
212 if (tok_count < token_len) {
213 token[tok_count].
u.
offset =
LEN(token_buffer);
214 token[tok_count].
type = ch;
226 if (tok_count < token_len) {
227 token[tok_count].
u.
offset =
LEN(token_buffer);
232 && !
ISCNTRL(ch) && !strchr(user_specials, ch)) {
234 if (tok_count < token_len)
237 if (tok_count < token_len) {
248 if (tok_count == 0 && ch == 0)
255 *ptr = (
const char *) cp;
256 for (n = 0; n < tok_count; n++)
261 tok_count > 0 ? token[0].u.
value :
"",
262 tok_count > 1 ? token[1].
u.
value :
"",
263 tok_count > 2 ? token[2].
u.
value :
"");
VSTRING * vstring_truncate(VSTRING *vp, ssize_t len)
#define IS_SPACE_TAB_CR_LF(ch)
#define VSTRING_ADDCH(vp, ch)
#define VSTRING_RESET(vp)
void msg_info(const char *fmt,...)