00001 /* 00002 * dict.h: dictionary of reusable strings, just used to avoid allocation 00003 * and freeing operations. 00004 * 00005 * Copyright (C) 2003 Daniel Veillard. 00006 * 00007 * Permission to use, copy, modify, and distribute this software for any 00008 * purpose with or without fee is hereby granted, provided that the above 00009 * copyright notice and this permission notice appear in all copies. 00010 * 00011 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 00012 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 00013 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE AUTHORS AND 00014 * CONTRIBUTORS ACCEPT NO RESPONSIBILITY IN ANY CONCEIVABLE MANNER. 00015 * 00016 * Author: daniel@veillard.com 00017 */ 00018 00019 #ifndef __XML_DICT_H__ 00020 #define __XML_DICT_H__ 00021 00022 #include <libxml/xmlversion.h> 00023 #include <libxml/tree.h> 00024 00025 #ifdef __cplusplus 00026 extern "C" { 00027 #endif 00028 00029 /* 00030 * The dictionnary. 00031 */ 00032 typedef struct _xmlDict xmlDict; 00033 typedef xmlDict *xmlDictPtr; 00034 00035 /* 00036 * Constructor and destructor. 00037 */ 00038 XMLPUBFUN xmlDictPtr XMLCALL 00039 xmlDictCreate (void); 00040 XMLPUBFUN int XMLCALL 00041 xmlDictReference(xmlDictPtr dict); 00042 XMLPUBFUN void XMLCALL 00043 xmlDictFree (xmlDictPtr dict); 00044 00045 /* 00046 * Lookup of entry in the dictionnary. 00047 */ 00048 XMLPUBFUN const xmlChar * XMLCALL 00049 xmlDictLookup (xmlDictPtr dict, 00050 const xmlChar *name, 00051 int len); 00052 XMLPUBFUN const xmlChar * XMLCALL 00053 xmlDictQLookup (xmlDictPtr dict, 00054 const xmlChar *prefix, 00055 const xmlChar *name); 00056 XMLPUBFUN int XMLCALL 00057 xmlDictOwns (xmlDictPtr dict, 00058 const xmlChar *str); 00059 XMLPUBFUN int XMLCALL 00060 xmlDictSize (xmlDictPtr dict); 00061 #ifdef __cplusplus 00062 } 00063 #endif 00064 #endif /* ! __XML_DICT_H__ */ 00065