patch-SelFile_c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. $OpenBSD: patch-SelFile_c,v 1.1 2002/04/26 01:44:08 espie Exp $
  2. --- SelFile.c.orig Sat Jul 24 04:29:12 1993
  3. +++ SelFile.c Fri Apr 26 02:40:34 2002
  4. @@ -46,7 +46,6 @@
  5. /* BSD 4.3 errno.h does not declare errno */
  6. extern int errno;
  7. extern int sys_nerr;
  8. -extern char *sys_errlist[];
  9. #include <sys/param.h>
  10. #include <X11/cursorfont.h>
  11. @@ -61,6 +60,7 @@ extern char *sys_errlist[];
  12. #include <X11/Xaw/Cardinals.h>
  13. #include "SFinternal.h"
  14. +#include "gv.h"
  15. #ifndef MAXPATHLEN
  16. #define MAXPATHLEN 1024
  17. @@ -127,6 +127,11 @@ char SFtextBuffer[MAXPATHLEN];
  18. XtIntervalId SFdirModTimerId;
  19. +void SFpositionWidget(Widget);
  20. +FILE *SFopenFile(char *, char *, char *, char *);
  21. +FILE *XsraSelFile(Widget, char *, char *, char *, char *, char *, char *,
  22. + int (*)(), char **);
  23. +
  24. int (*SFfunc)();
  25. static char *oneLineTextEditTranslations = "\
  26. @@ -146,7 +151,7 @@ SFexposeList(w, n, event, cont)
  27. return;
  28. }
  29. - SFdrawList(n, SF_DO_NOT_SCROLL);
  30. + SFdrawList(*((int *)n), SF_DO_NOT_SCROLL);
  31. }
  32. /* ARGSUSED */
  33. @@ -407,7 +412,10 @@ SFcreateWidgets(toplevel, prompt, ok, ca
  34. compositeWidgetClass, selFileForm, arglist, i);
  35. for (n = 0; n < 3; n++) {
  36. + int *box;
  37. + box = XtNew(int);
  38. + *box = n;
  39. i = 0;
  40. XtSetArg(arglist[i], XtNx, vScrollX); i++;
  41. XtSetArg(arglist[i], XtNy, vScrollY); i++;
  42. @@ -418,9 +426,9 @@ SFcreateWidgets(toplevel, prompt, ok, ca
  43. scrollbarWidgetClass, selFileLists[n], arglist, i);
  44. XtAddCallback(selFileVScrolls[n], XtNjumpProc,
  45. - SFvFloatSliderMovedCallback, (XtPointer) n);
  46. + SFvFloatSliderMovedCallback, (XtPointer) box);
  47. XtAddCallback(selFileVScrolls[n], XtNscrollProc,
  48. - SFvAreaSelectedCallback, (XtPointer) n);
  49. + SFvAreaSelectedCallback, (XtPointer) box);
  50. i = 0;
  51. @@ -435,9 +443,9 @@ SFcreateWidgets(toplevel, prompt, ok, ca
  52. scrollbarWidgetClass, selFileLists[n], arglist, i);
  53. XtAddCallback(selFileHScrolls[n], XtNjumpProc,
  54. - SFhSliderMovedCallback, (XtPointer) n);
  55. + SFhSliderMovedCallback, (XtPointer) box);
  56. XtAddCallback(selFileHScrolls[n], XtNscrollProc,
  57. - SFhAreaSelectedCallback, (XtPointer) n);
  58. + SFhAreaSelectedCallback, (XtPointer) box);
  59. }
  60. i = 0;
  61. @@ -495,18 +503,22 @@ SFcreateWidgets(toplevel, prompt, ok, ca
  62. XDefineCursor(SFdisplay, XtWindow(selFileCancel), dotCursor);
  63. for (n = 0; n < 3; n++) {
  64. + int *box;
  65. +
  66. + box = XtNew(int);
  67. + *box = n;
  68. XtAddEventHandler(selFileLists[n], ExposureMask, True,
  69. - SFexposeList, (XtPointer) n);
  70. + SFexposeList, (XtPointer) box);
  71. XtAddEventHandler(selFileLists[n], EnterWindowMask, False,
  72. - SFenterList, (XtPointer) n);
  73. + SFenterList, (XtPointer) box);
  74. XtAddEventHandler(selFileLists[n], LeaveWindowMask, False,
  75. - SFleaveList, (XtPointer) n);
  76. + SFleaveList, (XtPointer) box);
  77. XtAddEventHandler(selFileLists[n], PointerMotionMask, False,
  78. - SFmotionList, (XtPointer) n);
  79. + SFmotionList, (XtPointer) box);
  80. XtAddEventHandler(selFileLists[n], ButtonPressMask, False,
  81. - SFbuttonPressList, (XtPointer) n);
  82. + SFbuttonPressList, (XtPointer) box);
  83. XtAddEventHandler(selFileLists[n], ButtonReleaseMask, False,
  84. - SFbuttonReleaseList, (XtPointer) n);
  85. + SFbuttonReleaseList, (XtPointer) box);
  86. }
  87. XtAddEventHandler(selFileField, KeyPressMask, False,
  88. @@ -588,6 +600,7 @@ SFopenFile(name, mode, prompt, failed)
  89. return fp;
  90. }
  91. +void
  92. SFtextChanged()
  93. {
  94. @@ -617,7 +630,7 @@ SFgetText()
  95. SFtextBuffer);
  96. }
  97. -static
  98. +static void
  99. SFprepareToReturn()
  100. {
  101. SFstatus = SEL_FILE_NULL;