[comp.sources.x] v04i097: xdir, Patch1

argv@island.uu.net (Dan Heller) (08/31/89)

Submitted-by: Erik M. van der Poel <erik@sra.junet>
Posting-number: Volume 4, Issue 97
Archive-name: xdir/patch1

Patch-To: xdir/part01; Volume 4, Issue 14
Patch-To: xdir/part02; Volume 4, Issue 15

This is the first set of patches for the SelFile directory browser package
(otherwise known as xdir).

	* The wrong files were highlighted when show_entry was used. This bug
	  has been fixed.

	* The cpp symbol USG has been added. SYSV is used for System V Release
	  2, and USG for SVR3, in line with Jim Fulton's recently posted rules
	  for contrib software.

	* Support for System V's getcwd() has been added.

	* MAXPATHLEN has been defined for systems that do not have it.

	* A patchlevel.h file has been added. The initial patch level is one.

	* A Makefile has been added. How many of you gave up trying to compile
	  SelFile when you noticed that there was an Imakefile, but no
	  Makefile?

	* Support for the R2 version of the Xt Intrinsics has been added. See
	  the Imakefile.


Many thanks to the following individuals for bug reports, etc.:

	Jordan K. Hubbard
	T. S. Wong
	Ken Chin-Purcell
	Richard Neitzel
	Ian Darwin
	Steve Lodin
	Pramath (sinha)
	Scott E. Garfinkle
	Peter Lim
	Gary Bushey
	T. Scott Pyne


By the way, has anyone made any useful modifications to SelFile, such as
Widgetizing it so that it can be embedded within an application window?

--
Erik M. van der Poel                  erik@sra.co.jp             (Japan)
SRA, 1-1-1 Hirakawa-cho, Chiyoda-ku   erik%sra.co.jp@uunet.uu.net  (USA)
Tokyo 102 Japan. TEL +81-3-234-2692   erik%sra.co.jp@mcvax.uucp (Europe)


*** ../old/Dir.c	Wed Aug 30 16:23:22 1989
--- Dir.c	Wed Aug 30 15:57:37 1989
***************
*** 1,5 ****
  #ifndef lint
! static char rcsid[] = "$Header: Dir.c,v 1.3 89/05/29 15:03:50 erik Exp $";
  #endif
  
  /*
--- 1,5 ----
  #ifndef lint
! static char rcsid[] = "$Header: Dir.c,v 1.4 89/08/30 15:56:15 erik Exp $";
  #endif
  
  /*
***************
*** 25,30 ****
--- 25,31 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  #include <stdio.h>
***************
*** 35,51 ****
  
  #include "SFinternal.h"
  
! #ifdef SYSV
  #include <dirent.h>
! #else /* def SYSV */
  #include <sys/dir.h>
! #endif /* def SYSV */
  
  #include <sys/stat.h>
  
! #ifdef SYSV
  extern void qsort();
! #endif /* def SYSV */
  
  #ifdef SEL_FILE_IGNORE_CASE
  int
--- 36,53 ----
  
  #include "SFinternal.h"
  
! #if defined(SYSV) || defined(USG)
  #include <dirent.h>
! #else /* defined(SYSV) || defined(USG) */
  #include <sys/dir.h>
! #define dirent direct
! #endif /* defined(SYSV) || defined(USG) */
  
  #include <sys/stat.h>
  
! #if defined(SYSV) || defined(USG)
  extern void qsort();
! #endif /* defined(SYSV) || defined(USG) */
  
  #ifdef SEL_FILE_IGNORE_CASE
  int
***************
*** 102,114 ****
  	int		alloc = 0;
  	int		i;
  	DIR		*dirp;
- 
- #ifdef SYSV
  	struct dirent	*dp;
- #else /* def SYSV */
- 	struct direct	*dp;
- #endif /* def SYSV */
- 
  	char		*str;
  	int		len;
  	int		maxChars;
--- 104,110 ----
***************
*** 155,165 ****
  		i++;
  	}
  
