* xmlNewEntityRef: * @doc: the target document (optional) * @name: the entity name * * Create an empty entity reference node. This function doesn't attempt * to look up the entity in @doc. * * @name is consumed. * * Returns a pointer to the new node object or NULL if arguments are * invalid or a memory allocation failed. */
| 2394 | * invalid or a memory allocation failed. |
| 2395 | */ |
| 2396 | static xmlNodePtr |
| 2397 | xmlNewEntityRef(xmlDocPtr doc, xmlChar *name) { |
| 2398 | xmlNodePtr cur; |
| 2399 | |
| 2400 | /* |
| 2401 | * Allocate a new node and fill the fields. |
| 2402 | */ |
| 2403 | cur = (xmlNodePtr) xmlMalloc(sizeof(xmlNode)); |
| 2404 | if (cur == NULL) { |
| 2405 | xmlFree(name); |
| 2406 | return(NULL); |
| 2407 | } |
| 2408 | memset(cur, 0, sizeof(xmlNode)); |
| 2409 | cur->type = XML_ENTITY_REF_NODE; |
| 2410 | cur->doc = doc; |
| 2411 | cur->name = name; |
| 2412 | |
| 2413 | if ((__xmlRegisterCallbacks) && (xmlRegisterNodeDefaultValue)) |
| 2414 | xmlRegisterNodeDefaultValue(cur); |
| 2415 | |
| 2416 | return(cur); |
| 2417 | } |
| 2418 | |
| 2419 | /** |
| 2420 | * xmlNewCharRef: |
no outgoing calls
no test coverage detected