/usr/include/InsightToolkit/Utilities/znzlib.h is in libinsighttoolkit3-dev 3.20.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | #ifndef _ZNZLIB_H_
#define _ZNZLIB_H_
/*
znzlib.h (zipped or non-zipped library)
***** This code is released to the public domain. *****
***** Author: Mark Jenkinson, FMRIB Centre, University of Oxford *****
***** Date: September 2004 *****
***** Neither the FMRIB Centre, the University of Oxford, nor any of *****
***** its employees imply any warranty of usefulness of this software *****
***** for any purpose, and do not assume any liability for damages, *****
***** incidental or otherwise, caused by any use of this document. *****
*/
/*
This library provides an interface to both compressed (gzip/zlib) and
uncompressed (normal) file IO. The functions are written to have the
same interface as the standard file IO functions.
To use this library instead of normal file IO, the following changes
are required:
- replace all instances of FILE* with znzFile
- change the name of all function calls, replacing the initial character
f with the znz (e.g. fseek becomes znzseek)
- add a third parameter to all calls to znzopen (previously fopen)
that specifies whether to use compression (1) or not (0)
- use znz_isnull rather than any (pointer == NULL) comparisons in the code
NB: seeks for writable files with compression are quite restricted
*/
/*=================*/
#ifdef __cplusplus
extern "C" {
#endif
/*=================*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
/* include optional check for HAVE_FDOPEN here, from deleted config.h:
uncomment the following line if fdopen() exists for your compiler and
compiler options
*/
/* #define HAVE_FDOPEN */
#ifdef HAVE_ZLIB
#if defined(ITKZLIB)
#include "itk_zlib.h"
#else
#include "zlib.h"
#endif
#endif
struct znzptr {
int withz;
FILE* nzfptr;
#ifdef HAVE_ZLIB
gzFile zfptr;
#endif
} ;
/* the type for all file pointers */
typedef struct znzptr * znzFile;
/* int znz_isnull(znzFile f); */
/* int znzclose(znzFile f); */
#define znz_isnull(f) ((f) == NULL)
#define znzclose(f) Xznzclose(&(f))
/* Note extra argument (use_compression) where
use_compression==0 is no compression
use_compression!=0 uses zlib (gzip) compression
*/
znzFile znzopen(const char *path, const char *mode, int use_compression);
znzFile znzdopen(int fd, const char *mode, int use_compression);
int Xznzclose(znzFile * file);
size_t znzread(void* buf, size_t size, size_t nmemb, znzFile file);
size_t znzwrite(const void* buf, size_t size, size_t nmemb, znzFile file);
long znzseek(znzFile file, long offset, int whence);
int znzrewind(znzFile stream);
long znztell(znzFile file);
int znzputs(const char *str, znzFile file);
char * znzgets(char* str, int size, znzFile file);
int znzputc(int c, znzFile file);
int znzgetc(znzFile file);
#if !defined(WIN32)
int znzprintf(znzFile stream, const char *format, ...);
#endif
/*=================*/
#ifdef __cplusplus
}
#endif
/*=================*/
#endif
|