• Home
  • History
  • Annotate
  • Raw
  • Download

Lines Matching refs:table

68     struct _xmlHashEntry *table;  member
82 xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, in xmlHashComputeKey() argument
88 value = table->random_seed; in xmlHashComputeKey()
108 return (value % table->size); in xmlHashComputeKey()
112 xmlHashComputeQKey(xmlHashTablePtr table, in xmlHashComputeQKey() argument
120 value = table->random_seed; in xmlHashComputeQKey()
162 return (value % table->size); in xmlHashComputeQKey()
175 xmlHashTablePtr table; in xmlHashCreate() local
180 table = xmlMalloc(sizeof(xmlHashTable)); in xmlHashCreate()
181 if (table) { in xmlHashCreate()
182 table->dict = NULL; in xmlHashCreate()
183 table->size = size; in xmlHashCreate()
184 table->nbElems = 0; in xmlHashCreate()
185 table->table = xmlMalloc(size * sizeof(xmlHashEntry)); in xmlHashCreate()
186 if (table->table) { in xmlHashCreate()
187 memset(table->table, 0, size * sizeof(xmlHashEntry)); in xmlHashCreate()
189 table->random_seed = __xmlRandom(); in xmlHashCreate()
191 return(table); in xmlHashCreate()
193 xmlFree(table); in xmlHashCreate()
209 xmlHashTablePtr table; in xmlHashCreateDict() local
211 table = xmlHashCreate(size); in xmlHashCreateDict()
212 if (table != NULL) { in xmlHashCreateDict()
213 table->dict = dict; in xmlHashCreateDict()
216 return(table); in xmlHashCreateDict()
229 xmlHashGrow(xmlHashTablePtr table, int size) { in xmlHashGrow() argument
238 if (table == NULL) in xmlHashGrow()
245 oldsize = table->size; in xmlHashGrow()
246 oldtable = table->table; in xmlHashGrow()
250 table->table = xmlMalloc(size * sizeof(xmlHashEntry)); in xmlHashGrow()
251 if (table->table == NULL) { in xmlHashGrow()
252 table->table = oldtable; in xmlHashGrow()
255 memset(table->table, 0, size * sizeof(xmlHashEntry)); in xmlHashGrow()
256 table->size = size; in xmlHashGrow()
267 key = xmlHashComputeKey(table, oldtable[i].name, oldtable[i].name2, in xmlHashGrow()
269 memcpy(&(table->table[key]), &(oldtable[i]), sizeof(xmlHashEntry)); in xmlHashGrow()
270 table->table[key].next = NULL; in xmlHashGrow()
282 key = xmlHashComputeKey(table, iter->name, iter->name2, in xmlHashGrow()
284 if (table->table[key].valid == 0) { in xmlHashGrow()
285 memcpy(&(table->table[key]), iter, sizeof(xmlHashEntry)); in xmlHashGrow()
286 table->table[key].next = NULL; in xmlHashGrow()
289 iter->next = table->table[key].next; in xmlHashGrow()
290 table->table[key].next = iter; in xmlHashGrow()
320 xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f) { in xmlHashFree() argument
327 if (table == NULL) in xmlHashFree()
329 if (table->table) { in xmlHashFree()
330 nbElems = table->nbElems; in xmlHashFree()
331 for(i = 0; (i < table->size) && (nbElems > 0); i++) { in xmlHashFree()
332 iter = &(table->table[i]); in xmlHashFree()
340 if (table->dict == NULL) { in xmlHashFree()
356 xmlFree(table->table); in xmlHashFree()
358 if (table->dict) in xmlHashFree()
359 xmlDictFree(table->dict); in xmlHashFree()
360 xmlFree(table); in xmlHashFree()
375 xmlHashAddEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata) { in xmlHashAddEntry() argument
376 return(xmlHashAddEntry3(table, name, NULL, NULL, userdata)); in xmlHashAddEntry()
392 xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, in xmlHashAddEntry2() argument
394 return(xmlHashAddEntry3(table, name, name2, NULL, userdata)); in xmlHashAddEntry2()
411 xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name, in xmlHashUpdateEntry() argument
413 return(xmlHashUpdateEntry3(table, name, NULL, NULL, userdata, f)); in xmlHashUpdateEntry()
431 xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name, in xmlHashUpdateEntry2() argument
434 return(xmlHashUpdateEntry3(table, name, name2, NULL, userdata, f)); in xmlHashUpdateEntry2()
447 xmlHashLookup(xmlHashTablePtr table, const xmlChar *name) { in xmlHashLookup() argument
448 return(xmlHashLookup3(table, name, NULL, NULL)); in xmlHashLookup()
462 xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name, in xmlHashLookup2() argument
464 return(xmlHashLookup3(table, name, name2, NULL)); in xmlHashLookup2()
478 xmlHashQLookup(xmlHashTablePtr table, const xmlChar *prefix, in xmlHashQLookup() argument
480 return(xmlHashQLookup3(table, prefix, name, NULL, NULL, NULL, NULL)); in xmlHashQLookup()
496 xmlHashQLookup2(xmlHashTablePtr table, const xmlChar *prefix, in xmlHashQLookup2() argument
499 return(xmlHashQLookup3(table, prefix, name, prefix2, name2, NULL, NULL)); in xmlHashQLookup2()
517 xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, in xmlHashAddEntry3() argument
524 if ((table == NULL) || (name == NULL)) in xmlHashAddEntry3()
530 if (table->dict) { in xmlHashAddEntry3()
531 if (!xmlDictOwns(table->dict, name)) { in xmlHashAddEntry3()
532 name = xmlDictLookup(table->dict, name, -1); in xmlHashAddEntry3()
536 if ((name2 != NULL) && (!xmlDictOwns(table->dict, name2))) { in xmlHashAddEntry3()
537 name2 = xmlDictLookup(table->dict, name2, -1); in xmlHashAddEntry3()
541 if ((name3 != NULL) && (!xmlDictOwns(table->dict, name3))) { in xmlHashAddEntry3()
542 name3 = xmlDictLookup(table->dict, name3, -1); in xmlHashAddEntry3()
551 key = xmlHashComputeKey(table, name, name2, name3); in xmlHashAddEntry3()
552 if (table->table[key].valid == 0) { in xmlHashAddEntry3()
555 if (table->dict) { in xmlHashAddEntry3()
556 for (insert = &(table->table[key]); insert->next != NULL; in xmlHashAddEntry3()
569 for (insert = &(table->table[key]); insert->next != NULL; in xmlHashAddEntry3()
585 entry = &(table->table[key]); in xmlHashAddEntry3()
592 if (table->dict != NULL) { in xmlHashAddEntry3()
609 table->nbElems++; in xmlHashAddEntry3()
612 xmlHashGrow(table, MAX_HASH_LEN * table->size); in xmlHashAddEntry3()
633 xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, in xmlHashUpdateEntry3() argument
640 if ((table == NULL) || name == NULL) in xmlHashUpdateEntry3()
646 if (table->dict) { in xmlHashUpdateEntry3()
647 if (!xmlDictOwns(table->dict, name)) { in xmlHashUpdateEntry3()
648 name = xmlDictLookup(table->dict, name, -1); in xmlHashUpdateEntry3()
652 if ((name2 != NULL) && (!xmlDictOwns(table->dict, name2))) { in xmlHashUpdateEntry3()
653 name2 = xmlDictLookup(table->dict, name2, -1); in xmlHashUpdateEntry3()
657 if ((name3 != NULL) && (!xmlDictOwns(table->dict, name3))) { in xmlHashUpdateEntry3()
658 name3 = xmlDictLookup(table->dict, name3, -1); in xmlHashUpdateEntry3()
667 key = xmlHashComputeKey(table, name, name2, name3); in xmlHashUpdateEntry3()
668 if (table->table[key].valid == 0) { in xmlHashUpdateEntry3()
671 if (table ->dict) { in xmlHashUpdateEntry3()
672 for (insert = &(table->table[key]); insert->next != NULL; in xmlHashUpdateEntry3()
692 for (insert = &(table->table[key]); insert->next != NULL; in xmlHashUpdateEntry3()
715 entry = &(table->table[key]); in xmlHashUpdateEntry3()
722 if (table->dict != NULL) { in xmlHashUpdateEntry3()
734 table->nbElems++; in xmlHashUpdateEntry3()
755 xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, in xmlHashLookup3() argument
760 if (table == NULL) in xmlHashLookup3()
764 key = xmlHashComputeKey(table, name, name2, name3); in xmlHashLookup3()
765 if (table->table[key].valid == 0) in xmlHashLookup3()
767 if (table->dict) { in xmlHashLookup3()
768 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) { in xmlHashLookup3()
775 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) { in xmlHashLookup3()
799 xmlHashQLookup3(xmlHashTablePtr table, in xmlHashQLookup3() argument
806 if (table == NULL) in xmlHashQLookup3()
810 key = xmlHashComputeQKey(table, prefix, name, prefix2, in xmlHashQLookup3()
812 if (table->table[key].valid == 0) in xmlHashQLookup3()
814 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) { in xmlHashQLookup3()
845 xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data) { in xmlHashScan() argument
849 xmlHashScanFull (table, stubHashScannerFull, &stubdata); in xmlHashScan()
861 xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data) { in xmlHashScanFull() argument
866 if (table == NULL) in xmlHashScanFull()
871 if (table->table) { in xmlHashScanFull()
872 for(i = 0; i < table->size; i++) { in xmlHashScanFull()
873 if (table->table[i].valid == 0) in xmlHashScanFull()
875 iter = &(table->table[i]); in xmlHashScanFull()
878 nb = table->nbElems; in xmlHashScanFull()
882 if (nb != table->nbElems) { in xmlHashScanFull()
884 if (iter == &(table->table[i])) { in xmlHashScanFull()
885 if (table->table[i].valid == 0) in xmlHashScanFull()
887 if (table->table[i].next != next) in xmlHashScanFull()
888 iter = &(table->table[i]); in xmlHashScanFull()
912 xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, in xmlHashScan3() argument
915 xmlHashScanFull3 (table, name, name2, name3, in xmlHashScan3()
933 xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, in xmlHashScanFull3() argument
940 if (table == NULL) in xmlHashScanFull3()
945 if (table->table) { in xmlHashScanFull3()
946 for(i = 0; i < table->size; i++) { in xmlHashScanFull3()
947 if (table->table[i].valid == 0) in xmlHashScanFull3()
949 iter = &(table->table[i]); in xmlHashScanFull3()
975 xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f) { in xmlHashCopy() argument
981 if (table == NULL) in xmlHashCopy()
986 ret = xmlHashCreate(table->size); in xmlHashCopy()
990 if (table->table) { in xmlHashCopy()
991 for(i = 0; i < table->size; i++) { in xmlHashCopy()
992 if (table->table[i].valid == 0) in xmlHashCopy()
994 iter = &(table->table[i]); in xmlHashCopy()
1003 ret->nbElems = table->nbElems; in xmlHashCopy()
1017 xmlHashSize(xmlHashTablePtr table) { in xmlHashSize() argument
1018 if (table == NULL) in xmlHashSize()
1020 return(table->nbElems); in xmlHashSize()
1035 int xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, in xmlHashRemoveEntry() argument
1037 return(xmlHashRemoveEntry3(table, name, NULL, NULL, f)); in xmlHashRemoveEntry()
1054 xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, in xmlHashRemoveEntry2() argument
1056 return(xmlHashRemoveEntry3(table, name, name2, NULL, f)); in xmlHashRemoveEntry2()
1074 xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, in xmlHashRemoveEntry3() argument
1080 if (table == NULL || name == NULL) in xmlHashRemoveEntry3()
1083 key = xmlHashComputeKey(table, name, name2, name3); in xmlHashRemoveEntry3()
1084 if (table->table[key].valid == 0) { in xmlHashRemoveEntry3()
1087 for (entry = &(table->table[key]); entry != NULL; entry = entry->next) { in xmlHashRemoveEntry3()
1094 if (table->dict == NULL) { in xmlHashRemoveEntry3()
1110 memcpy(&(table->table[key]), entry, sizeof(xmlHashEntry)); in xmlHashRemoveEntry3()
1114 table->nbElems--; in xmlHashRemoveEntry3()