ReactOS  0.4.15-dev-1068-g467feb9
hash.h File Reference
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/dict.h>
Include dependency graph for hash.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define XML_CAST_FPTR(fptr)   fptr
 

Typedefs

typedef struct _xmlHashTable xmlHashTable
 
typedef xmlHashTablexmlHashTablePtr
 
: the name associated

xmlHashScannerFull: @payload: the data in the hash @data: extra scanner data

typedef void(* xmlHashDeallocator) (void *payload, const xmlChar *name)
 
typedef void *(* xmlHashCopier) (void *payload, const xmlChar *name)
 
typedef void(* xmlHashScanner) (void *payload, void *data, const xmlChar *name)
 

3: the third name associated

Callback when scanning data in a hash with the full scanner.

typedef void(* xmlHashScannerFull) (void *payload, void *data, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
 
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreate (int size)
 
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreateDict (int size, xmlDictPtr dict)
 
XMLPUBFUN void XMLCALL xmlHashFree (xmlHashTablePtr table, xmlHashDeallocator f)
 
XMLPUBFUN void XMLCALL xmlHashDefaultDeallocator (void *entry, const xmlChar *name)
 
XMLPUBFUN int XMLCALL xmlHashAddEntry (xmlHashTablePtr table, const xmlChar *name, void *userdata)
 
XMLPUBFUN int XMLCALL xmlHashUpdateEntry (xmlHashTablePtr table, const xmlChar *name, void *userdata, xmlHashDeallocator f)
 
XMLPUBFUN int XMLCALL xmlHashAddEntry2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata)
 
XMLPUBFUN int XMLCALL xmlHashUpdateEntry2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, void *userdata, xmlHashDeallocator f)
 
XMLPUBFUN int XMLCALL xmlHashAddEntry3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
 
XMLPUBFUN int XMLCALL xmlHashUpdateEntry3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator f)
 
XMLPUBFUN int XMLCALL xmlHashRemoveEntry (xmlHashTablePtr table, const xmlChar *name, xmlHashDeallocator f)
 
XMLPUBFUN int XMLCALL xmlHashRemoveEntry2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, xmlHashDeallocator f)
 
XMLPUBFUN int XMLCALL xmlHashRemoveEntry3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f)
 
XMLPUBFUN void *XMLCALL xmlHashLookup (xmlHashTablePtr table, const xmlChar *name)
 
XMLPUBFUN void *XMLCALL xmlHashLookup2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2)
 
XMLPUBFUN void *XMLCALL xmlHashLookup3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
 
XMLPUBFUN void *XMLCALL xmlHashQLookup (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix)
 
XMLPUBFUN void *XMLCALL xmlHashQLookup2 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, const xmlChar *name2, const xmlChar *prefix2)
 
XMLPUBFUN void *XMLCALL xmlHashQLookup3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *prefix, const xmlChar *name2, const xmlChar *prefix2, const xmlChar *name3, const xmlChar *prefix3)
 
XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCopy (xmlHashTablePtr table, xmlHashCopier f)
 
XMLPUBFUN int XMLCALL xmlHashSize (xmlHashTablePtr table)
 
XMLPUBFUN void XMLCALL xmlHashScan (xmlHashTablePtr table, xmlHashScanner f, void *data)
 
XMLPUBFUN void XMLCALL xmlHashScan3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScanner f, void *data)
 
XMLPUBFUN void XMLCALL xmlHashScanFull (xmlHashTablePtr table, xmlHashScannerFull f, void *data)
 
XMLPUBFUN void XMLCALL xmlHashScanFull3 (xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull f, void *data)
 

Macro Definition Documentation

◆ XML_CAST_FPTR

#define XML_CAST_FPTR (   fptr)    fptr

XML_CAST_FPTR: @fptr: pointer to a function

Macro to do a casting from an object pointer to a function pointer without encountering a warning from gcc

define XML_CAST_FPTR(fptr) (*(void **)(&fptr)) This macro violated ISO C aliasing rules (gcc4 on s390 broke) so it is disabled now

Definition at line 56 of file hash.h.

Typedef Documentation

◆ xmlHashCopier

typedef void*(* xmlHashCopier) (void *payload, const xmlChar *name)

Definition at line 79 of file hash.h.

◆ xmlHashDeallocator

typedef void(* xmlHashDeallocator) (void *payload, const xmlChar *name)

Definition at line 69 of file hash.h.

◆ xmlHashScanner

typedef void(* xmlHashScanner) (void *payload, void *data, const xmlChar *name)

Definition at line 88 of file hash.h.

◆ xmlHashScannerFull

typedef void(* xmlHashScannerFull) (void *payload, void *data, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)

