⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unzpriv.h

📁 完整的解压zip文件的源码。包含密码功能
💻 H
📖 第 1 页 / 共 5 页
字号:
       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..13.  e == 15 is EOB (end of block), e == 16   means that v is a literal, 16 < e < 32 means that v is a pointer to   the next table, which codes e - 16 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((uch *ef_buf, unsigned ef_len, int ef_is_c,                                     ulg dos_mdatetime,                                     iztimes *z_utim, ush *z_uidgid));#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,                                     unsigned *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));#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 len, 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));#endifint      zstrnicmp            OF((register ZCONST char *s1,                                  register ZCONST char *s2,                                  register unsigned n));#ifdef REGULUS   int zstat                  OF((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 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,                                     uch *src, ulg srcsize));int    memflush                  OF((__GPRO__ uch *rawbuf, ulg size));char  *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 ush *e,                                     struct huft **t, int *m));#ifdef USE_ZLIB   int    UZinflate              OF((__GPRO));                  /* inflate.c */#  define inflate_free(x)        inflateEnd(&((Uz_Globs *)(&G))->dstrm)#else   int    inflate                OF((__GPRO));                  /* inflate.c */   int    inflate_free           OF((__GPRO));                  /* inflate.c */#endif /* ?USE_ZLIB */#if (!defined(SFX) && !defined(FUNZIP))void   unreduce                  OF((__GPRO));                 /* unreduce.c *//* static void  LoadFollowers    OF((__GPRO__ f_array *follower, uch *Slen));                                                                * unreduce.c */int    unshrink                  OF((__GPRO));                 /* unshrink.c *//* static void  partial_clear    OF((__GPRO));                  * unshrink.c */#endif /* !SFX && !FUNZIP *//*---------------------------------------------------------------------------    Internal API functions (only included in DLL versions):  ---------------------------------------------------------------------------*/#ifdef DLL   void     setFileNotFound       OF((__GPRO));                     /* api.c */   int      unzipToMemory         OF((__GPRO__ char *zip, char *file,                                      UzpBuffer *retstr));          /* api.c */   int      redirect_outfile      OF((__GPRO));                     /* api.c */   int      writeToMemory         OF((__GPRO__ uch *rawbuf, ulg size));   int      close_redirect        OF((__GPRO));                     /* api.c */   /* this obsolescent entry point kept for compatibility: */   int      UzpUnzip              OF((int argc, char **argv));/* use UzpMain */#ifdef OS2DLL   int      varmessage            OF((__GPRO__ uch *buf, ulg size));   int      varputchar            OF((__GPRO__ int c));         /* rexxapi.c */   int      finish_REXX_redirect  OF((__GPRO));                 /* rexxapi.c */#endif#ifdef API_DOC   void     APIhelp               OF((__GPRO__ int argc, char **argv));#endif                                                          /* apihelp.c */#endif /* DLL *//*---------------------------------------------------------------------------    Acorn RISC OS-only functions:  ---------------------------------------------------------------------------*/#ifdef RISCOS   int   isRISCOSexfield     OF((void *extra_field));             /* acorn.c */   void  setRISCOSexfield    OF((char *path, void *extra_field)); /* acorn.c */   void  printRISCOSexfield  OF((int isdir, void *extra_field));  /* acorn.c */#endif/*---------------------------------------------------------------------------    Human68K-only functions:  ---------------------------------------------------------------------------*/#ifdef __human68k__   void  InitTwentyOne       OF((void));#endif/*---------------------------------------------------------------------------    Macintosh-only functions:  ---------------------------------------------------------------------------*/#ifdef MACOS   void    screenOpen        OF((char *));                    /* macscreen.c */   void    screenControl     OF((char *, int));               /* macscreen.c */   void    screenDump        OF((char *, long));              /* macscreen.c */   void    screenUpdate      OF((WindowPtr));                 /* macscreen.c */   void    screenClose       OF((void));                      /* macscreen.c */   int     macgetch          OF((void));                      /* macscreen.c */   int     macmkdir     OF((char *));                               /* mac.c */   short   macopen      OF((char *, short));                        /* mac.c */   short   maccreat     OF((char *));                               /* mac.c */   short   macread      OF((short, char *, unsigned));              /* mac.c */   long    macwrite     OF((short, char *, unsigned));              /* mac.c */   short   macclose     OF((short));                                /* mac.c */   long    maclseek     OF((short, long, short));                   /* mac.c */   char   *macfgets     OF((char *, int, FILE *));                  /* mac.c */   int     macfprintf   OF((FILE *, char *, ...));                  /* mac.c */   int     macprintf    OF((char *, ...));                          /* mac.c */#endif/*---------------------------------------------------------------------------    MSDOS-only functions:  ---------------------------------------------------------------------------*/#if (defined(MSDOS) && (defined(__GO32__) || defined(__EMX__)))   unsigned _dos_getcountryinfo(void *);                          /* msdos.c */#if (!defined(__DJGPP__) || (__DJGPP__ < 2))   unsigned _dos_setftime(int, unsigned short, unsigned short);   /* msdos.c */   unsigned _dos_setfileattr(char *, unsigned);                   /* msdos.c */   unsigned _dos_creat(char *, unsigned, int *);                  /* msdos.c */   void _dos_getdrive(unsigned *);                                /* msdos.c */   unsigned _dos_close(int);                                      /* msdos.c */#endif /* !__DJGPP__ || (__DJGPP__ < 2) */#endif/*---------------------------------------------------------------------------    OS/2-only functions:  ---------------------------------------------------------------------------*/#ifdef OS2   /* GetFileTime conflicts with something in Win32 header files */#if (defined(REENTRANT) && defined(USETHREADID))   ulg   GetThreadId          OF((void));#endif   int   GetCountryInfo       OF((void));                           /* os2.c */   long  GetFileTime          OF((ZCONST char *name));              /* os2.c *//* static void  SetPathAttrTimes OF((__GPRO__ int flags, int dir));    os2.c *//* static int   SetEAs        OF((__GPRO__ const char *path,                                  void *eablock));                     os2.c *//* static int   SetACL        OF((__GPRO__ const char *path,                                  void *eablock));                     os2.c *//* static int   IsFileNameValid OF((const char *name));                os2.c *//* static void  map2fat       OF((char *pathcomp, char **pEndFAT));    os2.c *//* static int   SetLongNameEA OF((char *name, char *longname));        os2.c *//* static void  InitNLS       OF((void));                              os2.c */   int   IsUpperNLS           OF((int nChr));                       /* os2.c */   int   ToLowerNLS           OF((int nChr));                       /* os2.c */   void  DebugMalloc          OF((void));                           /* os2.c */#endif/*---------------------------------------------------------------------------    QDOS-only functions:  ---------------------------------------------------------------------------*/#ifdef QDOS   int    QMatch              (uch, uch);   void   QFilename           (__GPRO__ char *);   char  *Qstrfix             (char *);   int    QReturn             (int zip_error);#endif/*---------------------------------------------------------------------------    TOPS20-only functions:  ---------------------------------------------------------------------------*/#ifdef TOPS20   int    upper               OF((char *s));                     /* tops20.c */   int    enquote             OF((char *s));                     /* tops20.c */   int    dequote             OF((char *s));                     /* tops20.c */   int    fnlegal             OF(()); /* error if prototyped? */ /* tops20.c */#endif/*---------------------------------------------------------------------------    VM/CMS- and MVS-only functions:  ---------------------------------------------------------------------------*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -