Imported Upstream version 9.20
[platform/upstream/7zip.git] / C / 7zBuf.h
1 /* 7zBuf.h -- Byte Buffer\r
2 2009-02-07 : Igor Pavlov : Public domain */\r
3 \r
4 #ifndef __7Z_BUF_H\r
5 #define __7Z_BUF_H\r
6 \r
7 #include "Types.h"\r
8 \r
9 #ifdef __cplusplus\r
10 extern "C" {\r
11 #endif\r
12 \r
13 typedef struct\r
14 {\r
15   Byte *data;\r
16   size_t size;\r
17 } CBuf;\r
18 \r
19 void Buf_Init(CBuf *p);\r
20 int Buf_Create(CBuf *p, size_t size, ISzAlloc *alloc);\r
21 void Buf_Free(CBuf *p, ISzAlloc *alloc);\r
22 \r
23 typedef struct\r
24 {\r
25   Byte *data;\r
26   size_t size;\r
27   size_t pos;\r
28 } CDynBuf;\r
29 \r
30 void DynBuf_Construct(CDynBuf *p);\r
31 void DynBuf_SeekToBeg(CDynBuf *p);\r
32 int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAlloc *alloc);\r
33 void DynBuf_Free(CDynBuf *p, ISzAlloc *alloc);\r
34 \r
35 #ifdef __cplusplus\r
36 }\r
37 #endif\r
38 \r
39 #endif\r