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

Function acl_xml_decode

lib_acl/src/code/acl_xmlcode.c:157–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157int acl_xml_decode(const char *in, ACL_VSTRING *out)
158{
159 int n = 0, len = (int) strlen(in);
160 const char *ptr = in, *pre;
161 const ACL_TOKEN *token;
162 const XML_SPEC *spec;
163
164 ACL_VSTRING_SPACE(out, len);
165
166 acl_pthread_once(&__token_once, xml_decode_init);
167 if (__token_tree == NULL)
168 acl_msg_fatal("__token_tree null");
169
170 while (*ptr != 0) {
171 pre = ptr;
172 token = acl_token_tree_match(__token_tree, &ptr, NULL, NULL);
173 if (token == NULL) {
174 pre = markup_unescape(pre, out);
175 len = (int) (ptr - pre);
176 if (len > 0)
177 acl_vstring_memcat(out, pre, len);
178 break;
179 }
180
181 spec = (const XML_SPEC*) token->ctx;
182 acl_assert(spec != NULL);
183
184 len = (int) (ptr - pre - spec->len);
185 if (len > 0)
186 acl_vstring_memcat(out, pre, len);
187 acl_vstring_strcat(out, spec->str);
188 n++;
189 }
190
191 ACL_VSTRING_TERMINATE(out);
192 return n;
193}
194
195/*--------------------------------------------------------------------------*/
196

Callers 9

mainFunction · 0.85
mainFunction · 0.85
xml_meta_attr_valueFunction · 0.85
xml_parse_meta_textFunction · 0.85
xml_parse_meta_commentFunction · 0.85
xml_parse_attr_valFunction · 0.85
xml_parse_textFunction · 0.85
xml_parse_attr_valFunction · 0.85
xml_parse_textFunction · 0.85

Calls 6

acl_pthread_onceFunction · 0.85
acl_msg_fatalFunction · 0.85
acl_token_tree_matchFunction · 0.85
acl_vstring_memcatFunction · 0.85
acl_vstring_strcatFunction · 0.85
markup_unescapeFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…