#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>#include <errno.h>#include "zlib.h"#include <direct.h>#include <io.h>#include <utime.h>Include dependency graph for untgz.c:

Go to the source code of this file.
Data Structures | |
| struct | tar_header |
| union | tar_buffer |
| struct | attr_item |
Defines | |
| #define | REGTYPE '0' |
| #define | AREGTYPE '\0' |
| #define | LNKTYPE '1' |
| #define | SYMTYPE '2' |
| #define | CHRTYPE '3' |
| #define | BLKTYPE '4' |
| #define | DIRTYPE '5' |
| #define | FIFOTYPE '6' |
| #define | CONTTYPE '7' |
| #define | GNUTYPE_DUMPDIR 'D' |
| #define | GNUTYPE_LONGLINK 'K' |
| #define | GNUTYPE_LONGNAME 'L' |
| #define | GNUTYPE_MULTIVOL 'M' |
| #define | GNUTYPE_NAMES 'N' |
| #define | GNUTYPE_SPARSE 'S' |
| #define | GNUTYPE_VOLHDR 'V' |
| #define | BLOCKSIZE 512 |
| #define | SHORTNAMESIZE 100 |
| #define | ISSPECIAL(c) (((c) == '*') || ((c) == '/')) |
Enumerations | |
| enum | { TGZ_EXTRACT, TGZ_LIST, TGZ_INVALID } |
Functions | |
| char *TGZfname | OF ((const char *)) |
| int getoct | OF ((char *, int)) |
| char *strtime | OF ((time_t *)) |
| int setfiletime | OF ((char *, time_t)) |
| void push_attr | OF ((struct attr_item **, char *, int, time_t)) |
| void restore_attr | OF ((struct attr_item **)) |
| int ExprMatch | OF ((char *, char *)) |
| int makedir | OF ((char *)) |
| int matchname | OF ((int, int, char **, char *)) |
| int tar | OF ((gzFile, int, int, int, char **)) |
| void help | OF ((int)) |
| int main | OF ((int, char **)) |
| char * | TGZfname (const char *arcname) |
| void | TGZnotfound (const char *arcname) |
| int | getoct (char *p, int width) |
| char * | strtime (time_t *t) |
| int | setfiletime (char *fname, time_t ftime) |
| void | push_attr (struct attr_item **list, char *fname, int mode, time_t time) |
| void | restore_attr (struct attr_item **list) |
| int | ExprMatch (char *string, char *expr) |
| int | makedir (char *newdir) |
| int | matchname (int arg, int argc, char **argv, char *fname) |
| int | tar (gzFile in, int action, int arg, int argc, char **argv) |
| void | help (int exitval) |
| void | error (const char *msg) |
| int | main (int argc, char **argv) |
Variables | |
| char * | prog |
| const char * | TGZsuffix [] = { "\0", ".tar", ".tar.gz", ".taz", ".tgz", NULL } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 55 of file untgz.c. Referenced by tar(). |
|
|
Definition at line 56 of file untgz.c. Referenced by tar(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 288 of file untgz.c. Referenced by ExprMatch(). |
|
|
|
|
|
|
|
|
Definition at line 66 of file untgz.c. Referenced by tar(). |
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
Definition at line 290 of file untgz.c. References ISSPECIAL. Referenced by matchname(). |
|
||||||||||||
|
Definition at line 168 of file untgz.c. Referenced by tar(). |
|
|
Definition at line 581 of file untgz.c. References exit(), printf, and zlibVersion(). |
|
||||||||||||
|
Definition at line 606 of file untgz.c. References arg, error, exit(), fprintf(), gzopen(), help(), NULL, prog, stderr, strcmp, strrchr(), tar(), TGZ_EXTRACT, TGZ_LIST, TGZfname(), and TGZnotfound(). |
|
|
Definition at line 328 of file untgz.c. References ENOENT, errno, fprintf(), free, mkdir, p, prog, stderr, strdup(), and strlen(). |
|
||||||||||||||||||||
|
Definition at line 371 of file untgz.c. References ExprMatch(). Referenced by tar(). |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||
|
Definition at line 253 of file untgz.c. References error, attr_item::fname, list, malloc(), attr_item::mode, attr_item::next, NULL, strdup(), and attr_item::time. Referenced by tar(). |
|
|
Definition at line 270 of file untgz.c. References chmod, attr_item::fname, free, list, attr_item::mode, attr_item::next, NULL, setfiletime(), and attr_item::time. Referenced by tar(). |
|
||||||||||||
|
Definition at line 206 of file untgz.c. References utimbuf::actime, if(), INVALID_HANDLE_VALUE, localtime(), utimbuf::modtime, NULL, result, st, tm::tm_hour, tm::tm_mday, tm::tm_min, tm::tm_mon, tm::tm_sec, tm::tm_wday, tm::tm_year, utime, and WORD. Referenced by restore_attr(). |
|
|
Definition at line 191 of file untgz.c. References local, localtime(), result, and sprintf(). Referenced by tar(). |
|
||||||||||||||||||||||||
|
Definition at line 386 of file untgz.c. References AREGTYPE, BLOCKSIZE, buffer, bytes, DIRTYPE, err, error, fclose(), fname, fopen(), fprintf(), fwrite(), getoct(), GNUTYPE_LONGLINK, GNUTYPE_LONGNAME, gzclose(), gzerror(), gzread(), makedir(), matchname(), NULL, outfile, p, printf, prog, push_attr(), REGTYPE, remove(), restore_attr(), SHORTNAMESIZE, stderr, strlen(), strncmp(), strncpy(), strrchr(), strtime(), TGZ_EXTRACT, TGZ_INVALID, TGZ_LIST, time_t, and Z_OK. Referenced by main(). |
|
|
Definition at line 132 of file untgz.c. References access, F_OK, i, origlen, strcpy(), and strlen(). Referenced by main(). |
|
|
Definition at line 152 of file untgz.c. References exit(), fprintf(), i, prog, stderr, and TGZsuffix. Referenced by main(). |
|
|
|
|
|
Definition at line 127 of file untgz.c. Referenced by TGZnotfound(). |
1.4.6