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