MCPcopy Create free account
hub / github.com/Kitware/VTK / xmlHashQLookup3

Function xmlHashQLookup3

ThirdParty/libxml2/vtklibxml2/hash.c:931–970  ·  view source on GitHub ↗

* xmlHashQLookup3: * @hash: hash table * @prefix: first prefix * @name: first local name * @prefix2: second prefix * @name2: second local name * @prefix3: third prefix * @name3: third local name * * Find the payload specified by the QNames tuple. * * Returns a pointer to the payload or NULL if no entry was found. */

Source from the content-addressed store, hash-verified

929 * Returns a pointer to the payload or NULL if no entry was found.
930 */
931ATTRIBUTE_NO_SANITIZE_INTEGER
932void *
933xmlHashQLookup3(xmlHashTablePtr hash,
934 const xmlChar *prefix, const xmlChar *name,
935 const xmlChar *prefix2, const xmlChar *name2,
936 const xmlChar *prefix3, const xmlChar *name3) {
937 const xmlHashEntry *entry;
938 unsigned hashValue, mask, pos, displ;
939
940 if ((hash == NULL) || (hash->size == 0) || (name == NULL))
941 return(NULL);
942
943 hashValue = xmlHashQNameValue(hash->randomSeed, prefix, name, prefix2,
944 name2, prefix3, name3);
945 mask = hash->size - 1;
946 pos = hashValue & mask;
947 entry = &hash->table[pos];
948
949 if (entry->hashValue != 0) {
950 displ = 0;
951 hashValue |= MAX_HASH_SIZE;
952
953 do {
954 if ((hashValue == entry->hashValue) &&
955 (xmlStrQEqual(prefix, name, entry->key)) &&
956 (xmlStrQEqual(prefix2, name2, entry->key2)) &&
957 (xmlStrQEqual(prefix3, name3, entry->key3)))
958 return(entry->payload);
959
960 displ++;
961 pos++;
962 entry++;
963 if ((pos & mask) == 0)
964 entry = hash->table;
965 } while ((entry->hashValue != 0) &&
966 (((pos - entry->hashValue) & mask) >= displ));
967 }
968
969 return(NULL);
970}
971
972typedef struct {
973 xmlHashScanner scan;

Callers 2

xmlHashQLookupFunction · 0.85
xmlHashQLookup2Function · 0.85

Calls 2

xmlHashQNameValueFunction · 0.85
xmlStrQEqualFunction · 0.85

Tested by

no test coverage detected