1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-03-25 10:50:08 +03:00

hash: Clean up libxml/hash.h

Rename variables, fix subincludes, whitespace.
This commit is contained in:
Nick Wellnhofer 2023-09-16 19:58:42 +02:00
parent de4b270aef
commit 9fc5090c05
7 changed files with 65 additions and 63 deletions

View File

@ -14,6 +14,7 @@
#include <stdio.h>
#include <libxml/xmlreader.h>
#include <libxml/parser.h>
#ifdef LIBXML_READER_ENABLED

View File

@ -13,6 +13,7 @@
#include <stddef.h>
#include <libxml/xmlversion.h>
#include <libxml/xmlstring.h>
#ifdef __cplusplus
extern "C" {

View File

@ -11,6 +11,10 @@
#ifndef __XML_HASH_H__
#define __XML_HASH_H__
#include <libxml/xmlversion.h>
#include <libxml/dict.h>
#include <libxml/xmlstring.h>
#ifdef __cplusplus
extern "C" {
#endif
@ -21,18 +25,6 @@ extern "C" {
typedef struct _xmlHashTable xmlHashTable;
typedef xmlHashTable *xmlHashTablePtr;
#ifdef __cplusplus
}
#endif
#include <libxml/xmlversion.h>
#include <libxml/parser.h>
#include <libxml/dict.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Recent version of gcc produce a warning when a function pointer is assigned
* to an object pointer, or vice versa. The following macro is a dirty hack
@ -55,7 +47,6 @@ extern "C" {
#define XML_CAST_FPTR(fptr) fptr
/*
* function types:
*/
@ -104,131 +95,136 @@ typedef void (*xmlHashScannerFull)(void *payload, void *data,
* Constructor and destructor.
*/
XMLPUBFUN xmlHashTablePtr
xmlHashCreate (int size);
xmlHashCreate (int size);
XMLPUBFUN xmlHashTablePtr
xmlHashCreateDict(int size,
xmlHashCreateDict (int size,
xmlDictPtr dict);
XMLPUBFUN void
xmlHashFree (xmlHashTablePtr table,
xmlHashDeallocator f);
xmlHashFree (xmlHashTablePtr hash,
xmlHashDeallocator dealloc);
XMLPUBFUN void
xmlHashDefaultDeallocator(void *entry,
xmlHashDefaultDeallocator(void *entry,
const xmlChar *name);
/*
* Add a new entry to the hash table.
*/
XMLPUBFUN int
xmlHashAddEntry (xmlHashTablePtr table,
xmlHashAddEntry (xmlHashTablePtr hash,
const xmlChar *name,
void *userdata);
XMLPUBFUN int
xmlHashUpdateEntry(xmlHashTablePtr table,
xmlHashUpdateEntry (xmlHashTablePtr hash,
const xmlChar *name,
void *userdata,
xmlHashDeallocator f);
xmlHashDeallocator dealloc);
XMLPUBFUN int
xmlHashAddEntry2(xmlHashTablePtr table,
xmlHashAddEntry2 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
void *userdata);
XMLPUBFUN int
xmlHashUpdateEntry2(xmlHashTablePtr table,
xmlHashUpdateEntry2 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
void *userdata,
xmlHashDeallocator f);
xmlHashDeallocator dealloc);
XMLPUBFUN int
xmlHashAddEntry3(xmlHashTablePtr table,
xmlHashAddEntry3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
void *userdata);
XMLPUBFUN int
xmlHashUpdateEntry3(xmlHashTablePtr table,
xmlHashUpdateEntry3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
void *userdata,
xmlHashDeallocator f);
xmlHashDeallocator dealloc);
/*
* Remove an entry from the hash table.
*/
XMLPUBFUN int
xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
xmlHashDeallocator f);
xmlHashRemoveEntry (xmlHashTablePtr hash,
const xmlChar *name,
xmlHashDeallocator dealloc);
XMLPUBFUN int
xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, xmlHashDeallocator f);
xmlHashRemoveEntry2 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
xmlHashDeallocator dealloc);
XMLPUBFUN int
xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
const xmlChar *name2, const xmlChar *name3,
xmlHashDeallocator f);
xmlHashRemoveEntry3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
xmlHashDeallocator dealloc);
/*
* Retrieve the userdata.
* Retrieve the payload.
*/
XMLPUBFUN void *
xmlHashLookup (xmlHashTablePtr table,
xmlHashLookup (xmlHashTablePtr hash,
const xmlChar *name);
XMLPUBFUN void *
xmlHashLookup2 (xmlHashTablePtr table,
xmlHashLookup2 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2);
XMLPUBFUN void *
xmlHashLookup3 (xmlHashTablePtr table,
xmlHashLookup3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3);
XMLPUBFUN void *
xmlHashQLookup (xmlHashTablePtr table,
const xmlChar *name,
const xmlChar *prefix);
XMLPUBFUN void *
xmlHashQLookup2 (xmlHashTablePtr table,
const xmlChar *name,
xmlHashQLookup (xmlHashTablePtr hash,
const xmlChar *prefix,
const xmlChar *name2,
const xmlChar *prefix2);
const xmlChar *name);
XMLPUBFUN void *
xmlHashQLookup3 (xmlHashTablePtr table,
const xmlChar *name,
xmlHashQLookup2 (xmlHashTablePtr hash,
const xmlChar *prefix,
const xmlChar *name2,
const xmlChar *name,
const xmlChar *prefix2,
const xmlChar *name3,
const xmlChar *prefix3);
const xmlChar *name2);
XMLPUBFUN void *
xmlHashQLookup3 (xmlHashTablePtr hash,
const xmlChar *prefix,
const xmlChar *name,
const xmlChar *prefix2,
const xmlChar *name2,
const xmlChar *prefix3,
const xmlChar *name3);
/*
* Helpers.
*/
XMLPUBFUN xmlHashTablePtr
xmlHashCopy (xmlHashTablePtr table,
xmlHashCopier f);
xmlHashCopy (xmlHashTablePtr hash,
xmlHashCopier copy);
XMLPUBFUN int
xmlHashSize (xmlHashTablePtr table);
xmlHashSize (xmlHashTablePtr hash);
XMLPUBFUN void
xmlHashScan (xmlHashTablePtr table,
xmlHashScanner f,
xmlHashScan (xmlHashTablePtr hash,
xmlHashScanner scan,
void *data);
XMLPUBFUN void
xmlHashScan3 (xmlHashTablePtr table,
xmlHashScan3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
xmlHashScanner f,
xmlHashScanner scan,
void *data);
XMLPUBFUN void
xmlHashScanFull (xmlHashTablePtr table,
xmlHashScannerFull f,
xmlHashScanFull (xmlHashTablePtr hash,
xmlHashScannerFull scan,
void *data);
XMLPUBFUN void
xmlHashScanFull3(xmlHashTablePtr table,
xmlHashScanFull3 (xmlHashTablePtr hash,
const xmlChar *name,
const xmlChar *name2,
const xmlChar *name3,
xmlHashScannerFull f,
xmlHashScannerFull scan,
void *data);
#ifdef __cplusplus
}

View File

@ -11,7 +11,7 @@
#define __XML_RELAX_NG__
#include <libxml/xmlversion.h>
#include <libxml/hash.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlstring.h>
#ifdef LIBXML_SCHEMAS_ENABLED

View File

@ -12,6 +12,7 @@
#include <libxml/xmlversion.h>
#include <libxml/tree.h>
#include <libxml/xmlerror.h>
#include <libxml/xmlIO.h>
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/relaxng.h>

View File

@ -16,7 +16,9 @@
#ifdef LIBXML_SCHEMAS_ENABLED
#include <libxml/encoding.h>
#include <libxml/tree.h>
#include <libxml/xmlerror.h>
#ifdef __cplusplus
extern "C" {

View File

@ -17,6 +17,7 @@
#include <libxml/xmlerror.h>
#include <libxml/catalog.h>
#include <libxml/relaxng.h>
#include <libxml/parser.h>
static int testlibxml2(void);