diff options
Diffstat (limited to 'src/drivers/Posix')
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.cxx | 15 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.H b/src/drivers/Posix/Fl_Posix_System_Driver.H index 5b2060283..9ef8a2909 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.H +++ b/src/drivers/Posix/Fl_Posix_System_Driver.H @@ -75,6 +75,7 @@ public: virtual const char *home_directory_name() { return ::getenv("HOME"); } virtual int dot_file_hidden() {return 1;} virtual void gettime(time_t *sec, int *usec); + virtual void* gzopen(const char *fname, const char *mode); }; #endif // FL_POSIX_SYSTEM_DRIVER_H diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index c2576b268..f603c2d17 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -34,6 +34,9 @@ #include <pwd.h> #include <unistd.h> #include <time.h> +#if defined(HAVE_LIBZ) +# include <zlib.h> +#endif // // Define missing POSIX/XPG4 macros as needed... @@ -99,6 +102,18 @@ void Fl_Posix_System_Driver::gettime(time_t *sec, int *usec) { *usec = tv.tv_usec; } +void* Fl_Posix_System_Driver::gzopen(const char *fname, const char *mode) { +#if defined(HAVE_LIBZ) + FILE *in = fl_fopen(fname, mode); + if (!in) return NULL; + int fd = dup(fileno(in)); + fclose(in); + return gzdopen(fd, mode); +#else + return NULL; +#endif +} + // // End of "$Id$". // |
