|
ReactOS 0.4.16-dev-2208-g6350669
|
#include "libxml.h"#include <string.h>#include <limits.h>#include <libxml/parser.h>#include <libxml/hash.h>#include <libxml/dict.h>#include <libxml/xmlmemory.h>#include <libxml/xmlstring.h>#include "private/dict.h"
Go to the source code of this file.
Classes | |
| struct | xmlHashEntry |
| struct | _xmlHashTable |
| struct | stubData |
Macros | |
| #define | IN_LIBXML |
| #define | SIZE_MAX ((size_t) -1) |
| #define | MAX_FILL_NUM 7 |
| #define | MAX_FILL_DENOM 8 |
| #define | MIN_HASH_SIZE 8 |
| #define | MAX_HASH_SIZE (1u << 31) |
|
static |
Definition at line 882 of file hash.c.
Referenced by xmlHashScan(), and xmlHashScan3().
xmlFastStrEqual: @s1: string @s2: string
Compare two strings for equality, allowing NULL values.
Definition at line 269 of file hash.c.
Referenced by xmlHashFindEntry(), and xmlHashScanFull3().
| int xmlHashAddEntry | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| void * | payload | ||
| ) |
xmlHashAddEntry: @hash: hash table @key: string key @payload: pointer to the payload
Add a hash table entry. If an entry with this key already exists, payload will not be updated and -1 is returned. This return value can't be distinguished from out-of-memory errors, so this function should be used with care.
Returns 0 on success and -1 in case of error.
Definition at line 621 of file hash.c.
Referenced by cache_add_entry(), xmlAddID(), xmlAddNotationDecl(), xmlAddRef(), xsltGetExtData(), xsltInitCtxtExt(), xsltInitCtxtKey(), xsltNamespaceAlias(), xsltRegisterExtModuleFull(), and xsltStyleInitializeStylesheetModule().
| int xmlHashAddEntry2 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| void * | payload | ||
| ) |
xmlHashAddEntry2: @hash: hash table @key: first string key @key2: second string key @payload: pointer to the payload
Add a hash table entry with two strings as key.
See xmlHashAddEntry.
Returns 0 on success and -1 in case of error.
Definition at line 639 of file hash.c.
Referenced by xmlAddElementDecl(), xmlAddSpecialAttr(), xmlGetDtdElementDesc2(), xsltAddTemplate(), xsltDocumentElem(), xsltEvalGlobalVariables(), xsltParseStylesheetAttributeSet(), xsltParseStylesheetOutput(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetStripSpace(), xsltProcessUserParamInternal(), xsltRegisterExtElement(), xsltRegisterExtFunction(), and xsltResolveSASCallback().
| int xmlHashAddEntry3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| const xmlChar * | key3, | ||
| void * | payload | ||
| ) |
xmlHashAddEntry3: @hash: hash table @key: first string key @key2: second string key @key3: third string key @payload: pointer to the payload
Add a hash table entry with three strings as key.
See xmlHashAddEntry.
Returns 0 on success and -1 in case of error.
Definition at line 659 of file hash.c.
Referenced by xmlAddAttributeDecl(), xmlHashCopy(), and xsltAddTemplate().
| xmlHashTablePtr xmlHashCopy | ( | xmlHashTablePtr | hash, |
| xmlHashCopier | copy | ||
| ) |
xmlHashCopy: @hash: hash table @copy: copier function for items in the hash
Copy the hash @table using @copy to copy payloads.
Returns the new table or NULL if a memory allocation failed.
Definition at line 1050 of file hash.c.
| xmlHashTablePtr xmlHashCreate | ( | int | size | ) |
xmlHashCreate: @size: initial size of the hash table
Create a new hash table. Set size to zero if the number of entries can't be estimated.
Returns the newly created object, or NULL if a memory allocation failed.
Definition at line 160 of file hash.c.
Referenced by SchemaCache_create(), xmlHashCopy(), xmlHashCreateDict(), xsltAddTemplate(), xsltApplyStylesheetInternal(), xsltDocumentElem(), xsltGatherNamespaces(), xsltGetExtData(), xsltInitCtxtExt(), xsltNamespaceAlias(), xsltNewKeyTable(), xsltParseStylesheetAttributeSet(), xsltParseStylesheetOutput(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetStripSpace(), xsltProcessUserParamInternal(), xsltRegisterExtElement(), xsltRegisterExtFunction(), xsltRegisterExtModuleElement(), xsltRegisterExtModuleFull(), xsltRegisterExtModuleFunction(), xsltRegisterExtModuleTopLevel(), xsltResolveStylesheetAttributeSet(), and xsltStyleInitializeStylesheetModule().
| xmlHashTablePtr xmlHashCreateDict | ( | int | size, |
| xmlDictPtr | dict | ||
| ) |
xmlHashCreateDict: @size: the size of the hash table @dict: a dictionary to use for the hash
Create a new hash table backed by a dictionary. This can reduce resource usage considerably if most keys passed to API functions originate from this dictionary.
Returns the newly created object, or NULL if a memory allocation failed.
Definition at line 209 of file hash.c.
Referenced by xmlAddAttributeDecl(), xmlAddDefAttrs(), xmlAddElementDecl(), xmlAddID(), xmlAddNotationDecl(), xmlAddRef(), xmlAddSpecialAttr(), and xmlGetDtdElementDesc2().
xmlHashDefaultDeallocator: @entry: hash table entry @key: the entry's string key
Free a hash table entry with xmlFree.
Definition at line 603 of file hash.c.
Referenced by xmlCtxtReset(), and xmlFreeParserCtxt().
|
static |
xmlHashFindEntry: @hash: hash table, non-NULL, size > 0 @key: first string key, non-NULL @key2: second string key @key3: third string key @hashValue: valid hash value of keys @pfound: result of search
Try to find a matching hash table entry. If an entry was found, set @found to 1 and return the entry. Otherwise, set @found to 0 and return the location where a new entry should be inserted.
Definition at line 292 of file hash.c.
Referenced by xmlHashLookup3(), xmlHashRemoveEntry3(), and xmlHashUpdateInternal().
| void xmlHashFree | ( | xmlHashTablePtr | hash, |
| xmlHashDeallocator | dealloc | ||
| ) |
xmlHashFree: @hash: hash table @dealloc: deallocator function or NULL
Free the hash and its contents. The payload is deallocated with @dealloc if provided.
Definition at line 229 of file hash.c.
Referenced by schema_cache_Release(), xmlCleanSpecialAttr(), xmlCtxtReset(), xmlFreeAttributeTable(), xmlFreeElementTable(), xmlFreeIDTable(), xmlFreeNotationTable(), xmlFreeParserCtxt(), xmlFreeRefTable(), xsltCleanupGlobals(), xsltFreeAttributeSetsHashes(), xsltFreeCtxtExts(), xsltFreeGlobalVariables(), xsltFreeKeyTable(), xsltFreeNamespaceAliasHashes(), xsltFreeStylesheet(), xsltFreeTemplateHashes(), xsltResolveStylesheetAttributeSet(), xsltShutdownCtxtExts(), xsltShutdownExts(), xsltUnregisterAllExtModuleElement(), xsltUnregisterAllExtModuleFunction(), xsltUnregisterAllExtModules(), and xsltUnregisterAllExtModuleTopLevel().
|
static |
xmlHashGrow: @hash: hash table @size: new size of the hash table
Resize the hash table.
Returns 0 in case of success, -1 if a memory allocation failed.
Definition at line 354 of file hash.c.
Referenced by xmlHashCreate(), and xmlHashUpdateInternal().
| void * xmlHashLookup | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key | ||
| ) |
xmlHashLookup: @hash: hash table @key: string key
Find the entry specified by @key.
Returns a pointer to the payload or NULL if no entry was found.
Definition at line 739 of file hash.c.
Referenced by cache_copy(), get_entry(), lookup_schema_elemDecl(), schema_cache_get(), xmlAddRef(), xmlGetDtdNotationDesc(), xmlGetID(), xmlGetRefs(), xmlRemoveID(), xmlRemoveRef(), xsltApplySequenceConstructor(), xsltCheckInstructionElement(), xsltCheckParentElement(), xsltCopyNamespaceList(), xsltGatherNamespaces(), xsltGetExtData(), xsltGetExtInfo(), xsltGetKey(), xsltGetNamespace(), xsltInitCtxtExt(), xsltInitCtxtKey(), xsltRegisterExtModuleFull(), xsltRegisterExtPrefix(), xsltStyleGetExtData(), and xsltStyleInitializeStylesheetModule().
xmlHashLookup2: @hash: hash table @key: first string key @key2: second string key
Find the payload specified by the (@key, @key2) tuple.
Returns a pointer to the payload or NULL if no entry was found.
Definition at line 754 of file hash.c.
Referenced by xmlAddDefAttrs(), xmlAddElementDecl(), xmlAddSpecialAttr(), xmlGetDtdElementDesc(), xmlGetDtdElementDesc2(), xmlGetDtdQElementDesc(), xmlParseStartTag2(), xsltAddTemplate(), xsltApplyAttributeSet(), xsltCopyText(), xsltCopyTextString(), xsltEvalGlobalVariables(), xsltExtElementLookup(), xsltExtModuleElementLookup(), xsltExtModuleElementPreComputeLookup(), xsltExtModuleFunctionLookup(), xsltExtModuleTopLevelLookup(), xsltFindElemSpaceHandling(), xsltFindTemplate(), xsltGlobalVariableLookup(), xsltParseStylesheetAttributeSet(), xsltPreComputeExtModuleElement(), xsltProcessUserParamInternal(), xsltResolveAttrSet(), xsltResolveUseAttrSets(), and xsltXPathFunctionLookup().
| void * xmlHashLookup3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| const xmlChar * | key3 | ||
| ) |
xmlHashLookup3: @hash: hash table @key: first string key @key2: second string key @key3: third string key
Find the payload specified by the (@key, @key2, @key3) tuple.
Returns a pointer to the payload or NULL if no entry was found.
Definition at line 806 of file hash.c.
Referenced by xmlAddAttributeDecl(), xmlGetDtdAttrDesc(), xmlGetDtdQAttrDesc(), xmlHashLookup(), xmlHashLookup2(), xsltAddTemplate(), and xsltGetTemplate().
Definition at line 770 of file hash.c.
| void * xmlHashQLookup2 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | prefix, | ||
| const xmlChar * | name, | ||
| const xmlChar * | prefix2, | ||
| const xmlChar * | name2 | ||
| ) |
| ATTRIBUTE_NO_SANITIZE_INTEGER void * xmlHashQLookup3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | prefix, | ||
| const xmlChar * | name, | ||
| const xmlChar * | prefix2, | ||
| const xmlChar * | name2, | ||
| const xmlChar * | prefix3, | ||
| const xmlChar * | name3 | ||
| ) |
Definition at line 837 of file hash.c.
Referenced by xmlHashQLookup(), and xmlHashQLookup2().
|
static |
Definition at line 101 of file hash.c.
Referenced by xmlHashQLookup3().
| int xmlHashRemoveEntry | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| xmlHashDeallocator | dealloc | ||
| ) |
xmlHashRemoveEntry: @hash: hash table @key: string key @dealloc: deallocator function for removed item or NULL
Find the entry specified by the @key and remove it from the hash table. Payload will be freed with @dealloc.
Returns 0 on success and -1 if no entry was found.
Definition at line 1102 of file hash.c.
Referenced by cache_add_entry(), cache_remove_entry(), xmlRemoveID(), and xsltUnregisterExtModule().
| int xmlHashRemoveEntry2 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| xmlHashDeallocator | dealloc | ||
| ) |
xmlHashRemoveEntry2: @hash: hash table @key: first string key @key2: second string key @dealloc: deallocator function for removed item or NULL
Remove an entry with two strings as key.
See xmlHashRemoveEntry.
Returns 0 on success and -1 in case of error.
Definition at line 1121 of file hash.c.
Referenced by xmlAddElementDecl(), xmlCleanSpecialAttrCallback(), xsltResolveAttrSet(), xsltUnregisterExtModuleElement(), xsltUnregisterExtModuleFunction(), and xsltUnregisterExtModuleTopLevel().
| ATTRIBUTE_NO_SANITIZE_INTEGER int xmlHashRemoveEntry3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| const xmlChar * | key3, | ||
| xmlHashDeallocator | dealloc | ||
| ) |
xmlHashRemoveEntry3: @hash: hash table @key: first string key @key2: second string key @key3: third string key @dealloc: deallocator function for removed item or NULL
Remove an entry with three strings as key.
See xmlHashRemoveEntry.
Returns 0 on success and -1 in case of error.
Definition at line 1142 of file hash.c.
Referenced by xmlHashRemoveEntry(), and xmlHashRemoveEntry2().
| void xmlHashScan | ( | xmlHashTablePtr | hash, |
| xmlHashScanner | scan, | ||
| void * | data | ||
| ) |
xmlHashScan: @hash: hash table @scan: scanner function for items in the hash @data: extra data passed to @scan
Scan the hash @table and apply @scan to each value.
Definition at line 898 of file hash.c.
Referenced by schema_cache_addCollection(), xsltCleanupGlobals(), xsltEvalGlobalVariables(), xsltFixImportedCompSteps(), xsltInitCtxtExts(), xsltShutdownCtxtExts(), and xsltShutdownExts().
| void xmlHashScan3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| const xmlChar * | key3, | ||
| xmlHashScanner | scan, | ||
| void * | data | ||
| ) |
xmlHashScan3: @hash: hash table @key: first string key or NULL @key2: second string key or NULL @key3: third string key or NULL @scan: scanner function for items in the hash @data: extra data passed to @scan
Scan the hash @table and apply @scan to each value matching (@key, @key2, @key3) tuple. If one of the keys is null, the comparison is considered to match.
Definition at line 969 of file hash.c.
| void xmlHashScanFull | ( | xmlHashTablePtr | hash, |
| xmlHashScannerFull | scan, | ||
| void * | data | ||
| ) |
xmlHashScanFull: @hash: hash table @scan: scanner function for items in the hash @data: extra data passed to @scan
Scan the hash @table and apply @scan to each value.
Definition at line 914 of file hash.c.
Referenced by xmlCleanSpecialAttr(), xmlHashScan(), xsltDebugDumpExtensions(), and xsltResolveStylesheetAttributeSet().
| void xmlHashScanFull3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| const xmlChar * | key3, | ||
| xmlHashScannerFull | scan, | ||
| void * | data | ||
| ) |
xmlHashScanFull3: @hash: hash table @key: first string key or NULL @key2: second string key or NULL @key3: third string key or NULL @scan: scanner function for items in the hash @data: extra data passed to @scan
Scan the hash @table and apply @scan to each value matching (@key, @key2, @key3) tuple. If one of the keys is null, the comparison is considered to match.
Definition at line 992 of file hash.c.
Referenced by xmlHashScan3().
| int xmlHashSize | ( | xmlHashTablePtr | hash | ) |
xmlHashSize: @hash: hash table
Query the number of elements in the hash table.
Returns the number of elements in the hash table or -1 in case of error.
Definition at line 1085 of file hash.c.
Referenced by lookup_schema_elemDecl(), and xmlCleanSpecialAttr().
| int xmlHashUpdateEntry | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| void * | payload, | ||
| xmlHashDeallocator | dealloc | ||
| ) |
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.
Definition at line 678 of file hash.c.
Referenced by xmlRemoveRef(), and xsltGatherNamespaces().
| int xmlHashUpdateEntry2 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| void * | payload, | ||
| xmlHashDeallocator | dealloc | ||
| ) |
xmlHashUpdateEntry2: @hash: hash table @key: first string key @key2: second string key @payload: pointer to the payload @dealloc: deallocator function for replaced item or NULL
Add a hash table entry with two strings as key.
See xmlHashUpdateEntry.
Returns 0 on success and -1 in case of error.
Definition at line 699 of file hash.c.
Referenced by xmlAddDefAttrs(), xsltRegisterExtModuleElement(), xsltRegisterExtModuleFunction(), and xsltRegisterExtModuleTopLevel().
| int xmlHashUpdateEntry3 | ( | xmlHashTablePtr | hash, |
| const xmlChar * | key, | ||
| const xmlChar * | key2, | ||
| const xmlChar * | key3, | ||
| void * | payload, | ||
| xmlHashDeallocator | dealloc | ||
| ) |
xmlHashUpdateEntry3: @hash: hash table @key: first string key @key2: second string key @key3: third string key @payload: pointer to the payload @dealloc: deallocator function for replaced item or NULL
Add a hash table entry with three strings as key.
See xmlHashUpdateEntry.
Returns 0 on success and -1 in case of error.
Definition at line 722 of file hash.c.
Referenced by xsltAddTemplate().
|
static |
xmlHashUpdateInternal: @hash: hash table @key: first string key @key2: second string key @key3: third string key @payload: pointer to the payload @dealloc: deallocator function for replaced item or NULL @update: whether existing entries should be updated
Internal function to add or update hash entries.
Definition at line 425 of file hash.c.
Referenced by xmlHashAddEntry(), xmlHashAddEntry2(), xmlHashAddEntry3(), xmlHashUpdateEntry(), xmlHashUpdateEntry2(), and xmlHashUpdateEntry3().
|
static |
Definition at line 61 of file hash.c.
Referenced by xmlHashLookup3(), xmlHashRemoveEntry3(), and xmlHashUpdateInternal().