diff options
| author | Manolo Gouy <Manolo> | 2016-04-07 16:54:20 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-04-07 16:54:20 +0000 |
| commit | 19b98e40de481349f88c02883a2330ed19ccd316 (patch) | |
| tree | 40346d9c13d70c2658406bcc7a5f0eedb83ec88b /src/drivers/Posix | |
| parent | 050dfb55045e81ff681982f3d429d9cf8850a606 (diff) | |
Rewrite filename_expand.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11553 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
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 | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.H b/src/drivers/Posix/Fl_Posix_System_Driver.H index aa922d590..74102675c 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.H +++ b/src/drivers/Posix/Fl_Posix_System_Driver.H @@ -66,6 +66,7 @@ public: virtual int event_key(int k); virtual int get_key(int k); virtual int filename_list(const char *d, dirent ***list, int (*sort)(struct dirent **, struct dirent **) ); + virtual const char *getpwnam(const char *login); }; #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 6ce92675f..4d0dd2003 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -23,6 +23,8 @@ #include <X11/Xlib.h> #include <locale.h> #include <stdio.h> +#include <sys/types.h> +#include <pwd.h> // Pointers you can use to change FLTK to a foreign language. // Note: Similar pointers are defined in FL/fl_ask.H and src/fl_ask.cxx @@ -140,6 +142,12 @@ int Fl_Posix_System_Driver::filename_list(const char *d, dirent ***list, int (*s return n; } +const char *Fl_Posix_System_Driver::getpwnam(const char *login) { + struct passwd *pwd; + pwd = ::getpwnam(login); + return pwd ? pwd->pw_dir : NULL; +} + // // End of "$Id$". // |
