summaryrefslogtreecommitdiff
path: root/src/drivers/Posix/Fl_Posix_System_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-10-04 11:46:33 +0000
committerManolo Gouy <Manolo>2017-10-04 11:46:33 +0000
commit5e6bf76b0a75f84dcdaa277d1aef7ab76e2d0631 (patch)
treea6b337e3d88fc23fe1941e09d22a0b28f5e31223 /src/drivers/Posix/Fl_Posix_System_Driver.cxx
parent6434d5d602344631cef2a75c015fa9e72035852d (diff)
Fl_SVG_Image class: add support for compressed .svgz image files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12475 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Posix/Fl_Posix_System_Driver.cxx')
-rw-r--r--src/drivers/Posix/Fl_Posix_System_Driver.cxx15
1 files changed, 15 insertions, 0 deletions
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$".
//