2011-12-04 15:14:43 +00:00
|
|
|
/* 7zBuf.h -- Byte Buffer
|
|
|
|
2009-02-07 : Igor Pavlov : Public domain */
|
|
|
|
|
|
|
|
#ifndef __7Z_BUF_H
|
|
|
|
#define __7Z_BUF_H
|
|
|
|
|
|
|
|
#include "Types.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2016-07-30 21:53:39 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-07-31 23:55:24 +00:00
|
|
|
Byte* data;
|
|
|
|
size_t size;
|
2011-12-04 15:14:43 +00:00
|
|
|
} CBuf;
|
|
|
|
|
2016-07-31 23:55:24 +00:00
|
|
|
void Buf_Init(CBuf* p);
|
|
|
|
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc);
|
|
|
|
void Buf_Free(CBuf* p, ISzAlloc* alloc);
|
2011-12-04 15:14:43 +00:00
|
|
|
|
2016-07-30 21:53:39 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2016-07-31 23:55:24 +00:00
|
|
|
Byte* data;
|
|
|
|
size_t size;
|
|
|
|
size_t pos;
|
2011-12-04 15:14:43 +00:00
|
|
|
} CDynBuf;
|
|
|
|
|
2016-07-31 23:55:24 +00:00
|
|
|
void DynBuf_Construct(CDynBuf* p);
|
|
|
|
void DynBuf_SeekToBeg(CDynBuf* p);
|
|
|
|
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc);
|
|
|
|
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc);
|
2011-12-04 15:14:43 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|