summaryrefslogtreecommitdiff
path: root/src/drivers/Darwin
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-07 16:54:20 +0000
committerManolo Gouy <Manolo>2016-04-07 16:54:20 +0000
commit19b98e40de481349f88c02883a2330ed19ccd316 (patch)
tree40346d9c13d70c2658406bcc7a5f0eedb83ec88b /src/drivers/Darwin
parent050dfb55045e81ff681982f3d429d9cf8850a606 (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/Darwin')
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.H1
-rw-r--r--src/drivers/Darwin/Fl_Darwin_System_Driver.cxx9
2 files changed, 10 insertions, 0 deletions
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.H b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
index 0803f32d5..85c8a3fa3 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.H
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.H
@@ -69,6 +69,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_DARWIN_SYSTEM_DRIVER_H
diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
index 617e8b19d..246c38e9f 100644
--- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
+++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx
@@ -28,6 +28,7 @@
#include <locale.h>
#include <stdio.h>
#include <dlfcn.h>
+#include <pwd.h>
extern int fl_mac_os_version; // the version number of the running Mac OS X
@@ -135,6 +136,14 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, int (*
return n;
}
+
+const char *Fl_Darwin_System_Driver::getpwnam(const char *login) {
+ struct passwd *pwd;
+ pwd = ::getpwnam(login);
+ return pwd ? pwd->pw_dir : NULL;
+}
+
+
//
// End of "$Id$".
//