Bill added more buffers, and I put in sccs.
authorMark Horton <mark@ucbvax.Berkeley.EDU>
Sat, 2 Aug 1980 11:45:07 +0000 (03:45 -0800)
committerMark Horton <mark@ucbvax.Berkeley.EDU>
Sat, 2 Aug 1980 11:45:07 +0000 (03:45 -0800)
SCCS-vsn: usr.bin/ex/ex_cmds.c 4.2
SCCS-vsn: usr.bin/ex/ex_cmds2.c 4.2
SCCS-vsn: usr.bin/ex/ex_cmdsub.c 4.2
SCCS-vsn: usr.bin/ex/ex_data.c 4.2
SCCS-vsn: usr.bin/ex/ex_get.c 4.2
SCCS-vsn: usr.bin/ex/ex_io.c 4.2
SCCS-vsn: usr.bin/ex/ex_put.c 4.2
SCCS-vsn: usr.bin/ex/ex_re.c 4.2
SCCS-vsn: usr.bin/ex/ex_re.h 4.2
SCCS-vsn: usr.bin/ex/ex_set.c 4.2
SCCS-vsn: usr.bin/ex/ex_subr.c 4.2
SCCS-vsn: usr.bin/ex/ex_temp.c 4.2
SCCS-vsn: usr.bin/ex/ex_temp.h 4.2
SCCS-vsn: usr.bin/ex/ex_tty.c 4.2
SCCS-vsn: usr.bin/ex/ex_tty.h 4.2
SCCS-vsn: usr.bin/ex/ex_unix.c 4.2
SCCS-vsn: usr.bin/ex/ex_v.c 4.2
SCCS-vsn: usr.bin/ex/ex_vadj.c 4.2
SCCS-vsn: usr.bin/ex/ex_vars.h 4.2
SCCS-vsn: usr.bin/ex/ex_vget.c 4.2
SCCS-vsn: usr.bin/ex/ex_vis.h 4.2
SCCS-vsn: usr.bin/ex/ex_vmain.c 4.2
SCCS-vsn: usr.bin/ex/ex_voper.c 4.2
SCCS-vsn: usr.bin/ex/ex_vops.c 4.2
SCCS-vsn: usr.bin/ex/ex_vops2.c 4.2
SCCS-vsn: usr.bin/ex/ex_vops3.c 4.2
SCCS-vsn: usr.bin/ex/ex_vput.c 4.2
SCCS-vsn: usr.bin/ex/ex_vwind.c 4.2
SCCS-vsn: usr.bin/ex/ex3.7preserve/ex3.7preserve.c 4.2
SCCS-vsn: usr.bin/ex/ex3.7recover/ex3.7recover.c 4.2
SCCS-vsn: usr.bin/ex/Makefile 4.2
SCCS-vsn: usr.bin/ex/OTHER/makefile.70 4.2
SCCS-vsn: usr.bin/ex/makeoptions 4.2
SCCS-vsn: usr.bin/ex/printf.c 4.2

34 files changed:
usr/src/usr.bin/ex/Makefile
usr/src/usr.bin/ex/OTHER/makefile.70
usr/src/usr.bin/ex/ex3.7preserve/ex3.7preserve.c
usr/src/usr.bin/ex/ex3.7recover/ex3.7recover.c
usr/src/usr.bin/ex/ex_cmds.c
usr/src/usr.bin/ex/ex_cmds2.c
usr/src/usr.bin/ex/ex_cmdsub.c
usr/src/usr.bin/ex/ex_data.c
usr/src/usr.bin/ex/ex_get.c
usr/src/usr.bin/ex/ex_io.c
usr/src/usr.bin/ex/ex_put.c
usr/src/usr.bin/ex/ex_re.c
usr/src/usr.bin/ex/ex_re.h
usr/src/usr.bin/ex/ex_set.c
usr/src/usr.bin/ex/ex_subr.c
usr/src/usr.bin/ex/ex_temp.c
usr/src/usr.bin/ex/ex_temp.h
usr/src/usr.bin/ex/ex_tty.c
usr/src/usr.bin/ex/ex_tty.h
usr/src/usr.bin/ex/ex_unix.c
usr/src/usr.bin/ex/ex_v.c
usr/src/usr.bin/ex/ex_vadj.c
usr/src/usr.bin/ex/ex_vars.h
usr/src/usr.bin/ex/ex_vget.c
usr/src/usr.bin/ex/ex_vis.h
usr/src/usr.bin/ex/ex_vmain.c
usr/src/usr.bin/ex/ex_voper.c
usr/src/usr.bin/ex/ex_vops.c
usr/src/usr.bin/ex/ex_vops2.c
usr/src/usr.bin/ex/ex_vops3.c
usr/src/usr.bin/ex/ex_vput.c
usr/src/usr.bin/ex/ex_vwind.c
usr/src/usr.bin/ex/makeoptions
usr/src/usr.bin/ex/printf.c