! #ifdef SYSV
  	qsort((char *) result, (unsigned) i, sizeof(SFEntry), SFcompareEntries);
! #else /* def SYSV */
  	qsort((char *) result, i, sizeof(SFEntry), SFcompareEntries);
! #endif /* def SYSV */
  
  	dir->entries = result;
  	dir->nEntries = i;
--- 151,161 ----
  		i++;
  	}
  
! #if defined(SYSV) || defined(USG)
  	qsort((char *) result, (unsigned) i, sizeof(SFEntry), SFcompareEntries);
! #else /* defined(SYSV) || defined(USG) */
  	qsort((char *) result, i, sizeof(SFEntry), SFcompareEntries);
! #endif /* defined(SYSV) || defined(USG) */
  
  	dir->entries = result;
  	dir->nEntries = i;
*** ../old/Draw.c	Wed Aug 30 16:23:26 1989
--- Draw.c	Wed Aug 30 15:58:13 1989
***************
*** 1,5 ****
  #ifndef lint
! static char rcsid[] = "$Header: Draw.c,v 1.6 89/05/29 15:04:26 erik Exp $";
  #endif
  
  /*
--- 1,5 ----
  #ifndef lint
! static char rcsid[] = "$Header: Draw.c,v 1.10 89/08/30 15:58:01 erik Exp $";
  #endif
  
  /*
***************
*** 25,30 ****
--- 25,31 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  #include <stdio.h>
***************
*** 81,87 ****
--- 82,98 ----
  
  			(void) sprintf(sbuf, "XsraSelFile: can't get font %s",
  				SF_DEFAULT_FONT);
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 			XtError(sbuf);
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  			XtAppError(SFapp, sbuf);
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  		}
  	}
  
***************
*** 246,251 ****
--- 257,263 ----
  	register SFEntry	*e;
  	register SFEntry	*end;
  	int			n;
+ 	int			idx;
  
  #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR)
  
***************
*** 254,259 ****
--- 266,287 ----
  
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  
+ 	idx = entry - dir->entries;
+ 
+ 	if (idx < dir->beginSelection) {
+ 		dir->beginSelection--;
+ 	}
+ 	if (idx <= dir->endSelection) {
+ 		dir->endSelection--;
+ 	}
+ 	if (dir->beginSelection > dir->endSelection) {
+ 		dir->beginSelection = dir->endSelection = -1;
+ 	}
+ 
+ 	if (idx < dir->vOrigin) {
+ 		dir->vOrigin--;
+ 	}
+ 
  	XtFree(entry->real);
  
  	end = &(dir->entries[dir->nEntries - 1]);
***************
*** 275,280 ****
--- 303,309 ----
  	XtSetArg(arglist[i], XtNsliderMax, dir->nEntries);		i++;
  	XtSetArg(arglist[i], XtNsliderExtent, dir->nEntries < SFlistSize ?
  		dir->nEntries : SFlistSize);				i++;
+ 	XtSetArg(arglist[i], XtNsliderOrigin, dir->vOrigin);		i++;
  	XtSetValues(selFileVScrolls[n], arglist, i);
  
  #else /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
***************
*** 580,586 ****
--- 609,625 ----
  	}
  
  	if (SFbuttonPressed) {
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 		SFscrollTimerId = XtAddTimeOut(
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  		SFscrollTimerId = XtAppAddTimeOut(SFapp,
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  			SFscrollTimerInterval(), SFscrollTimer, (caddr_t) n);
  	}
  }
***************
*** 620,626 ****
--- 659,675 ----
  			SFcurrentListY = y;
  			if (!SFscrollTimerAdded) {
  				SFscrollTimerAdded = 1;
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 				SFscrollTimerId = XtAddTimeOut(
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  				SFscrollTimerId = XtAppAddTimeOut(SFapp,
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  					SFscrollTimerInterval(), SFscrollTimer,
  					(caddr_t) n);
  			}
***************
*** 1073,1078 ****
--- 1122,1129 ----
  
  }
  
+ #ifndef SEL_FILE_R2_XT
+ 
  Boolean
  SFworkProc()
  {
***************
*** 1096,1098 ****
--- 1147,1151 ----
  
  	return True;
  }
+ 
+ #endif /* ndef SEL_FILE_R2_XT */
*** ../old/FILES	Wed Aug 30 16:23:29 1989
--- FILES	Fri Jul 21 16:37:46 1989
***************
*** 2,7 ****
--- 2,8 ----
  Draw.c
  FILES
  Imakefile
