__G
void version(__G)
int mapattr(__G)
void close_outfile(__G) /* GRR: change to return PK-style warning level */
#define zencode(c,t) (t=decrypt_byte(__G), update_keys(c), t^(c))
#define zdecode(c) update_keys(__G__ c ^= decrypt_byte(__G))
(encrypted? update_keys(__G__ getc(G.in)^decrypt_byte(__G)) : getc(G.in))
#ifndef __G /* UnZip only, for now (DLL stuff) */
int explode(__G)
if ((error = extract_or_test_member(__G)) != PK_COOL) {
static int extract_or_test_member(__G) /* return PK-type error code */
if (open_outfile(__G)) /* VMS: required even for stdout! */
} else if (open_outfile(__G))
defer_leftover_input(__G); /* so NEXTBYTE bounds check will work */
if ((r = unshrink(__G)) != PK_COOL) {
if ((r = unreduce(__G)) != PK_COOL) {
if (((r = explode(__G)) != 0) && (r != 5)) { /* treat 5 specially */
undefer_input(__G);
close_outfile(__G);
close_outfile(__G);
close_outfile(__G);
undefer_input(__G);
undefer_input(__G);
int extract_or_test_files(__G) /* return PK-type error code */
if ((error = process_cdir_file_hdr(__G)) != PK_COOL) {
if (store_info(__G))
if (store_info(__G))
process_defer_NT(__G); /* process any deferred items for this .zip file */
setFileNotFound(__G);
static int store_info(__G) /* return 0 if skipping, 1 if OK */
mapattr(__G); /* GRR: worry about return value later */
if ((error = process_local_file_hdr(__G)) != PK_COOL) {
return disk_error(__G);
static int disk_error(__G)
int open_input_file(__G) /* return 1 if open failed */
G.zipfd = vmmvs_open_infile(__G);
int open_outfile(__G) /* return 1 if fail */
return (redirect_outfile(__G) == FALSE);
void undefer_input(__G)
void defer_leftover_input(__G)
int readbyte(__G) /* refill inbuf and return a byte if available, else EOF */
defer_leftover_input(__G); /* decrements G.csize */
int fillinbuf(__G) /* like readbyte() except returns number of bytes in inbuf */
defer_leftover_input(__G); /* decrements G.csize */
return disk_error(__G);
return disk_error(__G);
return disk_error(__G);
return disk_error(__G);
SYSTEM_SPECIFIC_CTOR(__G);
registerGlobalPointer(__G);
static void registerGlobalPointer(__G)
void deregisterGlobalPointer(__G)
return inflate_dynamic(__G);
return inflate_stored(__G);
return inflate_fixed(__G);
int inflate_free(__G)
if (fillinbuf(__G) == 0) {
static int inflate_stored(__G)
static int inflate_fixed(__G)
static int inflate_dynamic(__G)
if ((error = process_cdir_file_hdr(__G)) != PK_COOL)
fnprint(__G);
static int fn_is_dir(__G) /* returns TRUE if G.filename is directory */
if ((error = process_cdir_file_hdr(__G)) != PK_COOL)
if ((G.process_all_files || do_this_file) && !fn_is_dir(__G)) {
void fnprint(__G) /* print filename (after filtering) and newline */
int list_files(__G) /* return PK-type error code */
int uz_end_central(__G) /* return PK-type error code */
int process_cdir_file_hdr(__G) /* return PK-type error code */
if ((error = get_cdir_ent(__G)) != 0)
int get_cdir_ent(__G) /* return PK-type error code */
int process_local_file_hdr(__G) /* return PK-type error code */
int process_zipfiles(__G) /* return PK-type error code */
free_G_buffers(__G);
free_G_buffers(__G);
free_G_buffers(__G);
void free_G_buffers(__G) /* releases all memory allocated in global vars */
inflate_free(__G);
if (check_format(__G)) /* check for variable-length format */
if (open_input_file(__G)) /* this should never happen, given */
(error_in_archive = zi_end_central(__G)) > PK_WARN))
(error_in_archive = uz_end_central(__G)) > PK_WARN)))
error = zipinfo(__G); /* ZIPINFO 'EM */
error = list_files(__G); /* LIST 'EM */
error = extract_or_test_files(__G); /* EXTRACT OR TEST 'EM */
void Echon(__G)
# define echon() Echon(__G)
#ifndef __G /* UnZip only, for now (DLL stuff) */
int unshrink(__G)
partial_clear(__G); /* clear leafs (nodes with no children) */
static void partial_clear(__G)
show_version_info(__G);
static void show_version_info(__G)
version(__G);
G.zipfn = GetLoadPath(__G);/* non-MSC NT puts path into G.filename[] */
retcode = process_zipfiles(__G);
# define NEXTBYTE (--G.incnt >= 0 ? (int)(*G.inptr++) : readbyte(__G))
# define FINISH_REDIRECT() finish_REXX_redirect(__G)
# define FINISH_REDIRECT() close_redirect(__G)
# define CLOSE_INFILE() close_infile(__G)
(*G.message)((zvoid *)&G, (uch *)" ", 2L, 0); fnprint(__G);
static int zi_short(__G) /* return PK-type error code */
fnprint(__G);
int zi_end_central(__G) /* return PK-type error code */
int zipinfo(__G) /* return PK-type error code */
if ((error = process_cdir_file_hdr(__G)) != PK_COOL)
fnprint(__G);
if ((error = zi_short(__G)) != PK_COOL) {