index bb182d7..b66534a 100644 (file)
@@ -1,52 +1,57 @@
 VERSION=3.4
 #
 VERSION=3.4
 #
-# Ex skeletal makefile for version 7
+# Ex skeletal makefile for VAX VM/Unix version 7
 #
 # NB: This makefile doesn't indicate any dependencies on header files.
 #
 #
 # NB: This makefile doesn't indicate any dependencies on header files.
 #
-# Ex is very large - it may not fit on PDP-11's depending on the operating
-# system and the cflags you turn on. Things that can be turned off to save
+# Ex is very large - this version will not fit on PDP-11's without overlay
+# software.  Things that can be turned off to save
 # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
 # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
 # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
 # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
-# chdir command.)
+# chdir command.)  VMUNIX makes ex considerably larger, raising many limits
+# and improving speed and simplicity of maintenance.  It is suitable only
+# for a VAX or other large machine, and then probably only in a paged system.
 #
 # Don't define VFORK unless your system has the VFORK system call,
 # which is like fork but the two processes have only one data space until the
 # child execs. This speeds up ex by saving the memory copy.
 #
 # Don't define VFORK unless your system has the VFORK system call,
 # which is like fork but the two processes have only one data space until the
 # child execs. This speeds up ex by saving the memory copy.
-# -DVMUNIX makes an ex which can edit very large files (eg the w2a dictionary)
-# this allows 200000 lines and about 16M byte temp files.
 #
 # If your system expands tabs to 4 spaces you should -DTABS=4 below
 #
 #
 # If your system expands tabs to 4 spaces you should -DTABS=4 below
 #
-# Ex is likely to overflow the symbol table in your C compiler.
-# It can use -t0 which is (purportedly) a C compiler with a larger
-# symbol table.  The -t1 flag to the C compiler is for a C compiler
-# which puts switch code in I space, increasing the text space size
-# to the benefit of per-user data space.  If you don't have this it
-# doesn't matter much. Another method, which works on v7 pdp-11's,
-# is to use pcc for ex_io.c instead of cc.
-#
 BINDIR=        /usr/ucb
 NBINDIR=/usr/new
 LIBDIR=        /usr/lib
 FOLD=  ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
 BINDIR=        /usr/ucb
 NBINDIR=/usr/new
 LIBDIR=        /usr/lib
 FOLD=  ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
-DEBUGFLAGS=    -DTRACE
-NONDEBUGFLAGS= -O
-CFLAGS=        -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DMACROS -DVFORK -DVMUNIX ${NONDEBUGFLAGS}
+DEBUGFLAGS=    -DTRACE -g
+#
+# D O   N O T   D I S T R I B U T E   E X    W I T H   H O R S E   I N   I T!!!
+NONDEBUGFLAGS= -O -DHORSE
+DEB=   ${NONDEBUGFLAGS}        # or ${DEBUGFLAGS} to to debug
+CFLAGS=        -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB}
+LDFLAGS=       -z              # or -i or -n
 TERMLIB=       -ltermlib
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 PR=    pr
 TERMLIB=       -ltermlib
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 PR=    pr
-OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_data.o ex_get.o \
-       ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
+OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
+       ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
+       ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
        ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
        ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
-       printf.o strings.o
-
-all:   a.out exrecover expreserve tags
+       printf.o bcopy.o horse.o strings.o
+HDRS=  ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
+SRC1=  ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
+SRC2=  ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
+SRC3=  ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
+SRC4=  ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voperate.c
+SRC5=  ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
+SRC6=  printf.c bcopy.c expreserve.c exrecover.c
+MISC=  makefile READ_ME :rofix
+VGRIND=        csh /usr/ucb/vgrind
+VHDR=  "Ex Version ${VERSION}"
 
 .c.o:
 #      ${MKSTR} - ex${VERSION}strings x $*.c
 
 .c.o:
 #      ${MKSTR} - ex${VERSION}strings x $*.c
