Action against software patentsGnome2 LogoW3C LogoRed Hat Logo
Made with Libxml2 Logo

Module dict from libxml2

API Menu
API Indexes
Related links

dictionary of reusable strings, just used to avoid allocation and freeing operations.

Table of Contents

Structure xmlDict
struct _xmlDict The content of this structure is not made public by the API.
Typedef xmlDict * xmlDictPtr
void	xmlDictCleanup			(void)
xmlDictPtr	xmlDictCreate		(void)
xmlDictPtr	xmlDictCreateSub	(xmlDictPtr sub)
const xmlChar *	xmlDictExists		(xmlDictPtr dict, 
const xmlChar * name,
int len)
void	xmlDictFree			(xmlDictPtr dict)
const xmlChar *	xmlDictLookup		(xmlDictPtr dict, 
const xmlChar * name,
int len)
int	xmlDictOwns			(xmlDictPtr dict, 
const xmlChar * str)
const xmlChar *	xmlDictQLookup		(xmlDictPtr dict, 
const xmlChar * prefix,
const xmlChar * name)
int	xmlDictReference		(xmlDictPtr dict)
int	xmlDictSize			(xmlDictPtr dict)

Description

Structure xmlDict

Structure xmlDict
struct _xmlDict { The content of this structure is not made public by the API. }

Function: xmlDictCleanup

void	xmlDictCleanup			(void)

Free the dictionary mutex.

Function: xmlDictCreate

xmlDictPtr	xmlDictCreate		(void)

Create a new dictionary

Returns:the newly created dictionnary, or NULL if an error occured.

Function: xmlDictCreateSub

xmlDictPtr	xmlDictCreateSub	(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.

Function: xmlDictExists

const xmlChar *	xmlDictExists		(xmlDictPtr dict, 
const 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.

Function: xmlDictFree

void	xmlDictFree			(xmlDictPtr dict)

Free the hash @dict and its contents. The userdata is deallocated with @f if provided.

dict:the dictionnary

Function: xmlDictLookup

const xmlChar *	xmlDictLookup		(xmlDictPtr dict, 
const 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

Function: xmlDictOwns

int	xmlDictOwns			(xmlDictPtr dict, 
const 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

Function: xmlDictQLookup

const xmlChar *	xmlDictQLookup		(xmlDictPtr dict, 
const xmlChar * prefix,
const 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

Function: xmlDictReference

int	xmlDictReference		(xmlDictPtr dict)

Increment the reference counter of a dictionary

dict:the dictionnary
Returns:0 in case of success and -1 in case of error

Function: xmlDictSize

int	xmlDictSize			(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

Daniel Veillard