| 1 | #cxx . . $ `<file>/Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h`/ifndef ZNZLIB_H |
| 2 | #define ZNZLIB_Hcxx . . $ `Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h:2:9`! |
| 3 | |
| 4 | /* |
| 5 | znzlib.h (zipped or non-zipped library) |
| 6 | |
| 7 | ***** This code is released to the public domain. ***** |
| 8 | |
| 9 | ***** Author: Mark Jenkinson, FMRIB Centre, University of Oxford ***** |
| 10 | ***** Date: September 2004 ***** |
| 11 | |
| 12 | ***** Neither the FMRIB Centre, the University of Oxford, nor any of ***** |
| 13 | ***** its employees imply any warranty of usefulness of this software ***** |
| 14 | ***** for any purpose, and do not assume any liability for damages, ***** |
| 15 | ***** incidental or otherwise, caused by any use of this document. ***** |
| 16 | |
| 17 | */ |
| 18 | |
| 19 | /* |
| 20 | |
| 21 | This library provides an interface to both compressed (gzip/zlib) and |
| 22 | uncompressed (normal) file IO. The functions are written to have the |
| 23 | same interface as the standard file IO functions. |
| 24 | |
| 25 | To use this library instead of normal file IO, the following changes |
| 26 | are required: |
| 27 | - replace all instances of FILE* with znzFile |
| 28 | - change the name of all function calls, replacing the initial character |
| 29 | f with the znz (e.g. fseek becomes znzseek) |
| 30 | - add a third parameter to all calls to znzopen (previously fopen) |
| 31 | that specifies whether to use compression (1) or not (0) |
| 32 | - use znz_isnull rather than any (pointer == NULL) comparisons in the code |
| 33 | |
| 34 | NB: seeks for writable files with compression are quite restricted |
| 35 | |
| 36 | */ |
| 37 | |
| 38 | |
| 39 | /*=================*/ |
| 40 | #ifdef __cpluspluscxx . . $ `<built-in>:465:9`! |
| 41 | extern "C" { |
| 42 | #endif |
| 43 | /*=================*/ |
| 44 | |
| 45 | #include <stdio.h> |
| 46 | #include <stdlib.h> |
| 47 | #include <string.h> |
| 48 | #include <stdarg.h> |
| 49 | |
| 50 | |
| 51 | /* include optional check for HAVE_FDOPEN here, from deleted config.h: |
| 52 | |
| 53 | uncomment the following line if fdopen() exists for your compiler and |
| 54 | compiler options |
| 55 | */ |
| 56 | /* #define HAVE_FDOPEN */ |
| 57 | |
| 58 | #if defined(WIN32) || defined(WIN64) || defined(_WIN32) || defined(_WIN64) || defined(_MSVC) || defined(_MSC_VER) |
| 59 | #include <io.h> |
| 60 | #define fseek _fseeki64 |
| 61 | #define ftell _ftelli64 |
| 62 | #define znz_off_t long long |
| 63 | #elif defined(__APPLE__) || defined(__FreeBSD__) |
| 64 | #define znz_off_t off_t |
| 65 | #else |
| 66 | #include <unistd.h> |
| 67 | #include <sys/types.h> |
| 68 | #define znz_off_tcxx . . $ `Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h:68:9`! off_t |
| 69 | #endif |
| 70 | |
| 71 | #ifdef HAVE_ZLIBcxx . . $ `<built-in>:410:9`! |
| 72 | #if defined(ITKZLIBcxx . . $ `<built-in>:411:9`!) && !defined(ITK_USE_SYSTEM_ZLIB) |
| 73 | #include "itk_zlib.h"cxx . . $ `<file>/build/Modules/ThirdParty/ZLIB/src/itk_zlib.h`/ |
| 74 | #else |
| 75 | #include "zlib.h" |
| 76 | #endif |
| 77 | #endif |
| 78 | |
| 79 | struct znzptrcxx . . $ znzptr# { |
| 80 | int withzcxx . . $ znzptr#withz.; |
| 81 | FILEcxx . . $ FILE#* nzfptrcxx . . $ znzptr#nzfptr.; |
| 82 | #ifdef HAVE_ZLIBcxx . . $ `<built-in>:410:9`! |
| 83 | gzFilecxx . . $ `build/Modules/ThirdParty/ZLIB/src/itkzlib-ng/zlib_name_mangling.h:142:11`! zfptrcxx . . $ znzptr#zfptr.; |
| 84 | #endif |
| 85 | } ; |
| 86 | |
| 87 | /* the type for all file pointers */ |
| 88 | typedef struct znzptrcxx . . $ znzptr# * znzFilecxx . . $ znzFile#; |
| 89 | |
| 90 | |
| 91 | /* int znz_isnull(znzFile f); */ |
| 92 | /* int znzclose(znzFile f); */ |
| 93 | #define znz_isnullcxx . . $ `Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h:93:9`!(f) ((f) == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!) |
| 94 | #define znzclosecxx . . $ `Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h:94:9`!(f) Xznzclose(&(f)) |
| 95 | |
| 96 | /* Note extra argument (use_compression) where |
| 97 | use_compression==0 is no compression |
| 98 | use_compression!=0 uses zlib (gzip) compression |
| 99 | */ |
| 100 | |
| 101 | znzFilecxx . . $ znzFile# znzopencxx . . $ znzopen(e0122eb2372df9a4).(const char *path, const char *mode, int use_compression); |
| 102 | |
| 103 | #ifdef COMPILE_NIFTIUNUSED_CODE |
| 104 | znzFile znzdopen(int fd, const char *mode, int use_compression); |
| 105 | #endif |
| 106 | |
| 107 | int Xznzclosecxx . . $ Xznzclose(1bbbccb74db67940).(znzFilecxx . . $ znzFile# * file); |
| 108 | |
| 109 | size_t znzreadcxx . . $ znzread(daac4e05e18e318b).(void* buf, size_t size, size_t nmemb, znzFilecxx . . $ znzFile# file); |
| 110 | |
| 111 | size_t znzwritecxx . . $ znzwrite(1f164599db97959d).(const void* buf, size_t size, size_t nmemb, znzFilecxx . . $ znzFile# file); |
| 112 | |
| 113 | znz_off_tcxx . . $ `Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h:68:9`! znzseekcxx . . $ znzseek(cd2d13ed623ecbb7).(znzFilecxx . . $ znzFile# file, znz_off_tcxx . . $ off_t# offset, int whence); |
| 114 | |
| 115 | int znzrewindcxx . . $ znzrewind(8436917d24402560).(znzFilecxx . . $ znzFile# stream); |
| 116 | |
| 117 | znz_off_tcxx . . $ `Modules/ThirdParty/NIFTI/src/nifti/znzlib/znzlib.h:68:9`! znztellcxx . . $ znztell(4d02afd068f8555a).(znzFilecxx . . $ znzFile# file); |
| 118 | |
| 119 | int znzputscxx . . $ znzputs(b05051f30e3b3dc0).(const char *str, znzFilecxx . . $ znzFile# file); |
| 120 | |
| 121 | #ifdef COMPILE_NIFTIUNUSED_CODE |
| 122 | char * znzgets(char* str, int size, znzFile file); |
| 123 | |
| 124 | int znzputc(int c, znzFile file); |
| 125 | |
| 126 | int znzgetc(znzFile file); |
| 127 | |
| 128 | #if !defined(WIN32) |
| 129 | int znzprintf(znzFile stream, const char *format, ...); |
| 130 | #endif |
| 131 | #endif |
| 132 | |
| 133 | /*=================*/ |
| 134 | #ifdef __cpluspluscxx . . $ `<built-in>:465:9`! |
| 135 | } |
| 136 | #endif |
| 137 | /*=================*/ |
| 138 | |
| 139 | #endif |