36 #if defined(HAVE_RAND) && defined(HAVE_SRAND) && defined(HAVE_TIME) && \ 37 !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION) 38 #define HASH_RANDOMIZATION 47 #define MAX_HASH_LEN 8 73 #ifdef HASH_RANDOMIZATION 91 #ifdef HASH_RANDOMIZATION 95 value += 30 * (*name);
96 while ((ch = *
name++) != 0) {
102 while ((ch = *
name2++) != 0) {
108 while ((ch = *
name3++) != 0) {
126 #ifdef HASH_RANDOMIZATION 130 value += 30 * (*prefix);
132 value += 30 * (*name);
134 if (prefix !=
NULL) {
135 while ((ch = *prefix++) != 0) {
141 while ((ch = *
name++) != 0) {
146 if (prefix2 !=
NULL) {
147 while ((ch = *prefix2++) != 0) {
153 while ((ch = *
name2++) != 0) {
158 if (prefix3 !=
NULL) {
159 while ((ch = *prefix3++) != 0) {
165 while ((ch = *
name3++) != 0) {
195 #ifdef HASH_RANDOMIZATION 242 unsigned long nbElem = 0;
252 oldsize =
table->size;
253 oldtable =
table->table;
254 if (oldtable ==
NULL)
259 table->table = oldtable;
271 for (
i = 0;
i < oldsize;
i++) {
272 if (oldtable[
i].
valid == 0)
280 for (
i = 0;
i < oldsize;
i++) {
281 iter = oldtable[
i].
next;
312 "xmlHashGrow : from %d to %d, %d elems\n", oldsize,
size, nbElem);
331 int inside_table = 0;
337 nbElems =
table->nbElems;
338 for(
i = 0; (
i <
table->size) && (nbElems > 0);
i++) {
339 iter = &(
table->table[
i]);
340 if (iter->
valid == 0)
539 unsigned long key,
len = 0;
620 entry->payload = userdata;
698 insert->payload = userdata;
707 insert->payload = userdata;
718 insert->payload = userdata;
727 insert->payload = userdata;
750 entry->payload = userdata;
791 return(
entry->payload);
798 return(
entry->payload);
837 return(
entry->payload);
892 if (
table->table[
i].valid == 0)
894 iter = &(
table->table[
i]);
901 if (nb !=
table->nbElems) {
903 if (iter == &(
table->table[
i])) {
904 if (
table->table[
i].valid == 0)
907 iter = &(
table->table[
i]);
969 if (
table->table[
i].valid == 0)
971 iter = &(
table->table[
i]);
1014 if (
table->table[
i].valid == 0)
1016 iter = &(
table->table[
i]);
1042 return(
table->nbElems);
1106 if (
table->table[
key].valid == 0) {
void * xmlHashQLookup3(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3)
int xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator f)
XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict)
int xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name, xmlHashDeallocator f)
void * xmlHashLookup2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2)
void(* xmlHashDeallocator)(void *payload, const xmlChar *name)
void(* xmlHashScannerFull)(void *payload, void *data, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
GLenum GLsizei GLenum GLenum const GLvoid * table
struct _xmlHashEntry * next
int xmlHashUpdateEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata, xmlHashDeallocator f)
void xmlHashFree(xmlHashTablePtr table, xmlHashDeallocator f)
void * xmlHashLookup(xmlHashTablePtr table, const xmlChar *name)
XMLPUBFUN int XMLCALL xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str)
int xmlHashSize(xmlHashTablePtr table)
#define ATTRIBUTE_NO_SANITIZE(arg)
int xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f)
xmlHashScanner hashscanner
void * xmlHashLookup3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
void *(* xmlHashCopier)(void *payload, const xmlChar *name)
static unsigned long xmlHashComputeQKey(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3)
xmlHashTablePtr xmlHashCopy(xmlHashTablePtr table, xmlHashCopier f)
static void stubHashScannerFull(void *payload, void *data, const xmlChar *name, const xmlChar *name2 ATTRIBUTE_UNUSED, const xmlChar *name3 ATTRIBUTE_UNUSED)
struct _xmlHashEntry * table
void xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data)
void xmlHashDefaultDeallocator(void *entry, const xmlChar *name ATTRIBUTE_UNUSED)
XMLPUBVAR xmlFreeFunc xmlFree
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void * xmlHashQLookup(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name)
XMLPUBFUN void XMLCALL xmlDictFree(xmlDictPtr dict)
#define memcpy(s1, s2, n)
int xmlHashAddEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata)
void xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull f, void *data)
void(* xmlHashScanner)(void *payload, void *data, const xmlChar *name)
xmlHashTablePtr xmlHashCreate(int size)
void * xmlHashQLookup2(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2)
static int xmlHashGrow(xmlHashTablePtr table, int size)
int xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
static unsigned __int64 next
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void xmlHashScan3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data)
int xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator f)
XMLPUBFUN int XMLCALL xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
XMLPUBVAR xmlMallocFunc xmlMalloc
int xmlHashUpdateEntry2(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata, xmlHashDeallocator f)
void xmlHashScan(xmlHashTablePtr table, xmlHashScanner f, void *data)
xmlHashTablePtr xmlHashCreateDict(int size, xmlDictPtr dict)
static const WCHAR name3[]
static unsigned long xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
xmlHashEntry * xmlHashEntryPtr
int xmlHashAddEntry(xmlHashTablePtr table, const xmlChar *name, void *userdata)
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
XMLPUBVAR void * xmlGenericErrorContext