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

Function xml_parse_meta_text

lib_acl/src/xml/acl_xml2_parse.c:350–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

348}
349
350static const char *xml_parse_meta_text(ACL_XML2 *xml, const char *data)
351{
352 int ch;
353
354 if (xml->curr_node->text == xml->dummy)
355 SKIP_SPACE(data);
356
357 if (*data == 0)
358 return data;
359
360 if (xml->curr_node->text == xml->dummy)
361 xml->curr_node->text = END(xml);
362
363 while ((ch = *data) != 0) {
364 if (xml->curr_node->quote) {
365 if (NO_SPACE(xml))
366 return data;
367 if (ch == xml->curr_node->quote)
368 xml->curr_node->quote = 0;
369 ADD(xml, ch);
370 } else if (IS_QUOTE(ch)) {
371 if (NO_SPACE(xml))
372 return data;
373 if (xml->curr_node->quote == 0)
374 xml->curr_node->quote = ch;
375 ADD(xml, ch);
376 } else if (ch == '<') {
377 if (NO_SPACE(xml))
378 return data;
379 xml->curr_node->nlt++;
380 ADD(xml, ch);
381 } else if (ch != '>') {
382 if (NO_SPACE(xml))
383 return data;
384 ADD(xml, ch);
385 } else if (xml->curr_node->nlt == 0) {
386 char *last;
387
388 if (NO_SPACE(xml))
389 return data;
390
391 xml->curr_node->text_size = (ssize_t)
392 (END(xml) - xml->curr_node->text);
393 xml->curr_node->status = ACL_XML2_S_MEND;
394
395 ADD(xml, '\0');
396 data++;
397
398 if ((xml->curr_node->flag & ACL_XML2_F_META_QM) == 0)
399 break;
400
401 last = END(xml) - 1;
402 while (last > xml->curr_node->text) {
403 if (*last == '?') {
404 *last = 0;
405 xml->curr_node->text_size = (ssize_t)
406 (last - xml->curr_node->text);
407 break;

Callers

nothing calls this directly

Calls 2

acl_xml_decodeFunction · 0.85
xml_meta_attrFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…