You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

86 lines
1.9 KiB

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