1 /* libxml2 - Library for parsing XML documents
2 * Copyright (C) 2006-2019 Free Software Foundation, Inc.
3 *
4 * This file is not part of the GNU gettext program, but is used with
5 * GNU gettext.
6 *
7 * The original copyright notice is as follows:
8 */
9
10 /*
11 * Copyright (C) 1998-2012 Daniel Veillard. All Rights Reserved.
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a copy
14 * of this software and associated documentation files (the "Software"), to deal
15 * in the Software without restriction, including without limitation the rights
16 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17 * copies of the Software, and to permit persons to whom the Software is fur-
18 * nished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included in
21 * all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT-
25 * NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29 * THE SOFTWARE.
30 *
31 * Author: Daniel Veillard
32 */
33
34 /*
35 * Summary: string dictionary
36 * Description: dictionary of reusable strings, just used to avoid allocation
37 * and freeing operations.
38 */
39
40 #ifndef __XML_DICT_H__
41 #define __XML_DICT_H__
42
43 #ifdef __cplusplus
44 #define __XML_EXTERNC extern "C"
45 #else
46 #define __XML_EXTERNC
47 #endif
48
49 /*
50 * The dictionary.
51 */
52 __XML_EXTERNC typedef struct _xmlDict xmlDict;
53 __XML_EXTERNC typedef xmlDict *xmlDictPtr;
54
55 #include <limits.h>
56 #include <libxml/xmlversion.h>
57 #include <libxml/tree.h>
58
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62
63 /*
64 * Initializer
65 */
66 XMLPUBFUN int XMLCALL xmlInitializeDict(void);
67
68 /*
69 * Constructor and destructor.
70 */
71 XMLPUBFUN xmlDictPtr XMLCALL
72 xmlDictCreate (void);
73 XMLPUBFUN size_t XMLCALL
74 xmlDictSetLimit (xmlDictPtr dict,
75 size_t limit);
76 XMLPUBFUN size_t XMLCALL
77 xmlDictGetUsage (xmlDictPtr dict);
78 XMLPUBFUN xmlDictPtr XMLCALL
79 xmlDictCreateSub(xmlDictPtr sub);
80 XMLPUBFUN int XMLCALL
81 xmlDictReference(xmlDictPtr dict);
82 XMLPUBFUN void XMLCALL
83 xmlDictFree (xmlDictPtr dict);
84
85 /*
86 * Lookup of entry in the dictionary.
87 */
88 XMLPUBFUN const xmlChar * XMLCALL
89 xmlDictLookup (xmlDictPtr dict,
90 const xmlChar *name,
91 int len);
92 XMLPUBFUN const xmlChar * XMLCALL
93 xmlDictExists (xmlDictPtr dict,
94 const xmlChar *name,
95 int len);
96 XMLPUBFUN const xmlChar * XMLCALL
97 xmlDictQLookup (xmlDictPtr dict,
98 const xmlChar *prefix,
99 const xmlChar *name);
100 XMLPUBFUN int XMLCALL
101 xmlDictOwns (xmlDictPtr dict,
102 const xmlChar *str);
103 XMLPUBFUN int XMLCALL
104 xmlDictSize (xmlDictPtr dict);
105
106 /*
107 * Cleanup function
108 */
109 XMLPUBFUN void XMLCALL
110 xmlDictCleanup (void);
111
112 #ifdef __cplusplus
113 }
114 #endif
115 #endif /* ! __XML_DICT_H__ */