summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGlenn L McGrath2002-01-02 13:52:26 +0000
committerGlenn L McGrath2002-01-02 13:52:26 +0000
commit87ac7028e01cdc4f504ea558a6ae3d086ed1bf2b (patch)
tree4f406c877f88a013c4e1dc650ac312640a95cb00 /include
parent438803311b67c6337ea97476e97336e027ef9a3a (diff)
downloadbusybox-87ac7028e01cdc4f504ea558a6ae3d086ed1bf2b.zip
busybox-87ac7028e01cdc4f504ea558a6ae3d086ed1bf2b.tar.gz
unzip applet by Laurence Anderson
----------------------------------------------------------------------
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 ba0a9aa..0d310bd 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 fccdf5f..8dadfd9 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 be49f3d..eada1c3 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 20e2448..cd3af9c 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 \