* xmlHashUpdateEntry: * @hash: hash table * @key: string key * @payload: pointer to the payload * @dealloc: deallocator function for replaced item or NULL * * Add a hash table entry. If an entry with this key already exists, * the old payload will be freed and updated with the new value. * * Returns 0 in case of success, -1 if a memory allocation failed. */
| 756 | * Returns 0 in case of success, -1 if a memory allocation failed. |
| 757 | */ |
| 758 | int |
| 759 | xmlHashUpdateEntry(xmlHashTablePtr hash, const xmlChar *key, |
| 760 | void *payload, xmlHashDeallocator dealloc) { |
| 761 | int res = xmlHashUpdateInternal(hash, key, NULL, NULL, payload, |
| 762 | dealloc, 1); |
| 763 | |
| 764 | if (res == 1) |
| 765 | res = 0; |
| 766 | |
| 767 | return(res); |
| 768 | } |
| 769 | |
| 770 | /** |
| 771 | * xmlHashUpdateEntry2: |
no test coverage detected