+ Makefile
  Path.c
  README
  SFinternal.h
***************
*** 9,12 ****
--- 10,14 ----
  SelFile.man
  TODO
  callback.c
+ patchlevel.h
  xdir.c
*** ../old/Imakefile	Wed Aug 30 16:23:29 1989
--- Imakefile	Wed Aug 30 16:44:18 1989
***************
*** 15,20 ****
--- 15,36 ----
  #
  # -DSEL_FILE_XW
  #
+ # Normally, the program should be linked with the R3 or a later version of the
+ # Xt Intrinsics, but it can be linked with the R2 Xt by defining the following:
+ #
+ # -DSEL_FILE_R2_XT
+ #
+ # System V Release 2 users will need something like Doug Gwyn's directory
+ # package (posted to comp.sources.unix), and will need to define the following:
+ #
+ # -DSYSV
+ #
+ # System V Release 3 users will need to define the following:
+ #
+ # -DUSG
+ #
+ #------------------------------------------------------------------------------
+ #
  #        DEFINES = -DSEL_FILE_XW
  
             SRCS = xdir.c SelFile.c Dir.c Path.c Draw.c
*** ../old/Makefile	Wed Aug 30 16:26:02 1989
--- Makefile	Wed May 24 13:52:22 1989
***************
*** 0 ****
--- 1,18 ----
+ CC = gcc
+ CC = cc
+ 
+ CFLAGS = -O -DSEL_FILE_XW
+ CFLAGS = -O
+ 
+ SRCS = SelFile.c Dir.c Path.c Draw.c
+ OBJS = SelFile.o Dir.o Path.o Draw.o
+ 
+ xdir:			xdir.o $(OBJS)
+ #	$(CC) $(CFLAGS) xdir.o $(OBJS) -lXw -lXt -lX11 -o $@
+ 	$(CC) $(CFLAGS) xdir.o $(OBJS) -lXaw -lXmu -lXt -lX11 -o $@
+ 
+ lint:
+ 	lint -auxz $(CFLAGS) xdir.c $(SRCS)
+ 
+ clean:
+ 	rm -f xdir *.o core a.out
*** ../old/Path.c	Wed Aug 30 16:23:31 1989
--- Path.c	Wed Aug 30 15:59:24 1989
***************
*** 1,5 ****
  #ifndef lint
! static char rcsid[] = "$Header: Path.c,v 1.5 89/05/29 15:05:30 erik Exp $";
  #endif
  
  /*
--- 1,5 ----
  #ifndef lint
! static char rcsid[] = "$Header: Path.c,v 1.9 89/08/30 15:58:47 erik Exp $";
  #endif
  
  /*
***************
*** 25,30 ****
--- 25,31 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  #include <stdio.h>
***************
*** 44,53 ****
  #include <X11/Scroll.h>
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  
! #ifdef SYSV
  extern unsigned short getuid();
  extern void qsort();
! #endif /* def SYSV */
  
  typedef struct {
  	char	*name;
--- 45,54 ----
  #include <X11/Scroll.h>
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWSCROLLBAR) */
  
! #if defined(SYSV) || defined(USG)
  extern unsigned short getuid();
  extern void qsort();
