2012-02-12 18:55:51 +01:00
|
|
|
/* 7zBuf.h -- Byte Buffer
|
2023-12-05 21:58:49 +01:00
|
|
|
2023-03-04 : Igor Pavlov : Public domain */
|
2012-02-12 18:55:51 +01:00
|
|
|
|
2023-12-05 21:58:49 +01:00
|
|
|
#ifndef ZIP7_INC_7Z_BUF_H
|
|
|
|
#define ZIP7_INC_7Z_BUF_H
|
2012-02-12 18:55:51 +01:00
|
|
|
|
2016-04-09 13:45:54 +02:00
|
|
|
#include "7zTypes.h"
|
2012-02-12 18:55:51 +01:00
|
|
|
|
2016-04-09 13:45:54 +02:00
|
|
|
EXTERN_C_BEGIN
|
2012-02-12 18:55:51 +01:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-01-11 08:10:25 +01:00
|
|
|
Byte *data;
|
|
|
|
size_t size;
|
2012-02-12 18:55:51 +01:00
|
|
|
} CBuf;
|
|
|
|
|
|
|
|
void Buf_Init(CBuf *p);
|
2023-05-03 18:41:16 +02:00
|
|
|
int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc);
|
|
|
|
void Buf_Free(CBuf *p, ISzAllocPtr alloc);
|
2012-02-12 18:55:51 +01:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2015-01-11 08:10:25 +01:00
|
|
|
Byte *data;
|
|
|
|
size_t size;
|
|
|
|
size_t pos;
|
2012-02-12 18:55:51 +01:00
|
|
|
} CDynBuf;
|
|
|
|
|
|
|
|
void DynBuf_Construct(CDynBuf *p);
|
|
|
|
void DynBuf_SeekToBeg(CDynBuf *p);
|
2023-05-03 18:41:16 +02:00
|
|
|
int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc);
|
|
|
|
void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc);
|
2012-02-12 18:55:51 +01:00
|
|
|
|
2016-04-09 13:45:54 +02:00
|
|
|
EXTERN_C_END
|
2012-02-12 18:55:51 +01:00
|
|
|
|
|
|
|
#endif
|