summaryrefslogtreecommitdiff
path: root/src/gui_at_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui_at_fs.c')
-rw-r--r--src/gui_at_fs.c276
1 files changed, 105 insertions, 171 deletions
diff --git a/src/gui_at_fs.c b/src/gui_at_fs.c
index 8c540fcd7..3c0c992cf 100644
--- a/src/gui_at_fs.c
+++ b/src/gui_at_fs.c
@@ -240,8 +240,7 @@ static int SFtwiddle = 0;
static int SFchdir(char *path);
static int
-SFchdir(path)
- char *path;
+SFchdir(char *path)
{
int result;
@@ -260,8 +259,7 @@ SFchdir(path)
static void SFfree(int i);
static void
-SFfree(i)
- int i;
+SFfree(int i)
{
SFDir *dir;
int j;
@@ -284,9 +282,7 @@ SFfree(i)
static void SFstrdup(char **s1, char *s2);
static void
-SFstrdup(s1, s2)
- char **s1;
- char *s2;
+SFstrdup(char **s1, char *s2)
{
*s1 = strcpy(XtMalloc((unsigned)(strlen(s2) + 1)), s2);
}
@@ -294,8 +290,7 @@ SFstrdup(s1, s2)
static void SFunreadableDir(SFDir *dir);
static void
-SFunreadableDir(dir)
- SFDir *dir;
+SFunreadableDir(SFDir *dir)
{
char *cannotOpen = _("<cannot open> ");
@@ -310,9 +305,7 @@ SFunreadableDir(dir)
static void SFreplaceText(SFDir *dir, char *str);
static void
-SFreplaceText(dir, str)
- SFDir *dir;
- char *str;
+SFreplaceText(SFDir *dir, char *str)
{
int len;
@@ -333,8 +326,7 @@ SFreplaceText(dir, str)
static void SFexpand(char *str);
static void
-SFexpand(str)
- char *str;
+SFexpand(char *str)
{
int len;
int cmp;
@@ -390,9 +382,7 @@ SFexpand(str)
static int SFfindFile(SFDir *dir, char *str);
static int
-SFfindFile(dir, str)
- SFDir *dir;
- char *str;
+SFfindFile(SFDir *dir, char *str)
{
int i, last, max;
char *name, save;
@@ -491,7 +481,7 @@ SFfindFile(dir, str)
static void SFunselect(void);
static void
-SFunselect()
+SFunselect(void)
{
SFDir *dir;
@@ -505,8 +495,7 @@ SFunselect()
static int SFcompareLogins(const void *p, const void *q);
static int
-SFcompareLogins(p, q)
- const void *p, *q;
+SFcompareLogins(const void *p, *q)
{
return strcmp(((SFLogin *)p)->name, ((SFLogin *)q)->name);
}
@@ -514,7 +503,7 @@ SFcompareLogins(p, q)
static void SFgetHomeDirs(void);
static void
-SFgetHomeDirs()
+SFgetHomeDirs(void)
{
struct passwd *pw;
int Alloc;
@@ -582,8 +571,7 @@ SFgetHomeDirs()
static int SFfindHomeDir(char *begin, char *end);
static int
-SFfindHomeDir(begin, end)
- char *begin, *end;
+SFfindHomeDir(char *begin, *end)
{
char save;
char *theRest;
@@ -613,7 +601,7 @@ SFfindHomeDir(begin, end)
}
static void
-SFupdatePath()
+SFupdatePath(void)
{
static int Alloc;
static int wasTwiddle = 0;
@@ -807,8 +795,7 @@ SFupdatePath()
#ifdef XtNinternational
static int
-WcsLen(p)
- wchar_t *p;
+WcsLen(wchar_t *p)
{
int i = 0;
while (*p++ != 0)
@@ -818,8 +805,7 @@ WcsLen(p)
#endif
static void
-SFsetText(path)
- char *path;
+SFsetText(char *path)
{
XawTextBlock text;
@@ -852,19 +838,19 @@ SFsetText(path)
}
static void
-SFbuttonPressList(w, n, event)
- Widget w UNUSED;
- int n UNUSED;
- XButtonPressedEvent *event UNUSED;
+SFbuttonPressList(
+ Widget w UNUSED,
+ int n UNUSED,
+ XButtonPressedEvent *event UNUSED)
{
SFbuttonPressed = 1;
}
static void
-SFbuttonReleaseList(w, n, event)
- Widget w;
- int n;
- XButtonReleasedEvent *event;
+SFbuttonReleaseList(
+ Widget w,
+ int n,
+ XButtonReleasedEvent *event)
{
SFDir *dir;
@@ -885,9 +871,7 @@ SFbuttonReleaseList(w, n, event)
static int SFcheckDir(int n, SFDir *dir);
static int
-SFcheckDir(n, dir)
- int n;
- SFDir *dir;
+SFcheckDir(int n, SFDir *dir)
{
struct stat statBuf;
int i;
@@ -951,8 +935,7 @@ SFcheckDir(n, dir)
static int SFcheckFiles(SFDir *dir);
static int
-SFcheckFiles(dir)
- SFDir *dir;
+SFcheckFiles(SFDir *dir)
{
int from, to;
int result;
@@ -988,9 +971,7 @@ SFcheckFiles(dir)
}
static void
-SFdirModTimer(cl, id)
- XtPointer cl UNUSED;
- XtIntervalId *id UNUSED;
+SFdirModTimer(XtPointer cl UNUSED, XtIntervalId *id UNUSED)
{
static int n = -1;
static int f = 0;
@@ -1036,8 +1017,7 @@ SFdirModTimer(cl, id)
/* Return a single character describing what kind of file STATBUF is. */
static char
-SFstatChar(statBuf)
- struct stat *statBuf;
+SFstatChar(struct stat *statBuf)
{
if (S_ISDIR (statBuf->st_mode))
return '/';
@@ -1100,7 +1080,7 @@ static XtIntervalId SFscrollTimerId;
static void SFinitFont(void);
static void
-SFinitFont()
+SFinitFont(void)
{
TextData *data;
#ifdef FEAT_XFONTSET
@@ -1151,7 +1131,7 @@ SFinitFont()
static void SFcreateGC(void);
static void
-SFcreateGC()
+SFcreateGC(void)
{
XGCValues gcValues;
XRectangle rectangles[1];
@@ -1209,9 +1189,7 @@ SFcreateGC()
}
static void
-SFclearList(n, doScroll)
- int n;
- int doScroll;
+SFclearList(int n, int doScroll)
{
SFDir *dir;
@@ -1286,9 +1264,7 @@ SFclearList(n, doScroll)
static void SFdeleteEntry(SFDir *dir, SFEntry *entry);
static void
-SFdeleteEntry(dir, entry)
- SFDir *dir;
- SFEntry *entry;
+SFdeleteEntry(SFDir *dir, SFEntry *entry)
{
SFEntry *e;
SFEntry *end;
@@ -1340,10 +1316,10 @@ SFdeleteEntry(dir, entry)
static void SFwriteStatChar(char *name, int last, struct stat *statBuf);
static void
-SFwriteStatChar(name, last, statBuf)
- char *name;
- int last;
- struct stat *statBuf;
+SFwriteStatChar(
+ char *name,
+ int last,
+ struct stat *statBuf)
{
name[last] = SFstatChar(statBuf);
}
@@ -1351,9 +1327,7 @@ SFwriteStatChar(name, last, statBuf)
static int SFstatAndCheck(SFDir *dir, SFEntry *entry);
static int
-SFstatAndCheck(dir, entry)
- SFDir *dir;
- SFEntry *entry;
+SFstatAndCheck(SFDir *dir, SFEntry *entry)
{
struct stat statBuf;
char save;
@@ -1414,11 +1388,11 @@ SFstatAndCheck(dir, entry)
static void
-SFdrawStrings(w, dir, from, to)
- Window w;
- SFDir *dir;
- int from;
- int to;
+SFdrawStrings(
+ Window w,
+ SFDir *dir,
+ int from,
+ int to)
{
int i;
SFEntry *entry;
@@ -1501,9 +1475,7 @@ SFdrawStrings(w, dir, from, to)
}
static void
-SFdrawList(n, doScroll)
- int n;
- int doScroll;
+SFdrawList(int n, int doScroll)
{
SFDir *dir;
Window w;
@@ -1539,8 +1511,7 @@ SFdrawList(n, doScroll)
}
static void
-SFdrawLists(doScroll)
- int doScroll;
+SFdrawLists(int doScroll)
{
int i;
@@ -1549,8 +1520,7 @@ SFdrawLists(doScroll)
}
static void
-SFinvertEntry(n)
- int n;
+SFinvertEntry(int n)
{
XFillRectangle(
SFdisplay,
@@ -1565,7 +1535,7 @@ SFinvertEntry(n)
static unsigned long SFscrollTimerInterval(void);
static unsigned long
-SFscrollTimerInterval()
+SFscrollTimerInterval(void)
{
static int maxVal = 200;
static int varyDist = 50;
@@ -1594,9 +1564,7 @@ SFscrollTimerInterval()
static void SFscrollTimer(XtPointer p, XtIntervalId *id);
static void
-SFscrollTimer(p, id)
- XtPointer p;
- XtIntervalId *id UNUSED;
+SFscrollTimer(XtPointer p, XtIntervalId *id UNUSED)
{
SFDir *dir;
int save;
@@ -1646,9 +1614,7 @@ SFscrollTimer(p, id)
}
static int
-SFnewInvertEntry(n, event)
- int n;
- XMotionEvent *event;
+SFnewInvertEntry(int n, XMotionEvent *event)
{
int x, y;
int nw;
@@ -1693,10 +1659,7 @@ SFnewInvertEntry(n, event)
}
static void
-SFenterList(w, n, event)
- Widget w UNUSED;
- int n;
- XEnterWindowEvent *event;
+SFenterList(Widget w UNUSED, int n, XEnterWindowEvent *event)
{
int nw;
@@ -1716,10 +1679,7 @@ SFenterList(w, n, event)
}
static void
-SFleaveList(w, n, event)
- Widget w UNUSED;
- int n;
- XEvent *event UNUSED;
+SFleaveList(Widget w UNUSED, int n, XEvent *event UNUSED)
{
if (SFcurrentInvert[n] != -1)
{
@@ -1729,10 +1689,7 @@ SFleaveList(w, n, event)
}
static void
-SFmotionList(w, n, event)
- Widget w UNUSED;
- int n;
- XMotionEvent *event;
+SFmotionList(Widget w UNUSED, int n, XMotionEvent *event)
{
int nw;
@@ -1749,10 +1706,7 @@ SFmotionList(w, n, event)
}
static void
-SFvFloatSliderMovedCallback(w, n, fnew)
- Widget w;
- XtPointer n;
- XtPointer fnew;
+SFvFloatSliderMovedCallback(Widget w, XtPointer n, XtPointer fnew)
{
int nw;
@@ -1761,10 +1715,7 @@ SFvFloatSliderMovedCallback(w, n, fnew)
}
static void
-SFvSliderMovedCallback(w, n, nw)
- Widget w UNUSED;
- int n;
- int nw;
+SFvSliderMovedCallback(Widget w UNUSED, int n, int nw)
{
int old;
Window win;
@@ -1846,10 +1797,7 @@ SFvSliderMovedCallback(w, n, nw)
}
static void
-SFvAreaSelectedCallback(w, n, pnew)
- Widget w;
- XtPointer n;
- XtPointer pnew;
+SFvAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew)
{
SFDir *dir;
int nw = (int)(long)pnew;
@@ -1906,10 +1854,7 @@ SFvAreaSelectedCallback(w, n, pnew)
}
static void
-SFhSliderMovedCallback(w, n, nw)
- Widget w UNUSED;
- XtPointer n;
- XtPointer nw;
+SFhSliderMovedCallback(Widget w UNUSED, XtPointer n, XtPointer nw)
{
SFDir *dir;
int save;
@@ -1924,10 +1869,7 @@ SFhSliderMovedCallback(w, n, nw)
}
static void
-SFhAreaSelectedCallback(w, n, pnew)
- Widget w;
- XtPointer n;
- XtPointer pnew;
+SFhAreaSelectedCallback(Widget w, XtPointer n, XtPointer pnew)
{
SFDir *dir;
int nw = (int)(long)pnew;
@@ -1984,10 +1926,10 @@ SFhAreaSelectedCallback(w, n, pnew)
}
static void
-SFpathSliderMovedCallback(w, client_data, nw)
- Widget w UNUSED;
- XtPointer client_data UNUSED;
- XtPointer nw;
+SFpathSliderMovedCallback(
+ Widget w UNUSED,
+ XtPointer client_data UNUSED,
+ XtPointer nw)
{
SFDir *dir;
int n;
@@ -2020,10 +1962,10 @@ SFpathSliderMovedCallback(w, client_data, nw)
}
static void
-SFpathAreaSelectedCallback(w, client_data, pnew)
- Widget w;
- XtPointer client_data UNUSED;
- XtPointer pnew;
+SFpathAreaSelectedCallback(
+ Widget w,
+ XtPointer client_data UNUSED,
+ XtPointer pnew)
{
int nw = (int)(long)pnew;
float f;
@@ -2071,7 +2013,7 @@ SFpathAreaSelectedCallback(w, client_data, pnew)
}
static Boolean
-SFworkProc()
+SFworkProc(void)
{
SFDir *dir;
SFEntry *entry;
@@ -2100,16 +2042,14 @@ SFworkProc()
/***************** Dir.c */
static int
-SFcompareEntries(p, q)
- const void *p;
- const void *q;
+SFcompareEntries(const void *p, const void *q)
{
- return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real);
+ return strcmp(((SFEntry *)p)->real, ((SFEntry *)q)->real);
}
static int
-SFgetDir(dir)
- SFDir *dir;
+SFgetDir(
+ SFDir *dir)
{
SFEntry *result = NULL;
int Alloc = 0;
@@ -2194,11 +2134,11 @@ static char *oneLineTextEditTranslations = "\
static void SFexposeList(Widget w, XtPointer n, XEvent *event, Boolean *cont);
static void
-SFexposeList(w, n, event, cont)
- Widget w UNUSED;
- XtPointer n;
- XEvent *event;
- Boolean *cont UNUSED;
+SFexposeList(
+ Widget w UNUSED,
+ XtPointer n,
+ XEvent *event,
+ Boolean *cont UNUSED)
{
if ((event->type == NoExpose) || event->xexpose.count)
return;
@@ -2209,11 +2149,11 @@ SFexposeList(w, n, event, cont)
static void SFmodVerifyCallback(Widget w, XtPointer client_data, XEvent *event, Boolean *cont);
static void
-SFmodVerifyCallback(w, client_data, event, cont)
- Widget w UNUSED;
- XtPointer client_data UNUSED;
- XEvent *event;
- Boolean *cont UNUSED;
+SFmodVerifyCallback(
+ Widget w UNUSED,
+ XtPointer client_data UNUSED,
+ XEvent *event,
+ Boolean *cont UNUSED)
{
char buf[2];
@@ -2227,10 +2167,7 @@ SFmodVerifyCallback(w, client_data, event, cont)
static void SFokCallback(Widget w, XtPointer cl, XtPointer cd);
static void
-SFokCallback(w, cl, cd)
- Widget w UNUSED;
- XtPointer cl UNUSED;
- XtPointer cd UNUSED;
+SFokCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED)
{
SFstatus = SEL_FILE_OK;
}
@@ -2244,10 +2181,7 @@ static XtCallbackRec SFokSelect[] =
static void SFcancelCallback(Widget w, XtPointer cl, XtPointer cd);
static void
-SFcancelCallback(w, cl, cd)
- Widget w UNUSED;
- XtPointer cl UNUSED;
- XtPointer cd UNUSED;
+SFcancelCallback(Widget w UNUSED, XtPointer cl UNUSED, XtPointer cd UNUSED)
{
SFstatus = SEL_FILE_CANCEL;
}
@@ -2261,11 +2195,11 @@ static XtCallbackRec SFcancelSelect[] =
static void SFdismissAction(Widget w, XEvent *event, String *params, Cardinal *num_params);
static void
-SFdismissAction(w, event, params, num_params)
- Widget w UNUSED;
- XEvent *event;
- String *params UNUSED;
- Cardinal *num_params UNUSED;
+SFdismissAction(
+ Widget w UNUSED,
+ XEvent *event,
+ String *params UNUSED,
+ Cardinal *num_params UNUSED)
{
if (event->type == ClientMessage
&& (Atom)event->xclient.data.l[0] != SFwmDeleteWindow)
@@ -2284,11 +2218,11 @@ static XtActionsRec actions[] =
};
static void
-SFsetColors(bg, fg, scroll_bg, scroll_fg)
- guicolor_T bg;
- guicolor_T fg;
- guicolor_T scroll_bg;
- guicolor_T scroll_fg;
+SFsetColors(
+ guicolor_T bg,
+ guicolor_T fg,
+ guicolor_T scroll_bg,
+ guicolor_T scroll_fg)
{
if (selFileForm)
{
@@ -2366,11 +2300,11 @@ SFsetColors(bg, fg, scroll_bg, scroll_fg)
}
static void
-SFcreateWidgets(toplevel, prompt, ok, cancel)
- Widget toplevel;
- char *prompt;
- char *ok;
- char *cancel;
+SFcreateWidgets(
+ Widget toplevel,
+ char *prompt,
+ char *ok,
+ char *cancel)
{
Cardinal n;
int listWidth, listHeight;
@@ -2686,7 +2620,7 @@ SFcreateWidgets(toplevel, prompt, ok, cancel)
}
static void
-SFtextChanged()
+SFtextChanged(void)
{
#if defined(FEAT_XFONTSET) && defined(XtNinternational)
if ((unsigned long)_XawTextFormat((TextWidget)selFileField) == XawFmtWide)
@@ -2730,7 +2664,7 @@ SFtextChanged()
}
static char *
-SFgetText()
+SFgetText(void)
{
#if defined(FEAT_XFONTSET) && defined(XtNinternational)
char *buf;
@@ -2756,7 +2690,7 @@ SFgetText()
}
static void
-SFprepareToReturn()
+SFprepareToReturn(void)
{
SFstatus = SEL_FILE_NULL;
XtRemoveGrab(selFile);
@@ -2770,14 +2704,14 @@ SFprepareToReturn()
}
char *
-vim_SelFile(toplevel, prompt, init_path, show_entry, x, y, fg, bg, scroll_fg, scroll_bg)
- Widget toplevel;
- char *prompt;
- char *init_path;
- int (*show_entry)();
- int x, y;
- guicolor_T fg, bg;
- guicolor_T scroll_fg, scroll_bg; /* The "Scrollbar" group colors */
+vim_SelFile(
+ Widget toplevel,
+ char *prompt,
+ char *init_path,
+ int (*show_entry)(),
+ int x, y,
+ guicolor_T fg, bg,
+ guicolor_T scroll_fg, scroll_bg) /* The "Scrollbar" group colors */
{
static int firstTime = 1;
XEvent event;