! #endif /* defined(SYSV) || defined(USG) */
  
  typedef struct {
  	char	*name;
***************
*** 463,475 ****
  	SFhomeDir.beginSelection	= -1		;
  	SFhomeDir.endSelection		= -1		;
  
! #ifdef SYSV
  	qsort((char *) entries, (unsigned)i, sizeof(SFEntry), SFcompareEntries);
  	qsort((char *) SFlogins, (unsigned)i, sizeof(SFLogin), SFcompareLogins);
! #else /* def SYSV */
  	qsort((char *) entries, i, sizeof(SFEntry), SFcompareEntries);
  	qsort((char *) SFlogins, i, sizeof(SFLogin), SFcompareLogins);
! #endif /* def SYSV */
  
  	for (i--; i >= 0; i--) {
  		(void) strcat(entries[i].real, "/");
--- 464,476 ----
  	SFhomeDir.beginSelection	= -1		;
  	SFhomeDir.endSelection		= -1		;
  
! #if defined(SYSV) || defined(USG)
  	qsort((char *) entries, (unsigned)i, sizeof(SFEntry), SFcompareEntries);
  	qsort((char *) SFlogins, (unsigned)i, sizeof(SFLogin), SFcompareLogins);
! #else /* defined(SYSV) || defined(USG) */
  	qsort((char *) entries, i, sizeof(SFEntry), SFcompareEntries);
  	qsort((char *) SFlogins, i, sizeof(SFLogin), SFcompareLogins);
! #endif /* defined(SYSV) || defined(USG) */
  
  	for (i--; i >= 0; i--) {
  		(void) strcat(entries[i].real, "/");
***************
*** 720,732 ****
  	static int	alloc = 0;
  	int		len;
  
! 	len = convEUCtoWS((unsigned char *) path, (wchar_t *) NULL);
  	while (len + 1 > alloc) {
  		alloc = 2 * (alloc + 1);
  		wstr = (wchar_t *) XtRealloc((char *) wstr, (unsigned) (alloc *
  			sizeof(wchar_t)));
  	}
! 	(void) convEUCtoWS((unsigned char *) path, wstr);
  
  	XwTextClearBuffer(selFileField);
  	XwTextInsert(selFileField, wstr);
--- 721,733 ----
  	static int	alloc = 0;
  	int		len;
  
! 	len = convEUCtoJWS((unsigned char *) path, (wchar_t *) NULL);
  	while (len + 1 > alloc) {
  		alloc = 2 * (alloc + 1);
  		wstr = (wchar_t *) XtRealloc((char *) wstr, (unsigned) (alloc *
  			sizeof(wchar_t)));
  	}
! 	(void) convEUCtoJWS((unsigned char *) path, wstr);
  
  	XwTextClearBuffer(selFileField);
  	XwTextInsert(selFileField, wstr);
***************
*** 846,851 ****
--- 847,862 ----
  		} else {
  			(void) SFfindFile(dir, dir->path);
  		}
+ 
+ #ifndef SEL_FILE_R2_XT
+ 
+ 		if (!SFworkProcAdded) {
+ 			(void) XtAppAddWorkProc(SFapp, SFworkProc, NULL);
+ 			SFworkProcAdded = 1;
+ 		}
+ 
+ #endif /* ndef SEL_FILE_R2_XT */
+ 
  		return 1;
  	}
  
***************
*** 951,956 ****
--- 962,976 ----
  		}
  	}
  
+ #ifdef SEL_FILE_R2_XT
+ 
+ 	SFdirModTimerId = XtAddTimeOut((unsigned long) 1000,
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  	SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  		SFdirModTimer, (caddr_t) NULL);
  }
*** ../old/README	Wed Aug 30 16:23:11 1989
--- README	Fri Jul 21 16:39:22 1989
***************
*** 32,39 ****
  * Xaw and/or Xw widgets
  
      SelFile can be linked with Xaw (Athena) and/or Xw (Hewlett-Packard)
!     widgets. However, it must be linked with the R3 or a later version of the
!     Xt Intrinsics. See the Imakefile for details.
  
  * automatic display update after directory modification
  
--- 32,40 ----
  * Xaw and/or Xw widgets
  
      SelFile can be linked with Xaw (Athena) and/or Xw (Hewlett-Packard)