@@ -56,16 +61,22 @@ all:        a.out exrecover expreserve tags
        mv x.o $*.o
 
 a.out: ${OBJS}
        mv x.o $*.o
 
 a.out: ${OBJS}
-       cc -i ${OBJS} ${TERMLIB}
+       cc ${LDFLAGS} ${OBJS} ${TERMLIB}
 
 
-tags:
-       ${CTAGS} -w *.h *.c
+all:   a.out exrecover expreserve tags
+
+tags:  /tmp
+       ${CTAGS} -w ex.[hc] ex_*.[hc]
 
 ${OBJS}: ex_vars.h
 
 ex_vars.h:
        csh makeoptions ${CFLAGS}
 
 
 ${OBJS}: ex_vars.h
 
 ex_vars.h:
        csh makeoptions ${CFLAGS}
 
+bcopy.o:       bcopy.c
+       cc -c ${CFLAGS} bcopy.c
+
+# xstr: hands off!
 strings.o: strings
        ${XSTR}
        ${CC} -c -S xs.c
 strings.o: strings
        ${XSTR}
        ${CC} -c -S xs.c
@@ -87,17 +98,19 @@ expreserve.o:
 
 clean:
 #      If we dont have ex we cant make it so dont rm ex_vars.h
 
 clean:
 #      If we dont have ex we cant make it so dont rm ex_vars.h
-       -rm -f a.out exrecover expreserve ex${VERSION}strings strings core trace tags
+       -rm -f a.out exrecover expreserve strings core errs trace
        -rm -f *.o x*.[cs]
 
        -rm -f *.o x*.[cs]
 
+# install a new version for testing in /usr/new
 ninstall: a.out
 ninstall: a.out