Definition at line 99 of file hash.h.

◆ xmlHashTable

Definition at line 21 of file hash.h.

◆ xmlHashTablePtr

Definition at line 22 of file hash.h.

Function Documentation

◆ xmlHashAddEntry()

XMLPUBFUN int XMLCALL xmlHashAddEntry ( xmlHashTablePtr  table,
const xmlChar name,
void userdata 
)

Definition at line 394 of file hash.c.

394  {
395  return(xmlHashAddEntry3(table, name, NULL, NULL, userdata));
396 }
smooth NULL
Definition: ftsmooth.c:416
int xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
Definition: hash.c:536
Definition: name.c:38

Referenced by xmlAddID(), xmlAddNotationDecl(), xmlAddRef(), xsltGetExtData(), xsltInitCtxtExt(), xsltInitCtxtKey(), xsltNamespaceAlias(), xsltRegisterExtModuleFull(), and xsltStyleInitializeStylesheetModule().

◆ xmlHashAddEntry2()

XMLPUBFUN int XMLCALL xmlHashAddEntry2 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
void userdata 
)

Definition at line 411 of file hash.c.

412  {
413  return(xmlHashAddEntry3(table, name, name2, NULL, userdata));
414 }
smooth NULL
Definition: ftsmooth.c:416
int xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
Definition: hash.c:536
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35

Referenced by xmlAddElementDecl(), xmlAddSpecialAttr(), xmlGetDtdElementDesc2(), xsltAddTemplate(), xsltDocumentElem(), xsltEvalGlobalVariables(), xsltParseStylesheetAttributeSet(), xsltParseStylesheetOutput(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetStripSpace(), xsltProcessUserParamInternal(), xsltRegisterExtElement(), xsltRegisterExtFunction(), and xsltResolveSASCallback().

◆ xmlHashAddEntry3()

XMLPUBFUN int XMLCALL xmlHashAddEntry3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
const xmlChar name3,
void userdata 
)

Definition at line 536 of file hash.c.

538  {
539  unsigned long key, len = 0;
542 
543  if ((table == NULL) || (name == NULL))
544  return(-1);
545 
546  /*
547  * If using a dict internalize if needed
548  */
549  if (table->dict) {
550  if (!xmlDictOwns(table->dict, name)) {
551  name = xmlDictLookup(table->dict, name, -1);
552  if (name == NULL)
553  return(-1);
554  }
555  if ((name2 != NULL) && (!xmlDictOwns(table->dict, name2))) {
556  name2 = xmlDictLookup(table->dict, name2, -1);
557  if (name2 == NULL)
558  return(-1);
559  }
560  if ((name3 != NULL) && (!xmlDictOwns(table->dict, name3))) {
561  name3 = xmlDictLookup(table->dict, name3, -1);
562  if (name3 == NULL)
563  return(-1);
564  }
565  }
566 
567  /*
568  * Check for duplicate and insertion location.
569  */
571  if (table->table[key].valid == 0) {
572  insert = NULL;
573  } else {
574  if (table->dict) {
575  for (insert = &(table->table[key]); insert->next != NULL;
576  insert = insert->next) {
577  if ((insert->name == name) &&
578  (insert->name2 == name2) &&
579  (insert->name3 == name3))
580  return(-1);
581  len++;
582  }
583  if ((insert->name == name) &&
584  (insert->name2 == name2) &&
585  (insert->name3 == name3))
586  return(-1);
587  } else {
588  for (insert = &(table->table[key]); insert->next != NULL;
589  insert = insert->next) {
590  if ((xmlStrEqual(insert->name, name)) &&
591  (xmlStrEqual(insert->name2, name2)) &&
592  (xmlStrEqual(insert->name3, name3)))
593  return(-1);
594  len++;
595  }
596  if ((xmlStrEqual(insert->name, name)) &&
597  (xmlStrEqual(insert->name2, name2)) &&
598  (xmlStrEqual(insert->name3, name3)))
599  return(-1);
600  }
601  }
602 
603  if (insert == NULL) {
604  entry = &(table->table[key]);
605  } else {
606  entry = xmlMalloc(sizeof(xmlHashEntry));
607  if (entry == NULL)
608  return(-1);
609  }
610 
611  if (table->dict != NULL) {
612  entry->name = (xmlChar *) name;
613  entry->name2 = (xmlChar *) name2;
614  entry->name3 = (xmlChar *) name3;
615  } else {
616  entry->name = xmlStrdup(name);
617  entry->name2 = xmlStrdup(name2);
618  entry->name3 = xmlStrdup(name3);
619  }
620  entry->payload = userdata;
621  entry->next = NULL;
622  entry->valid = 1;
623 
624 
625  if (insert != NULL)
626  insert->next = entry;
627 
628  table->nbElems++;
629 
630  if (len > MAX_HASH_LEN)
632 
633  return(0);
634 }
static int insert
Definition: xmllint.c:144
smooth NULL
Definition: ftsmooth.c:416
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
Definition: dict.c:865
#define MAX_HASH_LEN
Definition: hash.c:47
HKEY key
Definition: reg.c:42
uint32_t entry
Definition: isohybrid.c:63
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722
static int xmlHashGrow(xmlHashTablePtr table, int size)
Definition: hash.c:236
XMLPUBFUN int XMLCALL xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
Definition: dict.c:1218
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
static const WCHAR name3[]
Definition: db.c:2958
static unsigned long xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:86
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66
Definition: path.c:41

