1 /* 2 * Summary: string dictionary 3 * Description: dictionary of reusable strings, just used to avoid allocation 4 * and freeing operations. 5 * 6 * Copy: See Copyright for the status of this software. 7 * 8 * Author: Daniel Veillard 9 */ 10 11 #ifndef __XML_DICT_H__ 12 #define __XML_DICT_H__ 13 14 #include <stddef.h> 15 #include <libxml/xmlversion.h> 16 #include <libxml/xmlstring.h> 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 /* 23 * The dictionary. 24 */ 25 typedef struct _xmlDict xmlDict; 26 typedef xmlDict *xmlDictPtr; 27 28 /* 29 * Initializer 30 */ 31 XML_DEPRECATED 32 XMLPUBFUN int xmlInitializeDict(void); 33 34 /* 35 * Constructor and destructor. 36 */ 37 XMLPUBFUN xmlDictPtr 38 xmlDictCreate (void); 39 XMLPUBFUN size_t 40 xmlDictSetLimit (xmlDictPtr dict, 41 size_t limit); 42 XMLPUBFUN size_t 43 xmlDictGetUsage (xmlDictPtr dict); 44 XMLPUBFUN xmlDictPtr 45 xmlDictCreateSub(xmlDictPtr sub); 46 XMLPUBFUN int 47 xmlDictReference(xmlDictPtr dict); 48 XMLPUBFUN void 49 xmlDictFree (xmlDictPtr dict); 50 51 /* 52 * Lookup of entry in the dictionary. 53 */ 54 XMLPUBFUN const xmlChar * 55 xmlDictLookup (xmlDictPtr dict, 56 const xmlChar *name, 57 int len); 58 XMLPUBFUN const xmlChar * 59 xmlDictExists (xmlDictPtr dict, 60 const xmlChar *name, 61 int len); 62 XMLPUBFUN const xmlChar * 63 xmlDictQLookup (xmlDictPtr dict, 64 const xmlChar *prefix, 65 const xmlChar *name); 66 XMLPUBFUN int 67 xmlDictOwns (xmlDictPtr dict, 68 const xmlChar *str); 69 XMLPUBFUN int 70 xmlDictSize (xmlDictPtr dict); 71 72 /* 73 * Cleanup function 74 */ 75 XML_DEPRECATED 76 XMLPUBFUN void 77 xmlDictCleanup (void); 78 79 #ifdef __cplusplus 80 } 81 #endif 82 #endif /* ! __XML_DICT_H__ */ 83