deps/src/libxml2-2.9.1/doc/devhelp/libxml2-dict.html
| | | | | libxml2 Reference Manual |
dict - string dictionnary
dictionary of reusable strings, just used to avoid allocation and freeing operations.
Author(s): Daniel Veillard
typedef struct _xmlDict[xmlDict](#xmlDict);
typedef[xmlDict](libxml2-dict.html#xmlDict)*[xmlDictPtr](#xmlDictPtr);
size_t[xmlDictGetUsage](#xmlDictGetUsage)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict);
int[xmlDictReference](#xmlDictReference)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict);
void[xmlDictCleanup](#xmlDictCleanup)(void);
int[xmlDictSize](#xmlDictSize)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlDictExists](#xmlDictExists)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int len);
size_t[xmlDictSetLimit](#xmlDictSetLimit)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
size_t limit);
int[xmlDictOwns](#xmlDictOwns)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* str);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlDictQLookup](#xmlDictQLookup)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* prefix,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name);
int[xmlInitializeDict](#xmlInitializeDict)(void);[xmlDictPtr](libxml2-dict.html#xmlDictPtr)[xmlDictCreateSub](#xmlDictCreateSub)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)sub);
void[xmlDictFree](#xmlDictFree)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict);
const[xmlChar](libxml2-xmlstring.html#xmlChar)*[xmlDictLookup](#xmlDictLookup)([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int len);[xmlDictPtr](libxml2-dict.html#xmlDictPtr)[xmlDictCreate](#xmlDictCreate)(void);
struct _xmlDict {
The content of this structure is not made public by the API.
} xmlDict;
[xmlDict](libxml2-dict.html#xmlDict)* xmlDictPtr;
void xmlDictCleanup (void)
Free the dictionary mutex. Do not call unless sure the library is not in use anymore !
[xmlDictPtr](libxml2-dict.html#xmlDictPtr)xmlDictCreate (void)
Create a new dictionary
| Returns: | the newly created dictionnary, or NULL if an error occured. |
[xmlDictPtr](libxml2-dict.html#xmlDictPtr)xmlDictCreateSub ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)sub)
Create a new dictionary, inheriting strings from the read-only dictionnary @sub. On lookup, strings are first searched in the new dictionnary, then in @sub, and if not found are created in the new dictionnary.
| sub: | an existing dictionnary | | Returns: | the newly created dictionnary, or NULL if an error occured. |
const[xmlChar](libxml2-xmlstring.html#xmlChar)* xmlDictExists ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int len)
Check if the @name exists in the dictionnary @dict.
| dict: | the dictionnary | | name: | the name of the userdata | | len: | the length of the name, if -1 it is recomputed | | Returns: | the internal copy of the name or NULL if not found. |
void xmlDictFree ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict)
Free the hash @dict and its contents. The userdata is deallocated with @f if provided.
| dict: | the dictionnary |
size_t xmlDictGetUsage ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict)
Get how much memory is used by a dictionary for strings Added in 2.9.0
| dict: | the dictionnary | | Returns: | the amount of strings allocated |
const[xmlChar](libxml2-xmlstring.html#xmlChar)* xmlDictLookup ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name,
int len)
Add the @name to the dictionnary @dict if not present.
| dict: | the dictionnary | | name: | the name of the userdata | | len: | the length of the name, if -1 it is recomputed | | Returns: | the internal copy of the name or NULL in case of internal error |
int xmlDictOwns ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* str)
check if a string is owned by the disctionary
| dict: | the dictionnary | | str: | the string | | Returns: | 1 if true, 0 if false and -1 in case of error -1 in case of error |
const[xmlChar](libxml2-xmlstring.html#xmlChar)* xmlDictQLookup ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* prefix,
const[xmlChar](libxml2-xmlstring.html#xmlChar)* name)
Add the QName @prefix:@name to the hash @dict if not present.
| dict: | the dictionnary | | prefix: | the prefix | | name: | the name | | Returns: | the internal copy of the QName or NULL in case of internal error |
int xmlDictReference ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict)
Increment the reference counter of a dictionary
| dict: | the dictionnary | | Returns: | 0 in case of success and -1 in case of error |
size_t xmlDictSetLimit ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict,
size_t limit)
Set a size limit for the dictionary Added in 2.9.0
| dict: | the dictionnary | | limit: | the limit in bytes | | Returns: | the previous limit of the dictionary or 0 |
int xmlDictSize ([xmlDictPtr](libxml2-dict.html#xmlDictPtr)dict)
Query the number of elements installed in the hash @dict.
| dict: | the dictionnary | | Returns: | the number of elements in the dictionnary or -1 in case of error |
int xmlInitializeDict (void)
Do the dictionary mutex initialization. this function is deprecated
| Returns: | 0 if initialization was already done, and 1 if that call led to the initialization |