MCPcopy Create free account
hub / github.com/acl-dev/acl / tok822_internalize

Function tok822_internalize

lib_acl_cpp/src/mime/internal/tok822_parse.cpp:202–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200/* tok822_internalize - token tree to string, internal form */
201
202ACL_VSTRING *tok822_internalize(ACL_VSTRING *vp, TOK822 *tree, int flags)
203{
204 TOK822 *tp;
205
206 if (flags & TOK822_STR_WIPE)
207 ACL_VSTRING_RESET(vp);
208
209 for (tp = tree; tp; tp = tp->next) {
210 switch (tp->type) {
211 case ',':
212 ACL_VSTRING_ADDCH(vp, tp->type);
213 if (flags & TOK822_STR_LINE) {
214 ACL_VSTRING_ADDCH(vp, '\n');
215 continue;
216 }
217 break;
218 case TOK822_ADDR:
219 tok822_internalize(vp, tp->head, TOK822_STR_NONE);
220 break;
221 case TOK822_COMMENT:
222 case TOK822_ATOM:
223 case TOK822_QSTRING:
224 acl_vstring_strcat(vp, acl_vstring_str(tp->vstr));
225 break;
226 case TOK822_DOMLIT:
227 ACL_VSTRING_ADDCH(vp, '[');
228 acl_vstring_strcat(vp, acl_vstring_str(tp->vstr));
229 ACL_VSTRING_ADDCH(vp, ']');
230 break;
231 case TOK822_STARTGRP:
232 ACL_VSTRING_ADDCH(vp, ':');
233 break;
234 default:
235 if (tp->type >= TOK822_MINTOK)
236 acl_msg_panic("tok822_internalize: unknown operator %d", tp->type);
237 ACL_VSTRING_ADDCH(vp, tp->type);
238 }
239 if (tok822_append_space(tp))
240 ACL_VSTRING_ADDCH(vp, ' ');
241 }
242 if (flags & TOK822_STR_TERM)
243 ACL_VSTRING_TERMINATE(vp);
244 return (vp);
245}
246
247/* strip_address - strip non-address text from address expression */
248

Callers 6

rfc822.cppFile · 0.85
mail_rcptFunction · 0.85
mail_fromFunction · 0.85
strip_addressFunction · 0.85
tok822_externalizeFunction · 0.85
mainFunction · 0.85

Calls 3

acl_vstring_strcatFunction · 0.85
acl_msg_panicFunction · 0.85
tok822_append_spaceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…