* xmlCreateEnumeration: * @name: the enumeration name or NULL * * create and initialize an enumeration attribute node. * * Returns the xmlEnumerationPtr just created or NULL in case * of error. */
| 1482 | * of error. |
| 1483 | */ |
| 1484 | xmlEnumerationPtr |
| 1485 | xmlCreateEnumeration(const xmlChar *name) { |
| 1486 | xmlEnumerationPtr ret; |
| 1487 | |
| 1488 | ret = (xmlEnumerationPtr) xmlMalloc(sizeof(xmlEnumeration)); |
| 1489 | if (ret == NULL) |
| 1490 | return(NULL); |
| 1491 | memset(ret, 0, sizeof(xmlEnumeration)); |
| 1492 | |
| 1493 | if (name != NULL) { |
| 1494 | ret->name = xmlStrdup(name); |
| 1495 | if (ret->name == NULL) { |
| 1496 | xmlFree(ret); |
| 1497 | return(NULL); |
| 1498 | } |
| 1499 | } |
| 1500 | |
| 1501 | return(ret); |
| 1502 | } |
| 1503 | |
| 1504 | /** |
| 1505 | * xmlFreeEnumeration: |
no test coverage detected