libxml2_dict.h File Reference

Typedef xmlDictStrings

typedef struct _xmlDictStringsxmlDictStrings

Typedef xmlDictStringsPtr

typedef xmlDictStrings *xmlDictStringsPtr

Typedef xmlDictEntry

typedef struct _xmlDictEntryxmlDictEntry

Typedef xmlDictEntryPtr

typedef xmlDictEntry *xmlDictEntryPtr

Typedef xmlDict

typedef struct _xmlDictxmlDict

Typedef xmlDictPtr

typedef xmlDict *xmlDictPtr

xmlDictCreate ( void )

XMLPUBFUN xmlDictPtr XMLCALLxmlDictCreate(void)

xmlDictCreate:

Create a new dictionary

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

OOM: possible --> NULL is returned; OOM flag is set

xmlDictCreateSub ( xmlDictPtr )

XMLPUBFUN xmlDictPtr XMLCALLxmlDictCreateSub(xmlDictPtrsub)

xmlDictCreateSub: 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.

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

Parameters
suban existing dictionnary

xmlDictReference ( xmlDictPtr )

XMLPUBFUN int XMLCALLxmlDictReference(xmlDictPtrdict)

xmlDictReference: Increment the reference counter of a dictionary

Returns 0 in case of success and -1 in case of error

OOM: never

Parameters
dictthe dictionnary

xmlDictFree ( xmlDictPtr )

XMLPUBFUN void XMLCALLxmlDictFree(xmlDictPtrdict)

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

Parameters
dictthe dictionnary

xmlDictLookup ( xmlDictPtr, const xmlChar *, int )

XMLPUBFUN const xmlChar *XMLCALLxmlDictLookup(xmlDictPtrdict,
const xmlChar *name,
intlen
)

xmlDictLookup: Add the name to the hash dict if not present.

Returns the internal copy of the name or NULL in case of internal error

OOM: possible --> returns NULL and OOM flag is set

Parameters
dictthe dictionnary
namethe name of the userdata
lenthe length of the name, if -1 it is recomputed

xmlDictQLookup ( xmlDictPtr, const xmlChar *, const xmlChar * )

XMLPUBFUN const xmlChar *XMLCALLxmlDictQLookup(xmlDictPtrdict,
const xmlChar *prefix,
const xmlChar *name
)

xmlDictQLookup: Add the QName prefix:name to the hash dict if not present.

Returns the internal copy of the QName or NULL in case of internal error

Parameters
dictthe dictionnary
prefixthe prefix
namethe name

xmlDictSize ( xmlDictPtr )

XMLPUBFUN int XMLCALLxmlDictSize(xmlDictPtrdict)

xmlDictSize: Query the number of elements installed in the hash dict.

Returns the number of elements in the dictionnary or -1 in case of error

Parameters
dictthe dictionnary

xmlDictOwns ( xmlDictPtr, const xmlChar * )

XMLPUBFUN int XMLCALLxmlDictOwns(xmlDictPtrdict,
const xmlChar *str
)

xmlDictOwns: check if a string is owned by the disctionary

Returns 1 if true, 0 if false and -1 in case of error -1 in case of error

OOM: impossible

Parameters
dictthe dictionnary
strthe string