-       -rm -f ${NBINDIR}/ex ${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
-       cp a.out ${NBINDIR}/ex
+       -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
+       cp a.out ${DESTDIR}${NBINDIR}/ex
 #      -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
 #      -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
-       ln ${NBINDIR}/ex ${NBINDIR}/vi
+       ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
        ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
        ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
-       chmod 1755 ${NBINDIR}/ex
+       chmod 1755 ${DESTDIR}${NBINDIR}/ex
 
 
+# install in standard place (/usr/ucb)
 install: a.out exrecover expreserve
        -rm -f ${DESTDIR}${BINDIR}/ex
        -rm -f ${DESTDIR}${BINDIR}/vi
 install: a.out exrecover expreserve
        -rm -f ${DESTDIR}${BINDIR}/ex
        -rm -f ${DESTDIR}${BINDIR}/vi
@@ -114,14 +127,30 @@ install: a.out exrecover expreserve
        ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
        chmod 1755 ${DESTDIR}${BINDIR}/ex
        cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
        ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
        chmod 1755 ${DESTDIR}${BINDIR}/ex
        cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
-       cp expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve
+       cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
        chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
        chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
+# The following line normally fails.  This is OK.
        mkdir ${DESTDIR}/usr/preserve
 
        mkdir ${DESTDIR}/usr/preserve
 
+# move from /usr/new to /usr/ucb
+newucb: a.out
+       -rm -f ${DESTDIR}${BINDIR}/ex
+       -rm -f ${DESTDIR}${BINDIR}/vi
+       -rm -f ${DESTDIR}${BINDIR}/edit
+       -rm -f ${DESTDIR}${BINDIR}/e
+       -rm -f ${DESTDIR}/usr/bin/ex
+       mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
+       -rm -f ${DESTDIR}${NBINDIR}/vi
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
+       chmod 1755 ${DESTDIR}${BINDIR}/ex
+
 lint:
 lint:
-       lint ex.c ex_?*.c
-       lint -u exrecover.c
-       lint expreserve.c
+       lint ${CFLAGS} ex.c ex_?*.c
+       lint ${CFLAGS} -u exrecover.c
+       lint ${CFLAGS} expreserve.c
 
 print:
        @${PR} READ* BUGS
 
 print:
        @${PR} READ* BUGS
@@ -137,3 +166,14 @@ print:
        @ls -ls | ${PR}
        @${CXREF} *.c | ${PR} -h XREF
        @${PR} *.h *.c
        @ls -ls | ${PR}
        @${CXREF} *.c | ${PR} -h XREF
        @${PR} *.h *.c
+vgrind:
+       tee index < /dev/null
+#      ${VGRIND} -h ${VHDR} ${HDRS}
+#      ${VGRIND} -h ${VHDR} ${SRC1}
+#      ${VGRIND} -h ${VHDR} ${SRC2}
+       ${VGRIND} -h ${VHDR} ${SRC3}
+       ${VGRIND} -h ${VHDR} ${SRC4}
+       ${VGRIND} -h ${VHDR} ${SRC5}
+       ${VGRIND} -h ${VHDR} ${SRC6}
+#      ${VGRIND} -n -h ${VHDR} ${MISC}
+       ${VGRIND} -i -h ${VHDR} index
index bb182d7..b66534a 100644 (file)
@@ -1,52 +1,57 @@
 VERSION=3.4
 #
 VERSION=3.4
 #
-# Ex skeletal makefile for version 7
+# Ex skeletal makefile for VAX VM/Unix version 7
 #
 # NB: This makefile doesn't indicate any dependencies on header files.
 #
 #
 # NB: This makefile doesn't indicate any dependencies on header files.
 #
-# Ex is very large - it may not fit on PDP-11's depending on the operating
-# system and the cflags you turn on. Things that can be turned off to save
+# Ex is very large - this version will not fit on PDP-11's without overlay
+# software.  Things that can be turned off to save
 # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
 # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
 # space include LISPCODE (-l flag, showmatch and lisp options), UCVISUAL
 # (visual \ nonsense on upper case only terminals), CHDIR (the undocumented
-# chdir command.)
+# chdir command.)  VMUNIX makes ex considerably larger, raising many limits
+# and improving speed and simplicity of maintenance.  It is suitable only
+# for a VAX or other large machine, and then probably only in a paged system.
 #
 # Don't define VFORK unless your system has the VFORK system call,
 # which is like fork but the two processes have only one data space until the
 # child execs. This speeds up ex by saving the memory copy.
 #
 # Don't define VFORK unless your system has the VFORK system call,
 # which is like fork but the two processes have only one data space until the
 # child execs. This speeds up ex by saving the memory copy.
-# -DVMUNIX makes an ex which can edit very large files (eg the w2a dictionary)
-# this allows 200000 lines and about 16M byte temp files.
 #
 # If your system expands tabs to 4 spaces you should -DTABS=4 below
 #
 #
 # If your system expands tabs to 4 spaces you should -DTABS=4 below
 #
-# Ex is likely to overflow the symbol table in your C compiler.
-# It can use -t0 which is (purportedly) a C compiler with a larger
-# symbol table.  The -t1 flag to the C compiler is for a C compiler
-# which puts switch code in I space, increasing the text space size
-# to the benefit of per-user data space.  If you don't have this it
-# doesn't matter much. Another method, which works on v7 pdp-11's,
-# is to use pcc for ex_io.c instead of cc.
-#
 BINDIR=        /usr/ucb
 NBINDIR=/usr/new
 LIBDIR=        /usr/lib
 FOLD=  ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
 BINDIR=        /usr/ucb
 NBINDIR=/usr/new
 LIBDIR=        /usr/lib
 FOLD=  ${BINDIR}/fold
 CTAGS= ${BINDIR}/ctags
 XSTR=  ${BINDIR}/xstr
-DEBUGFLAGS=    -DTRACE
-NONDEBUGFLAGS= -O
-CFLAGS=        -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DMACROS -DVFORK -DVMUNIX ${NONDEBUGFLAGS}
+DEBUGFLAGS=    -DTRACE -g
+#
+# D O   N O T   D I S T R I B U T E   E X    W I T H   H O R S E   I N   I T!!!
+NONDEBUGFLAGS= -O -DHORSE
+DEB=   ${NONDEBUGFLAGS}        # or ${DEBUGFLAGS} to to debug
+CFLAGS=        -DTABS=8 -DLISPCODE -DCHDIR -DUCVISUAL -DVFORK -DVMUNIX ${DEB}
+LDFLAGS=       -z              # or -i or -n
 TERMLIB=       -ltermlib
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 PR=    pr
 TERMLIB=       -ltermlib
 MKSTR= ${BINDIR}/mkstr
 CXREF= ${BINDIR}/cxref
 INCLUDE=/usr/include
 PR=    pr
-OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o ex_data.o ex_get.o \
-       ex_io.o ex_put.o ex_re.o ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
+OBJS=  ex.o ex_addr.o ex_cmds.o ex_cmds2.o ex_cmdsub.o \
+       ex_data.o ex_get.o ex_io.o ex_put.o ex_re.o \
+       ex_set.o ex_subr.o ex_temp.o ex_tty.o ex_unix.o \
        ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
        ex_v.o ex_vadj.o ex_vget.o ex_vmain.o ex_voperate.o \
        ex_vops.o ex_vops2.o ex_vops3.o ex_vput.o ex_vwind.o \
-       printf.o strings.o
-
-all:   a.out exrecover expreserve tags
+       printf.o bcopy.o horse.o strings.o
+HDRS=  ex.h ex_argv.h ex_re.h ex_temp.h ex_tty.h ex_tune.h ex_vars.h ex_vis.h
+SRC1=  ex.c ex_addr.c ex_cmds.c ex_cmds2.c ex_cmdsub.c
+SRC2=  ex_data.c ex_get.c ex_io.c ex_put.c ex_re.c
+SRC3=  ex_set.c ex_subr.c ex_temp.c ex_tty.c ex_unix.c
+SRC4=  ex_v.c ex_vadj.c ex_vget.c ex_vmain.c ex_voperate.c
+SRC5=  ex_vops.c ex_vops2.c ex_vops3.c ex_vput.c ex_vwind.c
+SRC6=  printf.c bcopy.c expreserve.c exrecover.c
+MISC=  makefile READ_ME :rofix
+VGRIND=        csh /usr/ucb/vgrind
+VHDR=  "Ex Version ${VERSION}"
 
 .c.o:
 #      ${MKSTR} - ex${VERSION}strings x $*.c
 
 .c.o:
 #      ${MKSTR} - ex${VERSION}strings x $*.c
@@ -56,16 +61,22 @@ all:        a.out exrecover expreserve tags
        mv x.o $*.o
 
 a.out: ${OBJS}
        mv x.o $*.o
 
 a.out: ${OBJS}
-       cc -i ${OBJS} ${TERMLIB}
+       cc ${LDFLAGS} ${OBJS} ${TERMLIB}
 
 
-tags:
-       ${CTAGS} -w *.h *.c
+all:   a.out exrecover expreserve tags
+
+tags:  /tmp
+       ${CTAGS} -w ex.[hc] ex_*.[hc]
 
 ${OBJS}: ex_vars.h
 
 ex_vars.h:
        csh makeoptions ${CFLAGS}
 
 
 ${OBJS}: ex_vars.h
 
 ex_vars.h:
        csh makeoptions ${CFLAGS}
 
+bcopy.o:       bcopy.c
+       cc -c ${CFLAGS} bcopy.c
+
+# xstr: hands off!
 strings.o: strings
        ${XSTR}
        ${CC} -c -S xs.c
 strings.o: strings
        ${XSTR}
        ${CC} -c -S xs.c
@@ -87,17 +98,19 @@ expreserve.o:
 
 clean:
 #      If we dont have ex we cant make it so dont rm ex_vars.h
 
 clean:
 #      If we dont have ex we cant make it so dont rm ex_vars.h
-       -rm -f a.out exrecover expreserve ex${VERSION}strings strings core trace tags
+       -rm -f a.out exrecover expreserve strings core errs trace
        -rm -f *.o x*.[cs]
 
        -rm -f *.o x*.[cs]
 
+# install a new version for testing in /usr/new
 ninstall: a.out
 ninstall: a.out
-       -rm -f ${NBINDIR}/ex ${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
-       cp a.out ${NBINDIR}/ex
+       -rm -f ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi ${DESTDIR}${NBINDIR}/view
+       cp a.out ${DESTDIR}${NBINDIR}/ex
 #      -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
 #      -cp ex${VERSION}strings ${LIBDIR}/ex${VERSION}strings
-       ln ${NBINDIR}/ex ${NBINDIR}/vi
+       ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/vi
        ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
        ln ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/view
-       chmod 1755 ${NBINDIR}/ex
+       chmod 1755 ${DESTDIR}${NBINDIR}/ex
 
 
+# install in standard place (/usr/ucb)
 install: a.out exrecover expreserve
        -rm -f ${DESTDIR}${BINDIR}/ex
        -rm -f ${DESTDIR}${BINDIR}/vi
 install: a.out exrecover expreserve
        -rm -f ${DESTDIR}${BINDIR}/ex
        -rm -f ${DESTDIR}${BINDIR}/vi
@@ -114,14 +127,30 @@ install: a.out exrecover expreserve
        ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
        chmod 1755 ${DESTDIR}${BINDIR}/ex
        cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
        ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
        chmod 1755 ${DESTDIR}${BINDIR}/ex
        cp exrecover ${DESTDIR}${LIBDIR}/ex${VERSION}recover
-       cp expreserve ${DESTDIR}/${LIBDIR}/ex${VERSION}preserve
+       cp expreserve ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
        chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
        chmod 4755 ${DESTDIR}${LIBDIR}/ex${VERSION}recover ${DESTDIR}${LIBDIR}/ex${VERSION}preserve
+# The following line normally fails.  This is OK.
        mkdir ${DESTDIR}/usr/preserve
 
        mkdir ${DESTDIR}/usr/preserve
 
+# move from /usr/new to /usr/ucb
+newucb: a.out
+       -rm -f ${DESTDIR}${BINDIR}/ex
+       -rm -f ${DESTDIR}${BINDIR}/vi
+       -rm -f ${DESTDIR}${BINDIR}/edit
+       -rm -f ${DESTDIR}${BINDIR}/e
+       -rm -f ${DESTDIR}/usr/bin/ex
+       mv ${DESTDIR}${NBINDIR}/ex ${DESTDIR}${NBINDIR}/ex
+       -rm -f ${DESTDIR}${NBINDIR}/vi
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/edit
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/e
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}${BINDIR}/vi
+       ln ${DESTDIR}${BINDIR}/ex ${DESTDIR}/usr/bin/ex
+       chmod 1755 ${DESTDIR}${BINDIR}/ex
+
 lint:
 lint:
-       lint ex.c ex_?*.c
-       lint -u exrecover.c
-       lint expreserve.c
+       lint ${CFLAGS} ex.c ex_?*.c
+       lint ${CFLAGS} -u exrecover.c
+       lint ${CFLAGS} expreserve.c
 
 print:
        @${PR} READ* BUGS
 
 print:
        @${PR} READ* BUGS
@@ -137,3 +166,14 @@ print:
        @ls -ls | ${PR}
        @${CXREF} *.c | ${PR} -h XREF
        @${PR} *.h *.c
        @ls -ls | ${PR}
        @${CXREF} *.c | ${PR} -h XREF
        @${PR} *.h *.c
+vgrind:
+       tee index < /dev/null
+#      ${VGRIND} -h ${VHDR} ${HDRS}
+#      ${VGRIND} -h ${VHDR} ${SRC1}
+#      ${VGRIND} -h ${VHDR} ${SRC2}
+       ${VGRIND} -h ${VHDR} ${SRC3}
+       ${VGRIND} -h ${VHDR} ${SRC4}
+       ${VGRIND} -h ${VHDR} ${SRC5}
+       ${VGRIND} -h ${VHDR} ${SRC6}
+#      ${VGRIND} -n -h ${VHDR} ${MISC}
+       ${VGRIND} -i -h ${VHDR} index
index 373aa69..2934468 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex3.7preserve.c     4.2 %G%";
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
 #include <stdio.h>
 #include <ctype.h>
 #include <sys/types.h>
index 218e65a..e12d722 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex3.7recover.c      4.2 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
index 7e85951..b959374 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_cmds.c   4.2 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -649,8 +650,7 @@ quit:
 /* version */
                                tail("version");
                                setNAEOL();
 /* version */
                                tail("version");
                                setNAEOL();
-                               /* should use SCCS subst here */
-                               printf("Version 3.4, June 24, 1980");
+                               printf("@(#) Version 3.4, %G%"+5);
                                noonl();
                                continue;
 
                                noonl();
                                continue;
 
index 67210cc..e50811f 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_cmds2.c  4.2 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -104,6 +105,9 @@ error0()
 {
 
        if (laste) {
 {
 
        if (laste) {
+#ifdef VMUNIX
+               tlaste();
+#endif
                laste = 0;
                sync();
        }
                laste = 0;
                sync();
        }
index ae7b2f6..c4b536d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_cmdsub.c 4.2 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
index 5883f16..690ef94 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_data.c   4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 
 #include "ex.h"
 #include "ex_tty.h"
 
index 873a511..bfb0e82 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_get.c    4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 
 #include "ex.h"
 #include "ex_tty.h"
 
index 1c329dd..52db2a6 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_io.c     4.2 %G%";
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
 #include "ex.h"
 #include "ex_argv.h"
 #include "ex_temp.h"
@@ -407,6 +408,9 @@ other:
                }
        }
        if (laste) {
                }
        }
        if (laste) {
+#ifdef VMUNIX
+               tlaste();
+#endif
                laste = 0;
                sync();
        }
                laste = 0;
                sync();
        }
