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
00051
00052
00053
00054
00055
00056
00057
00058 #ifdef HAVE_ZLIB
00059 #if defined(ITKZLIB)
00060 #include "itk_zlib.h"
00061 #else
00062 #include "zlib.h"
00063 #endif
00064 #endif
00065
00066
00067 struct znzptr {
00068 int withz;
00069 FILE* nzfptr;
00070 #ifdef HAVE_ZLIB
00071 gzFile zfptr;
00072 #endif
00073 } ;
00074
00075
00076 typedef struct znzptr * znzFile;
00077
00078
00079
00080
00081 #define znz_isnull(f) ((f) == NULL)
00082 #define znzclose(f) Xznzclose(&(f))
00083
00084
00085
00086
00087
00088
00089 znzFile znzopen(const char *path, const char *mode, int use_compression);
00090
00091 znzFile znzdopen(int fd, const char *mode, int use_compression);
00092
00093 int Xznzclose(znzFile * file);
00094
00095 size_t znzread(void* buf, size_t size, size_t nmemb, znzFile file);
00096
00097 size_t znzwrite(const void* buf, size_t size, size_t nmemb, znzFile file);
00098
00099 long znzseek(znzFile file, long offset, int whence);
00100
00101 int znzrewind(znzFile stream);
00102
00103 long znztell(znzFile file);
00104
00105 int znzputs(const char *str, znzFile file);
00106
00107 char * znzgets(char* str, int size, znzFile file);
00108
00109 int znzputc(int c, znzFile file);
00110
00111 int znzgetc(znzFile file);
00112
00113 #if !defined(WIN32)
00114 int znzprintf(znzFile stream, const char *format, ...);
00115 #endif
00116
00117
00118 #ifdef __cplusplus
00119 }
00120 #endif
00121
00122
00123 #endif