*** ../grep-2.0/Makefile.in	Sun May  2 21:54:24 1993
--- Makefile.in	Fri Apr 22 10:04:31 1994
***************
*** 1,4 ****
! # Makefile for GNU grep
  # Copyright (C) 1992 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
--- 1,4 ----
! # Makefile for ve?grep, derived from GNU grep
  # Copyright (C) 1992 Free Software Foundation, Inc.
  
  # This program is free software; you can redistribute it and/or modify
***************
*** 40,58 ****
  DEFS=-DGREP @DEFS@
  
  # Extra libraries.
! LIBS=@LIBS@
  ALLOCA=@ALLOCA@
  
! CFLAGS=-O
! LDFLAGS=$(CFLAGS)
  
  prefix=/usr/local
  exec_prefix=$(prefix)
  
  # Prefix for installed program, normally empty or `g'.
! binprefix=
  # Prefix for installed man page, normally empty or `g'.
! manprefix=
  
  # Where to install executables.
  bindir=$(exec_prefix)/bin
--- 40,63 ----
  DEFS=-DGREP @DEFS@
  
  # Extra libraries.
! SHAPELIBPATH = $$SHAPETOOLS/lib
! SHAPEINCPATH = $$SHAPETOOLS/include
! SHAPELIBS    = -lAtFStk -lAtFS -lsttk
! 
! LIBS=$(SHAPELIBS) @LIBS@
  ALLOCA=@ALLOCA@
  
! CDEBUG=-O -I$(SHAPEINCPATH)
! CFLAGS=$(CDEBUG)
! LDFLAGS=-O -L$(SHAPELIBPATH)
  
  prefix=/usr/local
  exec_prefix=$(prefix)
  
  # Prefix for installed program, normally empty or `g'.
! binprefix=v
  # Prefix for installed man page, normally empty or `g'.
! manprefix=v
  
  # Where to install executables.
  bindir=$(exec_prefix)/bin
***************
*** 74,80 ****
  .c.o:
  	$(CC) $(CFLAGS) $(DEFS) -I$(srcdir) -c $<
  
! all: grep check.done
  
  # For Saber C.
  grep.load: $(SRCS)
--- 79,85 ----
  .c.o:
  	$(CC) $(CFLAGS) $(DEFS) -I$(srcdir) -c $<
  
! all: vgrep check.done
  
  # For Saber C.
  grep.load: $(SRCS)
***************
*** 85,91 ****
  	$(LINT) $(CFLAGS) $(DEFS) -I$(srcdir) $(SRCS)
  
  install: all
! 	$(INSTALL_PROGRAM) grep $(bindir)/$(binprefix)grep
  	rm -f $(bindir)/$(binprefix)egrep
  	$(LN) $(bindir)/$(binprefix)grep $(bindir)/$(binprefix)egrep
  	rm -f $(bindir)/$(binprefix)fgrep
--- 90,96 ----
  	$(LINT) $(CFLAGS) $(DEFS) -I$(srcdir) $(SRCS)
  
  install: all
! 	$(INSTALL_PROGRAM) vgrep $(bindir)/$(binprefix)grep
  	rm -f $(bindir)/$(binprefix)egrep
  	$(LN) $(bindir)/$(binprefix)grep $(bindir)/$(binprefix)egrep
  	rm -f $(bindir)/$(binprefix)fgrep
***************
*** 96,107 ****
  	AWK=$(AWK) sh $(srcdir)/tests/check.sh $(srcdir)/tests
  	touch check.done
  
! check.done: grep
  	AWK=$(AWK) sh $(srcdir)/tests/check.sh $(srcdir)/tests
  	touch check.done
  
! grep: $(OBJS) $(LIBOBJS) $(ALLOCA)
! 	$(CC) $(LDFLAGS) -o grep $(OBJS) $(LIBOBJS) $(LIBS) $(ALLOCA)
  
  clean:
  	rm -f core grep *.o check.done tmp.script khadafy.out
