7zBuf.h 655 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* 7zBuf.h -- Byte Buffer
  2. 2017-04-03 : Igor Pavlov : Public domain */
  3. #ifndef __7Z_BUF_H
  4. #define __7Z_BUF_H
  5. #include "7zTypes.h"
  6. EXTERN_C_BEGIN
  7. typedef struct
  8. {
  9. Byte *data;
  10. size_t size;
  11. } CBuf;
  12. void Buf_Init(CBuf *p);
  13. int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc);
  14. void Buf_Free(CBuf *p, ISzAllocPtr alloc);
  15. typedef struct
  16. {
  17. Byte *data;
  18. size_t size;
  19. size_t pos;
  20. } CDynBuf;
  21. void DynBuf_Construct(CDynBuf *p);
  22. void DynBuf_SeekToBeg(CDynBuf *p);
  23. int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc);
  24. void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc);
  25. EXTERN_C_END
  26. #endif