1/* 2 * Summary: string dictionnary 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 <limits.h> 15#include <libxml/xmlversion.h> 16#include <libxml/tree.h> 17 18#ifdef __cplusplus 19extern "C" { 20#endif 21 22/* 23 * The dictionnary. 24 */ 25typedef struct _xmlDict xmlDict; 26typedef xmlDict *xmlDictPtr; 27 28/* 29 * Initializer 30 */ 31XMLPUBFUN int XMLCALL xmlInitializeDict(void); 32 33/* 34 * Constructor and destructor. 35 */ 36XMLPUBFUN xmlDictPtr XMLCALL 37 xmlDictCreate (void); 38XMLPUBFUN size_t XMLCALL 39 xmlDictSetLimit (xmlDictPtr dict, 40 size_t limit); 41XMLPUBFUN size_t XMLCALL 42 xmlDictGetUsage (xmlDictPtr dict); 43XMLPUBFUN xmlDictPtr XMLCALL 44 xmlDictCreateSub(xmlDictPtr sub); 45XMLPUBFUN int XMLCALL 46 xmlDictReference(xmlDictPtr dict); 47XMLPUBFUN void XMLCALL 48 xmlDictFree (xmlDictPtr dict); 49 50/* 51 * Lookup of entry in the dictionnary. 52 */ 53XMLPUBFUN const xmlChar * XMLCALL 54 xmlDictLookup (xmlDictPtr dict, 55 const xmlChar *name, 56 int len); 57XMLPUBFUN const xmlChar * XMLCALL 58 xmlDictExists (xmlDictPtr dict, 59 const xmlChar *name, 60 int len); 61XMLPUBFUN const xmlChar * XMLCALL 62 xmlDictQLookup (xmlDictPtr dict, 63 const xmlChar *prefix, 64 const xmlChar *name); 65XMLPUBFUN int XMLCALL 66 xmlDictOwns (xmlDictPtr dict, 67 const xmlChar *str); 68XMLPUBFUN int XMLCALL 69 xmlDictSize (xmlDictPtr dict); 70 71/* 72 * Cleanup function 73 */ 74XMLPUBFUN void XMLCALL 75 xmlDictCleanup (void); 76 77#ifdef __cplusplus 78} 79#endif 80#endif /* ! __XML_DICT_H__ */ 81