diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2021-12-27 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-03-18 15:35:13 +0500 |
commit | f19f813537c7aea1c20749c914e756b54a9c3cf5 (patch) | |
tree | 816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /C/7zBuf.h | |
parent | 98e06a519b63b81986abe76d28887f6984a7732b (diff) | |
download | 7zip-f19f813537c7aea1c20749c914e756b54a9c3cf5.tar.gz 7zip-f19f813537c7aea1c20749c914e756b54a9c3cf5.tar.bz2 7zip-f19f813537c7aea1c20749c914e756b54a9c3cf5.zip |
'21.07'21.07
Diffstat (limited to 'C/7zBuf.h')
-rw-r--r-- | C/7zBuf.h | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/C/7zBuf.h b/C/7zBuf.h new file mode 100644 index 0000000..81d1b5b --- /dev/null +++ b/C/7zBuf.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* 7zBuf.h -- Byte Buffer | ||
2 | 2017-04-03 : Igor Pavlov : Public domain */ | ||
3 | |||
4 | #ifndef __7Z_BUF_H | ||
5 | #define __7Z_BUF_H | ||
6 | |||
7 | #include "7zTypes.h" | ||
8 | |||
9 | EXTERN_C_BEGIN | ||
10 | |||
11 | typedef struct | ||
12 | { | ||
13 | Byte *data; | ||
14 | size_t size; | ||
15 | } CBuf; | ||
16 | |||
17 | void Buf_Init(CBuf *p); | ||
18 | int Buf_Create(CBuf *p, size_t size, ISzAllocPtr alloc); | ||
19 | void Buf_Free(CBuf *p, ISzAllocPtr alloc); | ||
20 | |||
21 | typedef struct | ||
22 | { | ||
23 | Byte *data; | ||
24 | size_t size; | ||
25 | size_t pos; | ||
26 | } CDynBuf; | ||
27 | |||
28 | void DynBuf_Construct(CDynBuf *p); | ||
29 | void DynBuf_SeekToBeg(CDynBuf *p); | ||
30 | int DynBuf_Write(CDynBuf *p, const Byte *buf, size_t size, ISzAllocPtr alloc); | ||
31 | void DynBuf_Free(CDynBuf *p, ISzAllocPtr alloc); | ||
32 | |||
33 | EXTERN_C_END | ||
34 | |||
35 | #endif | ||