home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume4 / xdir / patch1 < prev    next >
Encoding:
Text File  |  1989-08-30  |  22.0 KB  |  1,007 lines

  1. Path: uunet!island!argv
  2. From: argv@island.uu.net (Dan Heller)
  3. Newsgroups: comp.sources.x
  4. Subject: v04i097: xdir, Patch1
  5. Message-ID: <1036@island.uu.net>
  6. Date: 31 Aug 89 06:30:09 GMT
  7. Organization: Island Graphics, Marin County, California
  8. Lines: 996
  9. Approved: island!argv@sun.com
  10.  
  11. Submitted-by: Erik M. van der Poel <erik@sra.junet>
  12. Posting-number: Volume 4, Issue 97
  13. Archive-name: xdir/patch1
  14.  
  15. Patch-To: xdir/part01; Volume 4, Issue 14
  16. Patch-To: xdir/part02; Volume 4, Issue 15
  17.  
  18. This is the first set of patches for the SelFile directory browser package
  19. (otherwise known as xdir).
  20.  
  21.     * The wrong files were highlighted when show_entry was used. This bug
  22.       has been fixed.
  23.  
  24.     * The cpp symbol USG has been added. SYSV is used for System V Release
  25.       2, and USG for SVR3, in line with Jim Fulton's recently posted rules
  26.       for contrib software.
  27.  
  28.     * Support for System V's getcwd() has been added.
  29.  
  30.     * MAXPATHLEN has been defined for systems that do not have it.
  31.  
  32.     * A patchlevel.h file has been added. The initial patch level is one.
  33.  
  34.     * A Makefile has been added. How many of you gave up trying to compile
  35.       SelFile when you noticed that there was an Imakefile, but no
  36.       Makefile?
  37.  
  38.     * Support for the R2 version of the Xt Intrinsics has been added. See
  39.       the Imakefile.
  40.  
  41.  
  42. Many thanks to the following individuals for bug reports, etc.:
  43.  
  44.     Jordan K. Hubbard
  45.     T. S. Wong
  46.     Ken Chin-Purcell
  47.     Richard Neitzel
  48.     Ian Darwin
  49.     Steve Lodin
  50.     Pramath (sinha)
  51.     Scott E. Garfinkle
  52.     Peter Lim
  53.     Gary Bushey
  54.     T. Scott Pyne
  55.  
  56.  
  57. By the way, has anyone made any useful modifications to SelFile, such as
  58. Widgetizing it so that it can be embedded within an application window?
  59.  
  60. --
  61. Erik M. van der Poel                  erik@sra.co.jp             (Japan)
  62. SRA, 1-1-1 Hirakawa-cho, Chiyoda-ku   erik%sra.co.jp@uunet.uu.net  (USA)
  63. Tokyo 102 Japan. TEL +81-3-234-2692   erik%sra.co.jp@mcvax.uucp (Europe)
  64.  
  65.  
  66. *** ../old/Dir.c    Wed Aug 30 16:23:22 1989
  67. --- Dir.c    Wed Aug 30 15:57:37 1989
  68. ***************
  69. *** 1,5 ****
  70.   #ifndef lint
  71. ! static char rcsid[] = "$Header: Dir.c,v 1.3 89/05/29 15:03:50 erik Exp $";
  72.   #endif
  73.   
  74.   /*
  75. --- 1,5 ----
  76.   #ifndef lint
  77. ! static char rcsid[] = "$Header: Dir.c,v 1.4 89/08/30 15:56:15 erik Exp $";
  78.   #endif
  79.   
  80.   /*
  81. ***************
  82. *** 25,30 ****
  83. --- 25,31 ----
  84.    *
  85.    * Author: Erik M. van der Poel
  86.    *         Software Research Associates, Inc., Tokyo, Japan
  87. +  *         erik@sra.co.jp
  88.    */
  89.   
  90.   #include <stdio.h>
  91. ***************
  92. *** 35,51 ****
  93.   
  94.   #include "SFinternal.h"
  95.   
  96. ! #ifdef SYSV
  97.   #include <dirent.h>
  98. ! #else /* def SYSV */
  99.   #include <sys/dir.h>
  100. ! #endif /* def SYSV */
  101.   
  102.   #include <sys/stat.h>
  103.   
  104. ! #ifdef SYSV
  105.   extern void qsort();
  106. ! #endif /* def SYSV */
  107.   
  108.   #ifdef SEL_FILE_IGNORE_CASE
  109.   int
  110. --- 36,53 ----
  111.   
  112.   #include "SFinternal.h"
  113.   
  114. ! #if defined(SYSV) || defined(USG)
  115.   #include <dirent.h>
  116. ! #else /* defined(SYSV) || defined(USG) */
  117.   #include <sys/dir.h>
  118. ! #define dirent direct
  119. ! #endif /* defined(SYSV) || defined(USG) */
  120.   
  121.   #include <sys/stat.h>
  122.   
  123. ! #if defined(SYSV) || defined(USG)
  124.   extern void qsort();
  125. ! #endif /* defined(SYSV) || defined(USG) */
  126.   
  127.   #ifdef SEL_FILE_IGNORE_CASE
  128.   int
  129. ***************
  130. *** 102,114 ****
  131.       int        alloc = 0;
  132.       int        i;
  133.       DIR        *dirp;
  134. - #ifdef SYSV
  135.       struct dirent    *dp;
  136. - #else /* def SYSV */
  137. -     struct direct    *dp;
  138. - #endif /* def SYSV */
  139.       char        *str;
  140.       int        len;
  141.       int        maxChars;
  142. --- 104,110 ----
  143. ***************
  144. *** 155,165 ****
  145.           i++;
  146.       }
  147.   
  148. ! #ifdef SYSV
  149.       qsort((char *) result, (unsigned) i, sizeof(SFEntry), SFcompareEntries);
  150. ! #else /* def SYSV */
  151.       qsort((char *) result, i, sizeof(SFEntry), SFcompareEntries);
  152. ! #endif /* def SYSV */
  153.   
  154.       dir->entries = result;
  155.       dir->nEntries = i;
  156. --- 151,161 ----
  157.           i++;
  158.       }
  159.   
  160. ! #if defined(SYSV) || defined(USG)
  161.       qsort((char *) result, (unsigned) i, sizeof(SFEntry), SFcompareEntries);
  162. ! #else /* defined(SYSV) || defined(USG) */
  163.       qsort((char *) result, i, sizeof(SFEntry), SFcompareEntries);
  164. ! #endif /* defined(SYSV) || defined(USG) */
  165.   
  166.       dir->entries = result;
  167.       dir->nEntries = i;
  168. *** ../old/Draw.c    Wed Aug 30 16:23:26 1989
  169. --- Draw.c    Wed Aug 30 15:58:13 1989
  170. ***************
  171. *** 1,5 ****
  172.   #ifndef lint
  173. ! static char rcsid[] = "$Header: Draw.c,v 1.6 89/05/29 15:04:26 erik Exp $";
  174.   #endif
  175.   
  176.   /*
  177. --- 1,5 ----
  178.   #ifndef lint
  179. ! static char rcsid[] = "$Header: Draw.c,v 1.10 89/08/30 15:58:01 erik Exp $";
  180.   #endif
  181.   
  182.   /*
  183. ***************
  184. *** 25,30 ****
  185. --- 25,31 ----
  186.    *
  187.    * Author: Erik M. van der Poel
  188.    *         Software Research Associates, Inc., Tokyo, Japan
  189. +  *         erik@sra.co.jp
  190.    */
  191.   
  192.   #include <stdio.h>
  193. ***************
  194. *** 81,87 ****
  195. --- 82,98 ----
  196.   
  197.               (void) sprintf(sbuf, "XsraSelFile: can't get font %s",
  198.                   SF_DEFAULT_FONT);
  199. + #ifdef SEL_FILE_R2_XT
  200. +             XtError(sbuf);
  201. + #else /* def SEL_FILE_R2_XT */
  202.               XtAppError(SFapp, sbuf);
  203. + #endif /* def SEL_FILE_R2_XT */
  204.           }
  205.       }
  206.   
  207. ***************
  208. *** 246,251 ****
  209. --- 257,263 ----
  210.       register SFEntry    *e;
  211.       register SFEntry    *end;
  212.       int            n;
  213. +     int            idx;
  214.   
  215.   #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR)
  216.   
  217. ***************
  218. *** 254,259 ****
  219. --- 266,287 ----
  220.   
  221.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  222.   
  223. +     idx = entry - dir->entries;
  224. +     if (idx < dir->beginSelection) {
  225. +         dir->beginSelection--;
  226. +     }
  227. +     if (idx <= dir->endSelection) {
  228. +         dir->endSelection--;
  229. +     }
  230. +     if (dir->beginSelection > dir->endSelection) {
  231. +         dir->beginSelection = dir->endSelection = -1;
  232. +     }
  233. +     if (idx < dir->vOrigin) {
  234. +         dir->vOrigin--;
  235. +     }
  236.       XtFree(entry->real);
  237.   
  238.       end = &(dir->entries[dir->nEntries - 1]);
  239. ***************
  240. *** 275,280 ****
  241. --- 303,309 ----
  242.       XtSetArg(arglist[i], XtNsliderMax, dir->nEntries);        i++;
  243.       XtSetArg(arglist[i], XtNsliderExtent, dir->nEntries < SFlistSize ?
  244.           dir->nEntries : SFlistSize);                i++;
  245. +     XtSetArg(arglist[i], XtNsliderOrigin, dir->vOrigin);        i++;
  246.       XtSetValues(selFileVScrolls[n], arglist, i);
  247.   
  248.   #else /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  249. ***************
  250. *** 580,586 ****
  251. --- 609,625 ----
  252.       }
  253.   
  254.       if (SFbuttonPressed) {
  255. + #ifdef SEL_FILE_R2_XT
  256. +         SFscrollTimerId = XtAddTimeOut(
  257. + #else /* def SEL_FILE_R2_XT */
  258.           SFscrollTimerId = XtAppAddTimeOut(SFapp,
  259. + #endif /* def SEL_FILE_R2_XT */
  260.               SFscrollTimerInterval(), SFscrollTimer, (caddr_t) n);
  261.       }
  262.   }
  263. ***************
  264. *** 620,626 ****
  265. --- 659,675 ----
  266.               SFcurrentListY = y;
  267.               if (!SFscrollTimerAdded) {
  268.                   SFscrollTimerAdded = 1;
  269. + #ifdef SEL_FILE_R2_XT
  270. +                 SFscrollTimerId = XtAddTimeOut(
  271. + #else /* def SEL_FILE_R2_XT */
  272.                   SFscrollTimerId = XtAppAddTimeOut(SFapp,
  273. + #endif /* def SEL_FILE_R2_XT */
  274.                       SFscrollTimerInterval(), SFscrollTimer,
  275.                       (caddr_t) n);
  276.               }
  277. ***************
  278. *** 1073,1078 ****
  279. --- 1122,1129 ----
  280.   
  281.   }
  282.   
  283. + #ifndef SEL_FILE_R2_XT
  284.   Boolean
  285.   SFworkProc()
  286.   {
  287. ***************
  288. *** 1096,1098 ****
  289. --- 1147,1151 ----
  290.   
  291.       return True;
  292.   }
  293. + #endif /* ndef SEL_FILE_R2_XT */
  294. *** ../old/FILES    Wed Aug 30 16:23:29 1989
  295. --- FILES    Fri Jul 21 16:37:46 1989
  296. ***************
  297. *** 2,7 ****
  298. --- 2,8 ----
  299.   Draw.c
  300.   FILES
  301.   Imakefile
  302. + Makefile
  303.   Path.c
  304.   README
  305.   SFinternal.h
  306. ***************
  307. *** 9,12 ****
  308. --- 10,14 ----
  309.   SelFile.man
  310.   TODO
  311.   callback.c
  312. + patchlevel.h
  313.   xdir.c
  314. *** ../old/Imakefile    Wed Aug 30 16:23:29 1989
  315. --- Imakefile    Wed Aug 30 16:44:18 1989
  316. ***************
  317. *** 15,20 ****
  318. --- 15,36 ----
  319.   #
  320.   # -DSEL_FILE_XW
  321.   #
  322. + # Normally, the program should be linked with the R3 or a later version of the
  323. + # Xt Intrinsics, but it can be linked with the R2 Xt by defining the following:
  324. + #
  325. + # -DSEL_FILE_R2_XT
  326. + #
  327. + # System V Release 2 users will need something like Doug Gwyn's directory
  328. + # package (posted to comp.sources.unix), and will need to define the following:
  329. + #
  330. + # -DSYSV
  331. + #
  332. + # System V Release 3 users will need to define the following:
  333. + #
  334. + # -DUSG
  335. + #
  336. + #------------------------------------------------------------------------------
  337. + #
  338.   #        DEFINES = -DSEL_FILE_XW
  339.   
  340.              SRCS = xdir.c SelFile.c Dir.c Path.c Draw.c
  341. *** ../old/Makefile    Wed Aug 30 16:26:02 1989
  342. --- Makefile    Wed May 24 13:52:22 1989
  343. ***************
  344. *** 0 ****
  345. --- 1,18 ----
  346. + CC = gcc
  347. + CC = cc
  348. + CFLAGS = -O -DSEL_FILE_XW
  349. + CFLAGS = -O
  350. + SRCS = SelFile.c Dir.c Path.c Draw.c
  351. + OBJS = SelFile.o Dir.o Path.o Draw.o
  352. + xdir:            xdir.o $(OBJS)
  353. + #    $(CC) $(CFLAGS) xdir.o $(OBJS) -lXw -lXt -lX11 -o $@
  354. +     $(CC) $(CFLAGS) xdir.o $(OBJS) -lXaw -lXmu -lXt -lX11 -o $@
  355. + lint:
  356. +     lint -auxz $(CFLAGS) xdir.c $(SRCS)
  357. + clean:
  358. +     rm -f xdir *.o core a.out
  359. *** ../old/Path.c    Wed Aug 30 16:23:31 1989
  360. --- Path.c    Wed Aug 30 15:59:24 1989
  361. ***************
  362. *** 1,5 ****
  363.   #ifndef lint
  364. ! static char rcsid[] = "$Header: Path.c,v 1.5 89/05/29 15:05:30 erik Exp $";
  365.   #endif
  366.   
  367.   /*
  368. --- 1,5 ----
  369.   #ifndef lint
  370. ! static char rcsid[] = "$Header: Path.c,v 1.9 89/08/30 15:58:47 erik Exp $";
  371.   #endif
  372.   
  373.   /*
  374. ***************
  375. *** 25,30 ****
  376. --- 25,31 ----
  377.    *
  378.    * Author: Erik M. van der Poel
  379.    *         Software Research Associates, Inc., Tokyo, Japan
  380. +  *         erik@sra.co.jp
  381.    */
  382.   
  383.   #include <stdio.h>
  384. ***************
  385. *** 44,53 ****
  386.   #include <X11/Scroll.h>
  387.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  388.   
  389. ! #ifdef SYSV
  390.   extern unsigned short getuid();
  391.   extern void qsort();
  392. ! #endif /* def SYSV */
  393.   
  394.   typedef struct {
  395.       char    *name;
  396. --- 45,54 ----
  397.   #include <X11/Scroll.h>
  398.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  399.   
  400. ! #if defined(SYSV) || defined(USG)
  401.   extern unsigned short getuid();
  402.   extern void qsort();
  403. ! #endif /* defined(SYSV) || defined(USG) */
  404.   
  405.   typedef struct {
  406.       char    *name;
  407. ***************
  408. *** 463,475 ****
  409.       SFhomeDir.beginSelection    = -1        ;
  410.       SFhomeDir.endSelection        = -1        ;
  411.   
  412. ! #ifdef SYSV
  413.       qsort((char *) entries, (unsigned)i, sizeof(SFEntry), SFcompareEntries);
  414.       qsort((char *) SFlogins, (unsigned)i, sizeof(SFLogin), SFcompareLogins);
  415. ! #else /* def SYSV */
  416.       qsort((char *) entries, i, sizeof(SFEntry), SFcompareEntries);
  417.       qsort((char *) SFlogins, i, sizeof(SFLogin), SFcompareLogins);
  418. ! #endif /* def SYSV */
  419.   
  420.       for (i--; i >= 0; i--) {
  421.           (void) strcat(entries[i].real, "/");
  422. --- 464,476 ----
  423.       SFhomeDir.beginSelection    = -1        ;
  424.       SFhomeDir.endSelection        = -1        ;
  425.   
  426. ! #if defined(SYSV) || defined(USG)
  427.       qsort((char *) entries, (unsigned)i, sizeof(SFEntry), SFcompareEntries);
  428.       qsort((char *) SFlogins, (unsigned)i, sizeof(SFLogin), SFcompareLogins);
  429. ! #else /* defined(SYSV) || defined(USG) */
  430.       qsort((char *) entries, i, sizeof(SFEntry), SFcompareEntries);
  431.       qsort((char *) SFlogins, i, sizeof(SFLogin), SFcompareLogins);
  432. ! #endif /* defined(SYSV) || defined(USG) */
  433.   
  434.       for (i--; i >= 0; i--) {
  435.           (void) strcat(entries[i].real, "/");
  436. ***************
  437. *** 720,732 ****
  438.       static int    alloc = 0;
  439.       int        len;
  440.   
  441. !     len = convEUCtoWS((unsigned char *) path, (wchar_t *) NULL);
  442.       while (len + 1 > alloc) {
  443.           alloc = 2 * (alloc + 1);
  444.           wstr = (wchar_t *) XtRealloc((char *) wstr, (unsigned) (alloc *
  445.               sizeof(wchar_t)));
  446.       }
  447. !     (void) convEUCtoWS((unsigned char *) path, wstr);
  448.   
  449.       XwTextClearBuffer(selFileField);
  450.       XwTextInsert(selFileField, wstr);
  451. --- 721,733 ----
  452.       static int    alloc = 0;
  453.       int        len;
  454.   
  455. !     len = convEUCtoJWS((unsigned char *) path, (wchar_t *) NULL);
  456.       while (len + 1 > alloc) {
  457.           alloc = 2 * (alloc + 1);
  458.           wstr = (wchar_t *) XtRealloc((char *) wstr, (unsigned) (alloc *
  459.               sizeof(wchar_t)));
  460.       }
  461. !     (void) convEUCtoJWS((unsigned char *) path, wstr);
  462.   
  463.       XwTextClearBuffer(selFileField);
  464.       XwTextInsert(selFileField, wstr);
  465. ***************
  466. *** 846,851 ****
  467. --- 847,862 ----
  468.           } else {
  469.               (void) SFfindFile(dir, dir->path);
  470.           }
  471. + #ifndef SEL_FILE_R2_XT
  472. +         if (!SFworkProcAdded) {
  473. +             (void) XtAppAddWorkProc(SFapp, SFworkProc, NULL);
  474. +             SFworkProcAdded = 1;
  475. +         }
  476. + #endif /* ndef SEL_FILE_R2_XT */
  477.           return 1;
  478.       }
  479.   
  480. ***************
  481. *** 951,956 ****
  482. --- 962,976 ----
  483.           }
  484.       }
  485.   
  486. + #ifdef SEL_FILE_R2_XT
  487. +     SFdirModTimerId = XtAddTimeOut((unsigned long) 1000,
  488. + #else /* def SEL_FILE_R2_XT */
  489.       SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
  490. + #endif /* def SEL_FILE_R2_XT */
  491.           SFdirModTimer, (caddr_t) NULL);
  492.   }
  493. *** ../old/README    Wed Aug 30 16:23:11 1989
  494. --- README    Fri Jul 21 16:39:22 1989
  495. ***************
  496. *** 32,39 ****
  497.   * Xaw and/or Xw widgets
  498.   
  499.       SelFile can be linked with Xaw (Athena) and/or Xw (Hewlett-Packard)
  500. !     widgets. However, it must be linked with the R3 or a later version of the
  501. !     Xt Intrinsics. See the Imakefile for details.
  502.   
  503.   * automatic display update after directory modification
  504.   
  505. --- 32,40 ----
  506.   * Xaw and/or Xw widgets
  507.   
  508.       SelFile can be linked with Xaw (Athena) and/or Xw (Hewlett-Packard)
  509. !     widgets. Normally, SelFile is linked with the R3 or a later version of the
  510. !     Xt Intrinsics, but it can be linked with the R2 Xt. See the Imakefile for
  511. !     details.
  512.   
  513.   * automatic display update after directory modification
  514.   
  515. *** ../old/SFinternal.h    Wed Aug 30 16:23:12 1989
  516. --- SFinternal.h    Wed Aug 30 15:59:54 1989
  517. ***************
  518. *** 1,4 ****
  519. ! /* $Header: SFinternal.h,v 1.3 89/04/26 17:48:34 erik Exp $ */
  520.   
  521.   /*
  522.    * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
  523. --- 1,4 ----
  524. ! /* $Header: SFinternal.h,v 1.6 89/08/30 15:59:46 erik Exp $ */
  525.   
  526.   /*
  527.    * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
  528. ***************
  529. *** 23,31 ****
  530. --- 23,33 ----
  531.    *
  532.    * Author: Erik M. van der Poel
  533.    *         Software Research Associates, Inc., Tokyo, Japan
  534. +  *         erik@sra.co.jp
  535.    */
  536.   
  537.   #include <X11/Intrinsic.h>
  538. + #include <X11/Xos.h>
  539.   
  540.   #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT)
  541.   #include <Xw/Xw.h>
  542. ***************
  543. *** 129,139 ****
  544. --- 131,145 ----
  545.   
  546.   extern int SFcurrentInvert[];
  547.   
  548. + #ifndef SEL_FILE_R2_XT
  549.   extern int SFworkProcAdded;
  550.   
  551.   extern Boolean SFworkProc();
  552.   
  553.   extern XtAppContext SFapp;
  554. + #endif /* ndef SEL_FILE_R2_XT */
  555.   
  556.   extern int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth;
  557.   
  558. *** ../old/SelFile.c    Wed Aug 30 16:23:15 1989
  559. --- SelFile.c    Wed Aug 30 16:01:26 1989
  560. ***************
  561. *** 1,5 ****
  562.   #ifndef lint
  563. ! static char rcsid[] = "$Header: SelFile.c,v 1.7 89/05/30 14:49:17 erik Exp $";
  564.   #endif
  565.   
  566.   /*
  567. --- 1,5 ----
  568.   #ifndef lint
  569. ! static char rcsid[] = "$Header: SelFile.c,v 1.12 89/08/30 16:00:17 erik Exp $";
  570.   #endif
  571.   
  572.   /*
  573. ***************
  574. *** 25,30 ****
  575. --- 25,31 ----
  576.    *
  577.    * Author: Erik M. van der Poel
  578.    *         Software Research Associates, Inc., Tokyo, Japan
  579. +  *         erik@sra.co.jp
  580.    */
  581.   
  582.   /*
  583. ***************
  584. *** 88,96 ****
  585.   #endif /* def SEL_FILE_JAPANESE */
  586.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  587.   
  588. ! #ifndef SYSV
  589.   extern char *getwd();
  590. ! #endif /* ndef SYSV */
  591.   
  592.   int SFstatus = SEL_FILE_NULL;
  593.   
  594. --- 89,101 ----
  595.   #endif /* def SEL_FILE_JAPANESE */
  596.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  597.   
  598. ! #ifndef MAXPATHLEN
  599. ! #define MAXPATHLEN 1024
  600. ! #endif /* ndef MAXPATHLEN */
  601. ! #if !defined(SYSV) && !defined(USG)
  602.   extern char *getwd();
  603. ! #endif /* !defined(SYSV) && !defined(USG) */
  604.   
  605.   int SFstatus = SEL_FILE_NULL;
  606.   
  607. ***************
  608. *** 141,150 ****
  609. --- 146,159 ----
  610.   
  611.   int SFlistSize = 10;
  612.   
  613. + #ifndef SEL_FILE_R2_XT
  614.   int SFworkProcAdded = 0;
  615.   
  616.   XtAppContext SFapp;
  617.   
  618. + #endif /* ndef SEL_FILE_R2_XT */
  619.   int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth;
  620.   
  621.   #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT)
  622. ***************
  623. *** 272,278 ****
  624. --- 281,303 ----
  625.   };
  626.   
  627.   #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT)
  628. + #ifdef SEL_FILE_R2_XT
  629.   typedef struct {
  630. +     int    height;
  631. + } SFfieldData, *sfFieldPtr;
  632. + static XtResource SFfieldResources[] = {
  633. +     {
  634. +         XtNheight, XtCHeight, XtRInt, sizeof(int),
  635. +         XtOffset(sfFieldPtr, height), XtRString, "1"
  636. +     },
  637. + };
  638. + #else /* def SEL_FILE_R2_XT */
  639. + typedef struct {
  640.       Dimension    height;
  641.   } SFfieldData, *sfFieldPtr;
  642.   
  643. ***************
  644. *** 282,287 ****
  645. --- 307,315 ----
  646.           XtOffset(sfFieldPtr, height), XtRString, "1"
  647.       },
  648.   };
  649. + #endif /* def SEL_FILE_R2_XT */
  650.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  651.   
  652.   static int
  653. ***************
  654. *** 321,329 ****
  655. --- 349,367 ----
  656.   
  657.       i = 0;
  658.       XtSetArg(arglist[i], XtNallowShellResize, True);        i++;
  659. + #ifdef SEL_FILE_R2_XT
  660. +     selFile = XtCreateApplicationShell("selFile",
  661. +         applicationShellWidgetClass, arglist, i);
  662. + #else /* def SEL_FILE_R2_XT */
  663.       selFile = XtAppCreateShell("selFile", "SelFile",
  664.           applicationShellWidgetClass, SFdisplay, arglist, i);
  665.   
  666. + #endif /* def SEL_FILE_R2_XT */
  667.   #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWFORM)
  668.       selFileForm = XtCreateManagedWidget("selFileForm",
  669.           XwformWidgetClass, selFile, (ArgList) NULL, 0);
  670. ***************
  671. *** 847,853 ****
  672. --- 885,896 ----
  673.           SFmodVerifyCallback, (caddr_t) NULL);
  674.   #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  675.   
  676. + #ifndef SEL_FILE_R2_XT
  677.       SFapp = XtWidgetToApplicationContext(selFile);
  678. + #endif /* ndef SEL_FILE_R2_XT */
  679.   }
  680.   
  681.   SFtextChanged()
  682. ***************
  683. *** 904,914 ****
  684. --- 947,961 ----
  685.   
  686.       }
  687.   
  688. + #ifndef SEL_FILE_R2_XT
  689.       if (!SFworkProcAdded) {
  690.           (void) XtAppAddWorkProc(SFapp, SFworkProc, NULL);
  691.           SFworkProcAdded = 1;
  692.       }
  693.   
  694. + #endif /* ndef SEL_FILE_R2_XT */
  695.       SFupdatePath();
  696.   }
  697.   
  698. ***************
  699. *** 927,934 ****
  700. --- 974,991 ----
  701.       XtUnmapWidget(selFile);
  702.       XtRemoveTimeOut(SFdirModTimerId);
  703.       if (SFchdir(SFstartDir)) {
  704. + #ifdef SEL_FILE_R2_XT
  705. +         XtError(
  706. + #else /* def SEL_FILE_R2_XT */
  707.           XtAppError(
  708.               SFapp,
  709. + #endif /* def SEL_FILE_R2_XT */
  710.               "XsraSelFile: can't return to current directory"
  711.           );
  712.       }
  713. ***************
  714. *** 985,991 ****
  715. --- 1042,1058 ----
  716.           SFcreateWidgets(prompt, ok, cancel);
  717.       } else {
  718.           if (display && (SFdisplay != display)) {
  719. + #ifdef SEL_FILE_R2_XT
  720. +             XtError("XsraSelFile: display different");
  721. + #else /* def SEL_FILE_R2_XT */
  722.               XtAppError(SFapp, "XsraSelFile: display different");
  723. + #endif /* def SEL_FILE_R2_XT */
  724.           }
  725.   
  726.           i = 0;
  727. ***************
  728. *** 1062,1075 ****
  729.           XtMapWidget(selFile);
  730.       }
  731.   
  732. ! #ifdef SYSV
  733.       if (!getwd(SFstartDir)) {
  734. !     /* if (!getcwd(SFstartDir, MAXPATHLEN)) { */
  735. ! #else /* def SYSV */
  736. !     if (!getwd(SFstartDir)) {
  737. ! #endif /* def SYSV */
  738.   
  739.           XtAppError(SFapp, "XsraSelFile: can't get current directory");
  740.       }
  741.       (void) strcat(SFstartDir, "/");
  742.       (void) strcpy(SFcurrentDir, SFstartDir);
  743. --- 1129,1150 ----
  744.           XtMapWidget(selFile);
  745.       }
  746.   
  747. ! #if defined(SYSV) || defined(USG)
  748. !     if (!getcwd(SFstartDir, MAXPATHLEN)) {
  749. ! #else /* defined(SYSV) || defined(USG) */
  750.       if (!getwd(SFstartDir)) {
  751. ! #endif /* defined(SYSV) || defined(USG) */
  752.   
  753. + #ifdef SEL_FILE_R2_XT
  754. +         XtError("XsraSelFile: can't get current directory");
  755. + #else /* def SEL_FILE_R2_XT */
  756.           XtAppError(SFapp, "XsraSelFile: can't get current directory");
  757. + #endif /* def SEL_FILE_R2_XT */
  758.       }
  759.       (void) strcat(SFstartDir, "/");
  760.       (void) strcpy(SFcurrentDir, SFstartDir);
  761. ***************
  762. *** 1101,1111 ****
  763. --- 1176,1205 ----
  764.   
  765.       XtAddGrab(selFile, True, True);
  766.   
  767. + #ifdef SEL_FILE_R2_XT
  768. +     SFdirModTimerId = XtAddTimeOut((unsigned long) 1000,
  769. + #else /* def SEL_FILE_R2_XT */
  770.       SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
  771. + #endif /* def SEL_FILE_R2_XT */
  772.           SFdirModTimer, (caddr_t) NULL);
  773.   
  774.       while (1) {
  775. + #ifdef SEL_FILE_R2_XT
  776. +         XtNextEvent(&event);
  777. + #else /* def SEL_FILE_R2_XT */
  778.           XtAppNextEvent(SFapp, &event);
  779. + #endif /* def SEL_FILE_R2_XT */
  780.           XtDispatchEvent(&event);
  781.           switch (SFstatus) {
  782.           case SEL_FILE_TEXT:
  783. *** ../old/SelFile.man    Wed Aug 30 16:23:17 1989
  784. --- SelFile.man    Wed Aug 30 16:01:46 1989
  785. ***************
  786. *** 1,4 ****
  787. ! .\" $Header: SelFile.man,v 1.3 89/04/24 22:27:00 erik Exp $
  788.   .\"
  789.   .\" Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
  790.   .\"
  791. --- 1,4 ----
  792. ! .\" $Header: SelFile.man,v 1.4 89/08/30 16:01:31 erik Exp $
  793.   .\"
  794.   .\" Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
  795.   .\"
  796. ***************
  797. *** 22,27 ****
  798. --- 22,28 ----
  799.   .\"
  800.   .\" Author: Erik M. van der Poel
  801.   .\"         Software Research Associates, Inc., Tokyo, Japan
  802. + .\"         erik@sra.co.jp
  803.   .\"
  804.   .TH XSRASELFILE 3X "April 24 1989" SRA
  805.   .SH NAME
  806. *** ../old/callback.c    Wed Aug 30 16:23:18 1989
  807. --- callback.c    Wed Aug 30 16:02:13 1989
  808. ***************
  809. *** 1,5 ****
  810.   #ifndef lint
  811. ! static char rcsid[] = "$Header: callback.c,v 1.2 89/05/29 15:06:48 erik Exp $";
  812.   #endif
  813.   
  814.   /*
  815. --- 1,5 ----
  816.   #ifndef lint
  817. ! static char rcsid[] = "$Header: callback.c,v 1.5 89/08/30 16:02:06 erik Exp $";
  818.   #endif
  819.   
  820.   /*
  821. ***************
  822. *** 25,34 ****
  823. --- 25,36 ----
  824.    *
  825.    * Author: Erik M. van der Poel
  826.    *         Software Research Associates, Inc., Tokyo, Japan
  827. +  *         erik@sra.co.jp
  828.    */
  829.   
  830.   #include <stdio.h>
  831.   #include <X11/Intrinsic.h>
  832. + #include <X11/Xos.h>
  833.   #include <sys/stat.h>
  834.   
  835.   extern char *re_comp();
  836. ***************
  837. *** 55,61 ****
  838.   {
  839.       static char    shown[256];
  840.   
  841. !     switch (match("^..*\.plt$", realFileName)) {
  842.       case 0:
  843.       case -1:
  844.       default:
  845. --- 57,63 ----
  846.   {
  847.       static char    shown[256];
  848.   
  849. !     switch (match("^..*\\.plt$", realFileName)) {
  850.       case 0:
  851.       case -1:
  852.       default:
  853. ***************
  854. *** 69,75 ****
  855.           return 1;
  856.       }
  857.   
  858. !     switch (match("^..*\.xy$", realFileName)) {
  859.       case 0:
  860.       case -1:
  861.       default:
  862. --- 71,77 ----
  863.           return 1;
  864.       }
  865.   
  866. !     switch (match("^..*\\.xy$", realFileName)) {
  867.       case 0:
  868.       case -1:
  869.       default:
  870. ***************
  871. *** 78,84 ****
  872.           return 0;
  873.       }
  874.   
  875. !     switch (match("^..*\.z$", realFileName)) {
  876.       case 0:
  877.       case -1:
  878.       default:
  879. --- 80,86 ----
  880.           return 0;
  881.       }
  882.   
  883. !     switch (match("^..*\\.z$", realFileName)) {
  884.       case 0:
  885.       case -1:
  886.       default:
  887. *** ../old/patchlevel.h    Wed Aug 30 16:26:33 1989
  888. --- patchlevel.h    Fri Jul 21 15:20:40 1989
  889. ***************
  890. *** 0 ****
  891. --- 1 ----
  892. + #define PATCHLEVEL 1
  893. *** ../old/xdir.c    Wed Aug 30 16:23:19 1989
  894. --- xdir.c    Wed Aug 30 16:02:46 1989
  895. ***************
  896. *** 1,5 ****
  897.   #ifndef lint
  898. ! static char rcsid[] = "$Header: xdir.c,v 1.3 89/05/29 15:07:10 erik Exp $";
  899.   #endif
  900.   
  901.   /*
  902. --- 1,5 ----
  903.   #ifndef lint
  904. ! static char rcsid[] = "$Header: xdir.c,v 1.4 89/08/30 16:02:39 erik Exp $";
  905.   #endif
  906.   
  907.   /*
  908. ***************
  909. *** 25,30 ****
  910. --- 25,31 ----
  911.    *
  912.    * Author: Erik M. van der Poel
  913.    *         Software Research Associates, Inc., Tokyo, Japan
  914. +  *         erik@sra.co.jp
  915.    */
  916.   
  917.   #include <stdio.h>
  918.