?? unzpriv.h
字號:
#ifdef SET_DIR_ATTRIB typedef struct dirtime { /* temporary struct for holding directory info */ struct dirtime *next; /* until can be sorted and set at end */ char *fn; /* filename of directory */ union { iztimes t3; /* mtime, atime, ctime */ ztimbuf t2; /* modtime, actime */ } u; unsigned perms; /* same as min_info.file_attr */ int have_uidgid; /* flag */ ush uidgid[2]; } dirtime;#endif /* SET_DIR_ATTRIB */typedef struct min_info { long offset; ulg crc; /* crc (needed if extended header) */ ulg compr_size; /* compressed size (needed if extended header) */ ulg uncompr_size; /* uncompressed size (needed if extended header) */ ush diskstart; /* no of volume where this entry starts */ uch hostver; uch hostnum; unsigned file_attr; /* local flavor, as used by creat(), chmod()... */ unsigned encrypted : 1; /* file encrypted: decrypt before uncompressing */ unsigned ExtLocHdr : 1; /* use time instead of CRC for decrypt check */ unsigned textfile : 1; /* file is text (according to zip) */ unsigned textmode : 1; /* file is to be extracted as text */ unsigned lcflag : 1; /* convert filename to lowercase */ unsigned vollabel : 1; /* "file" is an MS-DOS volume (disk) label */ unsigned HasUxAtt : 1; /* crec ext_file_attr has Unix style mode bits */} min_info;typedef struct VMStimbuf { char *revdate; /* (both roughly correspond to Unix modtime/st_mtime) */ char *credate;} VMStimbuf;/*--------------------------------------------------------------------------- Zipfile work area declarations. ---------------------------------------------------------------------------*/#ifdef MALLOC_WORK union work { struct { /* unshrink(): */ shrint *Parent; /* pointer to (8192 * sizeof(shrint)) */ uch *value; /* pointer to 8KB char buffer */ uch *Stack; /* pointer to another 8KB char buffer */ } shrink; uch *Slide; /* explode(), inflate(), unreduce() */ };#else /* !MALLOC_WORK */ union work { struct { /* unshrink(): */ shrint Parent[HSIZE]; /* (8192 * sizeof(shrint)) == 16KB minimum */ uch value[HSIZE]; /* 8KB */ uch Stack[HSIZE]; /* 8KB */ } shrink; /* total = 32KB minimum; 80KB on Cray/Alpha */ uch Slide[WSIZE]; /* explode(), inflate(), unreduce() */ };#endif /* ?MALLOC_WORK */#define slide G.area.Slide#if (defined(DLL) && !defined(NO_SLIDE_REDIR))# define redirSlide G.redirect_sldptr#else# define redirSlide G.area.Slide#endif/*--------------------------------------------------------------------------- Zipfile layout declarations. If these headers ever change, make sure the xxREC_SIZE defines (above) change with them! ---------------------------------------------------------------------------*/ typedef uch local_byte_hdr[ LREC_SIZE ];# define L_VERSION_NEEDED_TO_EXTRACT_0 0# define L_VERSION_NEEDED_TO_EXTRACT_1 1# define L_GENERAL_PURPOSE_BIT_FLAG 2# define L_COMPRESSION_METHOD 4# define L_LAST_MOD_DOS_DATETIME 6# define L_CRC32 10# define L_COMPRESSED_SIZE 14# define L_UNCOMPRESSED_SIZE 18# define L_FILENAME_LENGTH 22# define L_EXTRA_FIELD_LENGTH 24 typedef uch cdir_byte_hdr[ CREC_SIZE ];# define C_VERSION_MADE_BY_0 0# define C_VERSION_MADE_BY_1 1# define C_VERSION_NEEDED_TO_EXTRACT_0 2# define C_VERSION_NEEDED_TO_EXTRACT_1 3# define C_GENERAL_PURPOSE_BIT_FLAG 4# define C_COMPRESSION_METHOD 6# define C_LAST_MOD_DOS_DATETIME 8# define C_CRC32 12# define C_COMPRESSED_SIZE 16# define C_UNCOMPRESSED_SIZE 20# define C_FILENAME_LENGTH 24# define C_EXTRA_FIELD_LENGTH 26# define C_FILE_COMMENT_LENGTH 28# define C_DISK_NUMBER_START 30# define C_INTERNAL_FILE_ATTRIBUTES 32# define C_EXTERNAL_FILE_ATTRIBUTES 34# define C_RELATIVE_OFFSET_LOCAL_HEADER 38 typedef uch ec_byte_rec[ ECREC_SIZE+4 ];/* define SIGNATURE 0 space-holder only */# define NUMBER_THIS_DISK 4# define NUM_DISK_WITH_START_CENTRAL_DIR 6# define NUM_ENTRIES_CENTRL_DIR_THS_DISK 8# define TOTAL_ENTRIES_CENTRAL_DIR 10# define SIZE_CENTRAL_DIRECTORY 12# define OFFSET_START_CENTRAL_DIRECTORY 16# define ZIPFILE_COMMENT_LENGTH 20 typedef struct local_file_header { /* LOCAL */ uch version_needed_to_extract[2]; ush general_purpose_bit_flag; ush compression_method; ulg last_mod_dos_datetime; ulg crc32; ulg csize; ulg ucsize; ush filename_length; ush extra_field_length; } local_file_hdr;#if 0 typedef struct central_directory_file_header { /* CENTRAL */ uch version_made_by[2]; uch version_needed_to_extract[2]; ush general_purpose_bit_flag; ush compression_method; ulg last_mod_dos_datetime; ulg crc32; ulg csize; ulg ucsize; ush filename_length; ush extra_field_length; ush file_comment_length; ush disk_number_start; ush internal_file_attributes; ulg external_file_attributes; ulg relative_offset_local_header; } cdir_file_hdr;#endif /* 0 */ typedef struct end_central_dir_record { /* END CENTRAL */ ush number_this_disk; ush num_disk_start_cdir; ush num_entries_centrl_dir_ths_disk; ush total_entries_central_dir; ulg size_central_directory; ulg offset_start_central_directory; ush zipfile_comment_length; } ecdir_rec;/* Huffman code lookup table entry--this entry is four bytes for machines that have 16-bit pointers (e.g. PC's in the small or medium model). Valid extra bits are 0..16. e == 31 is EOB (end of block), e == 32 means that v is a literal, 32 < e < 64 means that v is a pointer to the next table, which codes (e & 31) bits, and lastly e == 99 indicates an unused code. If a code with e == 99 is looked up, this implies an error in the data. */struct huft { uch e; /* number of extra bits or operation */ uch b; /* number of bits in this code or subcode */ union { ush n; /* literal, length base, or distance base */ struct huft *t; /* pointer to next level of table */ } v;};typedef struct _APIDocStruct { char *compare; char *function; char *syntax; char *purpose;} APIDocStruct;/*************//* Globals *//*************/#if (defined(OS2) && !defined(FUNZIP))# include "os2/os2data.h"#endif#include "globals.h"/*************************//* Function Prototypes *//*************************//*--------------------------------------------------------------------------- Functions in unzip.c (initialization routines): ---------------------------------------------------------------------------*/#ifndef WINDLL int MAIN OF((int argc, char **argv)); int unzip OF((__GPRO__ int argc, char **argv)); int uz_opts OF((__GPRO__ int *pargc, char ***pargv)); int usage OF((__GPRO__ int error));#endif /* !WINDLL *//*--------------------------------------------------------------------------- Functions in process.c (main driver routines): ---------------------------------------------------------------------------*/int process_zipfiles OF((__GPRO));void free_G_buffers OF((__GPRO));/* static int do_seekable OF((__GPRO__ int lastchance)); *//* static int find_ecrec OF((__GPRO__ long searchlen)); */int uz_end_central OF((__GPRO));int process_cdir_file_hdr OF((__GPRO));int get_cdir_ent OF((__GPRO));int process_local_file_hdr OF((__GPRO));unsigned ef_scan_for_izux OF((ZCONST uch *ef_buf, unsigned ef_len, int ef_is_c, ulg dos_mdatetime, iztimes *z_utim, ush *z_uidgid));#if (defined(RISCOS) || defined(ACORN_FTYPE_NFS)) zvoid *getRISCOSexfield OF((ZCONST uch *ef_buf, unsigned ef_len));#endif#ifndef SFX/*--------------------------------------------------------------------------- Functions in zipinfo.c (`zipinfo-style' listing routines): ---------------------------------------------------------------------------*/#ifndef NO_ZIPINFO#ifndef WINDLL int zi_opts OF((__GPRO__ int *pargc, char ***pargv));#endifint zi_end_central OF((__GPRO));int zipinfo OF((__GPRO));/* static int zi_long OF((__GPRO__ ulg *pEndprev)); *//* static int zi_short OF((__GPRO)); *//* static char *zi_time OF((__GPRO__ ZCONST ulg *datetimez, ZCONST time_t *modtimez, char *d_t_str));*/#endif /* !NO_ZIPINFO *//*--------------------------------------------------------------------------- Functions in list.c (generic zipfile-listing routines): ---------------------------------------------------------------------------*/int list_files OF((__GPRO));#ifdef TIMESTAMP int get_time_stamp OF((__GPRO__ time_t *last_modtime, ulg *nmember));#endifint ratio OF((ulg uc, ulg c));void fnprint OF((__GPRO));#endif /* !SFX *//*--------------------------------------------------------------------------- Functions in fileio.c: ---------------------------------------------------------------------------*/int open_input_file OF((__GPRO));int open_outfile OF((__GPRO)); /* also vms.c */void undefer_input OF((__GPRO));void defer_leftover_input OF((__GPRO));unsigned readbuf OF((__GPRO__ char *buf, register unsigned len));int readbyte OF((__GPRO));int fillinbuf OF((__GPRO));int seek_zipf OF((__GPRO__ LONGINT abs_offset));#ifdef FUNZIP int flush OF((__GPRO__ ulg size)); /* actually funzip.c */#else int flush OF((__GPRO__ uch *buf, ulg size, int unshrink));#endif/* static int disk_error OF((__GPRO)); */void handler OF((int signal));time_t dos_to_unix_time OF((ulg dos_datetime));int check_for_newer OF((__GPRO__ char *filename)); /* os2,vmcms,vms */int do_string OF((__GPRO__ unsigned int length, int option));ush makeword OF((ZCONST uch *b));ulg makelong OF((ZCONST uch *sig));#if (!defined(STR_TO_ISO) || defined(NEED_STR2ISO)) char *str2iso OF((char *dst, ZCONST char *src));#endif#if (!defined(STR_TO_OEM) || defined(NEED_STR2OEM)) char *str2oem OF((char *dst, ZCONST char *src));#endif#ifdef NO_STRNICMP int zstrnicmp OF((register ZCONST char *s1, register ZCONST char *s2, register unsigned n));#endif#ifdef REGULUS int zstat OF((ZCONST char *p, struct stat *s));#endif#ifdef ZMEM /* MUST be ifdef'd because of conflicts with the standard def. */ zvoid *memset OF((register zvoid *, register int, register unsigned int)); int memcmp OF((register ZCONST zvoid*, register ZCONST zvoid *, register unsigned int)); zvoid *memcpy OF((register zvoid *, register ZCONST zvoid *, register unsigned int));#endif#ifdef NEED_UZMBSCHR unsigned char *uzmbschr OF((ZCONST unsigned char *str, unsigned int c));#endif#ifdef NEED_UZMBSRCHR unsigned char *uzmbsrchr OF((ZCONST unsigned char *str, unsigned int c));#endif#ifdef SMALL_MEM char *fLoadFarString OF((__GPRO__ const char Far *sz)); char *fLoadFarStringSmall OF((__GPRO__ const char Far *sz)); char *fLoadFarStringSmall2 OF((__GPRO__ const char Far *sz)); #ifndef zfstrcpy char Far * Far zfstrcpy OF((char Far *s1, const char Far *s2)); #endif#endif/*--------------------------------------------------------------------------- Functions in extract.c: ---------------------------------------------------------------------------*/int extract_or_test_files OF((__GPRO));/* static int store_info OF((void)); *//* static int extract_or_test_member OF((__GPRO)); *//* static int TestExtraField OF((__GPRO__ uch *ef, unsigned ef_len)); *//* static int test_OS2 OF((__GPRO__ uch *eb, unsigned eb_size)); *//* static int test_NT OF((__GPRO__ uch *eb, unsigned eb_size)); */int memextract OF((__GPRO__ uch *tgt, ulg tgtsize, ZCONST uch *src, ulg srcsize));int memflush OF((__GPRO__ ZCONST uch *rawbuf, ulg size));#if (defined(VMS) || defined(VMS_TEXT_CONV)) uch *extract_izvms_block OF((__GPRO__ ZCONST uch *ebdata, unsigned size, unsigned *retlen, ZCONST uch *init, unsigned needlen));#endifchar *fnfilter OF((ZCONST char *raw, uch *space));/*--------------------------------------------------------------------------- Decompression functions: ---------------------------------------------------------------------------*/#if (!defined(SFX) && !defined(FUNZIP))int explode OF((__GPRO)); /* explode.c */#endifint huft_free OF((struct huft *t)); /* inflate.c */int huft_build OF((__GPRO__ ZCONST unsigned *b, unsigned n, unsigned s, ZCONST ush *d, ZCONST uch *e, struct huft **t, int *m));#ifdef USE_ZLIB int UZinflate OF((__GPRO__ int is_defl64)); /* inflate.c */# define inflate_free(x) inflateEnd(&((Uz_Globs *)(&G))->dstrm)#else int inflate OF((__GPRO__ int is_defl64)); /* inflate.c */ int inflate_free OF((__GPRO)); /* inflate.c */#endif /* ?USE_ZLIB */#if (!defined(SFX) && !defined(FUNZIP))#ifndef COPYRIGHT_CLEAN int unreduce OF((__GPRO)); /* unreduce.c *//* static void LoadFollowers OF((__GPRO__ f_array *follower, uch *Slen)); * unreduce.c */#endif /* !COPYRIGHT_CLEAN */
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -