7zBuf.h 611 B

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