index 74fbb42..222c82d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_put.c    4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index c2b21d3..60415b3 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_re.c     4.2 %G%";
 #include "ex.h"
 #include "ex_re.h"
 
 #include "ex.h"
 #include "ex_re.h"
 
index e1bb3b4..78e9cb9 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+/* sccs id:    @(#)ex_re.h     4.2 %G%  */
 /*
  * Regular expression definitions.
  * The regular expressions in ex are similar to those in ed,
 /*
  * Regular expression definitions.
  * The regular expressions in ex are similar to those in ed,
index 0939742..ed305fc 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_set.c    4.2 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 
 #include "ex.h"
 #include "ex_temp.h"
 
index c77e5fc..bf76ec3 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_subr.c   4.2 %G%";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
index 597d881..4890085 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_temp.c   4.2 %G%";
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_vis.h"
@@ -57,6 +58,12 @@ dumbness:
        tfile = creat(tfname, 0600);
        if (tfile < 0)
                goto dumbness;
        tfile = creat(tfname, 0600);
        if (tfile < 0)
                goto dumbness;
+#ifdef VMUNIX
+       {
+               extern stilinc;         /* see below */
+               stilinc = 0;
+       }
+#endif
        havetmp = 1;
        close(tfile);
        tfile = open(tfname, 2);
        havetmp = 1;
        close(tfile);
        tfile = open(tfname, 2);
