38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Summary: Chained hash tables
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Description: This module implements the hash table support used in
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * various places in the library.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Copy: See Copyright for the status of this software.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Author: Bjorn Reese <bjorn.reese@systematic.dk>
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncextern "C" {
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * The hash table.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsyncextern "C" {
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Recent version of gcc produce a warning when a function pointer is assigned
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * to an object pointer, or vice versa. The following macro is a dirty hack
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * to allow suppression of the warning. If your architecture has function
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * pointers which are a different size than a void pointer, there may be some
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * serious trouble within the library.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * XML_CAST_FPTR:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @fptr: pointer to a function
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Macro to do a casting from an object pointer to a
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * function pointer without encountering a warning from
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * #define XML_CAST_FPTR(fptr) (*(void **)(&fptr))
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * This macro violated ISO C aliasing rules (gcc4 on s390 broke)
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * so it is disabled now
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * function types:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * xmlHashDeallocator:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @payload: the data in the hash
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @name: the name associated
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Callback to free data from a hash.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynctypedef void (*xmlHashDeallocator)(void *payload, xmlChar *name);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * xmlHashCopier:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @payload: the data in the hash
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @name: the name associated
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Callback to copy data from a hash.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Returns a copy of the data or NULL in case of error.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynctypedef void *(*xmlHashCopier)(void *payload, xmlChar *name);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * xmlHashScanner:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @payload: the data in the hash
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @data: extra scannner data
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @name: the name associated
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Callback when scanning data in a hash with the simple scanner.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynctypedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * xmlHashScannerFull:
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @payload: the data in the hash
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @data: extra scannner data
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @name: the name associated
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @name2: the second name associated
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * @name3: the third name associated
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Callback when scanning data in a hash with the full scanner.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsynctypedef void (*xmlHashScannerFull)(void *payload, void *data,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Constructor and destructor.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Add a new entry to the hash table.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Remove an entry from the hash table.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync * Retrieve the userdata.
38ae7e4efe803ea78b6499cd05a394db32623e41vboxsync#endif /* ! __XML_HASH_H__ */