2009-04-15 03:58:10 +00:00
|
|
|
/* 7zBuf.h -- Byte Buffer
|
2015-12-31 15:23:54 +00:00
|
|
|
2013-01-18 : Igor Pavlov : Public domain */
|
2009-04-15 03:58:10 +00:00
|
|
|
|
|
|
|
#ifndef __7Z_BUF_H
|
|
|
|
#define __7Z_BUF_H
|
|
|
|
|
2015-12-31 15:23:54 +00:00
|
|
|
#include "7zTypes.h"
|
2009-04-15 03:58:10 +00:00
|
|
|
|
2015-12-31 15:23:54 +00:00
|
|
|
EXTERN_C_BEGIN
|
2014-04-27 10:05:40 +00:00
|
|
|
|
2009-04-15 03:58:10 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Byte *data;
|
|
|
|
size_t size;
|
|
|
|
} CBuf;
|
|
|
|
|
|
|
|
void Buf_Init(CBuf *p);
|
|
|
|
int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc);
|
|
|
|
void Buf_Free(CBuf *p, ISzAlloc *alloc);
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
Byte *data;
|
|
|
|
size_t size;
|
|
|
|
size_t pos;
|
|
|
|
} CDynBuf;
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
2015-12-31 15:23:54 +00:00
|
|
|
EXTERN_C_END
|
2014-04-27 10:05:40 +00:00
|
|
|
|
2009-04-15 03:58:10 +00:00
|
|
|
#endif
|