@@ -205,17 +212,58 @@ getblock(atl, iof)
        return (obuff + off);
 }
 
        return (obuff + off);
 }
 
+#ifdef VMUNIX
+#define        INCORB  64
+char   incorb[INCORB+1][BUFSIZ];
+#define        pagrnd(a)       ((char *)(((int)a)&~(BUFSIZ-1)))
+int    stilinc;        /* up to here not written yet */
+#endif
+
 blkio(b, buf, iofcn)
        short b;
        char *buf;
        int (*iofcn)();
 {
 
 blkio(b, buf, iofcn)
        short b;
        char *buf;
        int (*iofcn)();
 {
 
+#ifdef VMUNIX
+       if (b < INCORB) {
+               if (iofcn == read) {
+                       bcopy(pagrnd(incorb[b+1]), buf, BUFSIZ);
+                       return;
+               }
+               bcopy(buf, pagrnd(incorb[b+1]), BUFSIZ);
+               if (laste) {
+                       if (b >= stilinc)
+                               stilinc = b + 1;
+                       return;
+               }
+       } else if (stilinc)
+               tflush();
+#endif
        lseek(tfile, (long) (unsigned) b * BUFSIZ, 0);
        if ((*iofcn)(tfile, buf, BUFSIZ) != BUFSIZ)
                filioerr(tfname);
 }
 
        lseek(tfile, (long) (unsigned) b * BUFSIZ, 0);
        if ((*iofcn)(tfile, buf, BUFSIZ) != BUFSIZ)
                filioerr(tfname);
 }
 