!     widgets. Normally, SelFile is linked with the R3 or a later version of the
!     Xt Intrinsics, but it can be linked with the R2 Xt. See the Imakefile for
!     details.
  
  * automatic display update after directory modification
  
*** ../old/SFinternal.h	Wed Aug 30 16:23:12 1989
--- SFinternal.h	Wed Aug 30 15:59:54 1989
***************
*** 1,4 ****
! /* $Header: SFinternal.h,v 1.3 89/04/26 17:48:34 erik Exp $ */
  
  /*
   * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
--- 1,4 ----
! /* $Header: SFinternal.h,v 1.6 89/08/30 15:59:46 erik Exp $ */
  
  /*
   * Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
***************
*** 23,31 ****
--- 23,33 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  #include <X11/Intrinsic.h>
+ #include <X11/Xos.h>
  
  #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT)
  #include <Xw/Xw.h>
***************
*** 129,139 ****
--- 131,145 ----
  
  extern int SFcurrentInvert[];
  
+ #ifndef SEL_FILE_R2_XT
+ 
  extern int SFworkProcAdded;
  
  extern Boolean SFworkProc();
  
  extern XtAppContext SFapp;
+ 
+ #endif /* ndef SEL_FILE_R2_XT */
  
  extern int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth;
  
*** ../old/SelFile.c	Wed Aug 30 16:23:15 1989
--- SelFile.c	Wed Aug 30 16:01:26 1989
***************
*** 1,5 ****
  #ifndef lint
! static char rcsid[] = "$Header: SelFile.c,v 1.7 89/05/30 14:49:17 erik Exp $";
  #endif
  
  /*
--- 1,5 ----
  #ifndef lint
! static char rcsid[] = "$Header: SelFile.c,v 1.12 89/08/30 16:00:17 erik Exp $";
  #endif
  
  /*
***************
*** 25,30 ****
--- 25,31 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  /*
***************
*** 88,96 ****
  #endif /* def SEL_FILE_JAPANESE */
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  
! #ifndef SYSV
  extern char *getwd();
! #endif /* ndef SYSV */
  
  int SFstatus = SEL_FILE_NULL;
  
--- 89,101 ----
  #endif /* def SEL_FILE_JAPANESE */
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  
! #ifndef MAXPATHLEN
! #define MAXPATHLEN 1024
! #endif /* ndef MAXPATHLEN */
! 
! #if !defined(SYSV) && !defined(USG)
  extern char *getwd();
! #endif /* !defined(SYSV) && !defined(USG) */
  
  int SFstatus = SEL_FILE_NULL;
  
***************
*** 141,150 ****
--- 146,159 ----
  
  int SFlistSize = 10;
  
+ #ifndef SEL_FILE_R2_XT
+ 
  int SFworkProcAdded = 0;
  
  XtAppContext SFapp;
  
+ #endif /* ndef SEL_FILE_R2_XT */
+ 
  int SFpathScrollWidth, SFvScrollHeight, SFhScrollWidth;
  
  #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT)
***************
*** 272,278 ****
--- 281,303 ----
  };
  
  #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT)
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
  typedef struct {
+ 	int	height;
+ } SFfieldData, *sfFieldPtr;
+ 
+ static XtResource SFfieldResources[] = {
+ 	{
+ 		XtNheight, XtCHeight, XtRInt, sizeof(int),
+ 		XtOffset(sfFieldPtr, height), XtRString, "1"
+ 	},
+ };
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
+ typedef struct {
  	Dimension	height;
  } SFfieldData, *sfFieldPtr;
  
***************
*** 282,287 ****
--- 307,315 ----
  		XtOffset(sfFieldPtr, height), XtRString, "1"
  	},
  };
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  
  static int
***************
*** 321,329 ****
--- 349,367 ----
  
  	i = 0;
  	XtSetArg(arglist[i], XtNallowShellResize, True);		i++;
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 	selFile = XtCreateApplicationShell("selFile",
+ 		applicationShellWidgetClass, arglist, i);
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  	selFile = XtAppCreateShell("selFile", "SelFile",
  		applicationShellWidgetClass, SFdisplay, arglist, i);
  