Referenced by xmlAddAttributeDecl(), xmlHashAddEntry(), xmlHashAddEntry2(), xmlHashCopy(), and xsltAddTemplate().

◆ xmlHashCopy()

xmlHashCopy: @table: the hash table @f: the copier function for items in the hash

Scan the hash @table and applied @f to each value.

Returns the new table or NULL in case of error.

Definition at line 997 of file hash.c.

997  {
998  int i;
999  xmlHashEntryPtr iter;
1002 
1003  if (table == NULL)
1004  return(NULL);
1005  if (f == NULL)
1006  return(NULL);
1007 
1008  ret = xmlHashCreate(table->size);
1009  if (ret == NULL)
1010  return(NULL);
1011 
1012  if (table->table) {
1013  for(i = 0; i < table->size; i++) {
1014  if (table->table[i].valid == 0)
1015  continue;
1016  iter = &(table->table[i]);
1017  while (iter) {
1018  next = iter->next;
1019  xmlHashAddEntry3(ret, iter->name, iter->name2,
1020  iter->name3, f(iter->payload, iter->name));
1021  iter = next;
1022  }
1023  }
1024  }
1025  ret->nbElems = table->nbElems;
1026  return(ret);
1027 }
struct _xmlHashEntry * next
Definition: hash.c:57
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
Definition: glfuncs.h:248
void * payload
Definition: hash.c:61
smooth NULL
Definition: ftsmooth.c:416
xmlChar * name
Definition: hash.c:58
GLfloat f
Definition: glext.h:7540
int ret
xmlHashTablePtr xmlHashCreate(int size)
Definition: hash.c:181
int xmlHashAddEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata)
Definition: hash.c:536
static unsigned __int64 next
Definition: rand_nt.c:6
xmlChar * name3
Definition: hash.c:60
xmlChar * name2
Definition: hash.c:59

◆ xmlHashCreate()

XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreate ( int  size)

xmlHashCreate: @size: the size of the hash table

Create a new xmlHashTablePtr.

Returns the newly created object, or NULL if an error occurred.

Definition at line 181 of file hash.c.

181  {
183 
184  if (size <= 0)
185  size = 256;
186 
187  table = xmlMalloc(sizeof(xmlHashTable));
188  if (table) {
189  table->dict = NULL;
190  table->size = size;
191  table->nbElems = 0;
192  table->table = xmlMalloc(size * sizeof(xmlHashEntry));
193  if (table->table) {
194  memset(table->table, 0, size * sizeof(xmlHashEntry));
195 #ifdef HASH_RANDOMIZATION
196  table->random_seed = __xmlRandom();
197 #endif
198  return(table);
199  }
200  xmlFree(table);
201  }
202  return(NULL);
203 }
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
int __xmlRandom(void)
Definition: dict.c:198
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
#define memset(x, y, z)
Definition: compat.h:39

