1 * Summary: Chained hash tables 2 * Description: This module implements the hash table support used in 3 * various places in the library. 4 * 5 * Copy: See Copyright for the status of this software. 6 * 7 * Author: Patrick Monnerat <pm (a] datasphere.ch>, DATASPHERE S.A. 8 9 /if not defined(XML_HASH_H__) 10 /define XML_HASH_H__ 11 12 * The hash table. 13 14 d xmlHashTablePtr... 15 d s * based(######typedef######) 16 17 /include "libxmlrpg/xmlversion" 18 /include "libxmlrpg/parser" 19 /include "libxmlrpg/dict" 20 21 * function types: 22 23 * xmlHashDeallocator: 24 * @payload: the data in the hash 25 * @name: the name associated 26 * 27 * Callback to free data from a hash. 28 29 d xmlHashDeallocator... 30 d s * based(######typedef######) 31 d procptr 32 33 * xmlHashCopier: 34 * @payload: the data in the hash 35 * @name: the name associated 36 * 37 * Callback to copy data from a hash. 38 * 39 * Returns a copy of the data or NULL in case of error. 40 41 d xmlHashCopier s * based(######typedef######) 42 d procptr 43 44 * xmlHashScanner: 45 * @payload: the data in the hash 46 * @data: extra scannner data 47 * @name: the name associated 48 * 49 * Callback when scanning data in a hash with the simple scanner. 50 51 d xmlHashScanner s * based(######typedef######) 52 d procptr 53 54 * xmlHashScannerFull: 55 * @payload: the data in the hash 56 * @data: extra scannner data 57 * @name: the name associated 58 * @name2: the second name associated 59 * @name3: the third name associated 60 * 61 * Callback when scanning data in a hash with the full scanner. 62 63 d xmlHashScannerFull... 64 d s * based(######typedef######) 65 d procptr 66 67 * Constructor and destructor. 68 69 d xmlHashCreate pr extproc('xmlHashCreate') 70 d like(xmlHashTablePtr) 71 d size 10i 0 value 72 73 d xmlHashCreateDict... 74 d pr extproc('xmlHashCreateDict') 75 d like(xmlHashTablePtr) 76 d size 10i 0 value 77 d dict value like(xmlDictPtr) 78 79 d xmlHashFree pr extproc('xmlHashFree') 80 d table value like(xmlHashTablePtr) 81 d f value like(xmlHashDeallocator) 82 83 * Add a new entry to the hash table. 84 85 d xmlHashAddEntry... 86 d pr 10i 0 extproc('xmlHashAddEntry') 87 d table value like(xmlHashTablePtr) 88 d name * value options(*string) const xmlChar * 89 d userdata * value options(*string) void * 90 91 d xmlHashUpdateEntry... 92 d pr 10i 0 extproc('xmlHashUpdateEntry') 93 d table value like(xmlHashTablePtr) 94 d name * value options(*string) const xmlChar * 95 d userdata * value options(*string) void * 96 d f value like(xmlHashDeallocator) 97 98 d xmlHashAddEntry2... 99 d pr 10i 0 extproc('xmlHashAddEntry2') 100 d table value like(xmlHashTablePtr) 101 d name * value options(*string) const xmlChar * 102 d name2 * value options(*string) const xmlChar * 103 d userdata * value options(*string) void * 104 105 d xmlHashUpdateEntry2... 106 d pr 10i 0 extproc('xmlHashUpdateEntry2') 107 d table value like(xmlHashTablePtr) 108 d name * value options(*string) const xmlChar * 109 d name2 * value options(*string) const xmlChar * 110 d userdata * value options(*string) void * 111 d f value like(xmlHashDeallocator) 112 113 d xmlHashAddEntry3... 114 d pr 10i 0 extproc('xmlHashAddEntry3') 115 d table value like(xmlHashTablePtr) 116 d name * value options(*string) const xmlChar * 117 d name2 * value options(*string) const xmlChar * 118 d name3 * value options(*string) const xmlChar * 119 d userdata * value options(*string) void * 120 121 d xmlHashUpdateEntry3... 122 d pr 10i 0 extproc('xmlHashUpdateEntry3') 123 d table value like(xmlHashTablePtr) 124 d name * value options(*string) const xmlChar * 125 d name2 * value options(*string) const xmlChar * 126 d name3 * value options(*string) const xmlChar * 127 d userdata * value options(*string) void * 128 d f value like(xmlHashDeallocator) 129 130 * Remove an entry from the hash table. 131 132 d xmlHashRemoveEntry... 133 d pr 10i 0 extproc('xmlHashRemoveEntry') 134 d table value like(xmlHashTablePtr) 135 d name * value options(*string) const xmlChar * 136 d f value like(xmlHashDeallocator) 137 138 d xmlHashRemoveEntry2... 139 d pr 10i 0 extproc('xmlHashRemoveEntry2') 140 d table value like(xmlHashTablePtr) 141 d name * value options(*string) const xmlChar * 142 d name2 * value options(*string) const xmlChar * 143 d f value like(xmlHashDeallocator) 144 145 d xmlHashRemoveEntry3... 146 d pr 10i 0 extproc('xmlHashRemoveEntry3') 147 d table value like(xmlHashTablePtr) 148 d name * value options(*string) const xmlChar * 149 d name2 * value options(*string) const xmlChar * 150 d name3 * value options(*string) const xmlChar * 151 d f value like(xmlHashDeallocator) 152 153 * Retrieve the userdata. 154 155 d xmlHashLookup pr * extproc('xmlHashLookup') void * 156 d table value like(xmlHashTablePtr) 157 d name * value options(*string) const xmlChar * 158 159 d xmlHashLookup2 pr * extproc('xmlHashLookup2') void * 160 d table value like(xmlHashTablePtr) 161 d name * value options(*string) const xmlChar * 162 d name2 * value options(*string) const xmlChar * 163 164 d xmlHashLookup3 pr * extproc('xmlHashLookup3') void * 165 d table value like(xmlHashTablePtr) 166 d name * value options(*string) const xmlChar * 167 d name2 * value options(*string) const xmlChar * 168 d name3 * value options(*string) const xmlChar * 169 170 d xmlHashQLookup pr * extproc('xmlHashQLookup') void * 171 d table value like(xmlHashTablePtr) 172 d name * value options(*string) const xmlChar * 173 d prefix * value options(*string) const xmlChar * 174 175 d xmlHashQLookup2... 176 d pr * extproc('xmlHashQLookup2') void * 177 d table value like(xmlHashTablePtr) 178 d name * value options(*string) const xmlChar * 179 d prefix * value options(*string) const xmlChar * 180 d name2 * value options(*string) const xmlChar * 181 d prefix2 * value options(*string) const xmlChar * 182 183 d xmlHashQLookup3... 184 d pr * extproc('xmlHashQLookup3') void * 185 d table value like(xmlHashTablePtr) 186 d name * value options(*string) const xmlChar * 187 d prefix * value options(*string) const xmlChar * 188 d name2 * value options(*string) const xmlChar * 189 d prefix2 * value options(*string) const xmlChar * 190 d name3 * value options(*string) const xmlChar * 191 d prefix3 * value options(*string) const xmlChar * 192 193 * Helpers. 194 195 d xmlHashCopy pr extproc('xmlHashCopy') 196 d like(xmlHashTablePtr) 197 d table value like(xmlHashTablePtr) 198 d f value like(xmlHashCopier) 199 200 d xmlHashSize pr 10i 0 extproc('xmlHashSize') 201 d table value like(xmlHashTablePtr) 202 203 d xmlHashScan pr extproc('xmlHashScan') 204 d table value like(xmlHashTablePtr) 205 d f value like(xmlHashScanner) 206 d data * value options(*string) void * 207 208 d xmlHashScan3 pr extproc('xmlHashScan3') 209 d table value like(xmlHashTablePtr) 210 d name * value options(*string) const xmlChar * 211 d name2 * value options(*string) const xmlChar * 212 d name3 * value options(*string) const xmlChar * 213 d f value like(xmlHashScanner) 214 d data * value options(*string) void * 215 216 d xmlHashScanFull... 217 d pr extproc('xmlHashScanFull') 218 d table value like(xmlHashTablePtr) 219 d f value like(xmlHashScannerFull) 220 d data * value options(*string) void * 221 222 d xmlHashScanFull3... 223 d pr extproc('xmlHashScanFull3') 224 d table value like(xmlHashTablePtr) 225 d name * value options(*string) const xmlChar * 226 d name2 * value options(*string) const xmlChar * 227 d name3 * value options(*string) const xmlChar * 228 d f value like(xmlHashScannerFull) 229 d data * value options(*string) void * 230 231 /endif XML_HASH_H__ 232