*/
#include <stdio.h>
+#include <stdlib.h> /* for qsort */
+#include "../config.h" /* to check for dirent.h */
#ifdef SEL_FILE_IGNORE_CASE
#include <ctype.h>
#include "selfile.h"
-#if defined(SVR4) || defined(SYSV) || defined(USG) || defined(__osf__)
+#ifdef HAVE_DIRENT_H
#include <dirent.h>
-#else /* defined(SVR4) || defined(SYSV) || defined(USG) */
+#else
#include <sys/dir.h>
#define dirent direct
-#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */
+#endif
#include <sys/stat.h>
-#if defined(SVR4) || defined(SYSV) || defined(USG)
-extern void qsort();
-#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */
-
#ifdef SEL_FILE_IGNORE_CASE
int
SFcompareEntries(p, q)
i++;
}
-#if defined(SVR4) || defined(SYSV) || defined(USG)
- qsort((char *) result, (unsigned) i, sizeof(SFEntry), SFcompareEntries);
-#else /* defined(SVR4) || defined(SYSV) || defined(USG) */
- qsort((char *) result, i, sizeof(SFEntry), SFcompareEntries);
-#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */
+ qsort((char *) result, (size_t) i, sizeof(SFEntry), SFcompareEntries);
dir->entries = result;
dir->nEntries = i;
#endif
#define ABS(x) (((x) < 0) ? (-(x)) : (x))
+/* added missing prototypes */
+extern char SFstatChar(struct stat*);
+extern int SFchdir(char *);
+void SFvSliderMovedCallback(Widget, int, int);
+
typedef struct {
char *fontname;
} TextData, *textPtr;
/* ARGSUSED */
void
-SFvFloatSliderMovedCallback(w, n, fnew)
- Widget w;
- int n;
- float *fnew;
-{
- int new;
-
- new = (*fnew) * SFdirs[SFdirPtr + n].nEntries;
-
- SFvSliderMovedCallback(w, n, new);
-}
-
-/* ARGSUSED */
-void
SFvSliderMovedCallback(w, n, new)
Widget w;
int n;
/* ARGSUSED */
void
+SFvFloatSliderMovedCallback(w, n, fnew)
+ Widget w;
+ int n;
+ float *fnew;
+{
+ int new;
+
+ new = (*fnew) * SFdirs[SFdirPtr + n].nEntries;
+
+ SFvSliderMovedCallback(w, n, new);
+}
+
+
+/* ARGSUSED */
+void
SFvAreaSelectedCallback(w, n, pnew)
Widget w;
int n;
*/
#include <stdio.h>
+#include <stdlib.h> /* for qsort */
+#include "../config.h"
#ifdef SEL_FILE_IGNORE_CASE
#include <ctype.h>
#define MAXPATHLEN 1024
#endif /* ndef MAXPATHLEN */
-
-#if defined(SVR4) || defined(SYSV) || defined(USG)
+#ifdef HAS_DIRENT_H
extern uid_t getuid();
-extern void qsort();
-#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */
+#endif /* def HAS_DIRENT_H */
+
+/* added missing prototypes */
+extern void SFtextChanged();
+extern int SFgetDir(SFDir *);
+extern void SFdrawLists(int);
+extern void SFdrawList(int, int);
+extern void SFclearList(int, int);
+extern void SFmotionList(Widget, int, XMotionEvent*);
typedef struct {
char *name;
}
#endif /* def SEL_FILE_IGNORE_CASE */
+void
+SFsetText(path)
+ char *path;
+{
+ XawTextBlock text;
+
+ text.firstPos = 0;
+ text.length = strlen(path);
+ text.ptr = path;
+ text.format = FMT8BIT;
+
+ XawTextReplace(selFileField, 0, strlen(SFtextBuffer), &text);
+ XawTextSetInsertionPoint(selFileField, strlen(SFtextBuffer));
+
+ return;
+}
+
static void
SFreplaceText(dir, str)
SFDir *dir;
SFhomeDir.beginSelection = -1 ;
SFhomeDir.endSelection = -1 ;
-#if defined(SVR4) || defined(SYSV) || defined(USG)
- qsort((char *) entries, (unsigned)i, sizeof(SFEntry), SFcompareEntries);
- qsort((char *) SFlogins, (unsigned)i, sizeof(SFLogin), SFcompareLogins);
-#else /* defined(SVR4) || defined(SYSV) || defined(USG) */
- qsort((char *) entries, i, sizeof(SFEntry), SFcompareEntries);
- qsort((char *) SFlogins, i, sizeof(SFLogin), SFcompareLogins);
-#endif /* defined(SVR4) || defined(SYSV) || defined(USG) */
+ qsort((char *) entries, (size_t)i, sizeof(SFEntry), SFcompareEntries);
+ qsort((char *) SFlogins, (size_t)i, sizeof(SFLogin), SFcompareLogins);
for (i--; i >= 0; i--) {
(void) strcat(entries[i].real, "/");
return;
}
-void
-SFsetText(path)
- char *path;
-{
- XawTextBlock text;
-
- text.firstPos = 0;
- text.length = strlen(path);
- text.ptr = path;
- text.format = FMT8BIT;
-
- XawTextReplace(selFileField, 0, strlen(SFtextBuffer), &text);
- XawTextSetInsertionPoint(selFileField, strlen(SFtextBuffer));
-
- return;
-}
-
/* ARGSUSED */
void
SFbuttonPressList(w, n, event)
dir,
dir->entries[dir->vOrigin + SFcurrentInvert[n]].shown
);
- SFmotionList(w, n, event);
+ SFmotionList(w, n, (XMotionEvent *) event);
}
}
return 0;
}
+/* Return a single character describing what kind of file STATBUF is. */
+
+char
+SFstatChar (statBuf)
+ struct stat *statBuf;
+{
+ if (S_ISDIR (statBuf->st_mode)) {
+ return '/';
+ } else if (S_ISREG (statBuf->st_mode)) {
+ return S_ISXXX (statBuf->st_mode) ? '*' : ' ';
+#ifdef S_ISSOCK
+ } else if (S_ISSOCK (statBuf->st_mode)) {
+ return '=';
+#endif /* S_ISSOCK */
+ } else {
+ return ' ';
+ }
+}
+
static int
SFcheckFiles(dir)
SFDir *dir;
SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
SFdirModTimer, (XtPointer) NULL);
}
-
-/* Return a single character describing what kind of file STATBUF is. */
-
-char
-SFstatChar (statBuf)
- struct stat *statBuf;
-{
- if (S_ISDIR (statBuf->st_mode)) {
- return '/';
- } else if (S_ISREG (statBuf->st_mode)) {
- return S_ISXXX (statBuf->st_mode) ? '*' : ' ';
-#ifdef S_ISSOCK
- } else if (S_ISSOCK (statBuf->st_mode)) {
- return '=';
-#endif /* S_ISSOCK */
- } else {
- return ' ';
- }
-}