Referenced by xmlHashCopy(), xmlHashCreateDict(), xsltAddTemplate(), xsltApplyStylesheetInternal(), xsltDocumentElem(), xsltGatherNamespaces(), xsltGetExtData(), xsltInitCtxtExt(), xsltNamespaceAlias(), xsltNewKeyTable(), xsltParseStylesheetAttributeSet(), xsltParseStylesheetOutput(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetStripSpace(), xsltProcessUserParamInternal(), xsltRegisterExtElement(), xsltRegisterExtFunction(), xsltRegisterExtModuleElement(), xsltRegisterExtModuleFull(), xsltRegisterExtModuleFunction(), xsltRegisterExtModuleTopLevel(), xsltResolveStylesheetAttributeSet(), and xsltStyleInitializeStylesheetModule().

◆ xmlHashCreateDict()

XMLPUBFUN xmlHashTablePtr XMLCALL xmlHashCreateDict ( int  size,
xmlDictPtr  dict 
)

xmlHashCreateDict: @size: the size of the hash table @dict: a dictionary to use for the hash

Create a new xmlHashTablePtr which will use @dict as the internal dictionary

Returns the newly created object, or NULL if an error occurred.

Definition at line 215 of file hash.c.

215  {
217 
219  if (table != NULL) {
220  table->dict = dict;
221  xmlDictReference(dict);
222  }
223  return(table);
224 }
XMLPUBFUN int XMLCALL xmlDictReference(xmlDictPtr dict)
Definition: dict.c:645
GLenum GLsizei GLenum GLenum const GLvoid * table
Definition: glext.h:5644
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
xmlHashTablePtr xmlHashCreate(int size)
Definition: hash.c:181

Referenced by xmlAddAttributeDecl(), xmlAddDefAttrs(), xmlAddElementDecl(), xmlAddID(), xmlAddNotationDecl(), xmlAddRef(), xmlAddSpecialAttr(), and xmlGetDtdElementDesc2().

◆ xmlHashDefaultDeallocator()

XMLPUBFUN void XMLCALL xmlHashDefaultDeallocator ( void entry,
const xmlChar name 
)

Referenced by xmlCtxtReset(), and xmlFreeParserCtxt().

◆ xmlHashFree()

XMLPUBFUN void XMLCALL xmlHashFree ( xmlHashTablePtr  table,
xmlHashDeallocator  f 
)

xmlHashFree: @table: the hash table @f: the deallocator function for items in the hash

Free the hash @table and its contents. The userdata is deallocated with @f if provided.

Definition at line 327 of file hash.c.

327  {
328  int i;
329  xmlHashEntryPtr iter;
331  int inside_table = 0;
332  int nbElems;
333 
334  if (table == NULL)
335  return;
336  if (table->table) {
337  nbElems = table->nbElems;
338  for(i = 0; (i < table->size) && (nbElems > 0); i++) {
339  iter = &(table->table[i]);
340  if (iter->valid == 0)
341  continue;
342  inside_table = 1;
343  while (iter) {
344  next = iter->next;
345  if ((f != NULL) && (iter->payload != NULL))
346  f(iter->payload, iter->name);
347  if (table->dict == NULL) {
348  if (iter->name)
349  xmlFree(iter->name);
350  if (iter->name2)
351  xmlFree(iter->name2);
352  if (iter->name3)
353  xmlFree(iter->name3);
354  }
355  iter->payload = NULL;
356  if (!inside_table)
357  xmlFree(iter);
358  nbElems--;
359  inside_table = 0;
360  iter = next;
361  }
362  }
363  xmlFree(table->table);
364  }
365  if (table->dict)
366  xmlDictFree(table->dict);
367  xmlFree(table);
368 }
struct _xmlHashEntry * next
Definition: hash.c:57
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
Definition: glfuncs.h:248
void * payload
Definition: hash.c:61
smooth NULL
Definition: ftsmooth.c:416
xmlChar * name
Definition: hash.c:58
int valid
Definition: hash.c:62
GLfloat f
Definition: glext.h:7540
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
XMLPUBFUN void XMLCALL xmlDictFree(xmlDictPtr dict)
Definition: dict.c:800
static unsigned __int64 next
Definition: rand_nt.c:6
xmlChar * name3
Definition: hash.c:60
#define f
Definition: ke_i.h:83
xmlChar * name2
Definition: hash.c:59

Referenced by xmlCleanSpecialAttr(), xmlCtxtReset(), xmlFreeAttributeTable(), xmlFreeElementTable(), xmlFreeIDTable(), xmlFreeNotationTable(), xmlFreeParserCtxt(), xmlFreeRefTable(), xsltCleanupGlobals(), xsltFreeAttributeSetsHashes(), xsltFreeCtxtExts(), xsltFreeGlobalVariables(), xsltFreeKeyTable(), xsltFreeNamespaceAliasHashes(), xsltFreeStylesheet(), xsltFreeTemplateHashes(), xsltResolveStylesheetAttributeSet(), xsltShutdownCtxtExts(), xsltShutdownExts(), xsltUnregisterAllExtModuleElement(), xsltUnregisterAllExtModuleFunction(), xsltUnregisterAllExtModules(), and xsltUnregisterAllExtModuleTopLevel().

◆ xmlHashLookup()

◆ xmlHashLookup2()

◆ xmlHashLookup3()

XMLPUBFUN void* XMLCALL xmlHashLookup3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
const xmlChar name3 
)

Definition at line 774 of file hash.c.

