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