dict.h 1.5 KB

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