775  {
776  unsigned long key;
778 
779  if (table == NULL)
780  return(NULL);
781  if (name == NULL)
782  return(NULL);
784  if (table->table[key].valid == 0)
785  return(NULL);
786  if (table->dict) {
787  for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
788  if ((entry->name == name) &&
789  (entry->name2 == name2) &&
790  (entry->name3 == name3))
791  return(entry->payload);
792  }
793  }
794  for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
795  if ((xmlStrEqual(entry->name, name)) &&
796  (xmlStrEqual(entry->name2, name2)) &&
797  (xmlStrEqual(entry->name3, name3)))
798  return(entry->payload);
799  }
800  return(NULL);
801 }
smooth NULL
Definition: ftsmooth.c:416
HKEY key
Definition: reg.c:42
uint32_t entry
Definition: isohybrid.c:63
static const WCHAR name3[]
Definition: db.c:2958
static unsigned long xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:86
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
Definition: path.c:41

Referenced by xmlAddAttributeDecl(), xmlGetDtdAttrDesc(), xmlGetDtdQAttrDesc(), xmlHashLookup(), xmlHashLookup2(), xsltAddTemplate(), and xsltGetTemplate().

◆ xmlHashQLookup()

XMLPUBFUN void* XMLCALL xmlHashQLookup ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar prefix 
)

Definition at line 497 of file hash.c.

498  {
499  return(xmlHashQLookup3(table, prefix, name, NULL, NULL, NULL, NULL));
500 }
void * xmlHashQLookup3(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3)
Definition: hash.c:818
smooth NULL
Definition: ftsmooth.c:416
Definition: name.c:38

◆ xmlHashQLookup2()

XMLPUBFUN void* XMLCALL xmlHashQLookup2 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar prefix,
const xmlChar name2,
const xmlChar prefix2 
)

Definition at line 515 of file hash.c.

517  {
518  return(xmlHashQLookup3(table, prefix, name, prefix2, name2, NULL, NULL));
519 }
void * xmlHashQLookup3(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3)
Definition: hash.c:818
smooth NULL
Definition: ftsmooth.c:416
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35

Referenced by xmlParseAttribute2().

◆ xmlHashQLookup3()

XMLPUBFUN void* XMLCALL xmlHashQLookup3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar prefix,
const xmlChar name2,
const xmlChar prefix2,
const xmlChar name3,
const xmlChar prefix3 
)

Definition at line 818 of file hash.c.

821  {
822  unsigned long key;
824 
825  if (table == NULL)
826  return(NULL);
827  if (name == NULL)
828  return(NULL);
829  key = xmlHashComputeQKey(table, prefix, name, prefix2,
830  name2, prefix3, name3);
831  if (table->table[key].valid == 0)
832  return(NULL);
833  for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
834  if ((xmlStrQEqual(prefix, name, entry->name)) &&
835  (xmlStrQEqual(prefix2, name2, entry->name2)) &&
836  (xmlStrQEqual(prefix3, name3, entry->name3)))
837  return(entry->payload);
838  }
839  return(NULL);
840 }
XMLPUBFUN int XMLCALL xmlStrQEqual(const xmlChar *pref, const xmlChar *name, const xmlChar *str)
Definition: xmlstring.c:179
smooth NULL
Definition: ftsmooth.c:416
static unsigned long xmlHashComputeQKey(xmlHashTablePtr table, const xmlChar *prefix, const xmlChar *name, const xmlChar *prefix2, const xmlChar *name2, const xmlChar *prefix3, const xmlChar *name3)
Definition: hash.c:119
HKEY key
Definition: reg.c:42
uint32_t entry
Definition: isohybrid.c:63
static const WCHAR name3[]
Definition: db.c:2958
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
Definition: path.c:41

Referenced by xmlHashQLookup(), and xmlHashQLookup2().

◆ xmlHashRemoveEntry()

XMLPUBFUN int XMLCALL xmlHashRemoveEntry ( xmlHashTablePtr  table,
const xmlChar name,
xmlHashDeallocator  f 
)

Definition at line 1057 of file hash.c.

1058  {
1059  return(xmlHashRemoveEntry3(table, name, NULL, NULL, f));
1060 }
int xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f)
Definition: hash.c:1096
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
Definition: name.c:38

Referenced by xmlRemoveID(), and xsltUnregisterExtModule().

◆ xmlHashRemoveEntry2()

XMLPUBFUN int XMLCALL xmlHashRemoveEntry2 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
xmlHashDeallocator  f 
)

Definition at line 1076 of file hash.c.

1077  {
1078  return(xmlHashRemoveEntry3(table, name, name2, NULL, f));
1079 }
int xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashDeallocator f)
Definition: hash.c:1096
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35

Referenced by xmlAddElementDecl(), xmlCleanSpecialAttrCallback(), xsltResolveAttrSet(), xsltUnregisterExtModuleElement(), xsltUnregisterExtModuleFunction(), and xsltUnregisterExtModuleTopLevel().

