mirror of
https://github.com/GNOME/libxml2.git
synced 2025-03-31 19:10:28 +08:00
added xmlHashScannerFull, xmlHashScanFull and xmlHashScannFull3 to get
* hash.c include/libxml/hash.h: added xmlHashScannerFull, xmlHashScanFull and xmlHashScannFull3 to get passed the three keys as arguments to the callback function
This commit is contained in:
parent
5e2dace1ca
commit
e812624729
@ -1,3 +1,9 @@
|
||||
Sun Jul 22 05:56:16 CEST 2001 Thomas Broyer <tbroyer@ltgt.net>
|
||||
|
||||
* hash.c include/libxml/hash.h: added xmlHashScannerFull,
|
||||
xmlHashScanFull and xmlHashScannFull3 to get passed the
|
||||
three keys as arguments to the callback function
|
||||
|
||||
Thu Jul 19 15:29:26 CEST 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
|
||||
|
||||
* configure.in Makefile.am: removed libxml softlink for good
|
||||
|
40
hash.c
40
hash.c
@ -510,6 +510,19 @@ xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name,
|
||||
*/
|
||||
void
|
||||
xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) {
|
||||
xmlHashScanFull (table, (xmlHashScannerFull) f, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlHashScanFull:
|
||||
* @table: the hash table
|
||||
* @f: the scanner function for items in the hash
|
||||
* @data: extra data passed to f
|
||||
*
|
||||
* Scan the hash table and applied f to each value.
|
||||
*/
|
||||
void
|
||||
xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) {
|
||||
int i;
|
||||
xmlHashEntryPtr iter;
|
||||
xmlHashEntryPtr next;
|
||||
@ -525,7 +538,8 @@ xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) {
|
||||
while (iter) {
|
||||
next = iter->next;
|
||||
if (f)
|
||||
f(iter->payload, data, iter->name);
|
||||
f(iter->payload, data, iter->name,
|
||||
iter->name2, iter->name3);
|
||||
iter = next;
|
||||
}
|
||||
}
|
||||
@ -549,6 +563,27 @@ void
|
||||
xmlHashScan3(xmlHashTablePtr table, const xmlChar *name,
|
||||
const xmlChar *name2, const xmlChar *name3,
|
||||
xmlHashScanner f, void *data) {
|
||||
xmlHashScanFull3 (table, name, name2, name3,
|
||||
(xmlHashScannerFull) f, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* xmlHashScanFull3:
|
||||
* @table: the hash table
|
||||
* @name: the name of the userdata or NULL
|
||||
* @name2: a second name of the userdata or NULL
|
||||
* @name3: a third name of the userdata or NULL
|
||||
* @f: the scanner function for items in the hash
|
||||
* @data: extra data passed to f
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
void
|
||||
xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name,
|
||||
const xmlChar *name2, const xmlChar *name3,
|
||||
xmlHashScannerFull f, void *data) {
|
||||
int i;
|
||||
xmlHashEntryPtr iter;
|
||||
xmlHashEntryPtr next;
|
||||
@ -566,7 +601,8 @@ xmlHashScan3(xmlHashTablePtr table, const xmlChar *name,
|
||||
if (((name == NULL) || (xmlStrEqual(name, iter->name))) &&
|
||||
((name2 == NULL) || (xmlStrEqual(name2, iter->name2))) &&
|
||||
((name3 == NULL) || (xmlStrEqual(name3, iter->name3)))) {
|
||||
f(iter->payload, data, iter->name);
|
||||
f(iter->payload, data, iter->name,
|
||||
iter->name2, iter->name3);
|
||||
}
|
||||
iter = next;
|
||||
}
|
||||
|
@ -36,6 +36,9 @@ typedef xmlHashTable *xmlHashTablePtr;
|
||||
typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name);
|
||||
typedef void *(*xmlHashCopier)(void *payload, xmlChar *name);
|
||||
typedef void *(*xmlHashScanner)(void *payload, void *data, xmlChar *name);
|
||||
typedef void (*xmlHashScannerFull)(void *payload, void *data,
|
||||
const xmlChar *name, const xmlChar *name2,
|
||||
const xmlChar *name3);
|
||||
|
||||
/*
|
||||
* Constructor and destructor
|
||||
@ -114,6 +117,15 @@ void xmlHashScan3 (xmlHashTablePtr table,
|
||||
const xmlChar *name3,
|
||||
xmlHashScanner f,
|
||||
void *data);
|
||||
void xmlHashScanFull (xmlHashTablePtr table,
|
||||
xmlHashScannerFull f,
|
||||
void *data);
|
||||
void xmlHashScanFull3(xmlHashTablePtr table,
|
||||
const xmlChar *name,
|
||||
const xmlChar *name2,
|
||||
const xmlChar *name3,
|
||||
xmlHashScannerFull f,
|
||||
void *data);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user