7zBuf.h 612 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* 7zBuf.h -- Byte Buffer
  2. 2013-01-18 : 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, ISzAlloc *alloc);
  14. void Buf_Free(CBuf *p, ISzAlloc *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, ISzAlloc *alloc);
  24. void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc);
  25. EXTERN_C_END
  26. #endif