◆ xmlHashRemoveEntry3()

XMLPUBFUN int XMLCALL xmlHashRemoveEntry3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
const xmlChar name3,
xmlHashDeallocator  f 
)

Definition at line 1096 of file hash.c.

1097  {
1098  unsigned long key;
1100  xmlHashEntryPtr prev = NULL;
1101 
1102  if (table == NULL || name == NULL)
1103  return(-1);
1104 
1106  if (table->table[key].valid == 0) {
1107  return(-1);
1108  } else {
1109  for (entry = &(table->table[key]); entry != NULL; entry = entry->next) {
1110  if (xmlStrEqual(entry->name, name) &&
1111  xmlStrEqual(entry->name2, name2) &&
1112  xmlStrEqual(entry->name3, name3)) {
1113  if ((f != NULL) && (entry->payload != NULL))
1114  f(entry->payload, entry->name);
1115  entry->payload = NULL;
1116  if (table->dict == NULL) {
1117  if(entry->name)
1118  xmlFree(entry->name);
1119  if(entry->name2)
1120  xmlFree(entry->name2);
1121  if(entry->name3)
1122  xmlFree(entry->name3);
1123  }
1124  if(prev) {
1125  prev->next = entry->next;
1126  xmlFree(entry);
1127  } else {
1128  if (entry->next == NULL) {
1129  entry->valid = 0;
1130  } else {
1131  entry = entry->next;
1132  memcpy(&(table->table[key]), entry, sizeof(xmlHashEntry));
1133  xmlFree(entry);
1134  }
1135  }
1136  table->nbElems--;
1137  return(0);
1138  }
1139  prev = entry;
1140  }
1141  return(-1);
1142  }
1143 }
struct _xmlHashEntry * next
Definition: hash.c:57
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
HKEY key
Definition: reg.c:42
uint32_t entry
Definition: isohybrid.c:63
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define f
Definition: ke_i.h:83
static const WCHAR name3[]
Definition: db.c:2958
static unsigned long xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:86
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
Definition: path.c:41

Referenced by xmlHashRemoveEntry(), and xmlHashRemoveEntry2().

◆ xmlHashScan()

XMLPUBFUN void XMLCALL xmlHashScan ( xmlHashTablePtr  table,
xmlHashScanner  f,
void data 
)

xmlHashScan: @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.

Definition at line 864 of file hash.c.

864  {
865  stubData stubdata;
866  stubdata.data = data;
867  stubdata.hashscanner = f;
869 }
xmlHashScanner hashscanner
Definition: hash.c:843
static void stubHashScannerFull(void *payload, void *data, const xmlChar *name, const xmlChar *name2 ATTRIBUTE_UNUSED, const xmlChar *name3 ATTRIBUTE_UNUSED)
Definition: hash.c:848
void xmlHashScanFull(xmlHashTablePtr table, xmlHashScannerFull f, void *data)
Definition: hash.c:880
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * data
Definition: hash.c:844
#define f
Definition: ke_i.h:83
Definition: hash.c:842

Referenced by xsltCleanupGlobals(), xsltEvalGlobalVariables(), xsltFixImportedCompSteps(), xsltInitCtxtExts(), xsltShutdownCtxtExts(), and xsltShutdownExts().

◆ xmlHashScan3()

XMLPUBFUN void XMLCALL xmlHashScan3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
const xmlChar name3,
xmlHashScanner  f,
void data 
)

Definition at line 931 of file hash.c.

933  {
934  stubData stubdata;
935  stubdata.data = data;
936  stubdata.hashscanner = f;
938  &stubdata);
939 }
xmlHashScanner hashscanner
Definition: hash.c:843
static void stubHashScannerFull(void *payload, void *data, const xmlChar *name, const xmlChar *name2 ATTRIBUTE_UNUSED, const xmlChar *name3 ATTRIBUTE_UNUSED)
Definition: hash.c:848
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * data
Definition: hash.c:844
void xmlHashScanFull3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, xmlHashScannerFull f, void *data)
Definition: hash.c:955
#define f
Definition: ke_i.h:83
static const WCHAR name3[]
Definition: db.c:2958
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
Definition: hash.c:842

◆ xmlHashScanFull()

