buf.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 xmlBufResize(xmlBufPtr buf, size_t len);
  29. int xmlBufAdd(xmlBufPtr buf, const xmlChar *str, int len);
  30. int xmlBufCat(xmlBufPtr buf, const xmlChar *str);
  31. int xmlBufCCat(xmlBufPtr buf, const char *str);
  32. int xmlBufWriteQuotedString(xmlBufPtr buf, const xmlChar *string);
  33. size_t xmlBufAvail(const xmlBufPtr buf);
  34. size_t xmlBufLength(const xmlBufPtr buf);
  35. /* size_t xmlBufUse(const xmlBufPtr buf); */
  36. int xmlBufIsEmpty(const xmlBufPtr buf);
  37. int xmlBufAddLen(xmlBufPtr buf, size_t len);
  38. /* const xmlChar * xmlBufContent(const xmlBuf *buf); */
  39. /* const xmlChar * xmlBufEnd(xmlBufPtr buf); */
  40. xmlChar * xmlBufDetach(xmlBufPtr buf);
  41. size_t xmlBufDump(FILE *file, xmlBufPtr buf);
  42. xmlBufPtr xmlBufFromBuffer(xmlBufferPtr buffer);
  43. xmlBufferPtr xmlBufBackToBuffer(xmlBufPtr buf);
  44. int xmlBufMergeBuffer(xmlBufPtr buf, xmlBufferPtr buffer);
  45. int xmlBufResetInput(xmlBufPtr buf, xmlParserInputPtr input);
  46. size_t xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input);
  47. int xmlBufSetInputBaseCur(xmlBufPtr buf, xmlParserInputPtr input,
  48. size_t base, size_t cur);
  49. #ifdef __cplusplus
  50. }
  51. #endif
  52. #endif /* __XML_BUF_H__ */