Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
#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>
Go to the source code of this file.
Data Structures | |
struct | tar_header |
union | tar_buffer |
struct | attr_item |
Macros | |
#define | REGTYPE '0' /* regular file */ |
#define | AREGTYPE '\0' /* regular file */ |
#define | LNKTYPE '1' /* link */ |
#define | SYMTYPE '2' /* reserved */ |
#define | CHRTYPE '3' /* character special */ |
#define | BLKTYPE '4' /* block special */ |
#define | DIRTYPE '5' /* directory */ |
#define | FIFOTYPE '6' /* FIFO special */ |
#define | CONTTYPE '7' /* reserved */ |
#define | GNUTYPE_DUMPDIR 'D' /* file names from dumped directory */ |
#define | GNUTYPE_LONGLINK 'K' /* long link name */ |
#define | GNUTYPE_LONGNAME 'L' /* long file name */ |
#define | GNUTYPE_MULTIVOL 'M' /* continuation of file from another volume */ |
#define | GNUTYPE_NAMES 'N' /* file name that does not fit into main hdr */ |
#define | GNUTYPE_SPARSE 'S' /* sparse file */ |
#define | GNUTYPE_VOLHDR 'V' /* tape/volume header */ |
#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 } |
void error | ( | const char * | msg | ) |
Definition at line 593 of file untgz.c.
References prog.
Referenced by dln_load(), getaddrinfo(), gmtime_r(), localtime_r(), main(), push_attr(), rb_io_modestr_fmode(), rb_keyword_error_new(), rb_memory_view_parse_item_format(), rb_process_status_new(), rb_reg_fragment_setenc(), rsock_getaddrinfo(), rsock_inspect_sockaddr(), rsock_ipaddr(), rsock_raise_socket_error(), strerror(), tar(), win32_error_file_func(), win32_read_file_func(), win32_seek64_file_func(), win32_seek_file_func(), win32_tell64_file_func(), win32_tell_file_func(), and win32_write_file_func().
int ExprMatch | ( | char * | string, |
char * | expr | ||
) |
void help | ( | int | exitval | ) |
int makedir | ( | char * | newdir | ) |
Definition at line 371 of file untgz.c.
References argc, argv, ExprMatch(), and attr_item::fname.
Referenced by tar().
int makedir OF | ( | (char *) | ) |
int setfiletime OF | ( | (char *, time_t) | ) |
void restore_attr OF | ( | (struct attr_item **) | ) |
char *strtime OF | ( | (time_t *) | ) |
Definition at line 253 of file untgz.c.
References error(), attr_item::fname, malloc, attr_item::mode, attr_item::next, NULL, strdup, and attr_item::time.
Referenced by tar().
void restore_attr | ( | struct attr_item ** | list | ) |
Definition at line 270 of file untgz.c.
References attr_item::fname, free, attr_item::mode, attr_item::next, NULL, setfiletime(), and attr_item::time.
Referenced by tar().
int setfiletime | ( | char * | fname, |
time_t | ftime | ||
) |
Definition at line 206 of file untgz.c.
References utimbuf::actime, if(), INVALID_HANDLE_VALUE, utimbuf::modtime, and NULL.
Referenced by restore_attr().
char * strtime | ( | time_t * | t | ) |
Definition at line 386 of file untgz.c.
References AREGTYPE, argc, argv, BLOCKSIZE, tar_buffer::buffer, DIRTYPE, err, error(), attr_item::fname, getoct(), GNUTYPE_LONGLINK, GNUTYPE_LONGNAME, gzclose(), gzerror(), gzread(), tar_buffer::header, in(), len, makedir(), matchname(), tar_header::mode, tar_header::mtime, tar_header::name, NULL, prog, push_attr(), REGTYPE, restore_attr(), SHORTNAMESIZE, tar_header::size, strlen(), strrchr(), strtime(), TGZ_EXTRACT, TGZ_INVALID, TGZ_LIST, tar_header::typeflag, and Z_OK.
Referenced by main().
char * TGZfname | ( | const char * | arcname | ) |
void TGZnotfound | ( | const char * | arcname | ) |
char* prog |
Definition at line 125 of file untgz.c.
Referenced by error(), main(), makedir(), rb_execarg_commandline(), rb_w32_aspawn(), rb_w32_aspawn_flags(), rb_w32_spawn(), rb_w32_uaspawn(), rb_w32_uaspawn_flags(), rb_w32_uspawn(), tar(), and TGZnotfound().
Definition at line 127 of file untgz.c.
Referenced by TGZfname(), and TGZnotfound().