summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-04-14 12:51:56 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-04-14 12:51:56 +0000
commitb5306348048f705280427c74ca3fae03862a1938 (patch)
tree64dd4902aa915a14d7fa3c10242fc45e2e6bb0f2 /src
parent8e3cdc0ac1556f510e936b0e154c6ce513ec3604 (diff)
Add Cygwin drive code.
Fix typos. Update dependencies. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2081 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_File_Browser.cxx60
-rw-r--r--src/Fl_arg.cxx7
-rw-r--r--src/makedepend4
3 files changed, 48 insertions, 23 deletions
diff --git a/src/Fl_File_Browser.cxx b/src/Fl_File_Browser.cxx
index 5b1bcd270..8d17bb345 100644
--- a/src/Fl_File_Browser.cxx
+++ b/src/Fl_File_Browser.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Browser.cxx,v 1.1.2.8 2002/03/29 14:16:03 easysw Exp $"
+// "$Id: Fl_File_Browser.cxx,v 1.1.2.9 2002/04/14 12:51:55 easysw Exp $"
//
// Fl_File_Browser routines.
//
@@ -44,15 +44,17 @@
#include <stdlib.h>
#include "flstring.h"
-#if defined(WIN32) && ! defined(__CYGWIN__)
+#ifdef __CYGWIN__
+# include <mntent.h>
+#elif defined(WIN32)
# include <windows.h>
# include <direct.h>
-#endif /* WIN32 */
+#endif /* __CYGWIN__ */
#if defined(__EMX__)
-#define INCL_DOS
-#define INCL_DOSMISC
-#include <os2.h>
+# define INCL_DOS
+# define INCL_DOSMISC
+# include <os2.h>
#endif /* __EMX__ */
@@ -409,9 +411,26 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
if ((icon = Fl_File_Icon::find("any", Fl_File_Icon::DEVICE)) == NULL)
icon = Fl_File_Icon::find("any", Fl_File_Icon::DIRECTORY);
-#if defined(WIN32) && ! defined (__CYGWIN__)
- DWORD drives; // Drive available bits
+#ifdef WIN32
+# ifdef __CYGWIN__
+ //
+ // Cygwin provides an implementation of setmntent() to get the list
+ // of available drives...
+ //
+ FILE *m = setmntent("/-not-used-", "r");
+ struct mntent *p;
+
+ while ((p = getmntent (m)) != NULL) {
+ add(p->mnt_dir, icon);
+ num_files ++;
+ }
+ endmntent(m);
+# else
+ //
+ // Normal WIN32 code uses drive bits...
+ //
+ DWORD drives; // Drive available bits
drives = GetLogicalDrives();
for (i = 'A'; i <= 'Z'; i ++, drives >>= 1)
@@ -426,7 +445,11 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
num_files ++;
}
+# endif // __CYGWIN__
#elif defined(__EMX__)
+ //
+ // OS/2 code uses drive bits...
+ //
ULONG curdrive; // Current drive
ULONG drives; // Drive available bits
int start = 3; // 'C' (MRS - dunno if this is correct!)
@@ -443,22 +466,23 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
num_files ++;
}
#else
+ //
+ // UNIX code uses /etc/fstab or similar...
+ //
FILE *mtab; // /etc/mtab or /etc/mnttab file
char line[1024]; // Input line
-
//
// Open the file that contains a list of mounted filesystems...
//
-# if defined(hpux) || defined(__sun)
+
mtab = fopen("/etc/mnttab", "r"); // Fairly standard
-# elif defined(__sgi) || defined(linux)
- mtab = fopen("/etc/mtab", "r"); // More standard
-# else
- mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list
if (mtab == NULL)
- mtab = fopen("/etc/vfstab", "r");
-# endif
+ mtab = fopen("/etc/mtab", "r"); // More standard
+ if (mtab == NULL)
+ mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list
+ if (mtab == NULL)
+ mtab = fopen("/etc/vfstab", "r"); // Alternate full list file
if (mtab != NULL)
{
@@ -489,7 +513,7 @@ Fl_File_Browser::load(const char *directory)// I - Directory to load
// Build the file list...
//
-#if (defined(WIN32) && ! defined(__CYGWIN__)) || defined(__EMX__)
+#if (defined(WIN32) && !defined(__CYGWIN__)) || defined(__EMX__)
strncpy(filename, directory_, sizeof(filename) - 1);
filename[sizeof(filename) - 1] = '\0';
i = strlen(filename) - 1;
@@ -559,5 +583,5 @@ Fl_File_Browser::filter(const char *pattern) // I - Pattern string
//
-// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.8 2002/03/29 14:16:03 easysw Exp $".
+// End of "$Id: Fl_File_Browser.cxx,v 1.1.2.9 2002/04/14 12:51:55 easysw Exp $".
//
diff --git a/src/Fl_arg.cxx b/src/Fl_arg.cxx
index 5f576ea41..85bbb4375 100644
--- a/src/Fl_arg.cxx
+++ b/src/Fl_arg.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_arg.cxx,v 1.5.2.8.2.10 2002/04/14 02:43:48 easysw Exp $"
+// "$Id: Fl_arg.cxx,v 1.5.2.8.2.11 2002/04/14 12:51:56 easysw Exp $"
//
// Optional argument initialization code for the Fast Light Tool Kit (FLTK).
//
@@ -29,6 +29,7 @@
#include <FL/Fl.H>
#include <FL/x.H>
#include <FL/Fl_Window.H>
+#include <FL/Fl_Tooltip.H>
#include <FL/filename.H>
#include <FL/fl_draw.H>
#include <ctype.h>
@@ -263,7 +264,7 @@ static const char * const helpmsg =
" -nok[bd]\n"
" -not[ooltips]\n"
" -s[cheme] scheme\n"
-" -ti[tle] windowtitle\n";
+" -ti[tle] windowtitle\n"
" -to[oltips]";
const char * const Fl::help = helpmsg+13;
@@ -411,5 +412,5 @@ int XParseGeometry(const char* string, int* x, int* y,
#endif // ifdef WIN32
//
-// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.10 2002/04/14 02:43:48 easysw Exp $".
+// End of "$Id: Fl_arg.cxx,v 1.5.2.8.2.11 2002/04/14 12:51:56 easysw Exp $".
//
diff --git a/src/makedepend b/src/makedepend
index e2ee50cd1..d6ad3dbd8 100644
--- a/src/makedepend
+++ b/src/makedepend
@@ -268,8 +268,8 @@ Fl_abort.o: ../config.h
Fl_add_idle.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_arg.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H ../FL/x.H
Fl_arg.o: ../FL/Fl_Window.H ../FL/Fl_Window.H ../FL/Fl_Group.H
-Fl_arg.o: ../FL/Fl_Widget.H ../FL/filename.H ../FL/fl_draw.H flstring.h
-Fl_arg.o: ../config.h
+Fl_arg.o: ../FL/Fl_Widget.H ../FL/Fl_Tooltip.H ../FL/Fl_Widget.H
+Fl_arg.o: ../FL/filename.H ../FL/fl_draw.H flstring.h ../config.h
Fl_compose.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H
Fl_display.o: ../FL/Fl.H ../FL/Enumerations.H ../FL/Fl_Export.H flstring.h
Fl_display.o: ../config.h