diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-17 20:06:02 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-07-17 20:06:02 +0000 |
commit | e110a89f4d58a06bc42084df1a402f1c843e8867 (patch) | |
tree | ca73962090982d16fbcd1889f04d481564c71bf4 /usr.bin/compress/compress.h | |
parent | a35fbb20dadabd0766b4f955207bd886c40dc456 (diff) |
o implement -l, -n and -N (including setting outfile + mtime)
o make -v behave like GNU gzip for compress/decompress stats
o write a full gzip header w/ mtime and file name
o for -t/-l just don't write data instead of writing to /dev/null
o exit code is now more consistent with GNU gzip
o a crc error on decompress no longer causes unlink(outfile)
mickey@ OK
Diffstat (limited to 'usr.bin/compress/compress.h')
-rw-r--r-- | usr.bin/compress/compress.h | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/usr.bin/compress/compress.h b/usr.bin/compress/compress.h index b9ce25d7ca2..22671b6b436 100644 --- a/usr.bin/compress/compress.h +++ b/usr.bin/compress/compress.h @@ -1,4 +1,4 @@ -/* $OpenBSD: compress.h,v 1.5 2003/07/11 02:31:18 millert Exp $ */ +/* $OpenBSD: compress.h,v 1.6 2003/07/17 20:06:01 millert Exp $ */ /* * Copyright (c) 1997 Michael Shalayeff @@ -27,32 +27,45 @@ * */ +struct z_info { + u_int32_t mtime; /* timestamp */ + u_int32_t crc; /* crc */ + u_int32_t hlen; /* header length */ + u_int64_t total_in; /* # bytes in */ + u_int64_t total_out; /* # bytes out */ +}; + /* * making it any bigger does not affect perfomance very much. * actually this value is just a little bit better than 8192. */ #define Z_BUFSIZE 16384 +/* + * exit codes for compress + */ +#define SUCCESS 0 +#define FAILURE 1 +#define WARNING 2 + extern const char main_rcsid[], z_rcsid[], gz_rcsid[], pkzip_rcsid[], pack_rcsid[], lzh_rcsid[]; -extern int z_check_header(int, struct stat *, const char *); -extern void *z_open(int, const char *, int, int); +extern void *z_open(int, const char *, char *, int, u_int32_t, int); extern FILE *zopen(const char *, const char *,int); extern int zread(void *, char *, int); extern int zwrite(void *, const char *, int); -extern int zclose(void *); +extern int z_close(void *, struct z_info *); + -extern int gz_check_header(int, struct stat *, const char *); -extern void *gz_open(int, const char *, int, int); +extern void *gz_open(int, const char *, char *, int, u_int32_t, int); extern int gz_read(void *, char *, int); extern int gz_write(void *, const char *, int); -extern int gz_close(void *); +extern int gz_close(void *, struct z_info *); extern int gz_flush(void *, int); -extern int lzh_check_header(int, struct stat *, const char *); -extern void *lzh_open(int, const char *, int, int); +extern void *lzh_open(int, const char *, char *, int, u_int32_t, int); extern int lzh_read(void *, char *, int); extern int lzh_write(void *, const char *, int); -extern int lzh_close(void *); +extern int lzh_close(void *, struct z_info *); extern int lzh_flush(void *, int); |