buf.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * Summary: Internal Interfaces for memory buffers in libxml2
  3. * Description: this module describes most of the new xmlBuf buffer
  4. * entry points, those are private routines, with a
  5. * few exceptions exported in tree.h. This was added
  6. * in 2.9.0.
  7. *
  8. * Copy: See Copyright for the status of this software.
  9. *
  10. * Author: Daniel Veillard
  11. */
  12. #ifndef __XML_BUF_H__
  13. #define __XML_BUF_H__
  14. #include <libxml/tree.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. xmlBufPtr xmlBufCreate(void);
  19. xmlBufPtr xmlBufCreateSize(size_t size);
  20. xmlBufPtr xmlBufCreateStatic(void *mem, size_t size);
  21. int xmlBufSetAllocationScheme(xmlBufPtr buf,
  22. xmlBufferAllocationScheme scheme);
  23. int xmlBufGetAllocationScheme(xmlBufPtr buf);
  24. void xmlBufFree(xmlBufPtr buf);
  25. void xmlBufEmpty(xmlBufPtr buf);
  26. /* size_t xmlBufShrink(xmlBufPtr buf, size_t len); */
  27. int xmlBufGrow(xmlBufPtr buf, int len);
  28. int xmlBufInflate(xmlBufPtr buf, size_t len);
  29. int xmlBufResize(xmlBufPtr buf, size_t len);
  30. int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
  31. int xmlBufAddHead(xmlBufPtr buf, const xmlChar *str, int len);
  32. int xmlBufCat(xmlBufPtr buf, const xmlChar *str);
  33. int xmlBufCCat(xmlBufPtr buf, const char *str);
  34. int xmlBufWriteCHAR(xmlBufPtr buf, const xmlChar *string);
  35. int xmlBufWriteChar(xmlBufPtr buf, const char *string);
  36. int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string);
  37. size_t xmlBufAvail(const xmlBufPtr buf);
  38. size_t xmlBufLength(const xmlBufPtr buf);
  39. /* size_t xmlBufUse(const xmlBufPtr buf); */
  40. int xmlBufIsEmpty(const xmlBufPtr buf);
  41. int xmlBufAddLen(xmlBufPtr buf, size_t len);
  42. int xmlBufErase(xmlBufPtr buf, size_t len);
  43. /* const xmlChar * xmlBufContent(const xmlBuf *buf); */
  44. /* const xmlChar * xmlBufEnd(xmlBufPtr buf); */
  45. xmlChar * xmlBufDetach(xmlBufPtr buf);
  46. size_t xmlBufDump(FILE *file, xmlBufPtr buf);
  47. xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer);
  48. xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf);
  49. int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer);
  50. int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
  51. size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input);
  52. int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
  53. size_t base, size_t cur);
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* __XML_BUF_H__ */