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