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