From 5262fdde0237dc28a24f64bf2e36d629e3345949 Mon Sep 17 00:00:00 2001 From: curt Date: Tue, 28 Apr 1998 21:41:39 +0000 Subject: [PATCH] Initial revision of fg_zlib.h --- Makefile.am | 1 + fg_zlib.h | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 fg_zlib.h diff --git a/Makefile.am b/Makefile.am index 0b4e25595..05052e039 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,5 +5,6 @@ EXTRA_DIST = \ fg_limits.h \ fg_typedefs.h \ fg_types.h \ + fg_zlib.h \ general.h \ keys.h diff --git a/fg_zlib.h b/fg_zlib.h new file mode 100644 index 000000000..728094735 --- /dev/null +++ b/fg_zlib.h @@ -0,0 +1,88 @@ +/************************************************************************** + * fg_zlib.h -- a zlib wrapper to replace zlib calls with normal uncompressed + * calls for systems that have problems building zlib. + * + * Written by Curtis Olson, started April 1998. + * + * Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * $Id$ + * (Log is kept at end of this file) + **************************************************************************/ + + +#ifndef _FG_ZLIB_H +#define _FG_ZLIB_H + + +#ifdef HAVE_CONFIG_H +# include +#endif + + +#ifdef AVOID_USING_ZLIB + + #include + + #define fgFile FILE * + + /* fgFile fgopen(char *filename, const char *flags) */ + #define fgopen(P, F) (fopen((P), (F))) + + /* int fgseek(fgFile *file, long offset, int whence) */ + #define fgseek(F, O, W) (fseek((F), (O), (W))) + + /* fgread(fgFile file, void *buf, int size); */ + #define fgread(F, B, S) (fread((B), (S), 1, (F))) + + /* int fggets(fgFile fd, char *buffer, int len) */ + #define fggets(F, B, L) (fgets((B), (L), (F))) + + /* int fgclose(fgFile fd) */ + #define fgclose(F) (fclose((F))) +#else + + #include + + #define fgFile gzFile + + /* fgFile fgopen(char *filename, const char *flags) */ + #define fgopen(P, F) (gzopen((P), (F))) + + /* int fgseek(fgFile *file, long offset, int whence) */ + #define fgseek(F, O, W) (gzseek((F), (O), (W))) + + /* fgread(fgFile file, void *buf, int size); */ + #define fgread(F, B, S) (gzread((F), (B), (S))) + + /* int fggets(fgFile fd, char *buffer, int len) */ + #define fggets(F, B, L) (gzgets((F), (B), (L))) + + /* int fgclose(fgFile fd) */ + #define fgclose(F) (gzclose((F))) + +#endif /* #ifdef AVOID_USING_ZLIB #else #endif */ + + +#endif /* _FG_ZLIB_H */ + + +/* $Log$ +/* Revision 1.1 1998/04/28 21:41:39 curt +/* Initial revision of fg_zlib.h +/* + */ -- 2.39.5