XMLPUBFUN void XMLCALL xmlHashScanFull ( xmlHashTablePtr  table,
xmlHashScannerFull  f,
void 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.

Definition at line 880 of file hash.c.

880  {
881  int i, nb;
882  xmlHashEntryPtr iter;
884 
885  if (table == NULL)
886  return;
887  if (f == NULL)
888  return;
889 
890  if (table->table) {
891  for(i = 0; i < table->size; i++) {
892  if (table->table[i].valid == 0)
893  continue;
894  iter = &(table->table[i]);
895  while (iter) {
896  next = iter->next;
897  nb = table->nbElems;
898  if ((f != NULL) && (iter->payload != NULL))
899  f(iter->payload, data, iter->name,
900  iter->name2, iter->name3);
901  if (nb != table->nbElems) {
902  /* table was modified by the callback, be careful */
903  if (iter == &(table->table[i])) {
904  if (table->table[i].valid == 0)
905  iter = NULL;
906  if (table->table[i].next != next)
907  iter = &(table->table[i]);
908  } else
909  iter = next;
910  } else
911  iter = next;
912  }
913  }
914  }
915 }
struct _xmlHashEntry * next
Definition: hash.c:57
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
Definition: glfuncs.h:248
void * payload
Definition: hash.c:61
smooth NULL
Definition: ftsmooth.c:416
xmlChar * name
Definition: hash.c:58
GLfloat f
Definition: glext.h:7540
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static unsigned __int64 next
Definition: rand_nt.c:6
xmlChar * name3
Definition: hash.c:60
#define f
Definition: ke_i.h:83
xmlChar * name2
Definition: hash.c:59

Referenced by xmlCleanSpecialAttr(), xmlHashScan(), xsltDebugDumpExtensions(), and xsltResolveStylesheetAttributeSet().

◆ xmlHashScanFull3()

XMLPUBFUN void XMLCALL xmlHashScanFull3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
const xmlChar name3,
xmlHashScannerFull  f,
void data 
)

Definition at line 955 of file hash.c.

957  {
958  int i;
959  xmlHashEntryPtr iter;
961 
962  if (table == NULL)
963  return;
964  if (f == NULL)
965  return;
966 
967  if (table->table) {
968  for(i = 0; i < table->size; i++) {
969  if (table->table[i].valid == 0)
970  continue;
971  iter = &(table->table[i]);
972  while (iter) {
973  next = iter->next;
974  if (((name == NULL) || (xmlStrEqual(name, iter->name))) &&
975  ((name2 == NULL) || (xmlStrEqual(name2, iter->name2))) &&
976  ((name3 == NULL) || (xmlStrEqual(name3, iter->name3))) &&
977  (iter->payload != NULL)) {
978  f(iter->payload, data, iter->name,
979  iter->name2, iter->name3);
980  }
981  iter = next;
982  }
983  }
984  }
985 }
struct _xmlHashEntry * next
Definition: hash.c:57
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
Definition: glfuncs.h:248
void * payload
Definition: hash.c:61
smooth NULL
Definition: ftsmooth.c:416
xmlChar * name
Definition: hash.c:58
GLfloat f
Definition: glext.h:7540
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
static unsigned __int64 next
Definition: rand_nt.c:6
xmlChar * name3
Definition: hash.c:60
#define f
Definition: ke_i.h:83
xmlChar * name2
Definition: hash.c:59
static const WCHAR name3[]
Definition: db.c:2958
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157

Referenced by xmlHashScan3().

◆ xmlHashSize()

XMLPUBFUN int XMLCALL xmlHashSize ( xmlHashTablePtr  table)

xmlHashSize: @table: the hash table

Query the number of elements installed in the hash @table.

Returns the number of elements in the hash table or -1 in case of error

Definition at line 1039 of file hash.c.

1039  {
1040  if (table == NULL)
1041  return(-1);
1042  return(table->nbElems);
1043 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by xmlCleanSpecialAttr().

◆ xmlHashUpdateEntry()

XMLPUBFUN int XMLCALL xmlHashUpdateEntry ( xmlHashTablePtr  table,
const xmlChar name,
void userdata,
xmlHashDeallocator  f 
)

Definition at line 430 of file hash.c.

431  {
432  return(xmlHashUpdateEntry3(table, name, NULL, NULL, userdata, f));
433 }
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
int xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator f)
Definition: hash.c:652
Definition: name.c:38

Referenced by xmlRemoveRef(), and xsltGatherNamespaces().

◆ xmlHashUpdateEntry2()

XMLPUBFUN int XMLCALL xmlHashUpdateEntry2 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
void userdata,
xmlHashDeallocator  f 
)

Definition at line 450 of file hash.c.

452  {
453  return(xmlHashUpdateEntry3(table, name, name2, NULL, userdata, f));
454 }
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
int xmlHashUpdateEntry3(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3, void *userdata, xmlHashDeallocator f)
Definition: hash.c:652
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35

Referenced by xmlAddDefAttrs(), xsltRegisterExtModuleElement(), xsltRegisterExtModuleFunction(), and xsltRegisterExtModuleTopLevel().

◆ xmlHashUpdateEntry3()

