aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/applets.h3
-rw-r--r--include/libbb.h1
-rw-r--r--include/unarchive.h2
-rw-r--r--include/usage.h13
4 files changed, 19 insertions, 0 deletions
diff --git a/include/applets.h b/include/applets.h
index ba0a9aaa9..0d310bdc3 100644
--- a/include/applets.h
+++ b/include/applets.h
@@ -470,6 +470,9 @@
#ifdef CONFIG_UNIX2DOS
APPLET(unix2dos, dos2unix_main, _BB_DIR_USR_BIN)
#endif
+#ifdef CONFIG_UNZIP
+ APPLET(unzip, unzip_main, _BB_DIR_USR_BIN)
+#endif
#ifdef CONFIG_UPDATE
APPLET(update, update_main, _BB_DIR_SBIN)
#endif
diff --git a/include/libbb.h b/include/libbb.h
index fccdf5fdf..8dadfd958 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -215,6 +215,7 @@ extern long arith (const char *startbuf, int *errcode);
int read_package_field(const char *package_buffer, char **field_name, char **field_value);
char *fgets_str(FILE *file, const char *terminating_string);
+extern int inflate(FILE *in, FILE *out);
extern int unzip(FILE *l_in_file, FILE *l_out_file);
extern void gz_close(int gunzip_pid);
extern FILE *gz_open(FILE *compressed_file, int *pid);
diff --git a/include/unarchive.h b/include/unarchive.h
index be49f3d01..eada1c337 100644
--- a/include/unarchive.h
+++ b/include/unarchive.h
@@ -26,11 +26,13 @@ typedef struct file_headers_s {
mode_t mode;
time_t mtime;
dev_t device;
+ int (*extract_func)(FILE *, FILE *);
} file_header_t;
file_header_t *get_header_ar(FILE *in_file);
file_header_t *get_header_cpio(FILE *src_stream);
file_header_t *get_header_tar(FILE *tar_stream);
+file_header_t *get_header_zip(FILE *zip_stream);
void seek_sub_file(FILE *src_stream, const int count);
diff --git a/include/usage.h b/include/usage.h
index 20e2448fd..cd3af9c55 100644
--- a/include/usage.h
+++ b/include/usage.h
@@ -1851,6 +1851,19 @@
"\t-u\toutput will be in UNIX format\n" \
"\t-d\toutput will be in DOS format"
+#define unzip_trivial_usage \
+ "[-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]"
+#define unzip_full_usage \
+ "Extracts files from ZIP archives\n" \
+ "Options:\n" \
+ "\t-l\tlist archive contents (short form)\n" \
+ "\t-n\tnever overwrite existing files (default)\n" \
+ "\t-o\toverwrite files without prompting\n" \
+ "\t-p\tsend output to stdout\n" \
+ "\t-q\tbe quiet\n" \
+ "\t-x\texclude these files\n" \
+ "\t-d\textract files into this directory"
+
#define update_trivial_usage \
"[options]"
#define update_full_usage \