Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

osdep.h

00001 /*
00002   Copyright (c) 1990-1999 Info-ZIP.  All rights reserved.
00003 
00004   See the accompanying file LICENSE, version 1999-Oct-05 or later
00005   (the contents of which are also included in zip.h) for terms of use.
00006   If, for some reason, both of these files are missing, the Info-ZIP license
00007   also may be found at:  ftp://ftp.cdrom.com/pub/infozip/license.html
00008 */
00009 /* Automatic setting of the common Microsoft C idenfifier MSC.
00010  * NOTE: Watcom also defines M_I*86 !
00011  */
00012 #if defined(_MSC_VER) || (defined(M_I86) && !defined(__WATCOMC__))
00013 #  ifndef MSC
00014 #    define MSC                 /* This should work for older MSC, too!  */
00015 #  endif
00016 #endif
00017 
00018 #if defined(__WATCOMC__) && defined(__386__)
00019 #  define WATCOMC_386
00020 #endif
00021 
00022 #if (defined(__CYGWIN32__) && !defined(__CYGWIN__))
00023 #  define __CYGWIN__            /* compatibility for CygWin B19 and older */
00024 #endif
00025 
00026 /* enable multibyte character set support by default */
00027 #ifndef _MBCS
00028 #  define _MBCS
00029 #endif
00030 #if defined(__CYGWIN__)
00031 #  undef _MBCS
00032 #endif
00033 
00034 #ifndef MSDOS
00035 /*
00036  * Windows 95 (and Windows NT) file systems are (to some extend)
00037  * extensions of MSDOS. Common features include for example:
00038  *      FAT or (FAT like) file systems,
00039  *      '\\' as directory separator in paths,
00040  *      "\r\n" as record (line) terminator in text files, ...
00041  */
00042 #  define MSDOS
00043 /* inherit MS-DOS file system etc. stuff */
00044 #endif
00045 
00046 #define USE_CASE_MAP
00047 #define PROCNAME(n) (action == ADD || action == UPDATE ? wild(n) : \
00048                      procname(n, 1))
00049 #define BROKEN_FSEEK
00050 #ifndef __RSXNT__
00051 #  define HAVE_FSEEKABLE
00052 #endif
00053 
00054 /* File operations--use "b" for binary if allowed or fixed length 512 on VMS
00055  *                  use "S" for sequential access on NT to prevent the NT
00056  *                  file cache eating up memory with large .zip files
00057  */
00058 #define FOPR "rb"
00059 #define FOPM "r+b"
00060 #define FOPW "wbS"
00061 
00062 #if (defined(__CYGWIN__) && !defined(NO_MKTIME))
00063 #  define NO_MKTIME             /* Cygnus' mktime() implementation is buggy */
00064 #endif
00065 #if (!defined(NT_TZBUG_WORKAROUND) && !defined(NO_NT_TZBUG_WORKAROUND))
00066 #  define NT_TZBUG_WORKAROUND
00067 #endif
00068 #if (defined(UTIL) && defined(NT_TZBUG_WORKAROUND))
00069 #  undef NT_TZBUG_WORKAROUND    /* the Zip utilities do not use time-stamps */
00070 #endif
00071 #if !defined(NO_EF_UT_TIME) && !defined(USE_EF_UT_TIME)
00072 #  define USE_EF_UT_TIME
00073 #endif
00074 #if (!defined(NO_NTSD_EAS) && !defined(NTSD_EAS))
00075 #  define NTSD_EAS
00076 #endif
00077 
00078 #if (defined(NTSD_EAS) && !defined(ZP_NEED_MEMCOMPR))
00079 #  define ZP_NEED_MEMCOMPR
00080 #endif
00081 
00082 #ifdef WINDLL
00083 # ifndef NO_ASM
00084 #   define NO_ASM
00085 # endif
00086 # ifndef MSWIN
00087 #   define MSWIN
00088 # endif
00089 # ifndef REENTRANT
00090 #   define REENTRANT
00091 # endif
00092 #endif /* WINDLL */
00093 
00094 /* Enable use of optimized x86 assembler version of longest_match() for
00095    MSDOS, WIN32 and OS2 per default.  */
00096 #if !defined(NO_ASM) && !defined(ASMV)
00097 #  define ASMV
00098 #endif
00099 
00100 #if !defined(__GO32__) && !defined(__EMX__) && !defined(__CYGWIN__)
00101 #  define NO_UNISTD_H
00102 #endif
00103 
00104 /* the following definitions are considered as "obsolete" by Microsoft and
00105  * might be missing in some versions of <windows.h>
00106  */
00107 #ifndef AnsiToOem
00108 #  define AnsiToOem CharToOemA
00109 #endif
00110 #ifndef OemToAnsi
00111 #  define OemToAnsi OemToCharA
00112 #endif
00113 
00114 #if (defined(__RSXNT__) && defined(__CRTRSXNT__))
00115 #  include <crtrsxnt.h>
00116 #endif
00117 
00118 /* Get types and stat */
00119 #include <sys/types.h>
00120 #include <sys/stat.h>
00121 #include <io.h>
00122 #ifdef _MBCS
00123 #  if (!defined(__EMX__) && !defined(__MINGW32__) && !defined(__CYGWIN__))
00124 #    include <stdlib.h>
00125 #    include <mbstring.h>
00126 #  endif
00127 #  if (defined(__MINGW32__) && !defined(MB_CUR_MAX))
00128 #    ifdef __MSVCRT__
00129        extern int *__p___mb_cur_max(void);
00130 #      define MB_CUR_MAX (*__p___mb_cur_max())
00131 #    else
00132        extern int *_imp____mb_cur_max_dll;
00133 #      define MB_CUR_MAX (*_imp____mb_cur_max_dll)
00134 #    endif
00135 #  endif
00136 #  if (defined(__LCC__) && !defined(MB_CUR_MAX))
00137      extern int *_imp____mb_cur_max;
00138 #    define MB_CUR_MAX (*_imp____mb_cur_max)
00139 #  endif
00140 #endif
00141 
00142 #ifdef __LCC__
00143 #  include <time.h>
00144 #endif
00145 #if (defined(__RSXNT__) || defined(__EMX__)) && !defined(tzset)
00146 #  define tzset _tzset
00147 #endif
00148 #ifdef __MINGW32__
00149    extern void _tzset(void);  /* this is missing in <time.h> */
00150 #  ifndef tzset
00151 #    define tzset _tzset
00152 #  endif
00153 #endif
00154 
00155 #ifdef MATCH
00156 #  undef MATCH
00157 #endif
00158 #define MATCH dosmatch          /* use DOS style wildcard matching */
00159 
00160 #ifdef ZCRYPT_INTERNAL
00161 #  ifdef WINDLL
00162 #    define ZCR_SEED2     (unsigned)3141592654L /* use PI as seed pattern */
00163 #  else
00164 #    include <process.h>        /* getpid() declaration for srand seed */
00165 #  endif
00166 #endif
00167 
00168 /* This patch of stat() is useful for at least three compilers.  It is   */
00169 /* difficult to take a stat() of a root directory under Windows95, so  */
00170 /* zstat_zipwin32() detects that case and fills in suitable values.    */
00171 #ifndef __RSXNT__
00172 #  ifndef W32_STATROOT_FIX
00173 #    define W32_STATROOT_FIX
00174 #  endif
00175 #endif /* !__RSXNT__ */
00176 
00177 #if (defined(NT_TZBUG_WORKAROUND) || defined(W32_STATROOT_FIX))
00178 #  define W32_STAT_BANDAID
00179    int zstat_zipwin32(const char *path, struct stat *buf);
00180 #  ifdef SSTAT
00181 #    undef SSTAT
00182 #  endif
00183 #  define SSTAT zstat_zipwin32
00184 #endif /* NT_TZBUG_WORKAROUND || W32_STATROOT_FIX */
00185 
00186 int getch_win32(void);
00187 
00188 #ifdef __GNUC__
00189 # define IZ_PACKED      __attribute__((packed))
00190 #else
00191 # define IZ_PACKED
00192 #endif
00193 
00194 /* for some (all ?) versions of IBM C Set/2 and IBM C Set++ */
00195 #ifndef S_IFMT
00196 #  define S_IFMT 0xF000
00197 #endif /* !S_IFMT */
00198 
00199 #ifdef __WATCOMC__
00200 #  include <stdio.h>    /* PATH_MAX is defined here */
00201 #  define NO_MKTEMP
00202 
00203 /* Get asm routines to link properly without using "__cdecl": */
00204 #  ifdef __386__
00205 #    ifdef ASMV
00206 #      pragma aux match_init    "_*" parm caller [] modify []
00207 #      pragma aux longest_match "_*" parm caller [] value [eax] \
00208                                       modify [eax ecx edx]
00209 #    endif
00210 #    if defined(ASM_CRC) && !defined(USE_ZLIB)
00211 #      pragma aux crc32         "_*" parm caller [] value [eax] modify [eax]
00212 #      pragma aux get_crc_table "_*" parm caller [] value [eax] \
00213                                       modify [eax ecx edx]
00214 #    endif /* ASM_CRC && !USE_ZLIB */
00215 #  endif /* __386__ */
00216 #endif /* __WATCOMC__ */

Generated on Wed Oct 26 14:46:51 2005 for Lgi by  doxygen 1.4.1