summaryrefslogtreecommitdiff
path: root/FL
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-10-12 14:42:12 +0000
committerManolo Gouy <Manolo>2017-10-12 14:42:12 +0000
commit789ed089c903922d0d66fcc2849dd24fbcaf2495 (patch)
tree8b36dfccefd881d7b85d81f2818933d447316096 /FL
parenta526818778f1e378dbcfe300dc5ab42df023adfe (diff)
Add fl_open_ext() to control whether the file is opened in binary/text mode.
This new function allows to write Fl_SVG_Image::fl_gzopen() in a completely platform-independent way. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'FL')
-rw-r--r--FL/Fl_System_Driver.H1
-rw-r--r--FL/fl_utf8.h2
2 files changed, 3 insertions, 0 deletions
diff --git a/FL/Fl_System_Driver.H b/FL/Fl_System_Driver.H
index bd73a96f9..b1fb209c6 100644
--- a/FL/Fl_System_Driver.H
+++ b/FL/Fl_System_Driver.H
@@ -87,6 +87,7 @@ public:
virtual char *getenv(const char* v) {return NULL;}
virtual int putenv(char* v) {return -1;}
virtual int open(const char* f, int oflags, int pmode) {return -1;}
+ virtual int open_ext(const char* f, int translation, int oflags, int pmode) {return this->open(f, oflags, pmode);}
virtual FILE *fopen(const char* f, const char *mode);
virtual int system(const char* cmd) {return -1;}
virtual int execvp(const char *file, char *const *argv) {return -1;}
diff --git a/FL/fl_utf8.h b/FL/fl_utf8.h
index ca4ac27e9..54b192b1f 100644
--- a/FL/fl_utf8.h
+++ b/FL/fl_utf8.h
@@ -177,6 +177,8 @@ FL_EXPORT int fl_execvp(const char *file, char *const *argv);
/* OD: Portable UTF-8 aware open wrapper */
FL_EXPORT int fl_open(const char* f, int o, ...);
+FL_EXPORT int fl_open_ext(const char* fname, int translation, int oflags, ...);
+
/* OD: Portable UTF-8 aware unlink wrapper */
FL_EXPORT int fl_unlink(const char *f);