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

📄 unzip.h

📁 汇编大全 中国矿业大学计算机学院 汇编实验5
💻 H
📖 第 1 页 / 共 3 页
字号:
#define SKIP              0    /* choice of activities for do_string() */#define DISPLAY           1#define FILENAME          2#define EXTRA_FIELD       3#define DOES_NOT_EXIST    -1   /* return values for check_for_newer() */#define EXISTS_AND_OLDER  0#define EXISTS_AND_NEWER  1#define DOS_OS2_FAT_      0    /* version_made_by codes (central dir) */#define AMIGA_            1#define VMS_              2    /* MAKE SURE THESE ARE NOT DEFINED ON */#define UNIX_             3    /* THE RESPECTIVE SYSTEMS!!  (like, for */#define VM_CMS_           4    /* instance, "VMS", or "UNIX":  CFLAGS = */#define ATARI_            5    /*  -O -DUNIX) */#define OS2_HPFS_         6#define MAC_              7#define Z_SYSTEM_         8#define CPM_              9/* #define TOPS20_   10?  (TOPS20_ is to be defined in PKZIP 2.0...)  */#define NUM_HOSTS         10   /* index of last system + 1 */#define STORED            0    /* compression methods */#define SHRUNK            1#define REDUCED1          2#define REDUCED2          3#define REDUCED3          4#define REDUCED4          5#define IMPLODED          6#define TOKENIZED         7#define DEFLATED          8#define NUM_METHODS       9    /* index of last method + 1 *//* don't forget to update list_files() appropriately if NUM_METHODS changes */#define DF_MDY            0    /* date format 10/26/91 (USA only) */#define DF_DMY            1    /* date format 26/10/91 (most of the world) */#define DF_YMD            2    /* date format 91/10/26 (a few countries) */#define UNZIP_VERSION     20   /* compatible with PKUNZIP 2.0 */#define VMS_VERSION       42   /* if OS-needed-to-extract is VMS:  can do *//*---------------------------------------------------------------------------    True sizes of the various headers, as defined by PKWare--so it is not    likely that these will ever change.  But if they do, make sure both these    defines AND the typedefs below get updated accordingly.  ---------------------------------------------------------------------------*/#define LREC_SIZE     26    /* lengths of local file headers, central */#define CREC_SIZE     42    /*  directory headers, and the end-of-    */#define ECREC_SIZE    18    /*  central-dir record, respectively      */#define MAX_BITS      13                 /* used in unShrink() */#define HSIZE         (1 << MAX_BITS)    /* size of global work area */#define LF   10   /* '\n' on ASCII machines.  Must be 10 due to EBCDIC */#define CR   13   /* '\r' on ASCII machines.  Must be 13 due to EBCDIC */#ifdef EBCDIC#  define ascii_to_native(c)   ebcdic[(c)]#  define NATIVE    "EBCDIC"#endif#ifdef AMIGA#  define FFLUSH    fflush(stderr);#else /* !AMIGA */#  if MPW#    define FFLUSH    putc('\n',stderr);#  else#    define FFLUSH#  endif#endif /* ?AMIGA */#ifdef CRYPT#  define OF __#  define PWLEN        80#  define DECRYPT(b)   (update_keys(t=((b)&0xff)^decrypt_byte()),t)#endif /* CRYPT */#ifdef QQ  /* Newtware version */#  define QCOND    (quietflg < 2)    /* -xq only kills comments */#  define QCOND2   (!quietflg)       /* for no file comments with -vq[q] */#else      /* (original) Bill Davidsen version  */#  define QCOND    (!quietflg)       /* -xq[q] both kill "extracting:" msgs */#  define QCOND2   (which_hdr)       /* file comments with -v, -vq, -vqq */#endif#ifndef TRUE#  define TRUE      1   /* sort of obvious */#  define FALSE     0#endif#ifndef SEEK_SET        /* These should all be declared in stdio.h!  But   */#  define SEEK_SET  0   /*  since they're not (in many cases), do so here. */#  define SEEK_CUR  1#  define SEEK_END  2#endif#ifndef S_IRUSR#  define S_IRWXU       00700       /* read, write, execute: owner */#  define S_IRUSR       00400       /* read permission: owner */#  define S_IWUSR       00200       /* write permission: owner */#  define S_IXUSR       00100       /* execute permission: owner */#  define S_IRWXG       00070       /* read, write, execute: group */#  define S_IRGRP       00040       /* read permission: group */#  define S_IWGRP       00020       /* write permission: group */#  define S_IXGRP       00010       /* execute permission: group */#  define S_IRWXO       00007       /* read, write, execute: other */#  define S_IROTH       00004       /* read permission: other */#  define S_IWOTH       00002       /* write permission: other */#  define S_IXOTH       00001       /* execute permission: other */#endif /* !S_IRUSR */#ifdef ZIPINFO      /* these are individually checked because SysV doesn't */#  ifndef S_IFBLK   /*  have some of them, Microsoft C others, etc. */#    define   S_IFBLK     0060000     /* block special */#  endif#  ifndef S_IFIFO  /* in Borland C, not MSC */#    define   S_IFIFO     0010000     /* fifo */#  endif#  ifndef S_IFLNK  /* in BSD, not SysV */#    define   S_IFLNK     0120000     /* symbolic link */#  endif#  ifndef S_IFSOCK  /* in BSD, not SysV */#    define   S_IFSOCK    0140000     /* socket */#  endif#  ifndef S_ISUID#    define S_ISUID       04000       /* set user id on execution */#  endif#  ifndef S_ISGID#    define S_ISGID       02000       /* set group id on execution */#  endif#  ifndef S_ISVTX#    define S_ISVTX       01000       /* directory permissions control */#  endif#  ifndef S_ENFMT#    define S_ENFMT       S_ISGID     /* record locking enforcement flag */#  endif#endif /* ZIPINFO *//**************//*  Typedefs  *//**************/#ifndef _BULL_SOURCE                /* Bull has it defined somewhere already */   typedef unsigned char  byte;     /* code assumes UNSIGNED bytes */#endif /* !_BULL_SOURCE */typedef char              boolean;typedef long              longint;typedef unsigned short    UWORD;#if !defined(IBMC32) && !defined(EMX32)   typedef unsigned long  ULONG;#endiftypedef struct min_info {    unsigned unix_attr;    unsigned dos_attr;    int hostnum;    longint offset;/*  ULONG crc;  */           /* did need to check decryption (use local now) */    unsigned encrypted : 1;  /* file encrypted: decrypt before uncompressing */    unsigned ExtLocHdr : 1;  /* use time instead of CRC for decrypt check */    unsigned text : 1;       /* file is text or binary */    unsigned lcflag : 1;     /* convert filename to lowercase */} min_info;/*---------------------------------------------------------------------------    Zipfile layout declarations.  If these headers ever change, make sure the    xxREC_SIZE defines (above) change with them!  ---------------------------------------------------------------------------*/   typedef byte   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_FILE_TIME              6#      define L_LAST_MOD_FILE_DATE              8#      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 byte   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_FILE_TIME              8#      define C_LAST_MOD_FILE_DATE              10#      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 byte   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 */       byte version_needed_to_extract[2];       UWORD general_purpose_bit_flag;       UWORD compression_method;       UWORD last_mod_file_time;       UWORD last_mod_file_date;       ULONG crc32;       ULONG compressed_size;       ULONG uncompressed_size;       UWORD filename_length;       UWORD extra_field_length;   } local_file_hdr;   typedef struct central_directory_file_header {     /* CENTRAL */       byte version_made_by[2];       byte version_needed_to_extract[2];       UWORD general_purpose_bit_flag;       UWORD compression_method;       UWORD last_mod_file_time;       UWORD last_mod_file_date;       ULONG crc32;       ULONG compressed_size;       ULONG uncompressed_size;       UWORD filename_length;       UWORD extra_field_length;       UWORD file_comment_length;       UWORD disk_number_start;       UWORD internal_file_attributes;       ULONG external_file_attributes;       ULONG relative_offset_local_header;   } cdir_file_hdr;   typedef struct end_central_dir_record {            /* END CENTRAL */       UWORD number_this_disk;       UWORD num_disk_with_start_central_dir;       UWORD num_entries_centrl_dir_ths_disk;       UWORD total_entries_central_dir;       ULONG size_central_directory;       ULONG offset_start_central_directory;       UWORD zipfile_comment_length;   } ecdir_rec;/*************************//*  Function Prototypes  *//*************************/#ifndef __              /* This is a common macro, but the name "__" was */#  if __STDC__          /*  swiped from the fine folks at Cray Research, */#    define __(X)   X   /*  Inc. (thanks, guys!).  Keep interior stuff   */#  else                 /*  parenthesized...                             */#    define __(X)   ()#  endif#endif/*---------------------------------------------------------------------------    Functions in unzip.c and/or zipinfo.c:  ---------------------------------------------------------------------------*/int    usage                     __( (int error) );int    process_zipfile           __( (void) );int    find_end_central_dir      __( (void) );int    process_end_central_dir   __( (void) );int    list_files                __( (void) );int    process_cdir_file_hdr     __( (void) );int    process_local_file_hdr    __( (void) );int    process_central_dir       __( (void) );int    long_info                 __( (void) );int    short_info                __( (void) );char   *zipinfo_time             __( (UWORD *datez, UWORD *timez) );/*---------------------------------------------------------------------------    Functions in extract.c:  ---------------------------------------------------------------------------*/int    extract_or_test_files     __( (void) );/* * static int   store_info               __( (void) ); * static int   extract_or_test_member   __( (void) ); *//*---------------------------------------------------------------------------    Functions in file_io.c and crypt.c:  ---------------------------------------------------------------------------*/int    open_input_file           __( (void) );int    readbuf                   __( (char *buf, register unsigned size) );int    create_output_file        __( (void) );int    FillBitBuffer             __( (void) );int    ReadByte                  __( (UWORD *x) );int    FlushOutput               __( (void) );/* * static int   dos2unix         __( (unsigned char *buf, int len) ); */void   set_file_time_and_close   __( (void) );char   *getp                     __( (char *, char *, int) );int    decrypt_byte              __( (void) );void   update_keys               __( (int) );void   init_keys                 __( (char *) );/*---------------------------------------------------------------------------    Macintosh file_io functions:  ---------------------------------------------------------------------------*/#ifdef MACOS/* * static int   IsHFSDisk        __( (int wAppVRefNum) ); */void   macfstest                 __( (int vrefnum) );int    mkdir                     __( (char *path) );#ifndef MCH_MACINTOSH            /* The next prototype upsets Aztec C. */void   SetMacVol                 __( (char *pch, short wVRefNum) );#endif#endif/*---------------------------------------------------------------------------    Uncompression functions (all internal compression routines, enclosed in    comments below, are prototyped in their respective files and are invisi-    ble to external functions):  ---------------------------------------------------------------------------*/

⌨️ 快捷键说明

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