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

📄 unz.h

📁 著名SFC模拟器Snes9x的源代码。
💻 H
📖 第 1 页 / 共 3 页
字号:
/*---------------------------------------------------------------------------  unzip.h  This header file is used by all of the unzip source files.  Its contents  are divided into seven more-or-less separate sections:  predefined macros,  OS-dependent includes, (mostly) OS-independent defines, typedefs, function   prototypes (or "prototypes," in the case of non-ANSI compilers), macros,   and global-variable declarations.  ---------------------------------------------------------------------------*/#include "zlib.h"/*****************************************//*  Predefined, Machine-specific Macros  *//*****************************************/#if (defined(__GO32__) && defined(unix))   /* DOS extender */#  undef unix#endif#if defined(unix) || defined(__convexc__) || defined(M_XENIX)#  ifndef UNIX#    define UNIX#  endif /* !UNIX */#endif /* unix || __convexc__ || M_XENIX *//* Much of the following is swiped from zip's tailor.h: *//* define MSDOS for Turbo C (unless OS/2) and Power C as well as Microsoft C */#ifdef __POWERC#  define __TURBOC__#  define MSDOS#endif /* __POWERC */#if (defined(__TURBOC__) && defined(__MSDOS__) && !defined(MSDOS))#  define MSDOS#endif/* use prototypes and ANSI libraries if __STDC__, or Microsoft or Borland C, * or Silicon Graphics, or Convex, or IBM C Set/2, or GNU gcc under emx, or * or Watcom C, or Macintosh, or Windows NT. */#if (__STDC__ || defined(MSDOS) || defined(sgi) || defined(CONVEX))#  ifndef PROTO#    define PROTO#  endif#  define MODERN#endif#if (defined(__IBMC__) || defined(__EMX__) || defined(__WATCOMC__))#  ifndef PROTO#    define PROTO#  endif#  define MODERN#endif#if (defined(THINK_C) || defined(MPW) || defined(WIN32))#  ifndef PROTO#    define PROTO#  endif#  define MODERN#endif/* turn off prototypes if requested */#if (defined(NOPROTO) && defined(PROTO))#  undef PROTO#endif#if (defined(ultrix) || defined(bsd4_2) || defined(sun) || defined(pyr))#  if (!defined(BSD) && !defined(__SYSTEM_FIVE) && !defined(SYSV))#    define BSD#  endif /* !BSD && !__SYSTEM_FIVE && !SYSV */#endif /* ultrix || bsd4_2 || sun || pyr */#if (defined(CONVEX) || defined(CRAY) || defined(__SYSTEM_FIVE))#  ifndef TERMIO#    define TERMIO#  endif /* !TERMIO */#endif /* CONVEX || CRAY || __SYSTEM_FIVE */#ifdef pyr  /* Pyramid */#  ifndef ZMEM#    define ZMEM#  endif /* !ZMEM */#endif /* pyr */#ifdef CRAY#  ifdef ZMEM#    undef ZMEM#  endif /* ZMEM */#endif /* CRAY *//* the i386 test below is to catch SCO Unix (which has redefinition * warnings if param.h is included), but it probably doesn't hurt if * other 386 Unixes get nailed, too...except now that 386BSD and BSDI * exist.  Sigh.  <sys/param.h> is mostly included for "BSD", I think. * [An alternate fix for SCO Unix is below.] */#if (defined(MINIX) || (defined(i386) && defined(unix)))#  define NO_PARAM_H#endif /* MINIX || (i386 && unix) *//***************************//*  OS-Dependent Includes  *//***************************/#ifndef MINIX            /* Minix needs it after all the other includes (?) */#  include <stdio.h>#endif#include <ctype.h>       /* skip for VMS, to use tolower() function? */#include <errno.h>       /* used in mapname() */#ifndef NO_ERRNO#  define DECLARE_ERRNO  /* everybody except MSC 6.0, SCO cc, Watcom C/386 */#endif /* !NO_ERRNO */#ifdef VMS#  include <types.h>     /* (placed up here instead of in VMS section below */#  include <stat.h>      /* because types.h is used in some other headers) */#else /* !VMS */#  if !defined(THINK_C) && !defined(MPW)#    include <sys/types.h>                 /* off_t, time_t, dev_t, ... */#    include <sys/stat.h>#  endif /* !THINK_C && !MPW */#endif /* ?VMS */#ifdef MODERN#  if (!defined(M_XENIX) && !(defined(__GNUC__) && defined(sun)))#    include <stddef.h>#  endif#  if (!defined(__GNUC__) && !defined(apollo))   /* both define __STDC__ */#    include <stdlib.h>    /* standard library prototypes, malloc(), etc. */#  else#    ifdef __EMX__#      include <stdlib.h>  /* emx IS gcc but has stdlib.h */#    endif#  endif#  include <string.h>      /* defines strcpy, strcmp, memcpy, etc. */   typedef size_t extent;#else /* !MODERN */   char *malloc();   char *strchr(), *strrchr();   long lseek();   typedef unsigned int extent;#  define void int#endif /* ?MODERN *//* this include must be down here for SysV.4, for some reason... */#include <signal.h>      /* used in unzip.c, file_io.c *//*---------------------------------------------------------------------------    Next, a word from our Unix (mostly) sponsors:  ---------------------------------------------------------------------------*/#ifdef UNIX#  ifdef AMIGA#    include <libraries/dos.h>#  else /* !AMIGA */#    ifndef NO_PARAM_H#if 0  /* [GRR: this is an alternate fix for SCO's redefinition bug] */#      ifdef NGROUPS_MAX#        undef NGROUPS_MAX     /* SCO bug:  defined again in <param.h> */#      endif /* NGROUPS_MAX */#endif /* 0 */#      include <sys/param.h>   /* conflict with <sys/types.h>, some systems? */#    endif /* !NO_PARAM_H */#  endif /* ?AMIGA */#  ifndef BSIZE#    ifdef MINIX#      define BSIZE   1024#    else /* !MINIX */#      define BSIZE   DEV_BSIZE  /* assume common for all Unix systems */#    endif /* ?MINIX */#  endif#  ifndef BSD#    if (!defined(AMIGA) && !defined(MINIX))#      define NO_MKDIR           /* for mapname() */#    endif /* !AMIGA && !MINIX */#    include <time.h>     struct tm *gmtime(), *localtime();#  else   /* BSD */#    include <sys/time.h>#    include <sys/timeb.h>#    ifdef _AIX#      include <time.h>#    endif#  endif#else   /* !UNIX */#  define BSIZE   512               /* disk block size */#endif /* ?UNIX */#if (defined(V7) || defined(BSD))#  define strchr    index#  define strrchr   rindex#endif/*---------------------------------------------------------------------------    And now, our MS-DOS and OS/2 corner:  ---------------------------------------------------------------------------*/#ifdef __TURBOC__#  define DOS_OS2#  include <sys/timeb.h>      /* for structure ftime                        */#  ifndef __BORLANDC__        /* there appears to be a bug (?) in Borland's */#    include <mem.h>          /*   MEM.H related to __STDC__ and far poin-  */#  endif                      /*   ters. (dpk)  [mem.h included for memcpy] */#  include <dos.h>            /* for REGS macro (at least for Turbo C 2.0)  */#else                         /* NOT Turbo C (or Power C)...                */#  ifdef MSDOS                /*   but still MS-DOS, so we'll assume it's   */#    ifndef MSC               /*   Microsoft's compiler and fake the ID, if */#      define MSC             /*   necessary (it is in 5.0; apparently not  */#    endif                    /*   in 5.1 and 6.0)                          */#    include <dos.h>          /* for _dos_setftime()                        */#  endif#endif#if (defined(__IBMC__) && defined(__OS2__))#  define DOS_OS2#  define S_IFMT 0xF000#  define timezone _timezone#endif#ifdef __WATCOMC__#  define DOS_OS2#  define __32BIT__#  ifdef DECLARE_ERRNO#    undef DECLARE_ERRNO#  endif#  undef far#  define far#endif#ifdef __EMX__#  define DOS_OS2#  define __32BIT__#  define far#endif /* __EMX__ */#ifdef MSC                    /* defined for all versions of MSC now         */#  define DOS_OS2             /* Turbo C under DOS, MSC under DOS or OS/2    */#  if (defined(_MSC_VER) && (_MSC_VER >= 600))    /* new with 5.1 or 6.0 ... */#    undef DECLARE_ERRNO      /* errno is now a function in a dynamic link   */#  endif                      /*   library (or something)--incompatible with */#endif                        /*   the usual "extern int errno" declaration  */#ifdef DOS_OS2                /* defined for all MS-DOS and OS/2 compilers   */#  include <io.h>             /* lseek(), open(), setftime(), dup(), creat() */#  include <time.h>           /* localtime() */#endif#ifdef OS2                    /* defined for all OS/2 compilers */#  ifdef isupper#    undef isupper#  endif#  ifdef tolower#    undef tolower#  endif#  define isupper(x)   IsUpperNLS((unsigned char)(x))#  define tolower(x)   ToLowerNLS((unsigned char)(x))#endif#ifdef WIN32#  include <io.h>             /* read(), open(), etc. */#  include <time.h>#  include <memory.h>#  include <direct.h>         /* mkdir() */#  ifdef FILE_IO_C#    include <fcntl.h>#    include <conio.h>#    include <sys\types.h>#    include <sys\utime.h>#    include <windows.h>#    define DOS_OS2#    define getch() getchar()#  endif#endif/*---------------------------------------------------------------------------    Followed by some VMS (mostly) stuff:  ---------------------------------------------------------------------------*/#ifdef VMS#  include <time.h>               /* the usual non-BSD time functions */#  include <file.h>               /* same things as fcntl.h has */#  include <rms.h>#  define _MAX_PATH NAM$C_MAXRSS  /* to define FILNAMSIZ below */#  define UNIX                    /* can share most of same code from now on */#  define RETURN    return_VMS    /* VMS interprets return codes incorrectly */#else /* !VMS */#  ifndef THINK_C#    define RETURN  return        /* only used in main() */#  else#    define RETURN(v) { int n;\                        n = (v);\                        fprintf(stderr, "\npress <return> to continue ");\                        while (getc(stdin) != '\n');\                        putc('\n', stderr);\                        InitCursor();\                        goto start;\                      }#  endif#  ifdef V7#    define O_RDONLY  0#    define O_WRONLY  1#    define O_RDWR    2#  else /* !V7 */#    ifdef MTS#      include <sys/file.h>     /* MTS uses this instead of fcntl.h */#      include <timeb.h>#      include <time.h>#    else /* !MTS */#      ifdef COHERENT           /* Coherent 3.10/Mark Williams C */#        include <sys/fcntl.h>#        define SHORT_NAMES#        define tzset  settz#      else /* !COHERENT */#        include <fcntl.h>      /* O_BINARY for open() w/o CR/LF translation */#      endif /* ?COHERENT */#    endif /* ?MTS */#  endif /* ?V7 */#endif /* ?VMS */#if (defined(MSDOS) || defined(VMS))#  define DOS_VMS#endif

⌨️ 快捷键说明

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