libsheepyCSmallDict.h (82530B)
1 // MIT License 2 // 3 // Copyright (c) 2026 Remy Noulin 4 // 5 // Permission is hereby granted, free of charge, to any person obtaining a copy 6 // of this software and associated documentation files (the "Software"), to deal 7 // in the Software without restriction, including without limitation the rights 8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 // copies of the Software, and to permit persons to whom the Software is 10 // furnished to do so, subject to the following conditions: 11 // 12 // The above copyright notice and this permission notice shall be included in all 13 // copies or substantial portions of the Software. 14 // 15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 // SOFTWARE. 22 #pragma once 23 24 #include "../libsheepyObject.h" 25 26 // Class smallDict 27 typedef struct smallDict smallDictt; 28 29 /** 30 * help text for this class 31 * It is public declaration so that child classes can add their help text easily: 32 * ret "Child help text \n\n" helpTextSmallDict; 33 */ 34 #define helpTextSmallDict "TODO smallDict help brief, class description /*, definitions,*/ methods, examples" 35 36 // for object inheriting smallDict, cast to smallDict to be able to use this class functions and generics 37 #define cDi(self) ( (smallDictt*) self ) 38 39 // base 40 41 typedef void (*freeSmallDictFt) (smallDictt *self); 42 typedef void (*terminateSmallDictFt) (smallDictt **self); 43 typedef char* (*toStringSmallDictFt) (smallDictt *self); 44 typedef smallDictt* (*duplicateSmallDictFt) (smallDictt *self); 45 46 // smallDict functions 47 48 typedef char* (*escapeSmallDictFt) (smallDictt *self); 49 50 /** 51 * free index but not the elements 52 * self becomes empty. 53 * 54 * Useful when the objects are shared 55 */ 56 typedef void (*disposeSmallDictFt) (smallDictt *self); 57 58 /** 59 * free self but not the elements 60 * self becomes empty. 61 * 62 * Useful when the objects are shared 63 */ 64 typedef void (*smashSmallDictFt) (smallDictt **self); 65 66 /** 67 * free container 68 */ 69 typedef void (*finishSmallDictFt) (smallDictt **self); 70 71 typedef const char* (*helpSmallDictFt) (smallDictt *self); 72 73 /** 74 * remove reference to internal sObject, set NULL and 75 * free the iterator 76 * 77 * this function is useful for object not allocated on the heap 78 * to free the iterator element when the object is not used anymore 79 * 80 * for example: 81 * createSmallDict(d); 82 * iter(d, e) { 83 * ... 84 * break; 85 * } 86 * resetG(d); // free iteraror element 87 * 88 */ 89 typedef void (*resetSmallDictFt) (smallDictt *self); 90 91 /** 92 * get the sobject, data in the container 93 */ 94 typedef sDictt* (*getsoSmallDictFt) (smallDictt *self); 95 96 /** 97 * set the sobject, data in the container 98 * the iterator is reset 99 */ 100 typedef void (*setsoSmallDictFt) (smallDictt *self, sDictt *so); 101 102 /** 103 * allocate a new container for the sobject, the iterator state is copied 104 * after this function is executed, there are 2 containers for one sobject, 105 * only one container should be freed or terminated, the other one should be finished 106 */ 107 typedef smallDictt* (*mirrorSmallDictFt) (smallDictt *self); 108 109 /** 110 * set element 111 * 112 * When the sObject pointer is updated by realloc, the sObject 113 * pointer in the smallDict has to be updated with setP. 114 * The operations reallocating the sObjects are: 115 * smallDict: push, set, trim, merge, append 116 * smallArray: push, prepend 117 * smallBytes: push, pushBuffer 118 * smallJson: push, set 119 * smallString: append, prepend, replace, intTo, insert, color, readFile 120 * 121 * The object is duplicated for: 122 * char * 123 * 124 * \param 125 * key smallDictionary key 126 * \param 127 * value an object 128 */ 129 typedef smallDictt* (*setSmallDictFt) (smallDictt *self, const char *key, baset *value); 130 typedef smallDictt* (*setUndefinedSmallDictFt)(smallDictt *self, const char *key); 131 typedef smallDictt* (*setBoolSmallDictFt) (smallDictt *self, const char *key, bool value); 132 typedef smallDictt* (*setDoubleSmallDictFt) (smallDictt *self, const char *key, double value); 133 typedef smallDictt* (*setIntSmallDictFt) (smallDictt *self, const char *key, int64_t value); 134 typedef smallDictt* (*setSSmallDictFt) (smallDictt *self, const char *key, const char *string); 135 typedef smallDictt* (*setCharSmallDictFt) (smallDictt *self, const char *key, char c); 136 typedef smallDictt* (*setDictSmallDictFt) (smallDictt *self, const char *key, smallDictt *dict); 137 typedef smallDictt* (*setArraySmallDictFt) (smallDictt *self, const char *key, smallArrayt *array); 138 typedef smallDictt* (*setArraycSmallDictFt) (smallDictt *self, const char *key, char **array); 139 typedef smallDictt* (*setCArraycSmallDictFt) (smallDictt *self, const char *key, const char **array); 140 typedef smallDictt* (*setSmallBoolSmallDictFt) (smallDictt *self, const char *key, smallBoolt *value); 141 typedef smallDictt* (*setSmallBytesSmallDictFt) (smallDictt *self, const char *key, smallBytest *value); 142 typedef smallDictt* (*setSmallDoubleSmallDictFt) (smallDictt *self, const char *key, smallDoublet *value); 143 typedef smallDictt* (*setSmallIntSmallDictFt) (smallDictt *self, const char *key, smallIntt *value); 144 typedef smallDictt* (*setSmallJsonSmallDictFt) (smallDictt *self, const char *key, smallJsont *value); 145 typedef smallDictt* (*setSmallStringSmallDictFt) (smallDictt *self, const char *key, smallStringt *string); 146 typedef smallDictt* (*setSmallContainerSmallDictFt)(smallDictt *self, const char *key, smallContainert *container); 147 148 typedef smallDictt* (*setKCharSmallDictFt) (smallDictt *self, char key, baset *value); 149 typedef smallDictt* (*setUndefinedKCharSmallDictFt)(smallDictt *self, char key); 150 typedef smallDictt* (*setBoolKCharSmallDictFt) (smallDictt *self, char key, bool value); 151 typedef smallDictt* (*setDoubleKCharSmallDictFt) (smallDictt *self, char key, double value); 152 typedef smallDictt* (*setIntKCharSmallDictFt) (smallDictt *self, char key, int64_t value); 153 typedef smallDictt* (*setSKCharSmallDictFt) (smallDictt *self, char key, const char *string); 154 typedef smallDictt* (*setCharKCharSmallDictFt) (smallDictt *self, char key, char c); 155 typedef smallDictt* (*setDictKCharSmallDictFt) (smallDictt *self, char key, smallDictt *dict); 156 typedef smallDictt* (*setArrayKCharSmallDictFt) (smallDictt *self, char key, smallArrayt *array); 157 typedef smallDictt* (*setArraycKCharSmallDictFt) (smallDictt *self, char key, char **array); 158 typedef smallDictt* (*setCArraycKCharSmallDictFt) (smallDictt *self, char key, const char **array); 159 typedef smallDictt* (*setSmallBoolKCharSmallDictFt) (smallDictt *self, char key, smallBoolt *value); 160 typedef smallDictt* (*setSmallBytesKCharSmallDictFt) (smallDictt *self, char key, smallBytest *value); 161 typedef smallDictt* (*setSmallDoubleKCharSmallDictFt) (smallDictt *self, char key, smallDoublet *value); 162 typedef smallDictt* (*setSmallIntKCharSmallDictFt) (smallDictt *self, char key, smallIntt *value); 163 typedef smallDictt* (*setSmallJsonKCharSmallDictFt) (smallDictt *self, char key, smallJsont *value); 164 typedef smallDictt* (*setSmallStringKCharSmallDictFt) (smallDictt *self, char key, smallStringt *string); 165 typedef smallDictt* (*setSmallContainerKCharSmallDictFt)(smallDictt *self, char key, smallContainert *container); 166 167 /** 168 * set element and free 169 * 170 * value container is freed at the end of the function 171 * Example: when setting a smallString, it is copied to an sStringt and then the object is freed 172 * 173 * \param 174 * key smallDictionary key 175 * \param 176 * value an object 177 */ 178 typedef smallDictt* (*setNFreeSmallDictFt) (smallDictt *self, const char *key, baset *value); 179 typedef smallDictt* (*setNFreeUndefinedSmallDictFt)(smallDictt *self, const char *key, undefinedt *undefined); 180 typedef smallDictt* (*setNFreeSSmallDictFt) (smallDictt *self, const char *key, char *string); 181 typedef smallDictt* (*setNFreeDictSmallDictFt) (smallDictt *self, const char *key, smallDictt *dict); 182 typedef smallDictt* (*setNFreeArraySmallDictFt) (smallDictt *self, const char *key, smallArrayt *array); 183 typedef smallDictt* (*setNFreeArraycSmallDictFt) (smallDictt *self, const char *key, char **array); 184 typedef smallDictt* (*setNFreeSmallBoolSmallDictFt) (smallDictt *self, const char *key, smallBoolt *value); 185 typedef smallDictt* (*setNFreeSmallBytesSmallDictFt) (smallDictt *self, const char *key, smallBytest *value); 186 typedef smallDictt* (*setNFreeSmallDoubleSmallDictFt) (smallDictt *self, const char *key, smallDoublet *value); 187 typedef smallDictt* (*setNFreeSmallIntSmallDictFt) (smallDictt *self, const char *key, smallIntt *value); 188 typedef smallDictt* (*setNFreeSmallJsonSmallDictFt) (smallDictt *self, const char *key, smallJsont *value); 189 typedef smallDictt* (*setNFreeSmallStringSmallDictFt) (smallDictt *self, const char *key, smallStringt *string); 190 typedef smallDictt* (*setNFreeSmallContainerSmallDictFt)(smallDictt *self, const char *key, smallContainert *container); 191 192 typedef smallDictt* (*setNFreeKCharSmallDictFt) (smallDictt *self, char key, baset *value); 193 typedef smallDictt* (*setNFreeUndefinedKCharSmallDictFt)(smallDictt *self, char key, undefinedt *undefined); 194 typedef smallDictt* (*setNFreeSKCharSmallDictFt) (smallDictt *self, char key, char *string); 195 typedef smallDictt* (*setNFreeDictKCharSmallDictFt) (smallDictt *self, char key, smallDictt *dict); 196 typedef smallDictt* (*setNFreeArrayKCharSmallDictFt) (smallDictt *self, char key, smallArrayt *array); 197 typedef smallDictt* (*setNFreeArraycKCharSmallDictFt) (smallDictt *self, char key, char **array); 198 typedef smallDictt* (*setNFreeSmallBoolKCharSmallDictFt) (smallDictt *self, char key, smallBoolt *value); 199 typedef smallDictt* (*setNFreeSmallBytesKCharSmallDictFt) (smallDictt *self, char key, smallBytest *value); 200 typedef smallDictt* (*setNFreeSmallDoubleKCharSmallDictFt) (smallDictt *self, char key, smallDoublet *value); 201 typedef smallDictt* (*setNFreeSmallIntKCharSmallDictFt) (smallDictt *self, char key, smallIntt *value); 202 typedef smallDictt* (*setNFreeSmallJsonKCharSmallDictFt) (smallDictt *self, char key, smallJsont *value); 203 typedef smallDictt* (*setNFreeSmallStringKCharSmallDictFt) (smallDictt *self, char key, smallStringt *string); 204 typedef smallDictt* (*setNFreeSmallContainerKCharSmallDictFt)(smallDictt *self, char key, smallContainert *container); 205 206 /** 207 * set pointer in element 208 * 209 * \param 210 * key smallDictionary key 211 * \param 212 * value an object 213 */ 214 typedef smallDictt* (*setPArraySmallDictFt) (smallDictt *self, const char *key, smallArrayt *array); 215 typedef smallDictt* (*setPDictSmallDictFt) (smallDictt *self, const char *key, smallDictt *dict); 216 typedef smallDictt* (*setPSmallJsonSmallDictFt) (smallDictt *self, const char *key, smallJsont *json); 217 typedef smallDictt* (*setPSmallStringSmallDictFt) (smallDictt *self, const char *key, smallStringt *string); 218 typedef smallDictt* (*setNFreePArraySmallDictFt) (smallDictt *self, const char *key, smallArrayt *array); 219 typedef smallDictt* (*setNFreePDictSmallDictFt) (smallDictt *self, const char *key, smallDictt *dict); 220 typedef smallDictt* (*setNFreePSmallJsonSmallDictFt) (smallDictt *self, const char *key, smallJsont *json); 221 typedef smallDictt* (*setNFreePSmallStringSmallDictFt)(smallDictt *self, const char *key, smallStringt *string); 222 223 typedef smallDictt* (*setPArrayKCharSmallDictFt) (smallDictt *self, char key, smallArrayt *array); 224 typedef smallDictt* (*setPDictKCharSmallDictFt) (smallDictt *self, char key, smallDictt *dict); 225 typedef smallDictt* (*setPSmallJsonKCharSmallDictFt) (smallDictt *self, char key, smallJsont *json); 226 typedef smallDictt* (*setPSmallStringKCharSmallDictFt) (smallDictt *self, char key, smallStringt *string); 227 typedef smallDictt* (*setNFreePArrayKCharSmallDictFt) (smallDictt *self, char key, smallArrayt *array); 228 typedef smallDictt* (*setNFreePDictKCharSmallDictFt) (smallDictt *self, char key, smallDictt *dict); 229 typedef smallDictt* (*setNFreePSmallJsonKCharSmallDictFt) (smallDictt *self, char key, smallJsont *json); 230 typedef smallDictt* (*setNFreePSmallStringKCharSmallDictFt)(smallDictt *self, char key, smallStringt *string); 231 232 /** 233 * get element 234 * 235 * \param 236 * key smallDictionary key 237 * \return 238 * object or NULL 239 */ 240 typedef baset* (*getSmallDictFt) (smallDictt *self, const char *key); 241 typedef undefinedt* (*getUndefinedSmallDictFt) (smallDictt *self, const char *key); 242 typedef bool (*getBoolSmallDictFt) (smallDictt *self, const char *key); 243 typedef bool* (*getBoolPSmallDictFt) (smallDictt *self, const char *key); 244 typedef double (*getDoubleSmallDictFt) (smallDictt *self, const char *key); 245 typedef double* (*getDoublePSmallDictFt) (smallDictt *self, const char *key); 246 typedef int64_t (*getIntSmallDictFt) (smallDictt *self, const char *key); 247 typedef int64_t* (*getIntPSmallDictFt) (smallDictt *self, const char *key); 248 typedef int32_t (*getInt32SmallDictFt) (smallDictt *self, const char *key); 249 typedef int32_t* (*getInt32PSmallDictFt) (smallDictt *self, const char *key); 250 typedef uint64_t (*getUintSmallDictFt) (smallDictt *self, const char *key); 251 typedef uint64_t* (*getUintPSmallDictFt) (smallDictt *self, const char *key); 252 typedef uint32_t (*getUint32SmallDictFt) (smallDictt *self, const char *key); 253 typedef uint32_t* (*getUint32PSmallDictFt) (smallDictt *self, const char *key); 254 typedef char* (*getSSmallDictFt) (smallDictt *self, const char *key); 255 typedef smallDictt* (*getDictSmallDictFt) (smallDictt *self, const char *key); 256 typedef smallArrayt* (*getArraySmallDictFt) (smallDictt *self, const char *key); 257 typedef smallBoolt* (*getSmallBoolSmallDictFt) (smallDictt *self, const char *key); 258 typedef smallBytest* (*getSmallBytesSmallDictFt) (smallDictt *self, const char *key); 259 typedef smallDoublet* (*getSmallDoubleSmallDictFt) (smallDictt *self, const char *key); 260 typedef smallIntt* (*getSmallIntSmallDictFt) (smallDictt *self, const char *key); 261 typedef smallJsont* (*getSmallJsonSmallDictFt) (smallDictt *self, const char *key); 262 typedef smallStringt* (*getSmallStringSmallDictFt) (smallDictt *self, const char *key); 263 typedef void* (*getVoidSmallDictFt) (smallDictt *self, const char *key); 264 typedef smallContainert* (*getSmallContainerSmallDictFt)(smallDictt *self, const char *key); 265 266 typedef baset* (*getKCharSmallDictFt) (smallDictt *self, char key); 267 typedef undefinedt* (*getUndefinedKCharSmallDictFt) (smallDictt *self, char key); 268 typedef bool (*getBoolKCharSmallDictFt) (smallDictt *self, char key); 269 typedef bool* (*getBoolPKCharSmallDictFt) (smallDictt *self, char key); 270 typedef double (*getDoubleKCharSmallDictFt) (smallDictt *self, char key); 271 typedef double* (*getDoublePKCharSmallDictFt) (smallDictt *self, char key); 272 typedef int64_t (*getIntKCharSmallDictFt) (smallDictt *self, char key); 273 typedef int64_t* (*getIntPKCharSmallDictFt) (smallDictt *self, char key); 274 typedef int32_t (*getInt32KCharSmallDictFt) (smallDictt *self, char key); 275 typedef int32_t* (*getInt32PKCharSmallDictFt) (smallDictt *self, char key); 276 typedef uint64_t (*getUintKCharSmallDictFt) (smallDictt *self, char key); 277 typedef uint64_t* (*getUintPKCharSmallDictFt) (smallDictt *self, char key); 278 typedef uint32_t (*getUint32KCharSmallDictFt) (smallDictt *self, char key); 279 typedef uint32_t* (*getUint32PKCharSmallDictFt) (smallDictt *self, char key); 280 typedef char* (*getSKCharSmallDictFt) (smallDictt *self, char key); 281 typedef smallDictt* (*getDictKCharSmallDictFt) (smallDictt *self, char key); 282 typedef smallArrayt* (*getArrayKCharSmallDictFt) (smallDictt *self, char key); 283 typedef smallBoolt* (*getSmallBoolKCharSmallDictFt) (smallDictt *self, char key); 284 typedef smallBytest* (*getSmallBytesKCharSmallDictFt) (smallDictt *self, char key); 285 typedef smallDoublet* (*getSmallDoubleKCharSmallDictFt) (smallDictt *self, char key); 286 typedef smallIntt* (*getSmallIntKCharSmallDictFt) (smallDictt *self, char key); 287 typedef smallJsont* (*getSmallJsonKCharSmallDictFt) (smallDictt *self, char key); 288 typedef smallStringt* (*getSmallStringKCharSmallDictFt) (smallDictt *self, char key); 289 typedef void* (*getVoidKCharSmallDictFt) (smallDictt *self, char key); 290 typedef smallContainert* (*getSmallContainerKCharSmallDictFt)(smallDictt *self, char key); 291 292 293 /** 294 * get element and duplicate object 295 * 296 * \param 297 * key smallDictionary key 298 * \return 299 * duplicated object or NULL 300 */ 301 typedef baset* (*getNDupSmallDictFt) (smallDictt *self, const char *key); 302 typedef undefinedt* (*getNDupUndefinedSmallDictFt) (smallDictt *self, const char *key); 303 typedef bool (*getNDupBoolSmallDictFt) (smallDictt *self, const char *key); 304 typedef double (*getNDupDoubleSmallDictFt) (smallDictt *self, const char *key); 305 typedef int64_t (*getNDupIntSmallDictFt) (smallDictt *self, const char *key); 306 typedef int32_t (*getNDupInt32SmallDictFt) (smallDictt *self, const char *key); 307 typedef uint64_t (*getNDupUintSmallDictFt) (smallDictt *self, const char *key); 308 typedef uint32_t (*getNDupUint32SmallDictFt) (smallDictt *self, const char *key); 309 typedef char* (*getNDupSSmallDictFt) (smallDictt *self, const char *key); 310 typedef smallDictt* (*getNDupDictSmallDictFt) (smallDictt *self, const char *key); 311 typedef smallArrayt* (*getNDupArraySmallDictFt) (smallDictt *self, const char *key); 312 typedef smallBoolt* (*getNDupSmallBoolSmallDictFt) (smallDictt *self, const char *key); 313 typedef smallBytest* (*getNDupSmallBytesSmallDictFt) (smallDictt *self, const char *key); 314 typedef smallDoublet* (*getNDupSmallDoubleSmallDictFt) (smallDictt *self, const char *key); 315 typedef smallIntt* (*getNDupSmallIntSmallDictFt) (smallDictt *self, const char *key); 316 typedef smallJsont* (*getNDupSmallJsonSmallDictFt) (smallDictt *self, const char *key); 317 typedef smallStringt* (*getNDupSmallStringSmallDictFt) (smallDictt *self, const char *key); 318 typedef void* (*getNDupVoidSmallDictFt) (smallDictt *self, const char *key); 319 typedef smallContainert* (*getNDupSmallContainerSmallDictFt)(smallDictt *self, const char *key); 320 321 typedef baset* (*getNDupKCharSmallDictFt) (smallDictt *self, char key); 322 typedef undefinedt* (*getNDupUndefinedKCharSmallDictFt) (smallDictt *self, char key); 323 typedef bool (*getNDupBoolKCharSmallDictFt) (smallDictt *self, char key); 324 typedef double (*getNDupDoubleKCharSmallDictFt) (smallDictt *self, char key); 325 typedef int64_t (*getNDupIntKCharSmallDictFt) (smallDictt *self, char key); 326 typedef int32_t (*getNDupInt32KCharSmallDictFt) (smallDictt *self, char key); 327 typedef uint64_t (*getNDupUintKCharSmallDictFt) (smallDictt *self, char key); 328 typedef uint32_t (*getNDupUint32KCharSmallDictFt) (smallDictt *self, char key); 329 typedef char* (*getNDupSKCharSmallDictFt) (smallDictt *self, char key); 330 typedef smallDictt* (*getNDupDictKCharSmallDictFt) (smallDictt *self, char key); 331 typedef smallArrayt* (*getNDupArrayKCharSmallDictFt) (smallDictt *self, char key); 332 typedef smallBoolt* (*getNDupSmallBoolKCharSmallDictFt) (smallDictt *self, char key); 333 typedef smallBytest* (*getNDupSmallBytesKCharSmallDictFt) (smallDictt *self, char key); 334 typedef smallDoublet* (*getNDupSmallDoubleKCharSmallDictFt) (smallDictt *self, char key); 335 typedef smallIntt* (*getNDupSmallIntKCharSmallDictFt) (smallDictt *self, char key); 336 typedef smallJsont* (*getNDupSmallJsonKCharSmallDictFt) (smallDictt *self, char key); 337 typedef smallStringt* (*getNDupSmallStringKCharSmallDictFt) (smallDictt *self, char key); 338 typedef void* (*getNDupVoidKCharSmallDictFt) (smallDictt *self, char key); 339 typedef smallContainert* (*getNDupSmallContainerKCharSmallDictFt)(smallDictt *self, char key); 340 341 /** 342 * get number 343 * 344 * if the element is a double, its value is returned as is 345 * if the element is an int, its value is converted to double 346 * if the element is not a number, 0 is returned 347 * 348 * \param 349 * key dictionary key 350 * \return 351 * double type number or 0 352 */ 353 typedef double (*getNumSmallDictFt) (smallDictt *self, const char *key); 354 355 /** 356 * Crop an Element 357 * return element for key 358 * and delete element in dictionary 359 * negative indexes are allowed 360 * 361 * \param 362 * key must exist in the dictionary 363 * \return 364 * element for key (you must free the pointer (terminate libsheepy objects)) 365 * NULL error 366 */ 367 typedef baset* (*cropElemSmallDictFt) (smallDictt *self, const char* key); 368 typedef undefinedt* (*cropElemUndefinedSmallDictFt) (smallDictt *self, const char* key); 369 typedef bool (*cropElemBoolSmallDictFt) (smallDictt *self, const char* key); 370 typedef double (*cropElemDoubleSmallDictFt) (smallDictt *self, const char* key); 371 typedef int64_t (*cropElemIntSmallDictFt) (smallDictt *self, const char* key); 372 typedef int32_t (*cropElemInt32SmallDictFt) (smallDictt *self, const char* key); 373 typedef uint64_t (*cropElemUintSmallDictFt) (smallDictt *self, const char* key); 374 typedef uint32_t (*cropElemUint32SmallDictFt) (smallDictt *self, const char* key); 375 typedef char* (*cropElemSSmallDictFt) (smallDictt *self, const char* key); 376 typedef smallDictt* (*cropElemDictSmallDictFt) (smallDictt *self, const char* key); 377 typedef smallArrayt* (*cropElemArraySmallDictFt) (smallDictt *self, const char* key); 378 typedef smallBoolt* (*cropElemSmallBoolSmallDictFt) (smallDictt *self, const char* key); 379 typedef smallBytest* (*cropElemSmallBytesSmallDictFt) (smallDictt *self, const char* key); 380 typedef smallDoublet* (*cropElemSmallDoubleSmallDictFt) (smallDictt *self, const char* key); 381 typedef smallIntt* (*cropElemSmallIntSmallDictFt) (smallDictt *self, const char* key); 382 typedef smallJsont* (*cropElemSmallJsonSmallDictFt) (smallDictt *self, const char* key); 383 typedef smallStringt* (*cropElemSmallStringSmallDictFt) (smallDictt *self, const char* key); 384 typedef void* (*cropElemVoidSmallDictFt) (smallDictt *self, const char* key); 385 typedef smallContainert* (*cropElemSmallContainerSmallDictFt) (smallDictt *self, const char* key); 386 387 /** 388 * delete element 389 * 390 * free element sObject for given key 391 * this function is to be used before dispose to free some elements 392 * For example: 393 * createSmallDict(d); 394 * smallStringt *s = allocG("the element to keep"); 395 * setG(d,"0", "The element to free"); 396 * setG(d,"1", s); 397 * 398 * The dictionary a is: {"0":"The element to free", "1":"the element to keep"} 399 * 400 * To dispose d and be able to free all objects, the element for key "0" must be freed with delElem 401 * The sObject for key "1" and the one in s are identical, so the element 1 is freed when s is freed 402 * 403 * \param 404 * key smallDictionary key 405 */ 406 typedef smallDictt* (*delSmallDictFt) (smallDictt *self, const char *key); 407 typedef smallDictt* (*delKCharSmallDictFt) (smallDictt *self, char key); 408 409 /** 410 * remove without freeing element 411 * 412 * remove element sObject for given key 413 * 414 * Example: 415 * cleanAllocateSmallString(S); 416 * setValG(S, "sString object"); 417 * cleanAllocateSmallDict(d); 418 * // set an object shared with another container in the dict d 419 * // "sString object" is in both container S and d 420 * setG(d, "key1" ,S); 421 * setG(d, "key2", "another string"); 422 * // the program deletes the element for "key1" 423 * // to do so, it uses removeElemG since S will free the sString object 424 * removeElemG(d, "key1"); 425 * 426 * \param 427 * key smallDictionary key 428 */ 429 typedef smallDictt* (*removeSmallDictFt) (smallDictt *self, const char *key); 430 typedef smallDictt* (*removeKCharSmallDictFt) (smallDictt *self, char key); 431 432 433 /** 434 * check if self has 'key' 435 * 436 * \param 437 * key to find 438 * \return 439 * true when the key is found 440 */ 441 typedef bool (*hasSmallDictFt) (smallDictt *self, const char *key); 442 typedef bool (*hasKCharSmallDictFt) (smallDictt *self, char key); 443 444 /** 445 * return key for object in dictionary 446 * 447 * \param 448 * value 449 * \return 450 * key 451 * NULL when the value is not found 452 * NULL when array or value are NULL 453 */ 454 typedef char* (*keyBySmallDictFt) (smallDictt *self, baset *value); 455 typedef char* (*keyByUndefinedSmallDictFt)(smallDictt *self, undefinedt *undefined); 456 typedef char* (*keyByBoolSmallDictFt) (smallDictt *self, bool value); 457 typedef char* (*keyByDoubleSmallDictFt) (smallDictt *self, double value); 458 typedef char* (*keyByIntSmallDictFt) (smallDictt *self, int64_t value); 459 typedef char* (*keyBySSmallDictFt) (smallDictt *self, const char *string); 460 typedef char* (*keyByCharSmallDictFt) (smallDictt *self, char c); 461 typedef char* (*keyByDictSmallDictFt) (smallDictt *self, smallDictt *dict); 462 typedef char* (*keyByArraySmallDictFt) (smallDictt *self, smallArrayt *array); 463 typedef char* (*keyByArraycSmallDictFt) (smallDictt *self, char **array); 464 typedef char* (*keyByCArraycSmallDictFt) (smallDictt *self, const char **array); 465 typedef char* (*keyBySmallBoolSmallDictFt) (smallDictt *self, smallBoolt *value); 466 typedef char* (*keyBySmallBytesSmallDictFt) (smallDictt *self, smallBytest *value); 467 typedef char* (*keyBySmallDoubleSmallDictFt) (smallDictt *self, smallDoublet *value); 468 typedef char* (*keyBySmallIntSmallDictFt) (smallDictt *self, smallIntt *value); 469 typedef char* (*keyBySmallJsonSmallDictFt) (smallDictt *self, smallJsont *string); 470 typedef char* (*keyBySmallStringSmallDictFt) (smallDictt *self, smallStringt *string); 471 typedef char* (*keyBySmallContainerSmallDictFt)(smallDictt *self, smallContainert *container); 472 473 /** 474 * ignore case and return key for object in dictionary 475 * 476 * \param 477 * value 478 * \return 479 * key 480 * NULL when the value is not found 481 * NULL when array or value are NULL 482 */ 483 typedef char* (*icKeyBySmallDictFt) (smallDictt *self, baset *value); 484 typedef char* (*icKeyBySSmallDictFt) (smallDictt *self, const char *string); 485 typedef char* (*icKeyByCharSmallDictFt) (smallDictt *self, char c); 486 typedef char* (*icKeyByDictSmallDictFt) (smallDictt *self, smallDictt *dict); 487 typedef char* (*icKeyByArraySmallDictFt) (smallDictt *self, smallArrayt *array); 488 typedef char* (*icKeyByArraycSmallDictFt) (smallDictt *self, char **array); 489 typedef char* (*icKeyByCArraycSmallDictFt) (smallDictt *self, const char **array); 490 typedef char* (*icKeyBySmallJsonSmallDictFt) (smallDictt *self, smallJsont *string); 491 typedef char* (*icKeyBySmallStringSmallDictFt) (smallDictt *self, smallStringt *string); 492 493 /** 494 * remove NULL keys from dictionary 495 */ 496 typedef smallDictt* (*trimSmallDictFt) (smallDictt *self); 497 498 /** 499 * list keys 500 */ 501 typedef char** (*keysSmallDictFt) (smallDictt *self); 502 typedef smallArrayt* (*keysSmallStringSmallDictFt)(smallDictt *self); 503 504 /** 505 * list values 506 */ 507 typedef smallArrayt* (*valuesSmallDictFt) (smallDictt *self); 508 509 /** 510 * merge override - already existing values are replaced 511 */ 512 typedef smallDictt* (*mergeSmallDictFt) (smallDictt *self, smallDictt *smallDict); 513 typedef smallDictt* (*mergeSmallJsonSmallDictFt) (smallDictt *self, smallJsont *json); 514 typedef smallDictt* (*mergeNSmashSmallDictFt) (smallDictt *self, smallDictt *smallDict); 515 typedef smallDictt* (*mergeNSmashSmallJsonSmallDictFt)(smallDictt *self, smallJsont *json); 516 517 /** 518 * add merge - already existing values are kept 519 */ 520 typedef smallDictt* (*appendSmallDictFt) (smallDictt *self, smallDictt *smallDict); 521 typedef smallDictt* (*appendNSmashSmallDictFt)(smallDictt *self, smallDictt *smallDict); 522 523 typedef bool (*equalSmallDictBaseFt) (smallDictt* self, baset* p2); 524 typedef bool (*equalSmallDictSmallJsonFt) (smallDictt* self, smallJsont* p2); 525 typedef bool (*equalSmallDictFt) (smallDictt* self, smallDictt* p2); 526 527 typedef bool (*icEqualSmallDictBaseFt) (smallDictt* self, baset* p2); 528 typedef bool (*icEqualSmallDictSmallJsonFt)(smallDictt* self, smallJsont* p2); 529 typedef bool (*icEqualSmallDictFt) (smallDictt* self, smallDictt* p2); 530 531 /** 532 * number of elements 533 */ 534 typedef size_t (*lenSmallDictFt) (smallDictt *self); 535 536 /** 537 * empty 538 */ 539 typedef smallDictt* (*emptySmallDictFt) (smallDictt *self); 540 541 /** 542 * \return 543 * true when self is empty (len=0) 544 * false when len > 0 545 */ 546 typedef bool (*isEmptySmallDictFt) (smallDictt *self); 547 548 /** 549 * user defined function called in the enumerate loop 550 * this fucntion is a parameter to the enumerate function 551 * 552 * \param 553 * closure user defined pointer 554 * \param 555 * key key for element 556 * \param 557 * element element for key 558 * \return 559 * true to continue the loop 560 * false to break the loop 561 */ 562 typedef bool (*enumerateElementSmallDictFt) (void *closure, char *key, baset *element); 563 564 /** 565 * enumerate elements in the dictionary 566 * 567 * \param 568 * closure user defined pointer 569 * \param 570 * funcElem user defined function call on each element 571 */ 572 typedef void (*enumerateSmallDictFt) (smallDictt *self, void *closure, enumerateElementSmallDictFt funcElem); 573 574 /** 575 * iterator 576 * 577 * iterStart resets and starts the iteration 578 * use iterKey method to get current key 579 * 580 * Example: 581 * iter(dict, e) { 582 * logVarG(e); 583 * } 584 */ 585 typedef baset* (*iterStartSmallDictFt) (smallDictt *self); 586 typedef const char* (*iterStartKeySmallDictFt) (smallDictt *self); 587 typedef baset* (*iterNextSmallDictFt) (smallDictt *self); 588 typedef const char* (*iterNextKeySmallDictFt) (smallDictt *self); 589 typedef baset* (*iterElementSmallDictFt) (smallDictt *self); 590 typedef const char* (*iterKeySmallDictFt) (smallDictt *self); 591 592 /** 593 * zip arrays and store in dictionary 594 * 595 * \return 596 * 1 all the elements from keys and values are in the dictionary 597 * 0 some elements from keys and values are in the dictionary or keys or values length is 0 598 * -1 keys or values is NULL 599 */ 600 typedef smallDictt* (*zipSmallDictFt) (smallDictt *self, smallArrayt *keys, smallArrayt *values); 601 typedef smallDictt* (*zipSmallJsonSmallDictFt) (smallDictt *self, smallArrayt *keys, smallJsont *values); 602 typedef smallDictt* (*zipSmallJsonSmallArraySmallDictFt)(smallDictt *self, smallJsont *keys, smallArrayt *values); 603 typedef smallDictt* (*zipSmallJsonSmallJsonSmallDictFt) (smallDictt *self, smallJsont *keys, smallJsont *values); 604 typedef smallDictt* (*zipSmallJsonVArraySmallDictFt) (smallDictt *self, smallJsont *keys, char** values); 605 typedef smallDictt* (*zipSmallJsonVCArraySmallDictFt) (smallDictt *self, smallJsont *keys, const char** values); 606 typedef smallDictt* (*zipArraySmallDictFt) (smallDictt *self, char** keys, smallArrayt *values); 607 typedef smallDictt* (*zipCArraySmallDictFt) (smallDictt *self, const char** keys, smallArrayt *values); 608 typedef smallDictt* (*zipArraySmallJsonSmallDictFt) (smallDictt *self, char** keys, smallJsont *values); 609 typedef smallDictt* (*zipCArraySmallJsonSmallDictFt) (smallDictt *self, const char** keys, smallJsont *values); 610 typedef smallDictt* (*zipArrayArraySmallDictFt) (smallDictt *self, char** keys, char** values); 611 typedef smallDictt* (*zipCArrayArraySmallDictFt) (smallDictt *self, const char** keys, char** values); 612 typedef smallDictt* (*zipArrayCArraySmallDictFt) (smallDictt *self, char** keys, const char** values); 613 typedef smallDictt* (*zipCArrayCArraySmallDictFt) (smallDictt *self, const char** keys, const char** values); 614 typedef smallDictt* (*zipVArraySmallDictFt) (smallDictt *self, smallArrayt *keys, char** values); 615 typedef smallDictt* (*zipVCArraySmallDictFt) (smallDictt *self, smallArrayt *keys, const char** values); 616 617 /** 618 * convert array to dictionary 619 * 620 * The array must have the format: 621 * [[key(string), value], ...] 622 * 623 * Elements not in this format are not added to the dictionary 624 */ 625 typedef smallDictt* (*fromArraySmallDictFt) (smallDictt *self, smallArrayt *items); 626 627 /** 628 * convert dictionary to array 629 * 630 * Array format: 631 * [[key, value], ...] 632 */ 633 typedef smallArrayt* (*toArraySmallDictFt) (smallDictt *self); 634 635 /** 636 * write dictionary to filePath 637 * 638 * \param 639 * filePath 640 * \return 641 * true success 642 * false failed, filePath or list are NULL 643 */ 644 typedef bool (*writeFileSmallDictFt) (smallDictt *self, const char *filePath); 645 typedef bool (*writeFileSmallJsonSmallDictFt) (smallDictt *self, smallJsont *filePath); 646 typedef bool (*writeFileSmallStringSmallDictFt)(smallDictt *self, smallStringt *filePath); 647 typedef bool (*writeStreamSmallDictFt) (smallDictt *self, FILE *fp); 648 649 /** 650 * append dictionary to filePath 651 * 652 * \param 653 * filePath 654 * list 655 * \return 656 * true success 657 * false failed, filePath or dict are NULL 658 */ 659 typedef bool (*appendFileSmallDictFt) (smallDictt *self, const char *filePath); 660 typedef bool (*appendFileSmallStringSmallDictFt)(smallDictt *self, smallStringt *filePath); 661 662 /** 663 * print dictionary content to stdout 664 */ 665 typedef void (*logSmallDictFt) (smallDictt *self); 666 667 /** 668 * get object type string for key 669 * 670 * \param 671 * key in dictionary 672 * \return 673 * object type string 674 */ 675 typedef const char* (*typeStringSmallDictFt) (smallDictt *self, const char *key); 676 typedef smallStringt* (*typeSmallStringSmallDictFt) (smallDictt *self, const char *key); 677 678 typedef const char* (*typeStringKCharSmallDictFt) (smallDictt *self, char key); 679 typedef smallStringt* (*typeSmallStringKCharSmallDictFt) (smallDictt *self, char key); 680 681 /** 682 * get object type for key 683 * 684 * \param 685 * key in dictionary 686 * \return 687 * object type 688 */ 689 typedef char (*typeSmallDictFt) (smallDictt *self, const char *key); 690 typedef char (*typeKCharSmallDictFt) (smallDictt *self, char key); 691 692 /** 693 * get first level of object type string in dictionary 694 * 695 * \return 696 * dictionary of object type strings 697 */ 698 typedef smallDictt* (*typeStringsSmallDictFt)(smallDictt *self); 699 700 /** 701 * is element at key of type type 702 */ 703 typedef bool (*isETypeSmallDictFt) (smallDictt *self, const char *key, const char *type); 704 typedef bool (*isEUndefinedSmallDictFt) (smallDictt *self, const char *key); 705 typedef bool (*isEBoolSmallDictFt) (smallDictt *self, const char *key); 706 typedef bool (*isEContainerSmallDictFt) (smallDictt *self, const char *key); 707 typedef bool (*isEDictSmallDictFt) (smallDictt *self, const char *key); 708 typedef bool (*isEDoubleSmallDictFt) (smallDictt *self, const char *key); 709 typedef bool (*isEIntSmallDictFt) (smallDictt *self, const char *key); 710 typedef bool (*isEStringSmallDictFt) (smallDictt *self, const char *key); 711 typedef bool (*isEFaststringSmallDictFt)(smallDictt *self, const char *key); 712 typedef bool (*isEArraySmallDictFt) (smallDictt *self, const char *key); 713 typedef bool (*isEBytesSmallDictFt) (smallDictt *self, const char *key); 714 715 /** 716 * are all elements of type type 717 */ 718 typedef bool (*areAllETypeSmallDictFt) (smallDictt *self, const char *type); 719 typedef bool (*areAllEUndefinedSmallDictFt) (smallDictt *self); 720 typedef bool (*areAllEBoolSmallDictFt) (smallDictt *self); 721 typedef bool (*areAllEContainerSmallDictFt) (smallDictt *self); 722 typedef bool (*areAllEDictSmallDictFt) (smallDictt *self); 723 typedef bool (*areAllEDoubleSmallDictFt) (smallDictt *self); 724 typedef bool (*areAllEIntSmallDictFt) (smallDictt *self); 725 typedef bool (*areAllEStringSmallDictFt) (smallDictt *self); 726 typedef bool (*areAllEFaststringSmallDictFt)(smallDictt *self); 727 typedef bool (*areAllEArraySmallDictFt) (smallDictt *self); 728 typedef bool (*areAllEBytesSmallDictFt) (smallDictt *self); 729 730 /** 731 * class functions 732 * allocated once for all objects 733 * 734 * freed with finalizeSmallDict or finalizeLibsheepy 735 */ 736 737 /** 738 * use this define in child classes and add the new function after this class functions 739 * 740 * in this define, add the methods after <finishClassTemplateFt finish;> 741 * 742 * Example: 743 * #define RINGFUNCTIONST \ 744 * CLASSTEMPLATEFUNCTIONST; \ 745 * setSizeRingFt setSize 746 */ 747 #define SMALLDICTFUNCTIONST \ 748 escapeSmallDictFt escape;\ 749 disposeSmallDictFt dispose;\ 750 helpSmallDictFt help;\ 751 resetSmallDictFt reset;\ 752 getsoSmallDictFt getso;\ 753 setsoSmallDictFt setso;\ 754 mirrorSmallDictFt mirror;\ 755 setSmallDictFt set;\ 756 setUndefinedSmallDictFt setUndefined;\ 757 setBoolSmallDictFt setBool;\ 758 setDoubleSmallDictFt setDouble;\ 759 setIntSmallDictFt setInt;\ 760 setSSmallDictFt setS;\ 761 setCharSmallDictFt setChar;\ 762 setDictSmallDictFt setDict;\ 763 setArraySmallDictFt setArray;\ 764 setArraycSmallDictFt setArrayc;\ 765 setCArraycSmallDictFt setCArrayc;\ 766 setSmallBoolSmallDictFt setSmallBool;\ 767 setSmallBytesSmallDictFt setSmallBytes;\ 768 setSmallDoubleSmallDictFt setSmallDouble;\ 769 setSmallIntSmallDictFt setSmallInt;\ 770 setSmallJsonSmallDictFt setSmallJson;\ 771 setSmallStringSmallDictFt setSmallString;\ 772 setSmallContainerSmallDictFt setSmallContainer;\ 773 setKCharSmallDictFt setKChar;\ 774 setUndefinedKCharSmallDictFt setUndefinedKChar;\ 775 setBoolKCharSmallDictFt setBoolKChar;\ 776 setDoubleKCharSmallDictFt setDoubleKChar;\ 777 setIntKCharSmallDictFt setIntKChar;\ 778 setSKCharSmallDictFt setSKChar;\ 779 setCharKCharSmallDictFt setCharKChar;\ 780 setDictKCharSmallDictFt setDictKChar;\ 781 setArrayKCharSmallDictFt setArrayKChar;\ 782 setArraycKCharSmallDictFt setArraycKChar;\ 783 setCArraycKCharSmallDictFt setCArraycKChar;\ 784 setSmallBoolKCharSmallDictFt setSmallBoolKChar;\ 785 setSmallBytesKCharSmallDictFt setSmallBytesKChar;\ 786 setSmallDoubleKCharSmallDictFt setSmallDoubleKChar;\ 787 setSmallIntKCharSmallDictFt setSmallIntKChar;\ 788 setSmallJsonKCharSmallDictFt setSmallJsonKChar;\ 789 setSmallStringKCharSmallDictFt setSmallStringKChar;\ 790 setSmallContainerKCharSmallDictFt setSmallContainerKChar;\ 791 setNFreeSmallDictFt setNFree;\ 792 setNFreeUndefinedSmallDictFt setNFreeUndefined;\ 793 setNFreeSSmallDictFt setNFreeS;\ 794 setNFreeDictSmallDictFt setNFreeDict;\ 795 setNFreeArraySmallDictFt setNFreeArray;\ 796 setNFreeArraycSmallDictFt setNFreeArrayc;\ 797 setNFreeSmallBoolSmallDictFt setNFreeSmallBool;\ 798 setNFreeSmallBytesSmallDictFt setNFreeSmallBytes;\ 799 setNFreeSmallDoubleSmallDictFt setNFreeSmallDouble;\ 800 setNFreeSmallIntSmallDictFt setNFreeSmallInt;\ 801 setNFreeSmallJsonSmallDictFt setNFreeSmallJson;\ 802 setNFreeSmallStringSmallDictFt setNFreeSmallString;\ 803 setNFreeSmallContainerSmallDictFt setNFreeSmallContainer;\ 804 setNFreeKCharSmallDictFt setNFreeKChar;\ 805 setNFreeUndefinedKCharSmallDictFt setNFreeUndefinedKChar;\ 806 setNFreeSKCharSmallDictFt setNFreeSKChar;\ 807 setNFreeDictKCharSmallDictFt setNFreeDictKChar;\ 808 setNFreeArrayKCharSmallDictFt setNFreeArrayKChar;\ 809 setNFreeArraycKCharSmallDictFt setNFreeArraycKChar;\ 810 setNFreeSmallBoolKCharSmallDictFt setNFreeSmallBoolKChar;\ 811 setNFreeSmallBytesKCharSmallDictFt setNFreeSmallBytesKChar;\ 812 setNFreeSmallDoubleKCharSmallDictFt setNFreeSmallDoubleKChar;\ 813 setNFreeSmallIntKCharSmallDictFt setNFreeSmallIntKChar;\ 814 setNFreeSmallJsonKCharSmallDictFt setNFreeSmallJsonKChar;\ 815 setNFreeSmallStringKCharSmallDictFt setNFreeSmallStringKChar;\ 816 setNFreeSmallContainerKCharSmallDictFt setNFreeSmallContainerKChar;\ 817 setPDictSmallDictFt setPDict;\ 818 setPArraySmallDictFt setPArray;\ 819 setPSmallJsonSmallDictFt setPSmallJson;\ 820 setPSmallStringSmallDictFt setPSmallString;\ 821 setNFreePDictSmallDictFt setNFreePDict;\ 822 setNFreePArraySmallDictFt setNFreePArray;\ 823 setNFreePSmallJsonSmallDictFt setNFreePSmallJson;\ 824 setNFreePSmallStringSmallDictFt setNFreePSmallString;\ 825 setPArrayKCharSmallDictFt setPArrayKChar;\ 826 setPDictKCharSmallDictFt setPDictKChar;\ 827 setPSmallJsonKCharSmallDictFt setPSmallJsonKChar;\ 828 setPSmallStringKCharSmallDictFt setPSmallStringKChar;\ 829 setNFreePArrayKCharSmallDictFt setNFreePArrayKChar;\ 830 setNFreePDictKCharSmallDictFt setNFreePDictKChar;\ 831 setNFreePSmallJsonKCharSmallDictFt setNFreePSmallJsonKChar;\ 832 setNFreePSmallStringKCharSmallDictFt setNFreePSmallStringKChar;\ 833 getSmallDictFt get;\ 834 getUndefinedSmallDictFt getUndefined;\ 835 getBoolSmallDictFt getBool;\ 836 getBoolPSmallDictFt getBoolP;\ 837 getDoubleSmallDictFt getDouble;\ 838 getDoublePSmallDictFt getDoubleP;\ 839 getIntSmallDictFt getInt;\ 840 getIntPSmallDictFt getIntP;\ 841 getInt32SmallDictFt getInt32;\ 842 getInt32PSmallDictFt getInt32P;\ 843 getUintSmallDictFt getUint;\ 844 getUintPSmallDictFt getUintP;\ 845 getUint32SmallDictFt getUint32;\ 846 getUint32PSmallDictFt getUint32P;\ 847 getSSmallDictFt getS;\ 848 getDictSmallDictFt getDict;\ 849 getArraySmallDictFt getArray;\ 850 getSmallBoolSmallDictFt getSmallBool;\ 851 getSmallBytesSmallDictFt getSmallBytes;\ 852 getSmallDoubleSmallDictFt getSmallDouble;\ 853 getSmallIntSmallDictFt getSmallInt;\ 854 getSmallJsonSmallDictFt getSmallJson;\ 855 getSmallStringSmallDictFt getSmallString;\ 856 getVoidSmallDictFt getVoid;\ 857 getSmallContainerSmallDictFt getSmallContainer;\ 858 getKCharSmallDictFt getKChar;\ 859 getUndefinedKCharSmallDictFt getUndefinedKChar;\ 860 getBoolKCharSmallDictFt getBoolKChar;\ 861 getBoolPKCharSmallDictFt getBoolPKChar;\ 862 getDoubleKCharSmallDictFt getDoubleKChar;\ 863 getDoublePKCharSmallDictFt getDoublePKChar;\ 864 getIntKCharSmallDictFt getIntKChar;\ 865 getIntPKCharSmallDictFt getIntPKChar;\ 866 getInt32KCharSmallDictFt getInt32KChar;\ 867 getInt32PKCharSmallDictFt getInt32PKChar;\ 868 getUintKCharSmallDictFt getUintKChar;\ 869 getUintPKCharSmallDictFt getUintPKChar;\ 870 getUint32KCharSmallDictFt getUint32KChar;\ 871 getUint32PKCharSmallDictFt getUint32PKChar;\ 872 getSKCharSmallDictFt getSKChar;\ 873 getDictKCharSmallDictFt getDictKChar;\ 874 getArrayKCharSmallDictFt getArrayKChar;\ 875 getSmallBoolKCharSmallDictFt getSmallBoolKChar;\ 876 getSmallBytesKCharSmallDictFt getSmallBytesKChar;\ 877 getSmallDoubleKCharSmallDictFt getSmallDoubleKChar;\ 878 getSmallIntKCharSmallDictFt getSmallIntKChar;\ 879 getSmallJsonKCharSmallDictFt getSmallJsonKChar;\ 880 getSmallStringKCharSmallDictFt getSmallStringKChar;\ 881 getVoidKCharSmallDictFt getVoidKChar;\ 882 getSmallContainerKCharSmallDictFt getSmallContainerKChar;\ 883 getNDupSmallDictFt getNDup;\ 884 getNDupUndefinedSmallDictFt getNDupUndefined;\ 885 getNDupBoolSmallDictFt getNDupBool;\ 886 getNDupDoubleSmallDictFt getNDupDouble;\ 887 getNDupIntSmallDictFt getNDupInt;\ 888 getNDupInt32SmallDictFt getNDupInt32;\ 889 getNDupUintSmallDictFt getNDupUint;\ 890 getNDupUint32SmallDictFt getNDupUint32;\ 891 getNDupSSmallDictFt getNDupS;\ 892 getNDupDictSmallDictFt getNDupDict;\ 893 getNDupArraySmallDictFt getNDupArray;\ 894 getNDupSmallBoolSmallDictFt getNDupSmallBool;\ 895 getNDupSmallBytesSmallDictFt getNDupSmallBytes;\ 896 getNDupSmallDoubleSmallDictFt getNDupSmallDouble;\ 897 getNDupSmallIntSmallDictFt getNDupSmallInt;\ 898 getNDupSmallJsonSmallDictFt getNDupSmallJson;\ 899 getNDupSmallStringSmallDictFt getNDupSmallString;\ 900 getNDupVoidSmallDictFt getNDupVoid;\ 901 getNDupSmallContainerSmallDictFt getNDupSmallContainer;\ 902 getNDupKCharSmallDictFt getNDupKChar;\ 903 getNDupUndefinedKCharSmallDictFt getNDupUndefinedKChar;\ 904 getNDupBoolKCharSmallDictFt getNDupBoolKChar;\ 905 getNDupDoubleKCharSmallDictFt getNDupDoubleKChar;\ 906 getNDupIntKCharSmallDictFt getNDupIntKChar;\ 907 getNDupInt32KCharSmallDictFt getNDupInt32KChar;\ 908 getNDupUintKCharSmallDictFt getNDupUintKChar;\ 909 getNDupUint32KCharSmallDictFt getNDupUint32KChar;\ 910 getNDupSKCharSmallDictFt getNDupSKChar;\ 911 getNDupDictKCharSmallDictFt getNDupDictKChar;\ 912 getNDupArrayKCharSmallDictFt getNDupArrayKChar;\ 913 getNDupSmallBoolKCharSmallDictFt getNDupSmallBoolKChar;\ 914 getNDupSmallBytesKCharSmallDictFt getNDupSmallBytesKChar;\ 915 getNDupSmallDoubleKCharSmallDictFt getNDupSmallDoubleKChar;\ 916 getNDupSmallIntKCharSmallDictFt getNDupSmallIntKChar;\ 917 getNDupSmallJsonKCharSmallDictFt getNDupSmallJsonKChar;\ 918 getNDupSmallStringKCharSmallDictFt getNDupSmallStringKChar;\ 919 getNDupVoidKCharSmallDictFt getNDupVoidKChar;\ 920 getNDupSmallContainerKCharSmallDictFt getNDupSmallContainerKChar;\ 921 getNumSmallDictFt getNum;\ 922 cropElemSmallDictFt cropElem;\ 923 cropElemUndefinedSmallDictFt cropElemUndefined;\ 924 cropElemBoolSmallDictFt cropElemBool;\ 925 cropElemDoubleSmallDictFt cropElemDouble;\ 926 cropElemIntSmallDictFt cropElemInt;\ 927 cropElemInt32SmallDictFt cropElemInt32;\ 928 cropElemUintSmallDictFt cropElemUint;\ 929 cropElemUint32SmallDictFt cropElemUint32;\ 930 cropElemSSmallDictFt cropElemS;\ 931 cropElemDictSmallDictFt cropElemDict;\ 932 cropElemArraySmallDictFt cropElemArray;\ 933 cropElemSmallBoolSmallDictFt cropElemSmallBool;\ 934 cropElemSmallBytesSmallDictFt cropElemSmallBytes;\ 935 cropElemSmallDoubleSmallDictFt cropElemSmallDouble;\ 936 cropElemSmallIntSmallDictFt cropElemSmallInt;\ 937 cropElemSmallJsonSmallDictFt cropElemSmallJson;\ 938 cropElemSmallStringSmallDictFt cropElemSmallString;\ 939 cropElemVoidSmallDictFt cropElemVoid;\ 940 cropElemSmallContainerSmallDictFt cropElemSmallContainer;\ 941 delSmallDictFt del;\ 942 delKCharSmallDictFt delKChar;\ 943 removeSmallDictFt remove;\ 944 removeKCharSmallDictFt removeKChar;\ 945 hasSmallDictFt has;\ 946 hasKCharSmallDictFt hasKChar;\ 947 keyBySmallDictFt keyBy;\ 948 keyByUndefinedSmallDictFt keyByUndefined;\ 949 keyByBoolSmallDictFt keyByBool;\ 950 keyByDoubleSmallDictFt keyByDouble;\ 951 keyByIntSmallDictFt keyByInt;\ 952 keyBySSmallDictFt keyByS;\ 953 keyByCharSmallDictFt keyByChar;\ 954 keyByDictSmallDictFt keyByDict;\ 955 keyByArraySmallDictFt keyByArray;\ 956 keyByArraycSmallDictFt keyByArrayc;\ 957 keyByCArraycSmallDictFt keyByCArrayc;\ 958 keyBySmallBoolSmallDictFt keyBySmallBool;\ 959 keyBySmallBytesSmallDictFt keyBySmallBytes;\ 960 keyBySmallDoubleSmallDictFt keyBySmallDouble;\ 961 keyBySmallIntSmallDictFt keyBySmallInt;\ 962 keyBySmallJsonSmallDictFt keyBySmallJson;\ 963 keyBySmallStringSmallDictFt keyBySmallString;\ 964 keyBySmallContainerSmallDictFt keyBySmallContainer;\ 965 icKeyBySmallDictFt icKeyBy;\ 966 icKeyBySSmallDictFt icKeyByS;\ 967 icKeyByCharSmallDictFt icKeyByChar;\ 968 icKeyByDictSmallDictFt icKeyByDict;\ 969 icKeyByArraySmallDictFt icKeyByArray;\ 970 icKeyByArraycSmallDictFt icKeyByArrayc;\ 971 icKeyByCArraycSmallDictFt icKeyByCArrayc;\ 972 icKeyBySmallJsonSmallDictFt icKeyBySmallJson;\ 973 icKeyBySmallStringSmallDictFt icKeyBySmallString;\ 974 trimSmallDictFt trim;\ 975 keysSmallDictFt keys;\ 976 keysSmallStringSmallDictFt keysSmallString;\ 977 valuesSmallDictFt values;\ 978 mergeSmallDictFt merge;\ 979 mergeSmallJsonSmallDictFt mergeSmallJson;\ 980 mergeNSmashSmallDictFt mergeNSmash;\ 981 mergeNSmashSmallJsonSmallDictFt mergeNSmashSmallJson;\ 982 appendSmallDictFt append;\ 983 appendNSmashSmallDictFt appendNSmash;\ 984 equalSmallDictBaseFt equalBase;\ 985 equalSmallDictSmallJsonFt equalSmallJson;\ 986 equalSmallDictFt equal;\ 987 icEqualSmallDictBaseFt icEqualBase;\ 988 icEqualSmallDictSmallJsonFt icEqualSmallJson;\ 989 icEqualSmallDictFt icEqual;\ 990 lenSmallDictFt len;\ 991 emptySmallDictFt empty;\ 992 isEmptySmallDictFt isEmpty;\ 993 enumerateSmallDictFt enumerate;\ 994 iterStartSmallDictFt iterStart;\ 995 iterStartKeySmallDictFt iterStartKey;\ 996 iterNextSmallDictFt iterNext;\ 997 iterNextKeySmallDictFt iterNextKey;\ 998 iterElementSmallDictFt iterElement;\ 999 iterKeySmallDictFt iterKey;\ 1000 zipSmallDictFt zip;\ 1001 zipSmallJsonSmallDictFt zipSmallJson;\ 1002 zipSmallJsonSmallArraySmallDictFt zipSmallJsonSmallArray;\ 1003 zipSmallJsonSmallJsonSmallDictFt zipSmallJsonSmallJson;\ 1004 zipSmallJsonVArraySmallDictFt zipSmallJsonVArray;\ 1005 zipSmallJsonVCArraySmallDictFt zipSmallJsonVCArray;\ 1006 zipArraySmallDictFt zipArray;\ 1007 zipCArraySmallDictFt zipCArray;\ 1008 zipArraySmallJsonSmallDictFt zipArraySmallJson;\ 1009 zipCArraySmallJsonSmallDictFt zipCArraySmallJson;\ 1010 zipArrayArraySmallDictFt zipArrayArray;\ 1011 zipCArrayArraySmallDictFt zipCArrayArray;\ 1012 zipArrayCArraySmallDictFt zipArrayCArray;\ 1013 zipCArrayCArraySmallDictFt zipCArrayCArray;\ 1014 zipVArraySmallDictFt zipVArray;\ 1015 zipVCArraySmallDictFt zipVCArray;\ 1016 fromArraySmallDictFt fromArray;\ 1017 toArraySmallDictFt toArray;\ 1018 writeFileSmallDictFt writeFile;\ 1019 writeFileSmallJsonSmallDictFt writeFileSmallJson;\ 1020 writeFileSmallStringSmallDictFt writeFileSmallString;\ 1021 appendFileSmallDictFt appendFile;\ 1022 appendFileSmallStringSmallDictFt appendFileSmallString;\ 1023 writeStreamSmallDictFt writeStream;\ 1024 logSmallDictFt log;\ 1025 typeStringSmallDictFt typeString;\ 1026 typeSmallStringSmallDictFt typeSmallString;\ 1027 typeStringKCharSmallDictFt typeStringKChar;\ 1028 typeSmallStringKCharSmallDictFt typeSmallStringKChar;\ 1029 typeSmallDictFt type;\ 1030 typeKCharSmallDictFt typeKChar;\ 1031 typeStringsSmallDictFt typeStrings;\ 1032 isETypeSmallDictFt isEType;\ 1033 isEUndefinedSmallDictFt isEUndefined;\ 1034 isEBoolSmallDictFt isEBool;\ 1035 isEContainerSmallDictFt isEContainer;\ 1036 isEDictSmallDictFt isEDict;\ 1037 isEDoubleSmallDictFt isEDouble;\ 1038 isEIntSmallDictFt isEInt;\ 1039 isEStringSmallDictFt isEString;\ 1040 isEFaststringSmallDictFt isEFaststring;\ 1041 isEArraySmallDictFt isEArray;\ 1042 isEBytesSmallDictFt isEBytes;\ 1043 areAllETypeSmallDictFt areAllEType;\ 1044 areAllEUndefinedSmallDictFt areAllEUndefined;\ 1045 areAllEBoolSmallDictFt areAllEBool;\ 1046 areAllEContainerSmallDictFt areAllEContainer;\ 1047 areAllEDictSmallDictFt areAllEDict;\ 1048 areAllEDoubleSmallDictFt areAllEDouble;\ 1049 areAllEIntSmallDictFt areAllEInt;\ 1050 areAllEStringSmallDictFt areAllEString;\ 1051 areAllEFaststringSmallDictFt areAllEFaststring;\ 1052 areAllEArraySmallDictFt areAllEArray;\ 1053 areAllEBytesSmallDictFt areAllEBytes 1054 1055 typedef struct { 1056 freeSmallDictFt free; 1057 terminateSmallDictFt terminate; 1058 toStringSmallDictFt toString; 1059 duplicateSmallDictFt duplicate; 1060 smashSmallDictFt smash; 1061 finishSmallDictFt finish; 1062 SMALLDICTFUNCTIONST; 1063 } smallDictFunctionst; 1064 1065 /** 1066 * class 1067 */ 1068 struct smallDict { 1069 const char *type; 1070 smallDictFunctionst *f; 1071 // internal 1072 sDictt *d; 1073 ssize_t iterIndex; 1074 char* iterKey; 1075 baset* iterElement; 1076 // iterElementDataType indicates what the type baset object in iterElement 1077 // if iterElement is not small* class object then finish must not be called 1078 // in the iterator 1079 // baset objects not from small* classes are stored directly in smallContainers 1080 // values: SH_DT_UNKNOWN, SH_DT_BASET 1081 char iterElementDataType; 1082 }; 1083 1084 // base 1085 1086 #define createSmallDict(obj) ;smallDictt obj; initiateSmallDict(&obj) 1087 #define createAllocateSmallDict(obj) ;smallDictt *obj; initiateAllocateSmallDict(&obj) 1088 1089 void initiateSmallDict(smallDictt *self); 1090 void initiateAllocateSmallDict(smallDictt **self); 1091 void finalizeRecycleSmallDict(void *arg UNUSED); 1092 void finalizeSmallDict(void); 1093 1094 // initialize class methods, call registerMethodsSmallDict from classes inheriting this class 1095 void registerMethodsSmallDict(smallDictFunctionst *f); 1096 1097 smallDictt* allocSmallDict(void); 1098 1099 // terminate smallDictt val when it is out of scope 1100 void cleanUpSmallDictTerminateG(smallDictt **val); 1101 1102 // free smallDictt local val when it is out of scope 1103 void cleanUpSmallDictFreeLocalG(smallDictt *val); 1104 1105 // free smallDictt val when it is out of scope 1106 void cleanUpSmallDictFreeG(smallDictt **val); 1107 1108 // finish smallDictt val when it is out of scope 1109 void cleanUpSmallDictFinishG(smallDictt **val); 1110 1111 // dispose smallDictt val when it is out of scope 1112 void cleanUpSmallDictDisposeG(smallDictt *val); 1113 1114 // smash smallDictt val when it is out of scope 1115 void cleanUpSmallDictSmashG(smallDictt **val); 1116 1117 /** 1118 * declare pointer name with type smallDictt and terminate name when it is out of scope 1119 */ 1120 #define cleanSmallDictP(name) smallDictt *name CLEANUP(cleanUpSmallDictTerminateG) 1121 1122 /** 1123 * allocate smallDict (pointer) and clean up when it is out of scope 1124 */ 1125 #define cleanAllocateSmallDict(obj) ;cleanSmallDictP(obj); initiateAllocateSmallDict(&obj) 1126 1127 /** 1128 * declare local object name with type smallDictt and free name when it is out of scope 1129 */ 1130 #define cleanSmallDict(name) smallDictt name CLEANUP(cleanUpSmallDictFreeLocalG); initiateSmallDict(&name) 1131 1132 /** 1133 * declare pointer name with type smallDictt and free name when it is out of scope 1134 */ 1135 #define cleanFreeSmallDict(name) smallDictt *name CLEANUP(cleanUpSmallDictFreeG) 1136 1137 /** 1138 * declare pointer name with Type smallDictt and finish name when it is out of scope 1139 */ 1140 #define cleanFinishSmallDictP(name) smallDictt *name CLEANUP(cleanUpSmallDictFinishG) 1141 1142 /** 1143 * declare local object name with Type smallDictt and dispose name when it is out of scope 1144 */ 1145 #define cleanDisposeSmallDict(name) smallDictt name CLEANUP(cleanUpSmallDictDisposeG); initiateSmallDict(&name) 1146 1147 /** 1148 * declare pointer name with Type smallDictt and smash name when it is out of scope 1149 */ 1150 #define cleanSmashSmallDictP(name) smallDictt *name CLEANUP(cleanUpSmallDictSmashG) 1151 1152 /** 1153 * forEach - loop macro on smallDict keys 1154 */ 1155 #define forEachSmallDict(smallDict, key, value) \ 1156 char **libsheepyInternalKeys = (smallDict)->f->keys(smallDict); \ 1157 char *key = libsheepyInternalKeys[0]; \ 1158 size_t UNIQVAR(libsheepyInternalIndex) = 0; \ 1159 for (baset *value = smallDict->f->get(smallDict, key); libsheepyInternalKeys[UNIQVAR(libsheepyInternalIndex)] != NULL ; UNIQVAR(libsheepyInternalIndex)++, key = libsheepyInternalKeys[UNIQVAR(libsheepyInternalIndex)], value = smallDict->f->get(smallDict, key)) 1160 1161 1162 /** 1163 * forEachType c11 - loop macro on smallDict keys 1164 * 1165 * return specified type 1166 */ 1167 #define forEachTypeSmallDict(type, smallDict, key, value) \ 1168 char **libsheepyInternalKeys = (smallDict)->f->keys(smallDict); \ 1169 char *key = libsheepyInternalKeys[0]; \ 1170 size_t UNIQVAR(libsheepyInternalIndex) = 0; \ 1171 for (type value = getG(smallDict, type, key); libsheepyInternalKeys[UNIQVAR(libsheepyInternalIndex)] != NULL ; UNIQVAR(libsheepyInternalIndex)++, key = libsheepyInternalKeys[UNIQVAR(libsheepyInternalIndex)], value = getG(smallDict, type, key)) 1172 1173 smallDictt* allocSmallDictG(smallDictt *self UNUSED); 1174 1175 smallDictt* duplicateSmallDictG (smallDictt *self); 1176 1177 void freeSmallDictG (smallDictt *self); 1178 1179 smallDictt* setSmallDictG (smallDictt *self, const char *key, baset *value); 1180 1181 baset* getSmallDictG (smallDictt *self, baset* retType UNUSED, const char *key); 1182 undefinedt* getUndefinedSmallDictG (smallDictt *self, undefinedt* retType UNUSED, const char *key); 1183 bool getBoolSmallDictG (smallDictt *self, bool retType UNUSED, const char *key); 1184 bool* getBoolPSmallDictG (smallDictt *self, bool* retType UNUSED, const char *key); 1185 double getDoubleSmallDictG (smallDictt *self, double retType UNUSED, const char *key); 1186 double* getDoublePSmallDictG (smallDictt *self, double* retType UNUSED, const char *key); 1187 int64_t getIntSmallDictG (smallDictt *self, int64_t retType UNUSED, const char *key); 1188 int64_t* getIntPSmallDictG (smallDictt *self, int64_t* retType UNUSED, const char *key); 1189 int32_t getInt32SmallDictG (smallDictt *self, int32_t retType UNUSED, const char *key); 1190 int32_t* getInt32PSmallDictG (smallDictt *self, int32_t* retType UNUSED, const char *key); 1191 uint64_t getUintSmallDictG (smallDictt *self, uint64_t retType UNUSED, const char *key); 1192 uint64_t* getUintPSmallDictG (smallDictt *self, uint64_t* retType UNUSED, const char *key); 1193 uint32_t getUint32SmallDictG (smallDictt *self, uint32_t retType UNUSED, const char *key); 1194 uint32_t* getUint32PSmallDictG (smallDictt *self, uint32_t* retType UNUSED, const char *key); 1195 char* getSSmallDictG (smallDictt *self, char* retType UNUSED, const char *key); 1196 smallDictt* getDictSmallDictG (smallDictt *self, smallDictt* retType UNUSED, const char *key); 1197 smallArrayt* getArraySmallDictG (smallDictt *self, smallArrayt* retType UNUSED, const char *key); 1198 smallBoolt* getSmallBoolSmallDictG (smallDictt *self, smallBoolt* retType UNUSED, const char *key); 1199 smallBytest* getSmallBytesSmallDictG (smallDictt *self, smallBytest* retType UNUSED, const char *key); 1200 smallDoublet* getSmallDoubleSmallDictG (smallDictt *self, smallDoublet* retType UNUSED, const char *key); 1201 smallIntt* getSmallIntSmallDictG (smallDictt *self, smallIntt* retType UNUSED, const char *key); 1202 smallJsont* getSmallJsonSmallDictG (smallDictt *self, smallJsont* retType UNUSED, const char *key); 1203 smallStringt* getSmallStringSmallDictG (smallDictt *self, smallStringt* retType UNUSED, const char *key); 1204 void* getVoidSmallDictG (smallDictt *self, void* retType UNUSED, const char *key); 1205 smallContainert* getSmallContainerSmallDictG(smallDictt *self, smallContainert* retType UNUSED, const char *key); 1206 1207 baset* getKCharSmallDictG (smallDictt *self, baset* retType UNUSED, char key); 1208 undefinedt* getUndefinedKCharSmallDictG (smallDictt *self, undefinedt* retType UNUSED, char key); 1209 bool getBoolKCharSmallDictG (smallDictt *self, bool retType UNUSED, char key); 1210 bool* getBoolPKCharSmallDictG (smallDictt *self, bool* retType UNUSED, char key); 1211 double getDoubleKCharSmallDictG (smallDictt *self, double retType UNUSED, char key); 1212 double* getDoublePKCharSmallDictG (smallDictt *self, double* retType UNUSED, char key); 1213 int64_t getIntKCharSmallDictG (smallDictt *self, int64_t retType UNUSED, char key); 1214 int64_t* getIntPKCharSmallDictG (smallDictt *self, int64_t* retType UNUSED, char key); 1215 int32_t getInt32KCharSmallDictG (smallDictt *self, int32_t retType UNUSED, char key); 1216 int32_t* getInt32PKCharSmallDictG (smallDictt *self, int32_t* retType UNUSED, char key); 1217 uint64_t getUintKCharSmallDictG (smallDictt *self, uint64_t retType UNUSED, char key); 1218 uint64_t* getUintPKCharSmallDictG (smallDictt *self, uint64_t* retType UNUSED, char key); 1219 uint32_t getUint32KCharSmallDictG (smallDictt *self, uint32_t retType UNUSED, char key); 1220 uint32_t* getUint32PKCharSmallDictG (smallDictt *self, uint32_t* retType UNUSED, char key); 1221 char* getSKCharSmallDictG (smallDictt *self, char* retType UNUSED, char key); 1222 smallDictt* getDictKCharSmallDictG (smallDictt *self, smallDictt* retType UNUSED, char key); 1223 smallArrayt* getArrayKCharSmallDictG (smallDictt *self, smallArrayt* retType UNUSED, char key); 1224 smallBoolt* getSmallBoolKCharSmallDictG (smallDictt *self, smallBoolt* retType UNUSED, char key); 1225 smallBytest* getSmallBytesKCharSmallDictG (smallDictt *self, smallBytest* retType UNUSED, char key); 1226 smallDoublet* getSmallDoubleKCharSmallDictG (smallDictt *self, smallDoublet* retType UNUSED, char key); 1227 smallIntt* getSmallIntKCharSmallDictG (smallDictt *self, smallIntt* retType UNUSED, char key); 1228 smallJsont* getSmallJsonKCharSmallDictG (smallDictt *self, smallJsont* retType UNUSED, char key); 1229 smallStringt* getSmallStringKCharSmallDictG (smallDictt *self, smallStringt* retType UNUSED, char key); 1230 void* getVoidKCharSmallDictG (smallDictt *self, void* retType UNUSED, char key); 1231 smallContainert* getSmallContainerKCharSmallDictG(smallDictt *self, smallContainert* retType UNUSED, char key); 1232 1233 1234 baset* getNDupSmallDictG (smallDictt *self, baset* retType UNUSED, const char *key); 1235 undefinedt* getNDupUndefinedSmallDictG (smallDictt *self, undefinedt* retType UNUSED, const char *key); 1236 bool getNDupBoolSmallDictG (smallDictt *self, bool retType UNUSED, const char *key); 1237 double getNDupDoubleSmallDictG (smallDictt *self, double retType UNUSED, const char *key); 1238 int64_t getNDupIntSmallDictG (smallDictt *self, int64_t retType UNUSED, const char *key); 1239 int32_t getNDupInt32SmallDictG (smallDictt *self, int32_t retType UNUSED, const char *key); 1240 uint64_t getNDupUintSmallDictG (smallDictt *self, uint64_t retType UNUSED, const char *key); 1241 uint32_t getNDupUint32SmallDictG (smallDictt *self, uint32_t retType UNUSED, const char *key); 1242 char* getNDupSSmallDictG (smallDictt *self, char* retType UNUSED, const char *key); 1243 smallDictt* getNDupDictSmallDictG (smallDictt *self, smallDictt* retType UNUSED, const char *key); 1244 smallArrayt* getNDupArraySmallDictG (smallDictt *self, smallArrayt* retType UNUSED, const char *key); 1245 smallBoolt* getNDupSmallBoolSmallDictG (smallDictt *self, smallBoolt* retType UNUSED, const char *key); 1246 smallBytest* getNDupSmallBytesSmallDictG (smallDictt *self, smallBytest* retType UNUSED, const char *key); 1247 smallDoublet* getNDupSmallDoubleSmallDictG (smallDictt *self, smallDoublet* retType UNUSED, const char *key); 1248 smallIntt* getNDupSmallIntSmallDictG (smallDictt *self, smallIntt* retType UNUSED, const char *key); 1249 smallJsont* getNDupSmallJsonSmallDictG (smallDictt *self, smallJsont* retType UNUSED, const char *key); 1250 smallStringt* getNDupSmallStringSmallDictG (smallDictt *self, smallStringt* retType UNUSED, const char *key); 1251 void* getNDupVoidSmallDictG (smallDictt *self, void* retType UNUSED, const char *key); 1252 smallContainert* getNDupSmallContainerSmallDictG(smallDictt *self, smallContainert* retType UNUSED, const char *key); 1253 1254 baset* getNDupKCharSmallDictG (smallDictt *self, baset* retType UNUSED, char key); 1255 undefinedt* getNDupUndefinedKCharSmallDictG (smallDictt *self, undefinedt* retType UNUSED, char key); 1256 bool getNDupBoolKCharSmallDictG (smallDictt *self, bool retType UNUSED, char key); 1257 double getNDupDoubleKCharSmallDictG (smallDictt *self, double retType UNUSED, char key); 1258 int64_t getNDupIntKCharSmallDictG (smallDictt *self, int64_t retType UNUSED, char key); 1259 int32_t getNDupInt32KCharSmallDictG (smallDictt *self, int32_t retType UNUSED, char key); 1260 uint64_t getNDupUintKCharSmallDictG (smallDictt *self, uint64_t retType UNUSED, char key); 1261 uint32_t getNDupUint32KCharSmallDictG (smallDictt *self, uint32_t retType UNUSED, char key); 1262 char* getNDupSKCharSmallDictG (smallDictt *self, char* retType UNUSED, char key); 1263 smallDictt* getNDupDictKCharSmallDictG (smallDictt *self, smallDictt* retType UNUSED, char key); 1264 smallArrayt* getNDupArrayKCharSmallDictG (smallDictt *self, smallArrayt* retType UNUSED, char key); 1265 smallBoolt* getNDupSmallBoolKCharSmallDictG (smallDictt *self, smallBoolt* retType UNUSED, char key); 1266 smallBytest* getNDupSmallBytesKCharSmallDictG (smallDictt *self, smallBytest* retType UNUSED, char key); 1267 smallDoublet* getNDupSmallDoubleKCharSmallDictG (smallDictt *self, smallDoublet* retType UNUSED, char key); 1268 smallIntt* getNDupSmallIntKCharSmallDictG (smallDictt *self, smallIntt* retType UNUSED, char key); 1269 smallJsont* getNDupSmallJsonKCharSmallDictG (smallDictt *self, smallJsont* retType UNUSED, char key); 1270 smallStringt* getNDupSmallStringKCharSmallDictG (smallDictt *self, smallStringt* retType UNUSED, char key); 1271 void* getNDupVoidKCharSmallDictG (smallDictt *self, void* retType UNUSED, char key); 1272 smallContainert* getNDupSmallContainerKCharSmallDictG(smallDictt *self, smallContainert* retType UNUSED, char key); 1273 1274 smallDictt* setUndefinedSmallDictG(smallDictt *self, const char *key, void *value UNUSED); 1275 smallDictt* setBoolSmallDictG (smallDictt *self, const char *key, bool value); 1276 smallDictt* setDoubleSmallDictG (smallDictt *self, const char *key, double value); 1277 smallDictt* setIntSmallDictG (smallDictt *self, const char *key, int64_t value); 1278 smallDictt* setSSmallDictG (smallDictt *self, const char *key, const char *string); 1279 smallDictt* setCharSmallDictG (smallDictt *self, const char *key, char c); 1280 smallDictt* setDictSmallDictG (smallDictt *self, const char *key, smallDictt *dict); 1281 smallDictt* setArraySmallDictG (smallDictt *self, const char *key, smallArrayt *array); 1282 smallDictt* setArraycSmallDictG (smallDictt *self, const char *key, char **array); 1283 smallDictt* setCArraycSmallDictG (smallDictt *self, const char *key, const char **array); 1284 smallDictt* setVoidSmallDictG (smallDictt *self, const char *key, void *value); 1285 smallDictt* setSmallBoolSmallDictG (smallDictt *self, const char *key, smallBoolt *value); 1286 smallDictt* setSmallBytesSmallDictG (smallDictt *self, const char *key, smallBytest *value); 1287 smallDictt* setSmallDoubleSmallDictG (smallDictt *self, const char *key, smallDoublet *value); 1288 smallDictt* setSmallIntSmallDictG (smallDictt *self, const char *key, smallIntt *value); 1289 smallDictt* setSmallJsonSmallDictG (smallDictt *self, const char *key, smallJsont *value); 1290 smallDictt* setSmallStringSmallDictG (smallDictt *self, const char *key, smallStringt *string); 1291 smallDictt* setSmallContainerSmallDictG(smallDictt *self, const char *key, smallContainert *container); 1292 1293 smallDictt* setKCharSmallDictG (smallDictt *self, char key, baset *value); 1294 smallDictt* setUndefinedKCharSmallDictG(smallDictt *self, char key, undefinedt *value UNUSED); 1295 smallDictt* setBoolKCharSmallDictG (smallDictt *self, char key, bool value); 1296 smallDictt* setDoubleKCharSmallDictG (smallDictt *self, char key, double value); 1297 smallDictt* setIntKCharSmallDictG (smallDictt *self, char key, int64_t value); 1298 smallDictt* setSKCharSmallDictG (smallDictt *self, char key, const char *string); 1299 smallDictt* setCharKCharSmallDictG (smallDictt *self, char key, char c); 1300 smallDictt* setDictKCharSmallDictG (smallDictt *self, char key, smallDictt *dict); 1301 smallDictt* setArrayKCharSmallDictG (smallDictt *self, char key, smallArrayt *array); 1302 smallDictt* setArraycKCharSmallDictG (smallDictt *self, char key, char **array); 1303 smallDictt* setCArraycKCharSmallDictG (smallDictt *self, char key, const char **array); 1304 smallDictt* setVoidKCharSmallDictG (smallDictt *self, char key, void *value); 1305 smallDictt* setSmallBoolKCharSmallDictG (smallDictt *self, char key, smallBoolt *value); 1306 smallDictt* setSmallBytesKCharSmallDictG (smallDictt *self, char key, smallBytest *value); 1307 smallDictt* setSmallDoubleKCharSmallDictG (smallDictt *self, char key, smallDoublet *value); 1308 smallDictt* setSmallIntKCharSmallDictG (smallDictt *self, char key, smallIntt *value); 1309 smallDictt* setSmallJsonKCharSmallDictG (smallDictt *self, char key, smallJsont *value); 1310 smallDictt* setSmallStringKCharSmallDictG (smallDictt *self, char key, smallStringt *string); 1311 smallDictt* setSmallContainerKCharSmallDictG(smallDictt *self, char key, smallContainert *container); 1312 1313 smallDictt* setNFreeSmallDictG (smallDictt *self, const char *key, baset *value); 1314 smallDictt* setNFreeUndefinedSmallDictG(smallDictt *self, const char *key, undefinedt *undefined); 1315 smallDictt* setNFreeSSmallDictG (smallDictt *self, const char *key, char *string); 1316 smallDictt* setNFreeDictSmallDictG (smallDictt *self, const char *key, smallDictt *dict); 1317 smallDictt* setNFreeArraySmallDictG (smallDictt *self, const char *key, smallArrayt *array); 1318 smallDictt* setNFreeArraycSmallDictG (smallDictt *self, const char *key, char **array); 1319 smallDictt* setNFreeSmallBoolSmallDictG (smallDictt *self, const char *key, smallBoolt *value); 1320 smallDictt* setNFreeSmallBytesSmallDictG (smallDictt *self, const char *key, smallBytest *value); 1321 smallDictt* setNFreeSmallDoubleSmallDictG (smallDictt *self, const char *key, smallDoublet *value); 1322 smallDictt* setNFreeSmallIntSmallDictG (smallDictt *self, const char *key, smallIntt *value); 1323 smallDictt* setNFreeSmallJsonSmallDictG (smallDictt *self, const char *key, smallJsont *value); 1324 smallDictt* setNFreeSmallStringSmallDictG (smallDictt *self, const char *key, smallStringt *string); 1325 smallDictt* setNFreeSmallContainerSmallDictG(smallDictt *self, const char *key, smallContainert *container); 1326 1327 smallDictt* setNFreeKCharSmallDictG (smallDictt *self, char key, baset *value); 1328 smallDictt* setNFreeUndefinedKCharSmallDictG(smallDictt *self, char key, undefinedt *undefined); 1329 smallDictt* setNFreeSKCharSmallDictG (smallDictt *self, char key, char *string); 1330 smallDictt* setNFreeDictKCharSmallDictG (smallDictt *self, char key, smallDictt *dict); 1331 smallDictt* setNFreeArrayKCharSmallDictG (smallDictt *self, char key, smallArrayt *array); 1332 smallDictt* setNFreeArraycKCharSmallDictG (smallDictt *self, char key, char **array); 1333 smallDictt* setNFreeSmallBoolKCharSmallDictG (smallDictt *self, char key, smallBoolt *value); 1334 smallDictt* setNFreeSmallBytesKCharSmallDictG (smallDictt *self, char key, smallBytest *value); 1335 smallDictt* setNFreeSmallDoubleKCharSmallDictG (smallDictt *self, char key, smallDoublet *value); 1336 smallDictt* setNFreeSmallIntKCharSmallDictG (smallDictt *self, char key, smallIntt *value); 1337 smallDictt* setNFreeSmallJsonKCharSmallDictG (smallDictt *self, char key, smallJsont *value); 1338 smallDictt* setNFreeSmallStringKCharSmallDictG (smallDictt *self, char key, smallStringt *string); 1339 smallDictt* setNFreeSmallContainerKCharSmallDictG(smallDictt *self, char key, smallContainert *container); 1340 1341 1342 smallDictt* setPDictSmallDictG (smallDictt *self, const char *key, smallDictt *dict); 1343 smallDictt* setPArraySmallDictG (smallDictt *self, const char *key, smallArrayt *array); 1344 smallDictt* setPSmallJsonSmallDictG (smallDictt *self, const char *key, smallJsont *json); 1345 smallDictt* setPSmallStringSmallDictG (smallDictt *self, const char *key, smallStringt *string); 1346 smallDictt* setNFreePDictSmallDictG (smallDictt *self, const char *key, smallDictt *dict); 1347 smallDictt* setNFreePArraySmallDictG (smallDictt *self, const char *key, smallArrayt *array); 1348 smallDictt* setNFreePSmallJsonSmallDictG (smallDictt *self, const char *key, smallJsont *json); 1349 smallDictt* setNFreePSmallStringSmallDictG(smallDictt *self, const char *key, smallStringt *string); 1350 1351 smallDictt* setPArrayKCharSmallDictG (smallDictt *self, char key, smallArrayt *array); 1352 smallDictt* setPDictKCharSmallDictG (smallDictt *self, char key, smallDictt *dict); 1353 smallDictt* setPSmallJsonKCharSmallDictG (smallDictt *self, char key, smallJsont *json); 1354 smallDictt* setPSmallStringKCharSmallDictG (smallDictt *self, char key, smallStringt *string); 1355 smallDictt* setNFreePArrayKCharSmallDictG (smallDictt *self, char key, smallArrayt *array); 1356 smallDictt* setNFreePDictKCharSmallDictG (smallDictt *self, char key, smallDictt *dict); 1357 smallDictt* setNFreePSmallJsonKCharSmallDictG (smallDictt *self, char key, smallJsont *json); 1358 smallDictt* setNFreePSmallStringKCharSmallDictG(smallDictt *self, char key, smallStringt *string); 1359 1360 double getNumSmallDictG (smallDictt *self, const char *key); 1361 1362 smallDictt* mergeSmallDictG (smallDictt *self, smallDictt *smallDict); 1363 smallDictt* mergeSmallJsonSmallDictG (smallDictt *self, smallJsont *json); 1364 smallDictt* mergeNSmashSmallDictG (smallDictt *self, smallDictt *smallDict); 1365 smallDictt* mergeNSmashSmallJsonSmallDictG(smallDictt *self, smallJsont *json); 1366 1367 bool equalSmallDictBaseG (smallDictt* self, baset* p2); 1368 bool equalSmallDictSmallJsonG (smallDictt* self, smallJsont* p2); 1369 bool equalSmallDictG (smallDictt* self, smallDictt* p2); 1370 1371 bool icEqualSmallDictBaseG (smallDictt* self, baset* p2); 1372 bool icEqualSmallDictSmallJsonG(smallDictt* self, smallJsont* p2); 1373 bool icEqualSmallDictG (smallDictt* self, smallDictt* p2); 1374 1375 baset* cropElemSmallDictG (smallDictt *self, const char* key); 1376 undefinedt* cropElemUndefinedSmallDictG (smallDictt *self, const char* key); 1377 bool cropElemBoolSmallDictG (smallDictt *self, const char* key); 1378 double cropElemDoubleSmallDictG (smallDictt *self, const char* key); 1379 int64_t cropElemIntSmallDictG (smallDictt *self, const char* key); 1380 int32_t cropElemInt32SmallDictG (smallDictt *self, const char* key); 1381 uint64_t cropElemUintSmallDictG (smallDictt *self, const char* key); 1382 uint32_t cropElemUint32SmallDictG (smallDictt *self, const char* key); 1383 char* cropElemSSmallDictG (smallDictt *self, const char* key); 1384 smallDictt* cropElemDictSmallDictG (smallDictt *self, const char* key); 1385 smallArrayt* cropElemArraySmallDictG (smallDictt *self, const char* key); 1386 smallBoolt* cropElemSmallBoolSmallDictG (smallDictt *self, const char* key); 1387 smallBytest* cropElemSmallBytesSmallDictG (smallDictt *self, const char* key); 1388 smallDoublet* cropElemSmallDoubleSmallDictG (smallDictt *self, const char* key); 1389 smallIntt* cropElemSmallIntSmallDictG (smallDictt *self, const char* key); 1390 smallJsont* cropElemSmallJsonSmallDictG (smallDictt *self, const char* key); 1391 smallStringt* cropElemSmallStringSmallDictG (smallDictt *self, const char* key); 1392 void* cropElemVoidSmallDictG (smallDictt *self, const char* key); 1393 smallContainert* cropElemSmallContainerSmallDictG(smallDictt *self, const char* key); 1394 smallDictt* delSmallDictG (smallDictt *self, const char *key, int unused UNUSED); 1395 smallDictt* delKCharSmallDictG (smallDictt *self, char key, int unused UNUSED); 1396 smallDictt* delElemSmallDictG (smallDictt *self, const char *key); 1397 smallDictt* delElemKCharSmallDictG(smallDictt *self, char key); 1398 smallDictt* removeSmallDictG (smallDictt *self, const char *key, int unused UNUSED); 1399 smallDictt* removeKCharSmallDictG (smallDictt *self, char key, int unused UNUSED); 1400 smallDictt* removeElemSmallDictG (smallDictt *self, const char *key); 1401 smallDictt* removeElemKCharSmallDictG(smallDictt *self, char key); 1402 bool hasSmallDictG (smallDictt *self, const char *key); 1403 bool hasKCharSmallDictG (smallDictt *self, char key); 1404 char* keyBySmallDictG(smallDictt *self, baset *value); 1405 char* keyByUndefinedSmallDictG(smallDictt *self, undefinedt *undefined); 1406 char* keyByBoolSmallDictG(smallDictt *self, bool value); 1407 char* keyByDoubleSmallDictG(smallDictt *self, double value); 1408 char* keyByIntSmallDictG(smallDictt *self, int64_t value); 1409 char* keyBySSmallDictG(smallDictt *self, const char *string); 1410 char* keyByCharSmallDictG(smallDictt *self, char c); 1411 char* keyByDictSmallDictG(smallDictt *self, smallDictt *dict); 1412 char* keyByArraySmallDictG(smallDictt *self, smallArrayt *array); 1413 char* keyByArraycSmallDictG(smallDictt *self, char **array); 1414 char* keyByCArraycSmallDictG(smallDictt *self, const char **array); 1415 char* keyBySmallBoolSmallDictG(smallDictt *self, smallBoolt *value); 1416 char* keyBySmallBytesSmallDictG(smallDictt *self, smallBytest *value); 1417 char* keyBySmallDoubleSmallDictG(smallDictt *self, smallDoublet *value); 1418 char* keyBySmallIntSmallDictG(smallDictt *self, smallIntt *value); 1419 char* keyBySmallJsonSmallDictG(smallDictt *self, smallJsont *string); 1420 char* keyBySmallStringSmallDictG(smallDictt *self, smallStringt *string); 1421 char* keyBySmallContainerSmallDictG(smallDictt *self, smallContainert *container); 1422 char* icKeyBySmallDictG(smallDictt *self, baset *value); 1423 char* icKeyBySSmallDictG(smallDictt *self, const char *string); 1424 char* icKeyByCharSmallDictG(smallDictt *self, char c); 1425 char* icKeyByDictSmallDictG(smallDictt *self, smallDictt *dict); 1426 char* icKeyByArraySmallDictG(smallDictt *self, smallArrayt *array); 1427 char* icKeyByArraycSmallDictG(smallDictt *self, char **array); 1428 char* icKeyByCArraycSmallDictG(smallDictt *self, const char **array); 1429 char* icKeyBySmallJsonSmallDictG(smallDictt *self, smallJsont *string); 1430 char* icKeyBySmallStringSmallDictG(smallDictt *self, smallStringt *string); 1431 smallDictt* trimSmallDictG (smallDictt *self); 1432 smallArrayt* keysSmallStringSmallDictG(smallDictt *self); 1433 size_t lenSmallDictG (smallDictt *self); 1434 smallDictt* emptySmallDictG (smallDictt *self); 1435 bool isEmptySmallDictG (smallDictt *self); 1436 smallDictt* zipSmallDictG (smallDictt *self, smallArrayt *keys, smallArrayt *values); 1437 smallDictt* zipSmallJsonSmallDictG (smallDictt *self, smallArrayt *keys, smallJsont *values); 1438 smallDictt* zipSmallJsonSmallArraySmallDictG(smallDictt *self, smallJsont *keys, smallArrayt *values); 1439 smallDictt* zipSmallJsonSmallJsonSmallDictG (smallDictt *self, smallJsont *keys, smallJsont *values); 1440 smallDictt* zipSmallJsonVArraySmallDictG (smallDictt *self, smallJsont *keys, char **values); 1441 smallDictt* zipSmallJsonVCArraySmallDictG (smallDictt *self, smallJsont *keys, const char **values); 1442 smallDictt* zipArraySmallDictG (smallDictt *self, char** keys, smallArrayt *values); 1443 smallDictt* zipArraySmallJsonSmallDictG (smallDictt *self, char** keys, smallJsont *values); 1444 smallDictt* zipCArraySmallDictG (smallDictt *self, const char** keys, smallArrayt *values); 1445 smallDictt* zipCArraySmallJsonSmallDictG (smallDictt *self, const char** keys, smallJsont *values); 1446 smallDictt* zipArrayArraySmallDictG (smallDictt *self, char** keys, char** values); 1447 smallDictt* zipCArrayArraySmallDictG (smallDictt *self, const char** keys, char** values); 1448 smallDictt* zipArrayCArraySmallDictG (smallDictt *self, char** keys, const char** values); 1449 smallDictt* zipCArrayCArraySmallDictG (smallDictt *self, const char** keys, const char** values); 1450 smallDictt* zipVArraySmallDictG (smallDictt *self, smallArrayt *keys, char** values); 1451 smallDictt* zipVCArraySmallDictG (smallDictt *self, smallArrayt *keys, const char** values); 1452 smallDictt* fromArraySmallDictG (smallDictt *self, smallArrayt *items); 1453 smallArrayt* toArraySmallDictG (smallDictt *self); 1454 bool writeFileSmallDictG (smallDictt *self, const char *filePath); 1455 bool writeFileSmallJsonSmallDictG (smallDictt *self, smallJsont *filePath); 1456 bool writeFileSmallStringSmallDictG (smallDictt *self, smallStringt *filePath); 1457 bool appendFileSmallDictG (smallDictt *self, const char *filePath); 1458 bool appendFileSmallStringSmallDictG (smallDictt *self, smallStringt *filePath); 1459 bool writeStreamSmallDictG (smallDictt *self, FILE *fp); 1460 void logSmallDictG(smallDictt *self); 1461 smallStringt* typeSmallStringSmallDictG(smallDictt *self, const char *key); 1462 const char* typeStringKCharSmallDictG (smallDictt *self, char key); 1463 smallStringt* typeSmallStringKCharSmallDictG (smallDictt *self, char key); 1464 1465 // end class smallDict