+ #endif /* def SEL_FILE_R2_XT */
+ 
  #if defined(SEL_FILE_XW) || defined(SEL_FILE_XWFORM)
  	selFileForm = XtCreateManagedWidget("selFileForm",
  		XwformWidgetClass, selFile, (ArgList) NULL, 0);
***************
*** 847,853 ****
--- 885,896 ----
  		SFmodVerifyCallback, (caddr_t) NULL);
  #endif /* defined(SEL_FILE_XW) || defined(SEL_FILE_XWTEXTEDIT) */
  
+ #ifndef SEL_FILE_R2_XT
+ 
  	SFapp = XtWidgetToApplicationContext(selFile);
+ 
+ #endif /* ndef SEL_FILE_R2_XT */
+ 
  }
  
  SFtextChanged()
***************
*** 904,914 ****
--- 947,961 ----
  
  	}
  
+ #ifndef SEL_FILE_R2_XT
+ 
  	if (!SFworkProcAdded) {
  		(void) XtAppAddWorkProc(SFapp, SFworkProc, NULL);
  		SFworkProcAdded = 1;
  	}
  
+ #endif /* ndef SEL_FILE_R2_XT */
+ 
  	SFupdatePath();
  }
  
***************
*** 927,934 ****
--- 974,991 ----
  	XtUnmapWidget(selFile);
  	XtRemoveTimeOut(SFdirModTimerId);
  	if (SFchdir(SFstartDir)) {
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 		XtError(
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  		XtAppError(
  			SFapp,
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  			"XsraSelFile: can't return to current directory"
  		);
  	}
***************
*** 985,991 ****
--- 1042,1058 ----
  		SFcreateWidgets(prompt, ok, cancel);
  	} else {
  		if (display && (SFdisplay != display)) {
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 			XtError("XsraSelFile: display different");
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  			XtAppError(SFapp, "XsraSelFile: display different");
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  		}
  
  		i = 0;
***************
*** 1062,1075 ****
  		XtMapWidget(selFile);
  	}
  
! #ifdef SYSV
  	if (!getwd(SFstartDir)) {
! 	/* if (!getcwd(SFstartDir, MAXPATHLEN)) { */
! #else /* def SYSV */
! 	if (!getwd(SFstartDir)) {
! #endif /* def SYSV */
  
  		XtAppError(SFapp, "XsraSelFile: can't get current directory");
  	}
  	(void) strcat(SFstartDir, "/");
  	(void) strcpy(SFcurrentDir, SFstartDir);
--- 1129,1150 ----
  		XtMapWidget(selFile);
  	}
  
