dict.h 1.8 KB

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