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

📄 zip.h

📁 给出了 zip 压缩算法的完整实现过程。
💻 H
📖 第 1 页 / 共 2 页
字号:
extern int linkput;             /* Store symbolic links as such */extern int noisy;               /* False for quiet operation */extern int extra_fields;        /* do not create extra fields */#ifdef NTSD_EAS    extern int use_privileges;  /* use security privilege overrides */#endifextern char *key;               /* Scramble password or NULL */extern char *tempath;           /* Path for temporary files */extern FILE *mesg;              /* Where informational output goes */extern char *zipfile;           /* New or existing zip archive (zip file) */extern ulg zipbeg;              /* Starting offset of zip structures */extern ulg cenbeg;              /* Starting offset of central directory */extern struct zlist far *zfiles;/* Pointer to list of files in zip file */extern extent zcount;           /* Number of files in zip file */extern extent zcomlen;          /* Length of zip file comment */extern char *zcomment;          /* Zip file comment (not zero-terminated) */extern struct zlist far **zsort;/* List of files sorted by name */extern ulg tempzn;              /* Count of bytes written to output zip file */extern struct flist far *found; /* List of names found */extern struct flist far *far *fnxt;     /* Where to put next in found list */extern extent fcount;           /* Count of names in found list */extern struct plist *patterns;  /* List of patterns to be matched */extern unsigned pcount;         /* number of patterns */extern unsigned icount;         /* number of include only patterns */extern unsigned Rcount;         /* number of -R include patterns */#ifdef IZ_CHECK_TZextern int zp_tz_is_valid;      /* signals "timezone info is available" */#endif#if (defined(MACOS) || defined(WINDLL))extern int zipstate;            /* flag "zipfile has been stat()'ed */#endif/* Diagnostic functions */#ifdef DEBUG# ifdef MSDOS#  undef  stderr#  define stderr stdout# endif#  define diag(where) fprintf(stderr, "zip diagnostic: %s\n", where)#  define Assert(cond,msg) {if(!(cond)) error(msg);}# ifdef THEOS#  define Trace(x) _fprintf x#  define Tracev(x) {if (verbose) _fprintf x ;}#  define Tracevv(x) {if (verbose>1) _fprintf x ;}#  define Tracec(c,x) {if (verbose && (c)) _fprintf x ;}#  define Tracecv(c,x) {if (verbose>1 && (c)) _fprintf x ;}# else#  define Trace(x) fprintf x#  define Tracev(x) {if (verbose) fprintf x ;}#  define Tracevv(x) {if (verbose>1) fprintf x ;}#  define Tracec(c,x) {if (verbose && (c)) fprintf x ;}#  define Tracecv(c,x) {if (verbose>1 && (c)) fprintf x ;}# endif#else#  define diag(where)#  define Assert(cond,msg)#  define Trace(x)#  define Tracev(x)#  define Tracevv(x)#  define Tracec(c,x)#  define Tracecv(c,x)#endif#ifdef DEBUGNAMES#  define free(x) { int *v;Free(x); v=x;*v=0xdeadbeef;x=(void *)0xdeadbeef; }#endif/* Public function prototypes */#ifndef UTIL#ifdef USE_ZIPMAINint zipmain OF((int, char **));#elseint main OF((int, char **));#endif /* USE_ZIPMAIN */#endif#ifdef EBCDICextern int aflag;#endif /* EBCDIC */#ifdef CMS_MVSextern int bflag;#endif /* CMS_MVS */void zipwarn  OF((ZCONST char *, ZCONST char *));void ziperr   OF((int, ZCONST char *));#ifdef UTIL#  define error(msg)    ziperr(ZE_LOGIC, msg)#else   void error OF((ZCONST char *));#  ifdef VMSCLI     void help OF((void));#  endif   int encr_passwd OF((int, char *, int, ZCONST char *));#endif        /* in zipup.c */#ifndef UTIL   int percent OF((ulg, ulg));   int zipup OF((struct zlist far *, FILE *));#  ifdef USE_ZLIB     void zl_deflate_free OF((void));#  else     void flush_outbuf OF((char *, unsigned *));     int seekable OF((void));     extern unsigned (*read_buf) OF((char *, unsigned int));#  endif /* !USE_ZLIB */#  ifdef ZP_NEED_MEMCOMPR     ulg memcompress OF((char *, ulg, char *, ulg));#  endif#endif /* !UTIL */        /* in zipfile.c */#ifndef UTIL   struct zlist far *zsearch OF((ZCONST char *));#  ifdef USE_EF_UT_TIME     int get_ef_ut_ztime OF((struct zlist far *, iztimes *));#  endif /* USE_EF_UT_TIME */   int trash OF((void));#endif /* !UTIL */char *ziptyp OF((char *));int readzipfile OF((void));int putlocal OF((struct zlist far *, FILE *));int putextended OF((struct zlist far *, FILE *));int putcentral OF((struct zlist far *, FILE *));int putend OF((unsigned, ulg, ulg, extent, char *, FILE *));int zipcopy OF((struct zlist far *, FILE *, FILE *));        /* in fileio.c */#ifndef UTIL   char *getnam OF((char *, FILE *));   struct flist far *fexpel OF((struct flist far *));   char *last OF((char *, int));   char *msname OF((char *));   int check_dup OF((void));   int filter OF((char *, int));   int newname OF((char *, int, int));#endif /* !UTIL */#if (!defined(UTIL) || defined(W32_STATROOT_FIX))   time_t dos2unixtime OF((ulg));#endif#ifndef UTIL   ulg dostime OF((int, int, int, int, int, int));   ulg unix2dostime OF((time_t *));   int issymlnk OF((ulg a));#  ifdef S_IFLNK#    define rdsymlnk(p,b,n) readlink(p,b,n)/*   extern int readlink OF((char *, char *, int)); */#  else /* !S_IFLNK */#    define rdsymlnk(p,b,n) (0)#  endif /* !S_IFLNK */#endif /* !UTIL */int destroy OF((char *));int replace OF((char *, char *));int getfileattr OF((char *));int setfileattr OF((char *, int));char *tempname OF((char *));int fcopy OF((FILE *, FILE *, ulg));#ifdef ZMEM   char *memset OF((char *, int, unsigned int));   char *memcpy OF((char *, char *, unsigned int));   int memcmp OF((char *, char *, unsigned int));#endif /* ZMEM */        /* in system dependent fileio code (<system>.c) */#ifndef UTIL#  ifdef PROCNAME     int wild OF((char *));#  endif   char *in2ex OF((char *));   char *ex2in OF((char *, int, int *));   int procname OF((char *, int));   void stamp OF((char *, ulg));   ulg filetime OF((char *, ulg *, long *, iztimes *));#if !(defined(VMS) && defined(VMS_PK_EXTRA))   int set_extra_field OF((struct zlist far *, iztimes *));#endif /* ?(VMS && VMS_PK_EXTRA) */   int deletedir OF((char *));#ifdef MY_ZCALLOC     zvoid far *zcalloc OF((unsigned int, unsigned int));     zvoid zcfree       OF((zvoid far *));#endif /* MY_ZCALLOC */#endif /* !UTIL */void version_local OF((void));        /* in util.c */#ifndef UTILint   fseekable    OF((FILE *));char *isshexp      OF((char *));int   shmatch      OF((ZCONST char *, ZCONST char *, int));#if defined(DOS) || defined(WIN32)   int dosmatch    OF((ZCONST char *, ZCONST char *, int));#endif /* DOS || WIN32 */#endif /* !UTIL */void init_upper    OF((void));int  namecmp       OF((ZCONST char *string1, ZCONST char *string2));#ifdef EBCDICchar *strtoasc     OF((char *str1, ZCONST char *str2));char *strtoebc     OF((char *str1, ZCONST char *str2));char *memtoasc     OF((char *mem1, ZCONST char *mem2, unsigned len));char *memtoebc     OF((char *mem1, ZCONST char *mem2, unsigned len));#endif /* EBCDIC */#ifdef IZ_ISO2OEM_ARRAYchar *str_iso_to_oem    OF((char *dst, ZCONST char *src));#endif#ifdef IZ_OEM2ISO_ARRAYchar *str_oem_to_iso    OF((char *dst, ZCONST char *src));#endifzvoid far **search OF((ZCONST zvoid *, ZCONST zvoid far **, extent,                       int (*)(ZCONST zvoid *, ZCONST zvoid far *)));void envargs       OF((int *, char ***, char *, char *));void expand_args   OF((int *, char ***));#ifndef USE_ZLIB#ifndef UTIL        /* in crc32.c */ulg  crc32         OF((ulg, ZCONST uch *, extent));#endif /* !UTIL */        /* in crctab.c */ZCONST ulg near *get_crc_table OF((void));#ifdef DYNALLOC_CRCTABvoid free_crc_table OF((void));#endif#endif /* !USE_ZLIB */#ifndef UTIL#ifndef USE_ZLIB        /* in deflate.c */void lm_init OF((int, ush *));void lm_free OF((void));ulg  deflate OF((void));        /* in trees.c */void     ct_init      OF((ush *, int *));int      ct_tally     OF((int, int));ulg      flush_block  OF((char far *, ulg, int));void     bi_init      OF((char *, unsigned int, int));#endif /* !USE_ZLIB */#endif /* !UTIL */        /* in system specific assembler code, replacing C code in trees.c */#if defined(ASMV) && defined(RISCOS)  void     send_bits    OF((int, int));  unsigned bi_reverse   OF((unsigned int, int));#endif /* ASMV && RISCOS *//*---------------------------------------------------------------------------    VMS-only functions:  ---------------------------------------------------------------------------*/#ifdef VMS   int    vms_stat        OF((char *, stat_t *));              /* vms.c */   void   vms_exit        OF((int));                           /* vms.c */#ifndef UTIL#ifdef VMSCLI   ulg    vms_zip_cmdline OF((int *, char ***));                /* cmdline.c */   void   VMSCLI_help     OF((void));                           /* cmdline.c */#endif /* VMSCLI */#endif /* !UTIL */#endif /* VMS *//*---------------------------------------------------------------------------    WIN32-only functions:  ---------------------------------------------------------------------------*/#ifdef WIN32   int    ZipIsWinNT         OF((void));                         /* win32.c */#endif /* WIN32 */#if (defined(WINDLL) || defined(DLL_ZIPAPI))/*---------------------------------------------------------------------------    Prototypes for public Zip API (DLL) functions.  ---------------------------------------------------------------------------*/#include "api.h"#endif /* WINDLL || DLL_ZIPAPI */#endif /* !__zip_h *//* end of zip.h */

⌨️ 快捷键说明

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