libxml2_hash.h File Reference

Typedef xmlHashTable

typedef struct _xmlHashTablexmlHashTable

Typedef xmlHashTablePtr

typedef xmlHashTable *xmlHashTablePtr

Typedef xmlHashDeallocator

typedef void(*xmlHashDeallocator

xmlHashDeallocator: Callback to free data from a hash.

Typedef xmlHashCopier

typedef void *(*xmlHashCopier

xmlHashCopier: Callback to copy data from a hash.

Returns a copy of the data or NULL in case of error.

Typedef xmlHashScanner

typedef void(*xmlHashScanner

xmlHashScanner: Callback when scanning data in a hash with the simple scanner.

Typedef xmlHashScannerFull

typedef void(*xmlHashScannerFull

xmlHashScannerFull: Callback when scanning data in a hash with the full scanner.

xmlHashCreate ( int )

XMLPUBFUN xmlHashTablePtr XMLCALLxmlHashCreate(intsize)

xmlHashCreate: Create a new xmlHashTablePtr.

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

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

Parameters
sizethe size of the hash table

xmlHashFree ( xmlHashTablePtr, xmlHashDeallocator )

XMLPUBFUN void XMLCALLxmlHashFree(xmlHashTablePtrtable,
xmlHashDeallocatorf
)

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

OOM: never // same as argument 'f' has when f!=NULL

Parameters
tablethe hash table
fthe deallocator function for items in the hash

xmlHashAddEntry ( xmlHashTablePtr, const xmlChar *, void * )

XMLPUBFUN int XMLCALLxmlHashAddEntry(xmlHashTablePtrtable,
const xmlChar *name,
void *userdata
)

xmlHashAddEntry: Add the userdata to the hash table. This can later be retrieved by using the name. Duplicate names generate errors.

Returns 0 the addition succeeded and -1 in case of error.

OOM: iif returns -1 and flag is set

Parameters
tablethe hash table
namethe name of the userdata
userdataa pointer to the userdata

xmlHashUpdateEntry ( xmlHashTablePtr, const xmlChar *, void *, xmlHashDeallocator )

XMLPUBFUN int XMLCALLxmlHashUpdateEntry(xmlHashTablePtrtable,
const xmlChar *name,
void *userdata,
xmlHashDeallocatorf
)

xmlHashUpdateEntry: Add the userdata to the hash table. This can later be retrieved by using the name. Existing entry for this name will be removed and freed with f if found.

Returns 0 the addition succeeded and -1 in case of error.

Parameters
tablethe hash table
namethe name of the userdata
userdataa pointer to the userdata
fthe deallocator function for replaced item (if any)

xmlHashAddEntry2 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, void * )

XMLPUBFUN int XMLCALLxmlHashAddEntry2(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
void *userdata
)

xmlHashAddEntry2: Add the userdata to the hash table. This can later be retrieved by using the (name, name2) tuple. Duplicate tuples generate errors.

Returns 0 the addition succeeded and -1 in case of error.

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
userdataa pointer to the userdata

xmlHashUpdateEntry2 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, void *, xmlHashDeallocator )

XMLPUBFUN int XMLCALLxmlHashUpdateEntry2(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
void *userdata,
xmlHashDeallocatorf
)

xmlHashUpdateEntry2: Add the userdata to the hash table. This can later be retrieved by using the (name, name2) tuple. Existing entry for this tuple will be removed and freed with f if found.

Returns 0 the addition succeeded and -1 in case of error.

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
userdataa pointer to the userdata
fthe deallocator function for replaced item (if any)

xmlHashAddEntry3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, void * )

XMLPUBFUN int XMLCALLxmlHashAddEntry3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
void *userdata
)

xmlHashAddEntry3: Add the userdata to the hash table. This can later be retrieved by using the tuple (name, name2, name3). Duplicate entries generate errors.

Returns 0 the addition succeeded and -1 in case of error.

OOM: iif returns -1 and flag is set

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
name3a third name of the userdata
userdataa pointer to the userdata

xmlHashUpdateEntry3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, void *, xmlHashDeallocator )

XMLPUBFUN int XMLCALLxmlHashUpdateEntry3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
void *userdata,
xmlHashDeallocatorf
)

xmlHashUpdateEntry3: Add the userdata to the hash table. This can later be retrieved by using the tuple (name, name2, name3). Existing entry for this tuple will be removed and freed with f if found.

Returns 0 the addition succeeded and -1 in case of error.

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
name3a third name of the userdata
userdataa pointer to the userdata
fthe deallocator function for replaced item (if any)

xmlHashRemoveEntry ( xmlHashTablePtr, const xmlChar *, xmlHashDeallocator )

XMLPUBFUN int XMLCALLxmlHashRemoveEntry(xmlHashTablePtrtable,
const xmlChar *name,
xmlHashDeallocatorf
)

xmlHashRemoveEntry: Find the userdata specified by the name and remove it from the hash table. Existing userdata for this tuple will be removed and freed with f.

Returns 0 if the removal succeeded and -1 in case of error or not found.

OOM: never / same as argument function 'f' has, if f!=NULL*

Parameters
tablethe hash table
namethe name of the userdata
fthe deallocator function for removed item (if any)

xmlHashRemoveEntry2 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, xmlHashDeallocator )

XMLPUBFUN int XMLCALLxmlHashRemoveEntry2(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
xmlHashDeallocatorf
)

xmlHashRemoveEntry2: Find the userdata specified by the (name, name2) tuple and remove it from the hash table. Existing userdata for this tuple will be removed and freed with f.

Returns 0 if the removal succeeded and -1 in case of error or not found.

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
fthe deallocator function for removed item (if any)

