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