* xmlCopyNotation: * @nota: A notation * * Build a copy of a notation. * * Returns the new xmlNotationPtr or NULL in case of error. */
| 2160 | * Returns the new xmlNotationPtr or NULL in case of error. |
| 2161 | */ |
| 2162 | static void * |
| 2163 | xmlCopyNotation(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 | |
| 2188 | error: |
| 2189 | xmlFreeNotation(cur); |
| 2190 | return(NULL); |
| 2191 | } |
| 2192 | |
| 2193 | /** |
| 2194 | * xmlCopyNotationTable: |
nothing calls this directly
no test coverage detected