-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patha.h
34 lines (28 loc) · 853 Bytes
/
a.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* a.h (archiver) -- esl */
#pragma once
/* file/directory entry */
typedef struct fdent {
bool isdir;
dstr_t name;
/* dir fields */
buf_t files;
/* file fields */
uint64_t offset;
uint64_t size;
bool executable;
bool unpacked;
int integrity_algorithm; /* 0=none, 1=SHA256 */
dstr_t integrity_hash; /* 32 bytes for SHA256 */
uint32_t integrity_block_size; /* 0x400000 */
dsbuf_t integrity_blocks; /* 32 bytes x N */
int compression_algorithm; /* 0=none, 1=DEFLATE */
uint64_t compression_original_size;
} fdent_t;
extern fdent_t* fdeinit(fdent_t* mem);
extern void fdefini(fdent_t* pe);
typedef buf_t fdebuf_t;
extern fdebuf_t* fdebinit(fdebuf_t* mem);
extern void fdebfini(fdebuf_t* pb);
#define fdeblen(pb) (buflen(pb))
#define fdebref(pb, i) ((fdent_t*)bufref(pb, i))
#define fdebnewbk(pb) (fdeinit(bufnewbk(pb)))