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