xmlHashRemoveEntry3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, xmlHashDeallocator )

XMLPUBFUN int XMLCALLxmlHashRemoveEntry3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
xmlHashDeallocatorf
)

xmlHashRemoveEntry3: Find the userdata specified by the (name, name2, name3) tuple and remove it from the hash table. Existing userdata for this tuple will be removed and freed with f.

Returns 0 if the removal succeeded and -1 in case of error or not found.

OOM: never / same as argument function 'f' has, if f!=NULL

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
name3a third name of the userdata
fthe deallocator function for removed item (if any)

xmlHashLookup ( xmlHashTablePtr, const xmlChar * )

XMLPUBFUN void *XMLCALLxmlHashLookup(xmlHashTablePtrtable,
const xmlChar *name
)

xmlHashLookup: Find the userdata specified by the name.

Returns the pointer to the userdata

Parameters
tablethe hash table
namethe name of the userdata

xmlHashLookup2 ( xmlHashTablePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN void *XMLCALLxmlHashLookup2(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2
)

xmlHashLookup2: Find the userdata specified by the (name, name2) tuple.

Returns the pointer to the userdata

OOM: never

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata

xmlHashLookup3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN void *XMLCALLxmlHashLookup3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3
)

xmlHashLookup3: Find the userdata specified by the (name, name2, name3) tuple.

Returns the a pointer to the userdata

OOM: never

Parameters
tablethe hash table
namethe name of the userdata
name2a second name of the userdata
name3a third name of the userdata

xmlHashQLookup ( xmlHashTablePtr, const xmlChar *, const xmlChar * )

XMLPUBFUN void *XMLCALLxmlHashQLookup(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *prefix
)

xmlHashQLookup: Find the userdata specified by the QName prefix:name/name.

Returns the pointer to the userdata

OOM: never

Parameters
tablethe hash table
namethe name of the userdata
prefixthe prefix of the userdata

xmlHashQLookup2 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN void *XMLCALLxmlHashQLookup2(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *prefix,
const xmlChar *name2,
const xmlChar *prefix2
)

xmlHashQLookup2: Find the userdata specified by the QNames tuple

Returns the pointer to the userdata

Parameters
tablethe hash table
namethe name of the userdata
prefixthe prefix of the userdata
name2a second name of the userdata
prefix2the second prefix of the userdata

xmlHashQLookup3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, const xmlChar *, const xmlChar *, const xmlChar * )

XMLPUBFUN void *XMLCALLxmlHashQLookup3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *prefix,
const xmlChar *name2,
const xmlChar *prefix2,
const xmlChar *name3,
const xmlChar *prefix3
)

xmlHashQLookup3: Find the userdata specified by the (name, name2, name3) tuple.

Returns the a pointer to the userdata

Parameters
tablethe hash table
namethe name of the userdata
prefixthe prefix of the userdata
name2a second name of the userdata
prefix2the second prefix of the userdata
name3a third name of the userdata
prefix3the third prefix of the userdata

xmlHashCopy ( xmlHashTablePtr, xmlHashCopier )

XMLPUBFUN xmlHashTablePtr XMLCALLxmlHashCopy(xmlHashTablePtrtable,
xmlHashCopierf
)

xmlHashCopy: Scan the hash table and applied f to each value.

Returns the new table or NULL in case of error.

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

Parameters
tablethe hash table
fthe copier function for items in the hash

xmlHashSize ( xmlHashTablePtr )

XMLPUBFUN int XMLCALLxmlHashSize(xmlHashTablePtrtable)

xmlHashSize: Query the number of elements installed in the hash table.

Returns the number of elements in the hash table or -1 in case of error

Parameters
tablethe hash table

xmlHashScan ( xmlHashTablePtr, xmlHashScanner, void * )

XMLPUBFUN void XMLCALLxmlHashScan(xmlHashTablePtrtable,
xmlHashScannerf,
void *data
)

xmlHashScan: Scan the hash table and applied f to each value.

Parameters
tablethe hash table
fthe scanner function for items in the hash
dataextra data passed to f

xmlHashScan3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, xmlHashScanner, void * )

XMLPUBFUN void XMLCALLxmlHashScan3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
xmlHashScannerf,
void *data
)

xmlHashScan3: Scan the hash table and applied f to each value matching (name, name2, name3) tuple. If one of the names is null, the comparison is considered to match.

Parameters
tablethe hash table
namethe name of the userdata or NULL
name2a second name of the userdata or NULL
name3a third name of the userdata or NULL
fthe scanner function for items in the hash
dataextra data passed to f

xmlHashScanFull ( xmlHashTablePtr, xmlHashScannerFull, void * )

XMLPUBFUN void XMLCALLxmlHashScanFull(xmlHashTablePtrtable,
xmlHashScannerFullf,
void *data
)

xmlHashScanFull: Scan the hash table and applied f to each value.

Parameters
tablethe hash table
fthe scanner function for items in the hash
dataextra data passed to f

xmlHashScanFull3 ( xmlHashTablePtr, const xmlChar *, const xmlChar *, const xmlChar *, xmlHashScannerFull, void * )

XMLPUBFUN void XMLCALLxmlHashScanFull3(xmlHashTablePtrtable,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
xmlHashScannerFullf,
void *data
)

xmlHashScanFull3: Scan the hash table and applied f to each value matching (name, name2, name3) tuple. If one of the names is null, the comparison is considered to match.

Parameters
tablethe hash table
namethe name of the userdata or NULL
name2a second name of the userdata or NULL
name3a third name of the userdata or NULL
fthe scanner function for items in the hash
dataextra data passed to f