epoc32/include/stdapis/libxml2/libxml2_hash.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/stdapis/libxml2/libxml2_hash.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,220 @@
     1.4 +/*
     1.5 + * Summary: chained hash tables
     1.6 + * description: this module implement the hash table support used in
     1.7 + * various place in the library.
     1.8 + *
     1.9 + * Copy: See Copyright for the status of this software.
    1.10 + *
    1.11 + * Author: Bjorn Reese <bjorn.reese@systematic.dk>
    1.12 + * Portion Copyright © 2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved. 
    1.13 + */
    1.14 +
    1.15 +/** @file
    1.16 +@publishedAll
    1.17 +@released
    1.18 +*/
    1.19 +
    1.20 +#ifndef XML_HASH_H
    1.21 +#define XML_HASH_H
    1.22 +
    1.23 +#include <stdapis/libxml2/libxml2_xmlstring.h>
    1.24 +
    1.25 +#ifdef __cplusplus
    1.26 +extern "C" {
    1.27 +#endif
    1.28 +
    1.29 +/*
    1.30 + * The hash table.
    1.31 + */
    1.32 +typedef struct _xmlHashTable xmlHashTable;
    1.33 +typedef xmlHashTable* xmlHashTablePtr;
    1.34 +
    1.35 +#ifdef __cplusplus
    1.36 +}
    1.37 +#endif
    1.38 +#ifdef __cplusplus
    1.39 +extern "C" {
    1.40 +#endif
    1.41 +
    1.42 +/*
    1.43 + * function types:
    1.44 + */
    1.45 +/**
    1.46 + * xmlHashDeallocator:
    1.47 + * @param payload the data in the hash
    1.48 + * @param name the name associated
    1.49 + *
    1.50 + * Callback to free data from a hash.
    1.51 + */
    1.52 +typedef void (*xmlHashDeallocator)(void *payload, xmlChar *name);
    1.53 +/**
    1.54 + * xmlHashCopier:
    1.55 + * @param payload the data in the hash
    1.56 + * @param name the name associated
    1.57 + *
    1.58 + * Callback to copy data from a hash.
    1.59 + *
    1.60 + * Returns a copy of the data or NULL in case of error.
    1.61 + */
    1.62 +typedef void *(*xmlHashCopier)(void *payload, xmlChar *name);
    1.63 +/**
    1.64 + * xmlHashScanner:
    1.65 + * @param payload the data in the hash
    1.66 + * @param data extra scannner data
    1.67 + * @param name the name associated
    1.68 + *
    1.69 + * Callback when scanning data in a hash with the simple scanner.
    1.70 + */
    1.71 +typedef void (*xmlHashScanner)(void *payload, void *data, xmlChar *name);
    1.72 +/**
    1.73 + * xmlHashScannerFull:
    1.74 + * @param payload the data in the hash
    1.75 + * @param data extra scannner data
    1.76 + * @param name the name associated
    1.77 + * @param name2 the second name associated
    1.78 + * @param name3 the third name associated
    1.79 + *
    1.80 + * Callback when scanning data in a hash with the full scanner.
    1.81 + */
    1.82 +typedef void (*xmlHashScannerFull)(void *payload, void *data,
    1.83 +                                   const xmlChar *name, const xmlChar *name2,
    1.84 +                                   const xmlChar *name3);
    1.85 +
    1.86 +/*
    1.87 + * Constructor and destructor.
    1.88 + */
    1.89 +XMLPUBFUN xmlHashTablePtr XMLCALL
    1.90 +                        xmlHashCreate   (int size);
    1.91 +XMLPUBFUN void XMLCALL
    1.92 +                        xmlHashFree     (xmlHashTablePtr table,
    1.93 +                                         xmlHashDeallocator f);
    1.94 +
    1.95 +
    1.96 +/*
    1.97 + * Add a new entry to the hash table.
    1.98 + */
    1.99 +XMLPUBFUN int XMLCALL
   1.100 +                        xmlHashAddEntry (xmlHashTablePtr table,
   1.101 +                                         const xmlChar *name,
   1.102 +                                         void *userdata);
   1.103 +XMLPUBFUN int XMLCALL
   1.104 +                        xmlHashUpdateEntry(xmlHashTablePtr table,
   1.105 +                                         const xmlChar *name,
   1.106 +                                         void *userdata,
   1.107 +                                         xmlHashDeallocator f);
   1.108 +XMLPUBFUN int XMLCALL
   1.109 +                        xmlHashAddEntry2(xmlHashTablePtr table,
   1.110 +                                         const xmlChar *name,
   1.111 +                                         const xmlChar *name2,
   1.112 +                                         void *userdata);
   1.113 +XMLPUBFUN int XMLCALL
   1.114 +                        xmlHashUpdateEntry2(xmlHashTablePtr table,
   1.115 +                                         const xmlChar *name,
   1.116 +                                         const xmlChar *name2,
   1.117 +                                         void *userdata,
   1.118 +                                         xmlHashDeallocator f);
   1.119 +XMLPUBFUN int XMLCALL
   1.120 +                        xmlHashAddEntry3(xmlHashTablePtr table,
   1.121 +                                         const xmlChar *name,
   1.122 +                                         const xmlChar *name2,
   1.123 +                                         const xmlChar *name3,
   1.124 +                                         void *userdata);
   1.125 +XMLPUBFUN int XMLCALL
   1.126 +                        xmlHashUpdateEntry3(xmlHashTablePtr table,
   1.127 +                                         const xmlChar *name,
   1.128 +                                         const xmlChar *name2,
   1.129 +                                         const xmlChar *name3,
   1.130 +                                         void *userdata,
   1.131 +                                         xmlHashDeallocator f);
   1.132 +
   1.133 +/*
   1.134 + * Remove an entry from the hash table.
   1.135 + */
   1.136 +XMLPUBFUN int XMLCALL
   1.137 +                        xmlHashRemoveEntry(xmlHashTablePtr table, const xmlChar *name,
   1.138 +                           xmlHashDeallocator f);
   1.139 +XMLPUBFUN int XMLCALL
   1.140 +                        xmlHashRemoveEntry2(xmlHashTablePtr table, const xmlChar *name,
   1.141 +                            const xmlChar *name2, xmlHashDeallocator f);
   1.142 +XMLPUBFUN int  XMLCALL
   1.143 +                        xmlHashRemoveEntry3(xmlHashTablePtr table, const xmlChar *name,
   1.144 +                            const xmlChar *name2, const xmlChar *name3,
   1.145 +                            xmlHashDeallocator f);
   1.146 +
   1.147 +/*
   1.148 + * Retrieve the userdata.
   1.149 + */
   1.150 +XMLPUBFUN void * XMLCALL
   1.151 +                        xmlHashLookup   (xmlHashTablePtr table,
   1.152 +                                         const xmlChar *name);
   1.153 +XMLPUBFUN void * XMLCALL
   1.154 +                        xmlHashLookup2  (xmlHashTablePtr table,
   1.155 +                                         const xmlChar *name,
   1.156 +                                         const xmlChar *name2);
   1.157 +XMLPUBFUN void * XMLCALL
   1.158 +                        xmlHashLookup3  (xmlHashTablePtr table,
   1.159 +                                         const xmlChar *name,
   1.160 +                                         const xmlChar *name2,
   1.161 +                                         const xmlChar *name3);
   1.162 +
   1.163 +#ifndef XMLENGINE_EXCLUDE_UNUSED
   1.164 +XMLPUBFUN void * XMLCALL
   1.165 +                        xmlHashQLookup  (xmlHashTablePtr table,
   1.166 +                                         const xmlChar *name,
   1.167 +                                         const xmlChar *prefix);
   1.168 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
   1.169 +
   1.170 +XMLPUBFUN void * XMLCALL
   1.171 +                        xmlHashQLookup2 (xmlHashTablePtr table,
   1.172 +                                         const xmlChar *name,
   1.173 +                                         const xmlChar *prefix,
   1.174 +                                         const xmlChar *name2,
   1.175 +                                         const xmlChar *prefix2);
   1.176 +XMLPUBFUN void * XMLCALL
   1.177 +                        xmlHashQLookup3 (xmlHashTablePtr table,
   1.178 +                                         const xmlChar *name,
   1.179 +                                         const xmlChar *prefix,
   1.180 +                                         const xmlChar *name2,
   1.181 +                                         const xmlChar *prefix2,
   1.182 +                                         const xmlChar *name3,
   1.183 +                                         const xmlChar *prefix3);
   1.184 +
   1.185 +/*
   1.186 + * Helpers.
   1.187 + */
   1.188 +XMLPUBFUN xmlHashTablePtr XMLCALL
   1.189 +                        xmlHashCopy     (xmlHashTablePtr table,
   1.190 +                                         xmlHashCopier f);
   1.191 +
   1.192 +#ifndef XMLENGINE_EXCLUDE_UNUSED
   1.193 +XMLPUBFUN int XMLCALL
   1.194 +                        xmlHashSize     (xmlHashTablePtr table);
   1.195 +#endif /* ifndef XMLENGINE_EXCLUDE_UNUSED */
   1.196 +
   1.197 +XMLPUBFUN void XMLCALL
   1.198 +                        xmlHashScan     (xmlHashTablePtr table,
   1.199 +                                         xmlHashScanner f,
   1.200 +                                         void *data);
   1.201 +XMLPUBFUN void XMLCALL
   1.202 +                        xmlHashScan3    (xmlHashTablePtr table,
   1.203 +                                         const xmlChar *name,
   1.204 +                                         const xmlChar *name2,
   1.205 +                                         const xmlChar *name3,
   1.206 +                                         xmlHashScanner f,
   1.207 +                                         void *data);
   1.208 +XMLPUBFUN void XMLCALL
   1.209 +                        xmlHashScanFull (xmlHashTablePtr table,
   1.210 +                                         xmlHashScannerFull f,
   1.211 +                                         void *data);
   1.212 +XMLPUBFUN void XMLCALL
   1.213 +                        xmlHashScanFull3(xmlHashTablePtr table,
   1.214 +                                         const xmlChar *name,
   1.215 +                                         const xmlChar *name2,
   1.216 +                                         const xmlChar *name3,
   1.217 +                                         xmlHashScannerFull f,
   1.218 +                                         void *data);
   1.219 +#ifdef __cplusplus
   1.220 +}
   1.221 +#endif
   1.222 +#endif /* XML_HASH_H */
   1.223 +