• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/timemachine/libxml2-2.7.2/

Lines Matching refs:table

35  * A single entry in the hash table
49 * The entire hash table
52 struct _xmlHashEntry *table;
63 xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name,
84 return (value % table->size);
88 xmlHashComputeQKey(xmlHashTablePtr table,
133 return (value % table->size);
138 * @size: the size of the hash table
146 xmlHashTablePtr table;
151 table = xmlMalloc(sizeof(xmlHashTable));
152 if (table) {
153 table->dict = NULL;
154 table->size = size;
155 table->nbElems = 0;
156 table->table = xmlMalloc(size * sizeof(xmlHashEntry));
157 if (table->table) {
158 memset(table->table, 0, size * sizeof(xmlHashEntry));
159 return(table);
161 xmlFree(table);
168 * @size: the size of the hash table
177 xmlHashTablePtr table;
179 table = xmlHashCreate(size);
180 if (table != NULL) {
181 table->dict = dict;
184 return(table);
189 * @table: the hash table
190 * @size: the new size of the hash table
192 * resize the hash table
197 xmlHashGrow(xmlHashTablePtr table, int size) {
206 if (table == NULL)
213 oldsize = table->size;
214 oldtable = table->table;
218 table->table = xmlMalloc(size * sizeof(xmlHashEntry));
219 if (table->table == NULL) {
220 table->table = oldtable;
223 memset(table->table, 0, size * sizeof(xmlHashEntry));
224 table->size = size;
228 the main table. So instead, we run through the array twice, first
235 key = xmlHashComputeKey(table, oldtable[i].name, oldtable[i].name2,
237 memcpy(&(table->table[key]), &(oldtable[i]), sizeof(xmlHashEntry));
238 table->table[key].next = NULL;
247 * put back the entry in the new table
250 key = xmlHashComputeKey(table, iter->name, iter->name2,
252 if (table->table[key].valid == 0) {
253 memcpy(&(table->table[key]), iter, sizeof(xmlHashEntry));
254 table->table[key].next = NULL;
257 iter->next = table->table[key].next;
258 table->table[key].next = iter;
281 * @table: the hash table
284 * Free the hash @table and its contents. The userdata is
288 xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f) {
295 if (table == NULL)
297 if (table->table) {
298 nbElems = table->nbElems;
299 for(i = 0; (i < table->size) && (nbElems > 0); i++) {
300 iter = &(table->table[i]);
308 if (table->dict == NULL) {
325 xmlFree(table->table);
327 if (table->dict)
328 xmlDictFree(table->dict);
329 xmlFree(table);
334 * @table: the hash table
338 * Add the @userdata to the hash @table. This can later be retrieved
344 xmlHashAddEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata) {
345 return(xmlHashAddEntry3(table, name, NULL, NULL, userdata));
350 * @table: the hash table
355 * Add the @userdata to the hash @table. This can later be retrieved
361 xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name,
363 return(xmlHashAddEntry3(table, name, name2, NULL, userdata));
368 * @table: the hash table
373 * Add the @userdata to the hash @table. This can later be retrieved
380 xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name,
382 return(xmlHashUpdateEntry3(table, name, NULL, NULL, userdata, f));
387 * @table: the hash table
393 * Add the @userdata to the hash @table. This can later be retrieved
400 xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name,
403 return(xmlHashUpdateEntry3(table, name, name2, NULL, userdata, f));
408 * @table: the hash table
416 xmlHashLookup(xmlHashTablePtr table, const xmlChar *name) {
417 return(xmlHashLookup3(table, name, NULL, NULL));
422 * @table: the hash table
431 xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name,
433 return(xmlHashLookup3(table, name, name2, NULL));
438 * @table: the hash table
447 xmlHashQLookup(xmlHashTablePtr table, const xmlChar *prefix,
449 return(xmlHashQLookup3(table, prefix, name, NULL, NULL, NULL, NULL));
454 * @table: the hash table
465 xmlHashQLookup2(xmlHashTablePtr table, const xmlChar *prefix,
468 return(xmlHashQLookup3(table, prefix, name, prefix2, name2, NULL, NULL));
473 * @table: the hash table
479 * Add the @userdata to the hash @table. This can later be retrieved
486 xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name,
493 if ((table == NULL) || (name == NULL))
499 if (table->dict) {
500 if (!xmlDictOwns(table->dict, name)) {
501 name = xmlDictLookup(table->dict, name, -1);
505 if ((name2 != NULL) && (!xmlDictOwns(table->dict, name2))) {
506 name2 = xmlDictLookup(table->dict, name2, -1);
510 if ((name3 != NULL) && (!xmlDictOwns(table->dict, name3))) {
511 name3 = xmlDictLookup(table->dict, name3, -1);
520 key = xmlHashComputeKey(table, name, name2, name3);
521 if (table->table[key].valid == 0) {
524 if (table->dict) {
525 for (insert = &(table->table[key]); insert->next != NULL;
538 for (insert = &(table->table[key]); insert->next != NULL;
554 entry = &(table->table[key]);
561 if (table->dict != NULL) {
578 table->nbElems++;
581 xmlHashGrow(table, MAX_HASH_LEN * table->size);
588 * @table: the hash table
595 * Add the @userdata to the hash @table. This can later be retrieved
602 xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name,
609 if ((table == NULL) || name == NULL)
615 if (table->dict) {
616 if (!xmlDictOwns(table->dict, name)) {
617 name = xmlDictLookup(table->dict, name, -1);
621 if ((name2 != NULL) && (!xmlDictOwns(table->dict, name2))) {
622 name2 = xmlDictLookup(table->dict, name2, -1);
626 if ((name3 != NULL) && (!xmlDictOwns(table->dict, name3))) {
627 name3 = xmlDictLookup(table->dict, name3, -1);
636 key = xmlHashComputeKey(table, name, name2, name3);
637 if (table->table[key].valid == 0) {
640 if (table ->dict) {
641 for (insert = &(table->table[key]); insert->next != NULL;
661 for (insert = &(table->table[key]); insert->next != NULL;
684 entry = &(table->table[key]);
691 if (table->dict != NULL) {
703 table->nbElems++;
714 * @table: the hash table
724 xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name,
729 if (table == NULL)
733 key = xmlHashComputeKey(table, name, name2, name3);
734 if (table->table[key].valid == 0)
736 if (table->dict) {
737 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
744 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
755 * @table: the hash table
768 xmlHashQLookup3(xmlHashTablePtr table,
775 if (table == NULL)
779 key = xmlHashComputeQKey(table, prefix, name, prefix2,
781 if (table->table[key].valid == 0)
783 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
807 * @table: the hash table
811 * Scan the hash @table and applied @f to each value.
814 xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) {
818 xmlHashScanFull (table, stubHashScannerFull, &stubdata);
823 * @table: the hash table
827 * Scan the hash @table and applied @f to each value.
830 xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) {
835 if (table == NULL)
840 if (table->table) {
841 for(i = 0; i < table->size; i++) {
842 if (table->table[i].valid == 0)
844 iter = &(table->table[i]);
847 nb = table->nbElems;
851 if (nb != table->nbElems) {
852 /* table was modified by the callback, be careful */
853 if (iter == &(table->table[i])) {
854 if (table->table[i].valid == 0)
856 if (table->table[i].next != next)
857 iter = &(table->table[i]);
869 * @table: the hash table
876 * Scan the hash @table and applied @f to each value matching
881 xmlHashScan3(xmlHashTablePtr table, const xmlChar *name,
884 xmlHashScanFull3 (table, name, name2, name3,
890 * @table: the hash table
897 * Scan the hash @table and applied @f to each value matching
902 xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name,
909 if (table == NULL)
914 if (table->table) {
915 for(i = 0; i < table->size; i++) {
916 if (table->table[i].valid == 0)
918 iter = &(table->table[i]);
936 * @table: the hash table
939 * Scan the hash @table and applied @f to each value.
941 * Returns the new table or NULL in case of error.
944 xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f) {
950 if (table == NULL)
955 ret = xmlHashCreate(table->size);
956 if (table->table) {
957 for(i = 0; i < table->size; i++) {
958 if (table->table[i].valid == 0)
960 iter = &(table->table[i]);
969 ret->nbElems = table->nbElems;
975 * @table: the hash table
977 * Query the number of elements installed in the hash @table.
979 * Returns the number of elements in the hash table or
983 xmlHashSize(xmlHashTablePtr table) {
984 if (table == NULL)
986 return(table->nbElems);
991 * @table: the hash table
996 * it from the hash @table. Existing userdata for this tuple will be removed
1001 int xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
1003 return(xmlHashRemoveEntry3(table, name, NULL, NULL, f));
1008 * @table: the hash table
1014 * it from the hash @table. Existing userdata for this tuple will be removed
1020 xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
1022 return(xmlHashRemoveEntry3(table, name, name2, NULL, f));
1027 * @table: the hash table
1034 * it from the hash @table. Existing userdata for this tuple will be removed
1040 xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
1046 if (table == NULL || name == NULL)
1049 key = xmlHashComputeKey(table, name, name2, name3);
1050 if (table->table[key].valid == 0) {
1053 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
1060 if (table->dict == NULL) {
1076 memcpy(&(table->table[key]), entry, sizeof(xmlHashEntry));
1080 table->nbElems--;