+#ifdef VMUNIX
+tlaste()
+{
+
+       if (stilinc)
+               dirtcnt = 0;
+}
+
+tflush()
+{
+       int i = stilinc;
+       
+       stilinc = 0;
+       lseek(tfile, (long) 0, 0);
+       if (write(tfile, pagrnd(incorb[1]), i * BUFSIZ) != (i * BUFSIZ))
+               filioerr(tfname);
+}
+#endif
+
 /*
  * Synchronize the state of the temporary file in case
  * a crash occurs.
 /*
  * Synchronize the state of the temporary file in case
  * a crash occurs.
@@ -226,6 +274,10 @@ synctmp()
        register line *a;
        register short *bp;
 
        register line *a;
        register short *bp;
 
+#ifdef VMUNIX
+       if (stilinc)
+               return;
+#endif
        if (dol == zero)
                return;
        if (ichanged)
        if (dol == zero)
                return;
        if (ichanged)
@@ -270,6 +322,10 @@ TSYNC()
 {
 
        if (dirtcnt > 12) {
 {
 
        if (dirtcnt > 12) {
+#ifdef VMUNIX
+               if (stilinc)
+                       tflush();
+#endif
                dirtcnt = 0;
                synctmp();
        }
                dirtcnt = 0;
                synctmp();
        }
index 7d4c751..b03d896 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+/* sccs id:    @(#)ex_temp.h   4.2 %G%  */
 /*
  * The editor uses a temporary file for files being edited, in a structure
  * similar to that of ed.  The first block of the file is used for a header
 /*
  * The editor uses a temporary file for files being edited, in a structure
  * similar to that of ed.  The first block of the file is used for a header
index 99b14e7..7efad18 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_tty.c    4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 
 #include "ex.h"
 #include "ex_tty.h"
 
index 522421f..31e5959 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+/* sccs id:    @(#)ex_tty.h    4.2 %G%  */
 /*
  * Capabilities from termcap
  *
 /*
  * Capabilities from termcap
  *
index 20757f1..fecdd1a 100644 (file)
@@ -1,4 +1,5 @@
 /* Copyright (c) 1979 Regents of the University of California */
 /* Copyright (c) 1979 Regents of the University of California */