--- 101,112 ----
  	AWK=$(AWK) sh $(srcdir)/tests/check.sh $(srcdir)/tests
  	touch check.done
  
! check.done: vgrep
  	AWK=$(AWK) sh $(srcdir)/tests/check.sh $(srcdir)/tests
  	touch check.done
  
! vgrep: $(OBJS) $(LIBOBJS) $(ALLOCA)
! 	$(CC) $(LDFLAGS) -o vgrep $(OBJS) $(LIBOBJS) $(LIBS) $(ALLOCA)
  
  clean:
  	rm -f core grep *.o check.done tmp.script khadafy.out
*** ../grep-2.0/grep.c	Sun May 23 06:52:52 1993
--- grep.c	Fri Apr 22 09:54:12 1994
***************
*** 309,318 ****
  	  bufmapped = 0;
  	  lseek(bufdesc, bufoffset, 0);
  	}
!       cc = read(bufdesc, buffer + bufsalloc, bufalloc - bufsalloc);
      }
  #else
!   cc = read(bufdesc, buffer + bufsalloc, bufalloc - bufsalloc);
  #endif
    if (cc > 0)
      buflim = buffer + bufsalloc + cc;
--- 309,318 ----
  	  bufmapped = 0;
  	  lseek(bufdesc, bufoffset, 0);
  	}
!       cc = atReadExpand(bufdesc, buffer + bufsalloc, bufalloc - bufsalloc);
      }
  #else
!   cc = atReadExpand(bufdesc, buffer + bufsalloc, bufalloc - bufsalloc);
  #endif
    if (cc > 0)
      buflim = buffer + bufsalloc + cc;
***************
*** 563,572 ****
    return nlines;
  }
  
! static char version[] = "GNU grep version 2.0";
  
  #define USAGE \
!   "usage: %s [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr> [<files...>]\n"
  
  static void
  usage()
--- 563,572 ----
    return nlines;
  }
  
! static char version[] = "ve?grep 1.0, derived from GNU grep version 2.0";
  
  #define USAGE \
!   "usage: %s [vbind-options] [-[[AB] ]<num>] [-[CEFGVchilnqsvwx]] [-[ef]] <expr> [<files...>]\n"
  
  static void
  usage()
***************
*** 606,611 ****
--- 606,613 ----
    extern char *optarg;
    extern int optind;
  
+   atBindSetArgv(&argc, &argv);
+ 
    prog = argv[0];
    if (prog && strrchr(prog, '/'))
      prog = strrchr(prog, '/') + 1;
***************
*** 777,783 ****
    if (optind < argc)
      while (optind < argc)
        {
! 	desc = strcmp(argv[optind], "-") ? open(argv[optind], O_RDONLY) : 0;
  	if (desc < 0)
  	  {
  	    if (!suppress_errors)
--- 779,785 ----
    if (optind < argc)
      while (optind < argc)
        {
! 	desc = strcmp(argv[optind], "-") ? atOpenExpand(argv[optind], 0) : 0;
  	if (desc < 0)
  	  {
  	    if (!suppress_errors)
***************
*** 803,809 ****
  	      printf("%s\n", filename);
  	  }
  	if (desc != 0)
! 	  close(desc);
  	++optind;
        }
    else
--- 805,811 ----
  	      printf("%s\n", filename);
  	  }
  	if (desc != 0)
! 	  atCloseExpand(desc);
  	++optind;
        }
    else
*** ../grep-2.0/grep.man	Sat Oct 17 03:08:16 1992
--- grep.man	Fri Apr 22 10:40:51 1994
***************
*** 1,9 ****
! .TH GREP 1 "1992 September 10" "GNU Project"
  .SH NAME
! grep, egrep, fgrep \- print lines matching a pattern
  .SH SYNOPOSIS
