unzip applet by Laurence Anderson

----------------------------------------------------------------------
This commit is contained in:
Glenn L McGrath
2002-01-02 13:52:26 +00:00
parent 438803311b
commit 87ac7028e0
13 changed files with 302 additions and 78 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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);

View File

@@ -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 \