1370b324cSopenharmony_ci/* 7zBuf.h -- Byte Buffer 2370b324cSopenharmony_ci2023-03-04 : Igor Pavlov : Public domain */ 3370b324cSopenharmony_ci 4370b324cSopenharmony_ci#ifndef ZIP7_INC_7Z_BUF_H 5370b324cSopenharmony_ci#define ZIP7_INC_7Z_BUF_H 6370b324cSopenharmony_ci 7370b324cSopenharmony_ci#include "7zTypes.h" 8370b324cSopenharmony_ci 9370b324cSopenharmony_ciEXTERN_C_BEGIN 10370b324cSopenharmony_ci 11370b324cSopenharmony_citypedef struct 12370b324cSopenharmony_ci{ 13370b324cSopenharmony_ci Byte *data; 14370b324cSopenharmony_ci size_t size; 15370b324cSopenharmony_ci} CBuf; 16370b324cSopenharmony_ci 17370b324cSopenharmony_civoid Buf_Init(CBuf *p); 18370b324cSopenharmony_ciint Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc); 19370b324cSopenharmony_civoid Buf_Free(CBuf *p, ISzAllocPtr alloc); 20370b324cSopenharmony_ci 21370b324cSopenharmony_citypedef struct 22370b324cSopenharmony_ci{ 23370b324cSopenharmony_ci Byte *data; 24370b324cSopenharmony_ci size_t size; 25370b324cSopenharmony_ci size_t pos; 26370b324cSopenharmony_ci} CDynBuf; 27370b324cSopenharmony_ci 28370b324cSopenharmony_civoid DynBuf_Construct(CDynBuf *p); 29370b324cSopenharmony_civoid DynBuf_SeekToBeg(CDynBuf *p); 30370b324cSopenharmony_ciint DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc); 31370b324cSopenharmony_civoid DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc); 32370b324cSopenharmony_ci 33370b324cSopenharmony_ciEXTERN_C_END 34370b324cSopenharmony_ci 35370b324cSopenharmony_ci#endif 36