! .B grep
  [
  .BR \- [[ AB "] ]\c"
  .I "num"
  ]
--- 1,11 ----
! .TH VGREP 1 "1992 September 10" "GNU Project"
  .SH NAME
! vgrep, vegrep, vfgrep \- print lines matching a pattern
  .SH SYNOPOSIS
! .B vgrep
  [
+ .I vbind-options
+ ] [
  .BR \- [[ AB "] ]\c"
  .I "num"
  ]
***************
*** 17,41 ****
  |
  .BI \-f file
  ] [
! .I files...
  ]
  .SH DESCRIPTION
  .PP
! .B Grep
! searches the named input
! .I files
! (or standard input if no files are named, or
! the file name
  .B \-
  is given)
  for lines containing a match to the given
  .IR pattern .
  By default,
! .B grep
  prints the matching lines.
  .PP
  There are three major variants of
! .BR grep ,
  controlled by the following options.
  .PD 0
  .TP
--- 19,45 ----
  |
  .BI \-f file
  ] [
! .I "names..."
  ]
  .SH DESCRIPTION
  .PP
! .B Vgrep
! is GNU
! .B grep
! with a patch to access AtFS version objects.
! .I Vgrep
! searches the files and AtFS version objects listed in the arguments
! (or standard input if no names are given, or the name
  .B \-
  is given)
  for lines containing a match to the given
  .IR pattern .
  By default,
! .B vgrep
  prints the matching lines.
  .PP
  There are three major variants of
! .BR vgrep ,
  controlled by the following options.
  .PD 0
  .TP
***************
*** 56,77 ****
  any of which is to be matched.
  .LP
  In addition, two variant programs
! .B egrep
  and
! .B fgrep
  are available.
! .B Egrep
  is similiar (but not identical) to
! .BR "grep\ \-E" ,
  and is compatible with the historical Unix
  .BR egrep .
! .B Fgrep
  is the same as
! .BR "grep\ \-F" .
  .PD
  .LP
  All variants of
! .B grep
  understand the following options:
  .PD 0
  .TP
--- 60,94 ----
  any of which is to be matched.
  .LP
  In addition, two variant programs
! .B vegrep
  and
! .B vfgrep
  are available.
! .B Vegrep
  is similiar (but not identical) to
! .BR "vgrep\ \-E" ,
  and is compatible with the historical Unix
  .BR egrep .
! .B Vfgrep
  is the same as
! .BR "vgrep\ \-F" .
  .PD
  .LP
+ .I Vgrep
+ understands the standard version binding options of the Shape toolkit.
+ The 
+ .I names
+ on the command line are replaced by the appropriate version IDs of the
+ selected version object.
+ .LP
+ The
+ .I vbind-options
+ are shapeTools' standard options for version binding.
+ A description of these options can be found in the manual page of
+ .IR vbind (1).
+ .LP
  All variants of
! .B vgrep
  understand the following options:
  .PD 0
  .TP
***************
*** 79,85 ****
  Matches will be printed with
  .I num
  lines of leading and trailing context.  However,
! .B grep
  will never print any given line more than once.
  .TP
  .BI \-A " num"
--- 96,102 ----
  Matches will be printed with
  .I num
  lines of leading and trailing context.  However,
! .B vgrep
  will never print any given line more than once.
  .TP
  .BI \-A " num"
***************
*** 98,104 ****
  .TP
  .B \-V
  Print the version number of
! .B grep
  to standard error.  This version number should
  be included in all bug reports (see below).
  .TP
--- 115,121 ----
  .TP
  .B \-V
  Print the version number of
! .B vgrep
  to standard error.  This version number should
  be included in all bug reports (see below).
  .TP
***************
*** 172,178 ****
  Regular expressions are constructed analagously to arithmetic
  expressions, by using various operators to combine smaller expressions.
  .PP
! .B Grep
  understands two different versions of regular expression syntax:
  ``basic'' and ``extended.''  In
  .RB "GNU\ " grep ,
--- 189,195 ----
  Regular expressions are constructed analagously to arithmetic
  expressions, by using various operators to combine smaller expressions.
  .PP
! .B Vgrep
  understands two different versions of regular expression syntax:
  ``basic'' and ``extended.''  In
  .RB "GNU\ " grep ,
***************
*** 343,349 ****
  .BR \e) .
  .PP
  In
! .B egrep
  the metacharacter
  .B {
  loses its special meaning; instead use
--- 360,366 ----
  .BR \e) .
  .PP
  In
! .B vegrep
  the metacharacter
  .B {
  loses its special meaning; instead use
***************
*** 357,362 ****
--- 374,401 ----
  Exit status is 2 if there were syntax errors
  in the pattern, inaccessible input files, or
  other system errors.
+ .SH EXAMPLES
+ Grep for ``foo'' in version 1.43 of smile.c:
+ .IP
+ \fCvgrep foo smile.c[1.43]\fP
+ .LP
+ Grep for ``foo'' in the last version of smile.c (last saved version or
+ busy file, if available):
+ .IP
+ \fCvgrep -last foo smile.c\fP
+ .LP
+ Grep for ``foo'' in all versions of C files that have been created
+ since February 14 1993:
+ .IP
+ \fCvgrep -since 14.2.93 foo \e\(**.c\fP
+ .LP
+ Grep for ``foo'' in all versions carrying the symbolic name
+ ``Release-2.3'':
+ .IP
+ \fCvgrep foo \e\(**[Release-2.3]\fP
+ .SH "SEE ALSO"
+ emacs(1), ed(1), sh(1), vbind(1), atread(3),
+ .I "GNU Emacs Manual"
  .SH BUGS
  .PP
  Email bug reports to
***************
*** 365,375 ****
  .PP
  Large repetition counts in the
  .BI { m , n }
! construct may cause grep to use lots of memory.
  In addition,
  certain other obscure regular expressions require exponential time
  and space, and may cause
! .B grep
  to run out of memory.
  .PP
  Backreferences are very slow, and may require exponential time.
--- 404,414 ----
  .PP
  Large repetition counts in the
  .BI { m , n }
! construct may cause vgrep to use lots of memory.
  In addition,
  certain other obscure regular expressions require exponential time
  and space, and may cause
! .B vgrep
  to run out of memory.
  .PP
  Backreferences are very slow, and may require exponential time.
*** ../grep-2.0/tests/check.sh	Sun May  2 20:13:22 1993
--- tests/check.sh	Fri Apr 22 10:09:38 1994
***************
*** 7,13 ****
  failures=0
  
  # The Khadafy test is brought to you by Scott Anderson . . .
! ./grep -E -f $testdir/khadafy.regexp $testdir/khadafy.lines > khadafy.out
  if cmp $testdir/khadafy.lines khadafy.out
  then
  	:
--- 7,13 ----
  failures=0
  
  # The Khadafy test is brought to you by Scott Anderson . . .
! ./vgrep -E -f $testdir/khadafy.regexp $testdir/khadafy.lines > khadafy.out
  if cmp $testdir/khadafy.lines khadafy.out
  then
  	:
*** ../grep-2.0/tests/scriptgen.awk	Sun Apr  4 00:49:54 1993
--- tests/scriptgen.awk	Wed Jun  8 11:29:29 1994
***************
*** 1,6 ****
  BEGIN { print "failures=0"; }
  $0 !~ /^#/ && NF == 3 {
! 	print "echo '" $3 "' | ./grep -E -e '" $2 "' > /dev/null 2>&1";
  	print "if [ $? != " $1 " ]"
  	print "then"
  	printf "\techo Spencer test \\#%d failed\n", ++n
--- 1,6 ----
  BEGIN { print "failures=0"; }
  $0 !~ /^#/ && NF == 3 {
! 	print "echo '" $3 "' | ./vgrep -E -e '" $2 "' > /dev/null 2>&1";
  	print "if [ $? != " $1 " ]"
  	print "then"
  	printf "\techo Spencer test \\#%d failed\n", ++n