XMLPUBFUN int XMLCALL xmlHashUpdateEntry3 ( xmlHashTablePtr  table,
const xmlChar name,
const xmlChar name2,
const xmlChar name3,
void userdata,
xmlHashDeallocator  f 
)

Definition at line 652 of file hash.c.

654  {
655  unsigned long key;
658 
659  if ((table == NULL) || name == NULL)
660  return(-1);
661 
662  /*
663  * If using a dict internalize if needed
664  */
665  if (table->dict) {
666  if (!xmlDictOwns(table->dict, name)) {
667  name = xmlDictLookup(table->dict, name, -1);
668  if (name == NULL)
669  return(-1);
670  }
671  if ((name2 != NULL) && (!xmlDictOwns(table->dict, name2))) {
672  name2 = xmlDictLookup(table->dict, name2, -1);
673  if (name2 == NULL)
674  return(-1);
675  }
676  if ((name3 != NULL) && (!xmlDictOwns(table->dict, name3))) {
677  name3 = xmlDictLookup(table->dict, name3, -1);
678  if (name3 == NULL)
679  return(-1);
680  }
681  }
682 
683  /*
684  * Check for duplicate and insertion location.
685  */
687  if (table->table[key].valid == 0) {
688  insert = NULL;
689  } else {
690  if (table ->dict) {
691  for (insert = &(table->table[key]); insert->next != NULL;
692  insert = insert->next) {
693  if ((insert->name == name) &&
694  (insert->name2 == name2) &&
695  (insert->name3 == name3)) {
696  if (f)
697  f(insert->payload, insert->name);
698  insert->payload = userdata;
699  return(0);
700  }
701  }
702  if ((insert->name == name) &&
703  (insert->name2 == name2) &&
704  (insert->name3 == name3)) {
705  if (f)
706  f(insert->payload, insert->name);
707  insert->payload = userdata;
708  return(0);
709  }
710  } else {
711  for (insert = &(table->table[key]); insert->next != NULL;
712  insert = insert->next) {
713  if ((xmlStrEqual(insert->name, name)) &&
714  (xmlStrEqual(insert->name2, name2)) &&
715  (xmlStrEqual(insert->name3, name3))) {
716  if (f)
717  f(insert->payload, insert->name);
718  insert->payload = userdata;
719  return(0);
720  }
721  }
722  if ((xmlStrEqual(insert->name, name)) &&
723  (xmlStrEqual(insert->name2, name2)) &&
724  (xmlStrEqual(insert->name3, name3))) {
725  if (f)
726  f(insert->payload, insert->name);
727  insert->payload = userdata;
728  return(0);
729  }
730  }
731  }
732 
733  if (insert == NULL) {
734  entry = &(table->table[key]);
735  } else {
736  entry = xmlMalloc(sizeof(xmlHashEntry));
737  if (entry == NULL)
738  return(-1);
739  }
740 
741  if (table->dict != NULL) {
742  entry->name = (xmlChar *) name;
743  entry->name2 = (xmlChar *) name2;
744  entry->name3 = (xmlChar *) name3;
745  } else {
746  entry->name = xmlStrdup(name);
747  entry->name2 = xmlStrdup(name2);
748  entry->name3 = xmlStrdup(name3);
749  }
750  entry->payload = userdata;
751  entry->next = NULL;
752  entry->valid = 1;
753  table->nbElems++;
754 
755 
756  if (insert != NULL) {
757  insert->next = entry;
758  }
759  return(0);
760 }
static int insert
Definition: xmllint.c:144
smooth NULL
Definition: ftsmooth.c:416
GLfloat f
Definition: glext.h:7540
XMLPUBFUN const xmlChar *XMLCALL xmlDictLookup(xmlDictPtr dict, const xmlChar *name, int len)
Definition: dict.c:865
HKEY key
Definition: reg.c:42
uint32_t entry
Definition: isohybrid.c:63
unsigned char xmlChar
Definition: xmlstring.h:28
#define f
Definition: ke_i.h:83
XMLPUBFUN int XMLCALL xmlDictOwns(xmlDictPtr dict, const xmlChar *str)
Definition: dict.c:1218
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
static const WCHAR name3[]
Definition: db.c:2958
static unsigned long xmlHashComputeKey(xmlHashTablePtr table, const xmlChar *name, const xmlChar *name2, const xmlChar *name3)
Definition: hash.c:86
Definition: name.c:38
static WCHAR name2[]
Definition: record.c:35
XMLPUBFUN int XMLCALL xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
XMLPUBFUN xmlChar *XMLCALL xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66
Definition: path.c:41

Referenced by xmlHashUpdateEntry(), xmlHashUpdateEntry2(), and xsltAddTemplate().