+static char *sccsid = "@(#)ex_unix.c   4.2;
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_temp.h"
 #include "ex_tty.h"
index 00ef0fa..a0f1ea5 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_v.c      4.2 %G%";
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
 #include "ex.h"
 #include "ex_re.h"
 #include "ex_tty.h"
index b0d9e1e..7cbda2a 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vadj.c   4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index b4cc3d8..02a7438 100644 (file)
@@ -1,3 +1,4 @@
+/*  sccs id  @(#)ex_vars.h     4.2 %G% */
 #define AUTOINDENT      0
 #define AUTOPRINT       1
 #define AUTOWRITE       2
 #define AUTOINDENT      0
 #define AUTOPRINT       1
 #define AUTOWRITE       2
index 177c854..8d0a4a5 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vget.c   4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index ee375c0..bea3905 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+/* sccs id:    @(#)ex_vis.h    4.2 %G%  */
 /*
  * Ex version 3
  * Mark Horton, UCB
 /*
  * Ex version 3
  * Mark Horton, UCB
index 3ee9828..7ddd96a 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vmain.c  4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index 63bf53c..3c2949d 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_voper.c  4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index 21e83ed..5709ed1 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vops.c   4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index cfffc8d..1296919 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vops2.c  4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index b1ae183..55e37ce 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vops3.c  4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index b06da78..7039f72 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vput.c   4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index 18f1104..d64e5bd 100644 (file)
@@ -1,4 +1,5 @@
-/* Copyright (c) 1979 Regents of the University of California */
+/* Copyright (c) 1980 Regents of the University of California */
+static char *sccsid = "@(#)ex_vwind.c  4.2 %G%";
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
 #include "ex.h"
 #include "ex_tty.h"
 #include "ex_vis.h"
index dd7e027..1334833 100644 (file)
@@ -36,6 +36,9 @@ ex - /tmp/foo.c <<'X'
 
 .
        $s/e[   ].*[    ]/e     NOPTS   /
 
 .
        $s/e[   ].*[    ]/e     NOPTS   /
+       0a
+       /*  sccs id   @(#)  ex_vars.h  @(#)makeoptions  4.2 %G%  */
+.
        w! ex_vars.h
        q
 'X'
        w! ex_vars.h
        q
 'X'
index be24ebe..f92995d 100644 (file)
@@ -1,4 +1,7 @@
-/* char printf_id[] = "@(#) printf.c:2.2 6/5/79";*/
+/* The pwb version this is based on */
+static char printf_id[] = "@(#) printf.c:2.2 6/5/79";
+/* The local sccs version within ex */
+static char *sccsid = "@(#)printf.c    4.2 %G%";
 #include "varargs.h"
 /*
  * This version of printf is compatible with the Version 7 C
 #include "varargs.h"
 /*
  * This version of printf is compatible with the Version 7 C