MCPcopy Create free account
hub / github.com/Kitware/VTK / htmlCheckMeta

Function htmlCheckMeta

ThirdParty/libxml2/vtklibxml2/HTMLparser.c:3708–3742  ·  view source on GitHub ↗

* htmlCheckMeta: * @ctxt: an HTML parser context * @atts: the attributes values * * Checks an attributes from a Meta tag */

Source from the content-addressed store, hash-verified

3706 * Checks an attributes from a Meta tag
3707 */
3708static void
3709htmlCheckMeta(htmlParserCtxtPtr ctxt, const xmlChar **atts) {
3710 int i;
3711 const xmlChar *att, *value;
3712 int http = 0;
3713 const xmlChar *content = NULL;
3714
3715 if ((ctxt == NULL) || (atts == NULL))
3716 return;
3717
3718 i = 0;
3719 att = atts[i++];
3720 while (att != NULL) {
3721 value = atts[i++];
3722 if (value != NULL) {
3723 if ((!xmlStrcasecmp(att, BAD_CAST "http-equiv")) &&
3724 (!xmlStrcasecmp(value, BAD_CAST "Content-Type"))) {
3725 http = 1;
3726 } else if (!xmlStrcasecmp(att, BAD_CAST "charset")) {
3727 xmlChar *copy;
3728
3729 copy = xmlStrdup(value);
3730 if (copy == NULL)
3731 htmlErrMemory(ctxt);
3732 xmlSetDeclaredEncoding(ctxt, copy);
3733 } else if (!xmlStrcasecmp(att, BAD_CAST "content")) {
3734 content = value;
3735 }
3736 }
3737 att = atts[i++];
3738 }
3739 if ((http) && (content != NULL))
3740 htmlCheckEncoding(ctxt, content);
3741
3742}
3743
3744/**
3745 * htmlParseStartTag:

Callers 1

htmlParseStartTagFunction · 0.85

Calls 5

xmlStrcasecmpFunction · 0.85
xmlStrdupFunction · 0.85
htmlErrMemoryFunction · 0.85
xmlSetDeclaredEncodingFunction · 0.85
htmlCheckEncodingFunction · 0.85

Tested by

no test coverage detected