dict.h 1.7 KB

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