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

Function xmlCopyNotation

ThirdParty/libxml2/vtklibxml2/valid.c:2162–2191  ·  view source on GitHub ↗

* xmlCopyNotation: * @nota: A notation * * Build a copy of a notation. * * Returns the new xmlNotationPtr or NULL in case of error. */

Source from the content-addressed store, hash-verified

2160 * Returns the new xmlNotationPtr or NULL in case of error.
2161 */
2162static void *
2163xmlCopyNotation(void *payload, const xmlChar *name ATTRIBUTE_UNUSED) {
2164 xmlNotationPtr nota = (xmlNotationPtr) payload;
2165 xmlNotationPtr cur;
2166
2167 cur = (xmlNotationPtr) xmlMalloc(sizeof(xmlNotation));
2168 if (cur == NULL)
2169 return(NULL);
2170 memset(cur, 0, sizeof(*cur));
2171 if (nota->name != NULL) {
2172 cur->name = xmlStrdup(nota->name);
2173 if (cur->name == NULL)
2174 goto error;
2175 }
2176 if (nota->PublicID != NULL) {
2177 cur->PublicID = xmlStrdup(nota->PublicID);
2178 if (cur->PublicID == NULL)
2179 goto error;
2180 }
2181 if (nota->SystemID != NULL) {
2182 cur->SystemID = xmlStrdup(nota->SystemID);
2183 if (cur->SystemID == NULL)
2184 goto error;
2185 }
2186 return(cur);
2187
2188error:
2189 xmlFreeNotation(cur);
2190 return(NULL);
2191}
2192
2193/**
2194 * xmlCopyNotationTable:

Callers

nothing calls this directly

Calls 2

xmlStrdupFunction · 0.85
xmlFreeNotationFunction · 0.85

Tested by

no test coverage detected