dict.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. * Initializer
  25. */
  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 dictionnary.
  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. XMLPUBFUN void XMLCALL
  67. xmlDictCleanup (void);
  68. #ifdef __cplusplus
  69. }
  70. #endif
  71. #endif /* ! __XML_DICT_H__ */