dict.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Summary: string dictionary
  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 <stddef.h>
  13. #include <libxml/xmlversion.h>
  14. #include <libxml/xmlstring.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /*
  19. * The dictionary.
  20. */
  21. typedef struct _xmlDict xmlDict;
  22. typedef xmlDict *xmlDictPtr;
  23. /*
  24. * Initializer
  25. */
  26. XML_DEPRECATED
  27. XMLPUBFUN int xmlInitializeDict(void);
  28. /*
  29. * Constructor and destructor.
  30. */
  31. XMLPUBFUN xmlDictPtr
  32. xmlDictCreate (void);
  33. XMLPUBFUN size_t
  34. xmlDictSetLimit (xmlDictPtr dict,
  35. size_t limit);
  36. XMLPUBFUN size_t
  37. xmlDictGetUsage (xmlDictPtr dict);
  38. XMLPUBFUN xmlDictPtr
  39. xmlDictCreateSub(xmlDictPtr sub);
  40. XMLPUBFUN int
  41. xmlDictReference(xmlDictPtr dict);
  42. XMLPUBFUN void
  43. xmlDictFree (xmlDictPtr dict);
  44. /*
  45. * Lookup of entry in the dictionary.
  46. */
  47. XMLPUBFUN const xmlChar *
  48. xmlDictLookup (xmlDictPtr dict,
  49. const xmlChar *name,
  50. int len);
  51. XMLPUBFUN const xmlChar *
  52. xmlDictExists (xmlDictPtr dict,
  53. const xmlChar *name,
  54. int len);
  55. XMLPUBFUN const xmlChar *
  56. xmlDictQLookup (xmlDictPtr dict,
  57. const xmlChar *prefix,
  58. const xmlChar *name);
  59. XMLPUBFUN int
  60. xmlDictOwns (xmlDictPtr dict,
  61. const xmlChar *str);
  62. XMLPUBFUN int
  63. xmlDictSize (xmlDictPtr dict);
  64. /*
  65. * Cleanup function
  66. */
  67. XML_DEPRECATED
  68. XMLPUBFUN void
  69. xmlDictCleanup (void);
  70. #ifdef __cplusplus
  71. }
  72. #endif
  73. #endif /* ! __XML_DICT_H__ */