-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunzip.h
More file actions
36 lines (28 loc) · 749 Bytes
/
unzip.h
File metadata and controls
36 lines (28 loc) · 749 Bytes
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
#ifndef SRC_UNZIP_H_
#define SRC_UNZIP_H_
#define _GNU_SOURCE
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include <zlib.h>
#define USAGE "Usage: unzip source_archive.zip [options] [output]\n"
#define DEFAULT_CHUNK_SIZE (2U << 12)
// config for read parameters
typedef struct {
int hFlag;
int fFlag;
} OptionsConfig;
// error types
typedef enum { ERROR = -1, OK = 0 } eErrorCode;
int unzip(const char* archive_filename, const char* filename,
OptionsConfig config);
int scanOptions(int argc, char** argv, OptionsConfig* config);
#endif // SRC_UNZIP_H_