-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patharchive.h
40 lines (34 loc) · 1.13 KB
/
archive.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
33
34
35
36
37
38
39
40
/*
* multihash - compute hashes on collections of files
* Copyright (c) 2017 Nicolas George <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 as published
* by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*/
typedef struct Archive_reader Archive_reader;
struct Archive_reader {
FILE *in;
char *filename;
char *target;
uint64_t toread;
uint64_t size;
int64_t mtime;
unsigned mode;
char *long_filename_buf;
char *long_target_buf;
unsigned long_filename_buf_size;
unsigned long_target_buf_size;
uint8_t filename_buf[101];
uint8_t target_buf[101];
char type;
};
int archive_open(Archive_reader **rar, FILE *in);
void archive_free(Archive_reader **rar);
int archive_next(Archive_reader *ar);
int archive_read(Archive_reader *ar, uint8_t *buf, int size);