Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygengzguts.h
Go to the documentation of this file.
00001 /* gzguts.h -- zlib internal header definitions for gz* operations 00002 * Copyright (C) 2004, 2005, 2010 Mark Adler 00003 * For conditions of distribution and use, see copyright notice in zlib.h 00004 */ 00005 00006 #ifdef _LARGEFILE64_SOURCE 00007 # ifndef _LARGEFILE_SOURCE 00008 # define _LARGEFILE_SOURCE 1 00009 # endif 00010 # ifdef _FILE_OFFSET_BITS 00011 # undef _FILE_OFFSET_BITS 00012 # endif 00013 #endif 00014 00015 #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) 00016 # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 00017 #else 00018 # define ZLIB_INTERNAL 00019 #endif 00020 00021 #include <stdio.h> 00022 #include "zlib.h" 00023 #ifdef STDC 00024 # include <string.h> 00025 # include <stdlib.h> 00026 # include <limits.h> 00027 #endif 00028 #include <fcntl.h> 00029 00030 #ifdef NO_DEFLATE /* for compatibility with old definition */ 00031 # define NO_GZCOMPRESS 00032 #endif 00033 00034 #ifdef _WIN32 00035 # include <io.h> 00036 #endif 00037 00038 #ifdef _MSC_VER 00039 # define vsnprintf _vsnprintf 00040 #endif 00041 00042 #ifndef local 00043 # define local static 00044 #endif 00045 /* compile with -Dlocal if your debugger can't find static symbols */ 00046 00047 /* gz* functions always use library allocation functions */ 00048 #ifndef STDC 00049 extern voidp malloc OF((uInt size)); 00050 extern void free OF((voidpf ptr)); 00051 #endif 00052 00053 /* get errno and strerror definition */ 00054 #if defined UNDER_CE 00055 # include <windows.h> 00056 # define zstrerror() gz_strwinerror((DWORD)GetLastError()) 00057 #else 00058 # ifdef STDC 00059 # include <errno.h> 00060 # define zstrerror() strerror(errno) 00061 # else 00062 # define zstrerror() "stdio error (consult errno)" 00063 # endif 00064 #endif 00065 00066 /* provide prototypes for these when building zlib without LFS */ 00067 #if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 00068 ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); 00069 ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); 00070 ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); 00071 ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); 00072 #endif 00073 00074 /* default i/o buffer size -- double this for output when reading */ 00075 #define GZBUFSIZE 8192 00076 00077 /* gzip modes, also provide a little integrity check on the passed structure */ 00078 #define GZ_NONE 0 00079 #define GZ_READ 7247 00080 #define GZ_WRITE 31153 00081 #define GZ_APPEND 1 /* mode set to GZ_WRITE after the file is opened */ 00082 00083 /* values for gz_state how */ 00084 #define LOOK 0 /* look for a gzip header */ 00085 #define COPY 1 /* copy input directly */ 00086 #define GZIP 2 /* decompress a gzip stream */ 00087 00088 /* internal gzip file state data structure */ 00089 typedef struct { 00090 /* used for both reading and writing */ 00091 int mode; /* see gzip modes above */ 00092 int fd; /* file descriptor */ 00093 char *path; /* path or fd for error messages */ 00094 z_off64_t pos; /* current position in uncompressed data */ 00095 unsigned size; /* buffer size, zero if not allocated yet */ 00096 unsigned want; /* requested buffer size, default is GZBUFSIZE */ 00097 unsigned char *in; /* input buffer */ 00098 unsigned char *out; /* output buffer (double-sized when reading) */ 00099 unsigned char *next; /* next output data to deliver or write */ 00100 /* just for reading */ 00101 unsigned have; /* amount of output data unused at next */ 00102 int eof; /* true if end of input file reached */ 00103 z_off64_t start; /* where the gzip data started, for rewinding */ 00104 z_off64_t raw; /* where the raw data started, for seeking */ 00105 int how; /* 0: get header, 1: copy, 2: decompress */ 00106 int direct; /* true if last read direct, false if gzip */ 00107 /* just for writing */ 00108 int level; /* compression level */ 00109 int strategy; /* compression strategy */ 00110 /* seek request */ 00111 z_off64_t skip; /* amount to skip (already rewound if backwards) */ 00112 int seek; /* true if seek request pending */ 00113 /* error information */ 00114 int err; /* error code */ 00115 char *msg; /* error message */ 00116 /* zlib inflate or deflate stream */ 00117 z_stream strm; /* stream structure in-place (not a pointer) */ 00118 } gz_state; 00119 typedef gz_state FAR *gz_statep; 00120 00121 /* shared functions */ 00122 void ZLIB_INTERNAL gz_error OF((gz_statep, int, const char *)); 00123 #if defined UNDER_CE 00124 char ZLIB_INTERNAL *gz_strwinerror OF((DWORD error)); 00125 #endif 00126 00127 /* GT_OFF(x), where x is an unsigned value, is true if x > maximum z_off64_t 00128 value -- needed when comparing unsigned to z_off64_t, which is signed 00129 (possible z_off64_t types off_t, off64_t, and long are all signed) */ 00130 #ifdef INT_MAX 00131 # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > INT_MAX) 00132 #else 00133 unsigned ZLIB_INTERNAL gz_intmax OF((void)); 00134 # define GT_OFF(x) (sizeof(int) == sizeof(z_off64_t) && (x) > gz_intmax()) 00135 #endif Generated on Mon May 28 2012 04:33:04 for ReactOS by
1.7.6.1
|