blob: abb8339cb891866a7b806f915ee91060fe29d9da [file] [log] [blame]
Daniel Veillard2fdbd322003-08-18 12:15:38 +00001/*
Daniel Veillardbe586972003-11-18 20:56:51 +00002 * Summary: string dictionnary
3 * Description: dictionary of reusable strings, just used to avoid allocation
Daniel Veillard2fdbd322003-08-18 12:15:38 +00004 * and freeing operations.
5 *
Daniel Veillardbe586972003-11-18 20:56:51 +00006 * Copy: See Copyright for the status of this software.
Daniel Veillard2fdbd322003-08-18 12:15:38 +00007 *
Daniel Veillardbe586972003-11-18 20:56:51 +00008 * Author: Daniel Veillard
Daniel Veillard2fdbd322003-08-18 12:15:38 +00009 */
10
11#ifndef __XML_DICT_H__
12#define __XML_DICT_H__
13
Igor Zlatkovic76874e42003-08-25 09:05:12 +000014#include <libxml/xmlversion.h>
Daniel Veillard2fdbd322003-08-18 12:15:38 +000015#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 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +000030XMLPUBFUN xmlDictPtr XMLCALL
31 xmlDictCreate (void);
Daniel Veillard4773df22004-01-23 13:15:13 +000032XMLPUBFUN xmlDictPtr XMLCALL
33 xmlDictCreateSub(xmlDictPtr sub);
Daniel Veillarde96a2a42003-09-24 21:23:56 +000034XMLPUBFUN int XMLCALL
35 xmlDictReference(xmlDictPtr dict);
Igor Zlatkovic76874e42003-08-25 09:05:12 +000036XMLPUBFUN void XMLCALL
37 xmlDictFree (xmlDictPtr dict);
Daniel Veillard2fdbd322003-08-18 12:15:38 +000038
39/*
40 * Lookup of entry in the dictionnary.
41 */
Igor Zlatkovic76874e42003-08-25 09:05:12 +000042XMLPUBFUN const xmlChar * XMLCALL
43 xmlDictLookup (xmlDictPtr dict,
Daniel Veillard2fdbd322003-08-18 12:15:38 +000044 const xmlChar *name,
45 int len);
Daniel Veillarde72c5082003-09-19 12:44:05 +000046XMLPUBFUN const xmlChar * XMLCALL
Daniel Veillard6bb3e862004-11-24 12:39:00 +000047 xmlDictExists (xmlDictPtr dict,
48 const xmlChar *name,
49 int len);
50XMLPUBFUN const xmlChar * XMLCALL
Daniel Veillarde72c5082003-09-19 12:44:05 +000051 xmlDictQLookup (xmlDictPtr dict,
52 const xmlChar *prefix,
53 const xmlChar *name);
Daniel Veillard81514ba2003-09-16 23:17:26 +000054XMLPUBFUN int XMLCALL
55 xmlDictOwns (xmlDictPtr dict,
56 const xmlChar *str);
Igor Zlatkovic76874e42003-08-25 09:05:12 +000057XMLPUBFUN int XMLCALL
58 xmlDictSize (xmlDictPtr dict);
Daniel Veillard14412512005-01-21 23:53:26 +000059
60/*
61 * Cleanup function
62 */
63XMLPUBFUN void XMLCALL
64 xmlDictCleanup (void);
65
Daniel Veillard2fdbd322003-08-18 12:15:38 +000066#ifdef __cplusplus
67}
68#endif
69#endif /* ! __XML_DICT_H__ */