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

Function xml_parse_meta_comment

lib_acl/src/xml/acl_xml2_parse.c:442–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

440}
441
442static const char *xml_parse_meta_comment(ACL_XML2 *xml, const char *data)
443{
444 int ch;
445
446 if (xml->curr_node->text == xml->dummy)
447 SKIP_SPACE(data);
448
449 if (*data == 0)
450 return data;
451
452 if (xml->curr_node->text == xml->dummy)
453 xml->curr_node->text = END(xml);
454
455 while ((ch = *data) != 0) {
456 if (xml->curr_node->quote) {
457 if (NO_SPACE(xml))
458 return data;
459 if (ch == xml->curr_node->quote)
460 xml->curr_node->quote = 0;
461 else
462 ADD(xml, ch);
463 } else if (IS_QUOTE(ch)) {
464 if (NO_SPACE(xml))
465 return data;
466 if (xml->curr_node->quote == 0)
467 xml->curr_node->quote = ch;
468 else
469 ADD(xml, ch);
470 } else if (ch == '<') {
471 if (NO_SPACE(xml))
472 return data;
473 xml->curr_node->nlt++;
474 ADD(xml, ch);
475 } else if (ch == '>') {
476 if (xml->curr_node->nlt == 0
477 && xml->curr_node->meta[0] == '-'
478 && xml->curr_node->meta[1] == '-')
479 {
480 if (NO_SPACE(xml))
481 return data;
482
483 data++;
484 xml->curr_node->text_size = (ssize_t)
485 (END(xml) - xml->curr_node->text);
486 ADD(xml, '\0');
487 xml->curr_node->status = ACL_XML2_S_MEND;
488 break;
489 }
490
491 xml->curr_node->nlt--;
492
493 if (NO_SPACE(xml))
494 return data;
495 ADD(xml, ch);
496 } else if (xml->curr_node->nlt > 0) {
497 if (NO_SPACE(xml))
498 return data;
499 ADD(xml, ch);

Callers

nothing calls this directly

Calls 1

acl_xml_decodeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…