! #if defined(SYSV) || defined(USG)
! 	if (!getcwd(SFstartDir, MAXPATHLEN)) {
! #else /* defined(SYSV) || defined(USG) */
  	if (!getwd(SFstartDir)) {
! #endif /* defined(SYSV) || defined(USG) */
  
+ #ifdef SEL_FILE_R2_XT
+ 
+ 		XtError("XsraSelFile: can't get current directory");
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  		XtAppError(SFapp, "XsraSelFile: can't get current directory");
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  	}
  	(void) strcat(SFstartDir, "/");
  	(void) strcpy(SFcurrentDir, SFstartDir);
***************
*** 1101,1111 ****
--- 1176,1205 ----
  
  	XtAddGrab(selFile, True, True);
  
+ #ifdef SEL_FILE_R2_XT
+ 
+ 	SFdirModTimerId = XtAddTimeOut((unsigned long) 1000,
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  	SFdirModTimerId = XtAppAddTimeOut(SFapp, (unsigned long) 1000,
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  		SFdirModTimer, (caddr_t) NULL);
  
  	while (1) {
+ 
+ #ifdef SEL_FILE_R2_XT
+ 
+ 		XtNextEvent(&event);
+ 
+ #else /* def SEL_FILE_R2_XT */
+ 
  		XtAppNextEvent(SFapp, &event);
+ 
+ #endif /* def SEL_FILE_R2_XT */
+ 
  		XtDispatchEvent(&event);
  		switch (SFstatus) {
  		case SEL_FILE_TEXT:
*** ../old/SelFile.man	Wed Aug 30 16:23:17 1989
--- SelFile.man	Wed Aug 30 16:01:46 1989
***************
*** 1,4 ****
! .\" $Header: SelFile.man,v 1.3 89/04/24 22:27:00 erik Exp $
  .\"
  .\" Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
  .\"
--- 1,4 ----
! .\" $Header: SelFile.man,v 1.4 89/08/30 16:01:31 erik Exp $
  .\"
  .\" Copyright 1989 Software Research Associates, Inc., Tokyo, Japan
  .\"
***************
*** 22,27 ****
--- 22,28 ----
  .\"
  .\" Author: Erik M. van der Poel
  .\"         Software Research Associates, Inc., Tokyo, Japan
+ .\"         erik@sra.co.jp
  .\"
  .TH XSRASELFILE 3X "April 24 1989" SRA
  .SH NAME
*** ../old/callback.c	Wed Aug 30 16:23:18 1989
--- callback.c	Wed Aug 30 16:02:13 1989
***************
*** 1,5 ****
  #ifndef lint
! static char rcsid[] = "$Header: callback.c,v 1.2 89/05/29 15:06:48 erik Exp $";
  #endif
  
  /*
--- 1,5 ----
  #ifndef lint
! static char rcsid[] = "$Header: callback.c,v 1.5 89/08/30 16:02:06 erik Exp $";
  #endif
  
  /*
***************
*** 25,34 ****
--- 25,36 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  #include <stdio.h>
  #include <X11/Intrinsic.h>
+ #include <X11/Xos.h>
  #include <sys/stat.h>
  
  extern char *re_comp();
***************
*** 55,61 ****
  {
  	static char	shown[256];
  
! 	switch (match("^..*\.plt$", realFileName)) {
  	case 0:
  	case -1:
  	default:
--- 57,63 ----
  {
  	static char	shown[256];
  
! 	switch (match("^..*\\.plt$", realFileName)) {
  	case 0:
  	case -1:
  	default:
***************
*** 69,75 ****
  		return 1;
  	}
  
! 	switch (match("^..*\.xy$", realFileName)) {
  	case 0:
  	case -1:
  	default:
--- 71,77 ----
  		return 1;
  	}
  
! 	switch (match("^..*\\.xy$", realFileName)) {
  	case 0:
  	case -1:
  	default:
***************
*** 78,84 ****
  		return 0;
  	}
  
! 	switch (match("^..*\.z$", realFileName)) {
  	case 0:
  	case -1:
  	default:
--- 80,86 ----
  		return 0;
  	}
  
! 	switch (match("^..*\\.z$", realFileName)) {
  	case 0:
  	case -1:
  	default:
*** ../old/patchlevel.h	Wed Aug 30 16:26:33 1989
--- patchlevel.h	Fri Jul 21 15:20:40 1989
***************
*** 0 ****
--- 1 ----
+ #define PATCHLEVEL 1
*** ../old/xdir.c	Wed Aug 30 16:23:19 1989
--- xdir.c	Wed Aug 30 16:02:46 1989
***************
*** 1,5 ****
  #ifndef lint
! static char rcsid[] = "$Header: xdir.c,v 1.3 89/05/29 15:07:10 erik Exp $";
  #endif
  
  /*
--- 1,5 ----
  #ifndef lint
! static char rcsid[] = "$Header: xdir.c,v 1.4 89/08/30 16:02:39 erik Exp $";
  #endif
  
  /*
***************
*** 25,30 ****
--- 25,31 ----
   *
   * Author: Erik M. van der Poel
   *         Software Research Associates, Inc., Tokyo, Japan
+  *         erik@sra.co.jp
   */
  
  #include <stdio.h>