00001 #ifndef _ZNZLIB_H_
00002 #define _ZNZLIB_H_
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00044
00045 #include <stdio.h>
00046 #include <stdlib.h>
00047 #include <string.h>
00048 #include <stdarg.h>
00049
00050 #include "config.h"
00051
00052 #ifdef HAVE_ZLIB
00053 #include "zlib.h"
00054 #endif
00055
00056
00057 struct znzptr {
00058 int withz;
00059 FILE* nzfptr;
00060 #ifdef HAVE_ZLIB
00061 gzFile zfptr;
00062 #endif
00063 } ;
00064
00065
00066 typedef struct znzptr * znzFile;
00067
00068
00069
00070
00071 #define znz_isnull(f) ((f) == NULL)
00072 #define znzclose(f) Xznzclose(&(f))
00073
00074
00075
00076
00077
00078
00079 znzFile znzopen(const char *path, const char *mode, int use_compression);
00080
00081 znzFile znzdopen(int fd, const char *mode, int use_compression);
00082
00083 int Xznzclose(znzFile * file);
00084
00085 size_t znzread(void* buf, size_t size, size_t nmemb, znzFile file);
00086
00087 size_t znzwrite(const void* buf, size_t size, size_t nmemb, znzFile file);
00088
00089 long znzseek(znzFile file, long offset, int whence);
00090
00091 int znzrewind(znzFile stream);
00092
00093 long znztell(znzFile file);
00094
00095 int znzputs(const char *str, znzFile file);
00096
00097 char * znzgets(char* str, int size, znzFile file);
00098
00099 int znzputc(int c, znzFile file);
00100
00101 int znzgetc(znzFile file);
00102
00103 #if !defined(WIN32)
00104 int znzprintf(znzFile stream, const char *format, ...);
00105 #endif
00106
00107
00108 #ifdef __cplusplus
00109 }
00110 #endif
00111
00112
00113 #endif