v37i001: vim - Vi IMitation editor v1.27, Part01/24

39 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 23, 1993, 1:17:16 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 1
Archive-name: vim/part01
Environment: UNIX, AMIGA, MS-DOS

Vim - Vi IMitation. A clone of the UNIX text editor Vi. Very useful for
editing programs and other plain ASCII text. Full Vi compatibility (except Q
command) and includes most Ex commands.

Extra features above Vi: Multilevel undo, command line history, improved
command line editing, command typeahead display, command to display yank
buffers, possibility to edit binary files, file name stack, support for Manx
QuickFix, shows current file name in window title, on-line help, etc.

Version 1.27, update to 1.24. Most important changes:
- 'ignorecase' did not work with UNIX, fixed
- ":s/a/b/ did not work with MSDOS, fixed
- all other reported bugs fixed
- portability for UNIX improved for linux, hpux, pyramid, SCO Xenix, etc.
- improved security for .exrc and .vimrc in current directory
- a few Ex commands added and a few compatibility problems fixed
- added 'compatible' option to switch off a few vi incompatible extentions
- Vim now works on more terminals (e.g. Sun cmdtool)
- with Amiga DOS 2.0 arp.library is no longer needed
- help file is now displayed using terminal codes
- support for locale() with UNIX

Portability: Runs on Amiga, MSDOS and several UNIX versions.

Distribution:
comp.sources.misc: Sources and documentation (shell archive)
comp.binaries.amiga: AMIGA binaries and documentation (lha archive)
comp.binaries.ibm.pc: MSDOS binaries and documentation (lha archive)
(Sorry to post the documentation three times. It is the only way to guarantee
that everybody gets it. Otherwise people will start asking me for it).

The shell archive contains a few uuencoded files and the reference.doc file
is split up in three. To get the original files back you can use the
"execute.me" script.

Vim is public domain. You are encouraged to put it on ftp servers. It has
already been put on "Aminet". I will ask Fred Fish to put it on one of his
disks.

-------------8<----------------8<----------------8<---------------8<--------
#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:
# "End of archive 1 (of 23)."
# Contents: vim vim/.exrc vim/doc vim/doc/unix.doc vim/doc/vim132.uue
# vim/execute.me vim/macros vim/macros/center.uue vim/macros/hanoi
# vim/macros/hanoi/click.me vim/macros/hanoi/hanoi.mac.uue
# vim/macros/hanoi/poster vim/macros/maze vim/macros/maze/README
# vim/macros/maze/makefile vim/macros/maze/maze.c
# vim/macros/maze/maze_5.78 vim/macros/maze/maze_ansi.c
# vim/macros/maze/poster vim/macros/readme vim/src vim/src/addcr.c
# vim/src/ascii.h vim/src/debug.h vim/src/keymap.h vim/src/macros.h
# vim/src/mark.h vim/src/proto vim/src/proto.h
# vim/src/proto/alloc.pro vim/src/proto/amiga.pro
# vim/src/proto/buffers.pro vim/src/proto/charset.pro
# vim/src/proto/cmdline.pro vim/src/proto/csearch.pro
# vim/src/proto/digraph.pro vim/src/proto/edit.pro
# vim/src/proto/fileio.pro vim/src/proto/help.pro
# vim/src/proto/linefunc.pro vim/src/proto/main.pro
# vim/src/proto/mark.pro vim/src/proto/message.pro
# vim/src/proto/misccmds.pro vim/src/proto/normal.pro
# vim/src/proto/ops.pro vim/src/proto/param.pro
# vim/src/proto/quickfix.pro vim/src/proto/regexp.pro
# vim/src/proto/regsub.pro vim/src/proto/screen.pro
# vim/src/proto/script.pro vim/src/proto/search.pro
# vim/src/proto/storage.pro vim/src/proto/tag.pro
# vim/src/proto/term.pro vim/src/proto/termlib.pro
# vim/src/proto/undo.pro vim/src/ptx_stdlib.h vim/src/regexp.h
# vim/src/regmagic.h vim/src/termlib.fix.uue vim/src/vim.prj
# vim/src/vimresp vim/todo vim/tutor vim/tutor/Readme
# vim/tutor/poster
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:03 1993
PATH=/bin:/usr/bin:/usr/ucb ; export PATH
if test ! -d 'vim' ; then
echo shar: Creating directory \"'vim'\"
mkdir 'vim'
fi
if test -f 'vim/.exrc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/.exrc'\"
else
echo shar: Extracting \"'vim/.exrc'\" \(35 characters\)
sed "s/^X//" >'vim/.exrc' <<'END_OF_FILE'
Xset ai bs=2 shell=csh nojs nord ru
END_OF_FILE
if test 35 -ne `wc -c <'vim/.exrc'`; then
echo shar: \"'vim/.exrc'\" unpacked with wrong size!
fi
# end of 'vim/.exrc'
fi
if test ! -d 'vim/doc' ; then
echo shar: Creating directory \"'vim/doc'\"
mkdir 'vim/doc'
fi
if test -f 'vim/doc/unix.doc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/unix.doc'\"
else
echo shar: Extracting \"'vim/doc/unix.doc'\" \(1300 characters\)
sed "s/^X//" >'vim/doc/unix.doc' <<'END_OF_FILE'
XThis file contains the particularities for the UNIX version of Vim.
X
XThe default help filename is "/usr/local/doc/vim.hlp"
XThe files "$HOME/.vimrc" and "$HOME/.exrc" are used instead of "s:.vimrc" and
X"s:.exrc". Additionally "/usr/etc/.vimrc" is used first.
X
XTemporary files (for filtering) are put in "/tmp".
X
XIn some rare cases the terminal may have a problem with CTRL-Q or CTRL-S. To
Xget around this you can map another key to CTRL-Q and CTRL-S, and remap
XCTRL-Q and CTRL-S to nothing. You could use CTRL-W and CTRL-X:
X :noremap! ^W ^V017
X :noremap! ^X ^V019
X :noremap! ^V017 ^V^V
X :noremap! ^V019 ^V^V
X :noremap ^W ^V017
X :noremap ^X ^V019
X :noremap ^V017 ^V^V
X :noremap ^V019 ^V^V
X(^V is the single character CTRL-V. Do not use the '^' character. You have to
Xtype CTRL-V twice to get one. What is shown above is what you have to type,
Xit will look different on the screen or in the .exrc file.)
X
XWith wildcard expansion you can use <~> (home directory) and <$>
X(environment variable).
X
XIf terminal updating is slow, try resetting the 'showcommand' and the
X'ruler' option (e.g. in a shell window in suntools).
X
XThe file Vim132 is a shell script that can be used to put Vim in 132 column
Xmode on a vt100 and lookalikes.
X
XThe *.info files are for the Amiga. You don't need them with unix.
END_OF_FILE
if test 1300 -ne `wc -c <'vim/doc/unix.doc'`; then
echo shar: \"'vim/doc/unix.doc'\" unpacked with wrong size!
fi
# end of 'vim/doc/unix.doc'
fi
if test -f 'vim/doc/vim132.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/vim132.uue'\"
else
echo shar: Extracting \"'vim/doc/vim132.uue'\" \(372 characters\)
sed "s/^X//" >'vim/doc/vim132.uue' <<'END_OF_FILE'
X
Xbegin 644 vim132
XM(R$@+V)I;B]C<V@*(R!3:&5L;"!S8W)I<'0@9F]R('5S92!W:71H(%5.25@*1
XM(R!3=&%R=',@=7`@5FEM('=I=&@@=&AE('1E<FUI;F%L(&EN(#$S,B!C;VQU.
XM;6X@;6]D90HC($]N;'D@=V]R:W,@;VX@5E0M,3`P('1E<FUI;F%L<R!A;F0@,
XM;&]O:V%L:6ME<PHC"G-E="!O;&1T97)M/21T97)M"F5C:&\@(AM;/S-H(@IS[
XM971E;G8@5$5232!V=#$P,"UW(`IV:6T@)"H*<V5T('1E<FT])&]L9'1E<FT*M
X-96-H;R`B&UL_,VPB"C$P"
X``
Xend
Xsize 238
END_OF_FILE
if test 372 -ne `wc -c <'vim/doc/vim132.uue'`; then
echo shar: \"'vim/doc/vim132.uue'\" unpacked with wrong size!
fi
# end of 'vim/doc/vim132.uue'
fi
if test -f 'vim/execute.me' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/execute.me'\"
else
echo shar: Extracting \"'vim/execute.me'\" \(599 characters\)
sed "s/^X//" >'vim/execute.me' <<'END_OF_FILE'
X#execute this script while standing in the 'vim' directory
Xcd macros
Xuudecode center.uue
Xrm center.uue
Xcd maze
Xuudecode maze.mac.uue
Xrm maze.mac.uue
Xcd ../hanoi
Xuudecode hanoi.mac.uue
Xrm hanoi.mac.uue
Xcd ../../src
Xuudecode digraph.c.uue
Xuudecode tcconfig.tc.uue
Xuudecode termlib.fix.uue
Xrm digraph.c.uue tcconfig.tc.uue termlib.fix.uue
Xcd ../doc
Xuudecode vim.hlp.uue
Xuudecode digraph.doc.uue
Xuudecode vim.man.uue
Xuudecode vim132.uue
Xrm vim.hlp.uue digraph.doc.uue vim.man.uue vim132.uue
Xcat reference.doc1 reference.doc2 reference.doc3 >reference.doc
Xrm reference.doc1 reference.doc2 reference.doc3
END_OF_FILE
if test 599 -ne `wc -c <'vim/execute.me'`; then
echo shar: \"'vim/execute.me'\" unpacked with wrong size!
fi
chmod +x 'vim/execute.me'
# end of 'vim/execute.me'
fi
if test ! -d 'vim/macros' ; then
echo shar: Creating directory \"'vim/macros'\"
mkdir 'vim/macros'
fi
if test -f 'vim/macros/center.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/center.uue'\"
else
echo shar: Extracting \"'vim/macros/center.uue'\" \(274 characters\)
sed "s/^X//" >'vim/macros/center.uue' <<'END_OF_FILE'
X
Xbegin 644 center
XM(E1H:7,@;6%C<F\@8V5N=&5R<R!A(&QI;F4@:6X@86X@.#`@8VAA<F%C=&5R$
XM('-P86-E+@HB0V%R969U;#H@;&EN97,@;&]N9V5R('1H86X@.#`@8VAA<F%CY
XM=&5R<R!W:6QL(&)E('1R=6YC871E9`IM87`@.V-E(#IS+UY;(`E=*B\O#21MS
XB83@Q82`;.#$6?$1@86QL9#`Z<R\@("\@+V<-)'`-:R1X"EY;+
X``
Xend
Xsize 169
END_OF_FILE
if test 274 -ne `wc -c <'vim/macros/center.uue'`; then
echo shar: \"'vim/macros/center.uue'\" unpacked with wrong size!
fi
# end of 'vim/macros/center.uue'
fi
if test ! -d 'vim/macros/hanoi' ; then
echo shar: Creating directory \"'vim/macros/hanoi'\"
mkdir 'vim/macros/hanoi'
fi
if test -f 'vim/macros/hanoi/click.me' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/hanoi/click.me'\"
else
echo shar: Extracting \"'vim/macros/hanoi/click.me'\" \(255 characters\)
sed "s/^X//" >'vim/macros/hanoi/click.me' <<'END_OF_FILE'
X
X
XSee Vim solve the towers of Hanoi!
X
XInstructions:
X type ":so hanoi.mac<RETURN>" to load the macros
X type "g" to start it
X
Xand watch it go.
X
X to quit type ":q!<RETURN>"
Xto interrupt type CTRL-C
X
X(This text will disappear as soon as you type "g")
END_OF_FILE
if test 255 -ne `wc -c <'vim/macros/hanoi/click.me'`; then
echo shar: \"'vim/macros/hanoi/click.me'\" unpacked with wrong size!
fi
# end of 'vim/macros/hanoi/click.me'
fi
if test -f 'vim/macros/hanoi/hanoi.mac.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/hanoi/hanoi.mac.uue'\"
else
echo shar: Extracting \"'vim/macros/hanoi/hanoi.mac.uue'\" \(1577 characters\)
sed "s/^X//" >'vim/macros/hanoi/hanoi.mac.uue' <<'END_OF_FILE'
X
Xbegin 644 hanoi.mac
XM<V5T(')E;6%P"G-E="!N;W1E<G-E"G-E="!W<F%P<V-A;@HB('1O('-E="!T[
XM:&4@:&5I9VAT(&]F('1H92!T;W=E<BP@8VAA;F=E('1H92!D:6=I="!I;B!T<
XM:&4@9F]L;&]W:6YG"B(@='=O(&QI;F5S('1O('1H92!H96EG:'0@>6]U('=A1
XM;G0@*'-E;&5C="!F<F]M(#$@=&\@.2D*;6%P('0@-PIM87`A('0@-PIM87`@#
XM3"`Q1R]T#5@O7C`-)%`Q1THD06XD0D=#,&4D6#!%,$8D6"]4#4!F#4!H#21!$
XM,4=*0&8P;"18;B1050IM87`@9R!)3`H*;6%P($H@+UXP6UYT72HD#0IM87`@A
XM6"!X"FUA<"!0('`*;6%P(%4@3`IM87`@02`B9GEL"FUA<"!"(")H>6P*;6%P8
XM($,@(F9P"FUA<"!E(")F>3)L"FUA<"!%(")H<`IM87`@1B`B:'DR;`H*(B!I\
XM;FET:6%L:7-A=&EO;G,Z"B(@2TT)8VQE86YU<"!B=69F97(*(B!9"6-R96%T1
XM92!T;W=E<B!O9B!D97-I<F5D(&AE:6=H=`HB($Y/40EC;W!Y(&ET(&%N9"!I;
XM;G-T97(@82!4"B(@3D\)8V]P>2!T:&ES(&]N90HB(%,)8VAA;F=E(&QA<W0@*
XM8VAA<B!I;G1O(&$@)`HB(%()8VAA;F=E(&QA<W0@8VAA<B!I;B!P<F5V:6]U]
XM<R!L:6YE(&EN=&\@82!N"B(@5`EI;G-E<G0@='=O(&QI;F5S(&-O;G1A:6YI,
XM;F<@82!Z97)O"B(@5@EA9&0@82!L87-T(&QI;F4@8V]N=&%I;FEN9R!A(&)A5
XM8VMS;&%S:`IM87`@22!+35E.3U%.3U-K4E16"@HB8W)E871E(&5M<'1Y(&QI>
XM;F4*;6%P($L@,4=O&PH*(F1E;&5T92!T;R!E;F0@;V8@9FEL90IM87`@32!D9
XM1PH*(GEA;FL@;VYE(&QI;F4*;6%P($X@>7D*"B)P=70*;6%P($\@<`H*(F1EW
XM;&5T92!M;W)E('1H86X@:&5I9VAT+6]F+71O=V5R(&-H87)A8W1E<G,*;6%P)
XM('$@=&QL1`H*(F-R96%T92!A('1O=V5R(&]F(&1E<VER960@:&5I9VAT"FUAC
XM<"!9(&\P,3(S-#4V-S@Y6ALP<0H*(FEN<V5R="!A(%0@:6X@8V]L=6UN(#$*;
XM;6%P(%$@,&E4&PH*(G-U8G-T:71U=&4@;&%S="!C:&%R86-T97(@=VET:"!AG
XM(&X*;6%P(%(@)')N"@HB<W5B<W1I='5T92!L87-T(&-H87)A8W1E<B!W:71H[
XM(&$@)`IM87`@4R`D<B0*"B)I;G-E<G0@='=O(&QI;F5S(&-O;G1A:6YI;F<@$
XM82!Z97)O"FUA<"!4(&MO,`TP#0T;"@HB861D(&$@8F%C:W-L87-H(&%T('1HV
X192!E;F0*;6%P(%8@1V\O&PHP4
X``
Xend
Xsize 1097
END_OF_FILE
if test 1577 -ne `wc -c <'vim/macros/hanoi/hanoi.mac.uue'`; then
echo shar: \"'vim/macros/hanoi/hanoi.mac.uue'\" unpacked with wrong size!
fi
# end of 'vim/macros/hanoi/hanoi.mac.uue'
fi
if test -f 'vim/macros/hanoi/poster' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/hanoi/poster'\"
else
echo shar: Extracting \"'vim/macros/hanoi/poster'\" \(1259 characters\)
sed "s/^X//" >'vim/macros/hanoi/poster' <<'END_OF_FILE'
XArticle 2913 of alt.sources:
XPath: oce-rd1!hp4nl!mcsun!uunet!munnari.oz.au!metro!cluster!swift!softway!otc!gregm
XFrom: gr...@otc.otca.oz.au (Greg McFarlane)
XNewsgroups: comp.sources.d,alt.sources,comp.editors
XSubject: VI SOLVES HANOI
XMessage-ID: <23...@otc.otca.oz>
XDate: 19 Feb 91 01:32:14 GMT
XSender: ne...@otc.otca.oz
XReply-To: gr...@otc.otca.oz.au (Greg McFarlane)
XOrganization: OTC Development Unit, Australia
XLines: 80
XXref: oce-rd1 comp.sources.d:5702 alt.sources:2913 comp.editors:2313
X
XSubmitted-by: gr...@otc.otca.oz.au
XArchive-name: hanoi.vi.macros/part01
X
XEveryone seems to be writing stupid Tower of Hanoi programs.
XWell, here is the stupidest of them all: the hanoi solving vi macros.
X
XSave this article, unshar it, and run uudecode on hanoi.vi.macros.uu.
XThis will give you the macro file hanoi.vi.macros.
XThen run vi (with no file: just type "vi") and type:
X :so hanoi.vi.macros
X g
Xand watch it go.
X
XThe default height of the tower is 7 but can be easily changed by editing
Xthe macro file.
X
XThe disks aren't actually shown in this version, only numbers representing
Xeach disk, but I believe it is possible to write some macros to show the
Xdisks moving about as well. Any takers?
X
X(For maze solving macros, see alt.sources or comp.editors)
X
XGreg
END_OF_FILE
if test 1259 -ne `wc -c <'vim/macros/hanoi/poster'`; then
echo shar: \"'vim/macros/hanoi/poster'\" unpacked with wrong size!
fi
# end of 'vim/macros/hanoi/poster'
fi
if test ! -d 'vim/macros/maze' ; then
echo shar: Creating directory \"'vim/macros/maze'\"
mkdir 'vim/macros/maze'
fi
if test -f 'vim/macros/maze/README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/maze/README'\"
else
echo shar: Extracting \"'vim/macros/maze/README'\" \(1666 characters\)
sed "s/^X//" >'vim/macros/maze/README' <<'END_OF_FILE'
XTo prove that you can do anything in vi, I wrote a couple of macros that
Xallows vi to solve mazes. It will solve any maze produced by maze.c
Xthat was posted to the net recently.
X
XJust follow this recipe and SEE FOR YOURSELF.
X 1. run uudecode on the file "maze.vi.macros.uu" to
X produce the file "maze.vi.macros"
X (If you can't wait to see the action, jump to step 4)
X 2. compile maze.c with "cc -o maze maze.c"
X 3. run maze > maze.out and input a small number (for example 10 if
X you are on a fast machine, 3-5 if slow) which
X is the size of the maze to produce
X 4. edit the maze (vi maze.out)
X 5. include the macros with the vi command:
X :so maze.vi.macros
X 6. type the letter "g" (for "go") and watch vi solve the maze
X 7. when vi solves the maze, you will see why it lies
X 8. now look at maze.vi.macros and all will be revealed
X
XTested on a sparc, a sun and a pyramid (although maze.c will not compile
Xon the pyramid).
X
XAnyone who can't get the maze.c file to compile, get a new compiler,
Xtry maze.ansi.c which was also posted to the net.
XIf you can get it to compile but the maze comes out looking like a fence
Xand not a maze and you are using SysV or DOS replace the "27" on the
Xlast line of maze.c by "11"
XThanks to John Tromp (tr...@piring.cwi.nl) for maze.c.
XThanks to ant...@nntp-server.caltech.edu (Bill T. Cat) for maze.ansi.c.
X
XAny donations should be in unmarked small denomination bills :^)=.
X
X ACSnet: gr...@otc.otca.oz.au
XGreg McFarlane UUCP: {uunet,mcvax}!otc.otca.oz.au!gregm
X|||| OTC || Snail: OTC R&D GPO Box 7000, Sydney 2001, Australia
X Phone: +61 2 287 3139 Fax: +61 2 287 3299
X
X
END_OF_FILE
if test 1666 -ne `wc -c <'vim/macros/maze/README'`; then
echo shar: \"'vim/macros/maze/README'\" unpacked with wrong size!
fi
# end of 'vim/macros/maze/README'
fi
if test -f 'vim/macros/maze/makefile' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/maze/makefile'\"
else
echo shar: Extracting \"'vim/macros/maze/makefile'\" \(104 characters\)
sed "s/^X//" >'vim/macros/maze/makefile' <<'END_OF_FILE'
X#On the amiga with manx C 5.0 we have to use maze.ansi.c
X
Xmaze: maze.ansi.o
X ln maze.ansi.o -o maze -lc
END_OF_FILE
if test 104 -ne `wc -c <'vim/macros/maze/makefile'`; then
echo shar: \"'vim/macros/maze/makefile'\" unpacked with wrong size!
fi
# end of 'vim/macros/maze/makefile'
fi
if test -f 'vim/macros/maze/maze.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/maze/maze.c'\"
else
echo shar: Extracting \"'vim/macros/maze/maze.c'\" \(441 characters\)
sed "s/^X//" >'vim/macros/maze/maze.c' <<'END_OF_FILE'
Xchar*M,A,Z,E=40,J[40],T[40];main(C){for(*J=A=scanf(M="%d",&C);
X-- E; J[ E] =T
X[E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|"
X) , A = 39 ,C --
X) ; Z || printf (M ))M[Z]=Z[A-(E =A[J-Z])&&!C
X& A == T[ A]
X|6<<27<rand()||!C&!Z?J[T[E]=T[A]]=E,J[T[A]=A-Z]=A,"_.":" |"];}
END_OF_FILE
if test 441 -ne `wc -c <'vim/macros/maze/maze.c'`; then
echo shar: \"'vim/macros/maze/maze.c'\" unpacked with wrong size!
fi
# end of 'vim/macros/maze/maze.c'
fi
if test -f 'vim/macros/maze/maze_5.78' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/maze/maze_5.78'\"
else
echo shar: Extracting \"'vim/macros/maze/maze_5.78'\" \(758 characters\)
sed "s/^X//" >'vim/macros/maze/maze_5.78' <<'END_OF_FILE'
X._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
X| ._| . . ._| | |_._._. . ._|_._._._._. ._|_. ._|_._. ._| . ._|_. | . ._._. |
X| ._|_| |_. | | | | ._._|_._|_._. . |_. | | | ._._| |_._._| | ._. ._| . . |_|
X|_._._._. | ._|_. ._._._. | | ._. |_._. . | ._._| |_. | ._._._. |_. | |_|_| |
X| | . |_._| . ._._._| ._._. ._._| | | |_| . | |_. . ._|_| ._._. |_._|_| . | |
X|_._|_._._._|_._._._|_|_._._._|_._|_._._._|_._._._|_._._._|_._._._._._._|_._|
X
XSee Vim solve a maze!
X
X type ":so maze<DOT>mac<RETURN>" to load the macros
X (replace <DOT> by a real dot; can't type it here because the
X macros use the last dot in the file as the goal in the maze)
X type "g" to start
X
Xto interrupt type "<CTRL-C>"
X to quit type ":q!<RETURN>"
X
END_OF_FILE
if test 758 -ne `wc -c <'vim/macros/maze/maze_5.78'`; then
echo shar: \"'vim/macros/maze/maze_5.78'\" unpacked with wrong size!
fi
# end of 'vim/macros/maze/maze_5.78'
fi
if test -f 'vim/macros/maze/maze_ansi.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/maze/maze_ansi.c'\"
else
echo shar: Extracting \"'vim/macros/maze/maze_ansi.c'\" \(441 characters\)
sed "s/^X//" >'vim/macros/maze/maze_ansi.c' <<'END_OF_FILE'
Xchar*M,A,Z,E=40,J[80],T[3];main(C){for(M=J+E,*J=A=scanf("%d",&
XC) ;-- E;J [E ]=M
X[E ]= E) printf("._"); for(;(A-=Z=!Z) || (printf("\n|"
X) , A = 39 ,C --
X) ; Z || printf (T ))T[Z]=Z[A-(E =A[J-Z])&&!C
X& A == M[ A]
X|6<<11<rand()||!C&!Z?J[M[E]=M[A]]=E,J[M[A]=A-Z]=A,"_.":" |"];}
END_OF_FILE
if test 441 -ne `wc -c <'vim/macros/maze/maze_ansi.c'`; then
echo shar: \"'vim/macros/maze/maze_ansi.c'\" unpacked with wrong size!
fi
# end of 'vim/macros/maze/maze_ansi.c'
fi
if test -f 'vim/macros/maze/poster' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/maze/poster'\"
else
echo shar: Extracting \"'vim/macros/maze/poster'\" \(1562 characters\)
sed "s/^X//" >'vim/macros/maze/poster' <<'END_OF_FILE'
XArticle 2846 of alt.sources:
XPath: oce-rd1!hp4nl!mcsun!uunet!munnari.oz.au!metro!otc!gregm
XFrom: gr...@otc.otca.oz.au (Greg McFarlane)
XNewsgroups: alt.sources
XSubject: VI SOLVES MAZE (commented macros)
XMessage-ID: <22...@otc.otca.oz>
XDate: 10 Feb 91 23:31:02 GMT
XSender: ne...@otc.otca.oz
XReply-To: gr...@otc.otca.oz.au (Greg McFarlane)
XOrganization: OTC Development Unit, Australia
XLines: 464
X
XSubmitted-by: gr...@otc.otca.oz.au
XArchive-name: maze_solving_vi_macros
X
XA real working model. See it walk the maze in front of your very own eyes.
X
XTo prove that you can do anything in vi, I wrote a couple of macros that
Xallows vi to solve mazes. It will solve any maze produced by maze.c
Xthat was posted to the alt.sources last month. (Maze.c is also included
Xin this posting as well as an example of its output.)
X
XThe uncommented version of the macros was sent to alt.sources last month.
XHowever, so many people mailed me requesting the commented version of the
Xmacros that I decided to post it. I have made some modifications to the
Xoriginal macros to make them easier to follow and also after I learnt
Xthat you can escape the special meaning of '|' in macros by using '^V|'.
X
XSave this article and unshar it. Then read maze.README.
X
XAfter studying these macros, anyone who cannot write an emacs emulator
Xin vi macros should just curl up and :q!.
X
XComing soon to a newsgroup near you: "Vi macros solve Tower of Hanoi",
Xand a repost of the original "Turing Machine implemented in Vi macros"
X
XAnyone who has a version of these macros for edlin or nroff, please post.
END_OF_FILE
if test 1562 -ne `wc -c <'vim/macros/maze/poster'`; then
echo shar: \"'vim/macros/maze/poster'\" unpacked with wrong size!
fi
# end of 'vim/macros/maze/poster'
fi
if test -f 'vim/macros/readme' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/macros/readme'\"
else
echo shar: Extracting \"'vim/macros/readme'\" \(271 characters\)
sed "s/^X//" >'vim/macros/readme' <<'END_OF_FILE'
XThe macros in these directories can be used to test Vim for vi compatibility.
XThey have been written for vi to show its unlimited possibilities.
X
XHANOI are macros that solve the tower of hanoi problem.
XMAZE are macros that solve a maze (amazing!).
X
XThey are unmodified.
END_OF_FILE
if test 271 -ne `wc -c <'vim/macros/readme'`; then
echo shar: \"'vim/macros/readme'\" unpacked with wrong size!
fi
# end of 'vim/macros/readme'
fi
if test ! -d 'vim/src' ; then
echo shar: Creating directory \"'vim/src'\"
mkdir 'vim/src'
fi
if test -f 'vim/src/addcr.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/addcr.c'\"
else
echo shar: Extracting \"'vim/src/addcr.c'\" \(413 characters\)
sed "s/^X//" >'vim/src/addcr.c' <<'END_OF_FILE'
X/*
X * This program, when compiled with Turbo-C, will make <LF> into <CR><LF>
X */
X
X#include <stdio.h>
X
Xmain(argc, argv)
X int argc;
X char **argv;
X{
X char buffer[1024];
X int len;
X
X while ((len = fread(buffer, 1, 1024, stdin)) > 0)
X fwrite(buffer, 1, len, stdout);
X if (ferror(stdin))
X fprintf(stderr, "Error while reading\n");
X if (ferror(stdout))
X fprintf(stderr, "Error while writing\n");
X}
END_OF_FILE
if test 413 -ne `wc -c <'vim/src/addcr.c'`; then
echo shar: \"'vim/src/addcr.c'\" unpacked with wrong size!
fi
# end of 'vim/src/addcr.c'
fi
if test -f 'vim/src/ascii.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/ascii.h'\"
else
echo shar: Extracting \"'vim/src/ascii.h'\" \(766 characters\)
sed "s/^X//" >'vim/src/ascii.h' <<'END_OF_FILE'
X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*
X * Definitions of various common control characters
X */
X
X#define NUL '\000'
X#define BS '\010'
X#define BS_STR "\010"
X#define TAB '\011'
X#define NL '\012'
X#define NL_STR "\012"
X#define CR '\015'
X#define ESC '\033'
X#define ESC_STR "\033"
X#define DEL 0x7f
X#define CSI 0x9b
X
X#define Ctrl(x) ((x) & 0x1f)
X
X/*
X * character that separates dir names in a path
X */
X#ifdef MSDOS
X# define PATHSEP '\\'
X# define PATHSEPSTR "\\"
X#else
X# define PATHSEP '/'
X# define PATHSEPSTR "/"
X#endif
END_OF_FILE
if test 766 -ne `wc -c <'vim/src/ascii.h'`; then
echo shar: \"'vim/src/ascii.h'\" unpacked with wrong size!
fi
# end of 'vim/src/ascii.h'
fi
if test -f 'vim/src/debug.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/debug.h'\"
else
echo shar: Extracting \"'vim/src/debug.h'\" \(865 characters\)
sed "s/^X//" >'vim/src/debug.h' <<'END_OF_FILE'
X/*
X * debug.h -- my debug header for just any program.
X * use:
X * place the statement OPENDEBUG("/tmp/programdebug"); inside main.
X * Nothing will happen, unless you compile the source with -DDEBUG.
X *
X * jw. 13.4.91.
X */
X#ifndef FILE
X# include <stdio.h>
X#endif
X
X#ifdef DEBUG
X# define debug(x) {fprintf(debugfp,x);fflush(debugfp);}
X# define debug1(x,a) {fprintf(debugfp,x,a);fflush(debugfp);}
X# define debug2(x,a,b) {fprintf(debugfp,x,a,b);fflush(debugfp);}
X# define debug3(x,a,b,c) {fprintf(debugfp,x,a,b,c);fflush(debugfp);}
X# define OPENDEBUG(file)\
X if ((debugfp = fopen(file,"w")) == NULL)\
X { debugfp = stderr;\
X debug1("OPENDEBUG: sorry, cannot open '%s'\n", file);\
X debug(" beware, using stderr!\n");\
X sleep(3);\
X }
X#else
X# define debug(x)
X# define debug1(x,a)
X# define debug2(x,a,b)
X# define debug3(x,a,b,c)
X# define OPENDEBUG(file)
X#endif
END_OF_FILE
if test 865 -ne `wc -c <'vim/src/debug.h'`; then
echo shar: \"'vim/src/debug.h'\" unpacked with wrong size!
fi
# end of 'vim/src/debug.h'
fi
if test -f 'vim/src/keymap.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/keymap.h'\"
else
echo shar: Extracting \"'vim/src/keymap.h'\" \(1576 characters\)
sed "s/^X//" >'vim/src/keymap.h' <<'END_OF_FILE'
X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*
X * Keycode definitions for special keys
X *
X * On systems that have any of these keys, the routine 'inchar' in the
X * machine-dependent code should return one of the codes here.
X */
X
X#define K_CCIRCM 0x1e /* control circumflex */
X
X/*
X * careful: the next entries must be in the same order as the termcap strings
X * in term.h and the numbers must be consecutive (used by inchar()).
X */
X#define K_UARROW 0x80
X#define K_DARROW 0x81
X#define K_LARROW 0x82
X#define K_RARROW 0x83
X#define K_SUARROW 0x84
X#define K_SDARROW 0x85
X#define K_SLARROW 0x86
X#define K_SRARROW 0x87
X
X#define K_F1 0x88 /* function keys */
X#define K_F2 0x89
X#define K_F3 0x8a
X#define K_F4 0x8b
X#define K_F5 0x8c
X#define K_F6 0x8d
X#define K_F7 0x8e
X#define K_F8 0x8f
X#define K_F9 0x90
X#define K_F10 0x91
X
X#define K_SF1 0x92 /* shifted function keys */
X#define K_SF2 0x93
X#define K_SF3 0x94
X#define K_SF4 0x95
X#define K_SF5 0x96
X#define K_SF6 0x97
X#define K_SF7 0x98
X#define K_SF8 0x99
X#define K_SF9 0x9a
X#define K_SF10 0x9b
X
X#define K_HELP 0x9c
X#define K_UNDO 0x9d
X
X/*
X * NULs cannot be in the input string, therefore CTRL-@ is replaced by K_ZERO.
X * K_NUL is used for MSDOS extended keys (same value used in term.h).
X */
X#define K_NUL 0x9e /* for MSDOS: special key follows */
X#define K_ZERO 0x9f /* replaces ^@ */
END_OF_FILE
if test 1576 -ne `wc -c <'vim/src/keymap.h'`; then
echo shar: \"'vim/src/keymap.h'\" unpacked with wrong size!
fi
# end of 'vim/src/keymap.h'
fi
if test -f 'vim/src/macros.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/macros.h'\"
else
echo shar: Extracting \"'vim/src/macros.h'\" \(1055 characters\)
sed "s/^X//" >'vim/src/macros.h' <<'END_OF_FILE'
X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*
X * macros.h: macro definitions for often used code
X */
X
X/*
X * pchar(lp, c) - put character 'c' at position 'lp'
X */
X#define pchar(lp, c) (*(nr2ptr((lp).lnum) + (lp).col) = (c))
X
X/*
X * Position comparisons
X */
X#define lt(a, b) (((a).lnum != (b).lnum) \
X ? ((a).lnum < (b).lnum) : ((a).col < (b).col))
X
X#define ltoreq(a, b) (((a).lnum != (b).lnum) \
X ? ((a).lnum < (b).lnum) : ((a).col <= (b).col))
X
X#define equal(a, b) (((a).lnum == (b).lnum) && ((a).col == (b).col))
X
X/*
X * buf1line() - return TRUE if there is only one line in file buffer
X */
X#define buf1line() (line_count == 1)
X
X/*
X * lineempty() - return TRUE if the line is empty
X */
X#define lineempty(p) (*nr2ptr(p) == NUL)
X
X/*
X * bufempty() - return TRUE if the file buffer is empty
X */
X#define bufempty() (buf1line() && lineempty((linenr_t)1))
END_OF_FILE
if test 1055 -ne `wc -c <'vim/src/macros.h'`; then
echo shar: \"'vim/src/macros.h'\" unpacked with wrong size!
fi
# end of 'vim/src/macros.h'
fi
if test -f 'vim/src/mark.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/mark.h'\"
else
echo shar: Extracting \"'vim/src/mark.h'\" \(546 characters\)
sed "s/^X//" >'vim/src/mark.h' <<'END_OF_FILE'
X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*
X * mark.h: definitions shared between tag.c and mark.c
X */
X
Xstruct mark
X{
X char *ptr;
X colnr_t col;
X};
X
Xstruct filemark
X{
X struct mark mark; /* cursor position */
X linenr_t lnum; /* last known line number */
X int fnum; /* file number */
X};
X
Xchar *fm_getname __ARGS((struct filemark *));
END_OF_FILE
if test 546 -ne `wc -c <'vim/src/mark.h'`; then
echo shar: \"'vim/src/mark.h'\" unpacked with wrong size!
fi
# end of 'vim/src/mark.h'
fi
if test ! -d 'vim/src/proto' ; then
echo shar: Creating directory \"'vim/src/proto'\"
mkdir 'vim/src/proto'
fi
if test -f 'vim/src/proto.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto.h'\"
else
echo shar: Extracting \"'vim/src/proto.h'\" \(1269 characters\)
sed "s/^X//" >'vim/src/proto.h' <<'END_OF_FILE'
X/*
X * proto.h: include the (automatically generated) function prototypes
X *
X * the proto/xxx.pro files are automatically generated when using Manx/Aztec C.
X * For other compilers you will have to edit them.
X */
X
X#include "regexp.h" /* for struct regexp */
X
X/*
X * Machine-dependent routines.
X */
X#ifdef AMIGA
X# include "proto/amiga.pro"
X#endif
X#ifdef UNIX
X# include "unix.h"
X#endif
X#ifdef MSDOS
X# include "msdos.h"
X#endif
X
X#include "proto/alloc.pro"
X#include "proto/buffers.pro"
X#include "proto/charset.pro"
X#include "proto/cmdline.pro"
X#include "proto/csearch.pro"
X#include "proto/digraph.pro"
X#include "proto/edit.pro"
X#include "proto/fileio.pro"
X#include "proto/help.pro"
X#include "proto/linefunc.pro"
X#include "proto/main.pro"
X#include "proto/mark.pro"
X
X#ifndef MESSAGE
Xvoid smsg __PARMS((char *, ...)); /* cannot be produced automatically */
X#endif
X#include "proto/message.pro"
X#include "proto/misccmds.pro"
X#include "proto/normal.pro"
X#include "proto/ops.pro"
X#include "proto/param.pro"
X#include "proto/quickfix.pro"
X#include "proto/regexp.pro"
X#include "proto/regsub.pro"
X#include "proto/screen.pro"
X#include "proto/script.pro"
X#include "proto/search.pro"
X#include "proto/storage.pro"
X#include "proto/tag.pro"
X#include "proto/term.pro"
X#include "proto/undo.pro"
END_OF_FILE
if test 1269 -ne `wc -c <'vim/src/proto.h'`; then
echo shar: \"'vim/src/proto.h'\" unpacked with wrong size!
fi
# end of 'vim/src/proto.h'
fi
if test -f 'vim/src/proto/alloc.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/alloc.pro'\"
else
echo shar: Extracting \"'vim/src/proto/alloc.pro'\" \(300 characters\)
sed "s/^X//" >'vim/src/proto/alloc.pro' <<'END_OF_FILE'
X/* alloc.c */
Xchar *alloc __PARMS((unsigned int size));
Xchar *lalloc __PARMS((unsigned long size, int message));
Xchar *strsave __PARMS((char *string));
Xchar *strnsave __PARMS((char *string, int len));
Xvoid copy_spaces __PARMS((char *ptr, unsigned long count));
Xchar *mkstr __PARMS((unsigned int c));
END_OF_FILE
if test 300 -ne `wc -c <'vim/src/proto/alloc.pro'`; then
echo shar: \"'vim/src/proto/alloc.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/alloc.pro'
fi
if test -f 'vim/src/proto/amiga.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/amiga.pro'\"
else
echo shar: Extracting \"'vim/src/proto/amiga.pro'\" \(1222 characters\)
sed "s/^X//" >'vim/src/proto/amiga.pro' <<'END_OF_FILE'
X/* amiga.c */
Xvoid win_resize_on __PARMS((void));
Xvoid win_resize_off __PARMS((void));
Xvoid flushbuf __PARMS((void));
Xvoid outchar __PARMS((unsigned int c));
Xint GetChars __PARMS((char *buf, int maxlen, int type));
Xvoid sleep __PARMS((int n));
Xvoid vim_delay __PARMS((void));
Xvoid mch_suspend __PARMS((void));
Xvoid mch_windinit __PARMS((void));
Xvoid check_win __PARMS((int argc, char **argv));
Xvoid fname_case __PARMS((char *name));
Xvoid settitle __PARMS((char *str));
Xvoid resettitle __PARMS((void));
Xint dirname __PARMS((char *buf, int len));
Xint FullName __PARMS((char *fname, char *buf, int len));
Xlong getperm __PARMS((char *name));
Xint setperm __PARMS((char *name, long perm));
Xint isdir __PARMS((char *name));
Xvoid mch_windexit __PARMS((int r));
Xvoid mch_settmode __PARMS((int raw));
Xint mch_get_winsize __PARMS((void));
Xvoid mch_set_winsize __PARMS((void));
Xint call_shell __PARMS((char *cmd, int filter));
Xvoid breakcheck __PARMS((void));
Xlong Chk_Abort __PARMS((void));
Xint ExpandWildCards __PARMS((int num_pat, char **pat, int *num_file, char ***file, int files_only, int list_notfound));
Xvoid FreeWild __PARMS((int num, char **file));
Xint has_wildcard __PARMS((char *p));
Xchar *vimgetenv __PARMS((char *var));
END_OF_FILE
if test 1222 -ne `wc -c <'vim/src/proto/amiga.pro'`; then
echo shar: \"'vim/src/proto/amiga.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/amiga.pro'
fi
if test -f 'vim/src/proto/buffers.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/buffers.pro'\"
else
echo shar: Extracting \"'vim/src/proto/buffers.pro'\" \(832 characters\)
sed "s/^X//" >'vim/src/proto/buffers.pro' <<'END_OF_FILE'
X/* buffers.c */
Xunsigned char *get_bufcont __PARMS((struct buffheader *buffer));
Xunsigned char *get_recorded __PARMS((void));
Xunsigned char *get_inserted __PARMS((void));
Xint stuff_empty __PARMS((void));
Xvoid flush_buffers __PARMS((void));
Xvoid ResetBuffers __PARMS((void));
Xvoid AppendToRedobuff __PARMS((char *s));
Xvoid AppendNumberToRedobuff __PARMS((long n));
Xvoid stuffReadbuff __PARMS((char *s));
Xvoid stuffnumReadbuff __PARMS((long n));
Xvoid copy_redo __PARMS((void));
Xint start_redo __PARMS((long count));
Xint start_redo_ins __PARMS((void));
Xvoid set_redo_ins __PARMS((void));
Xvoid stop_redo_ins __PARMS((void));
Xint ins_mapbuf __PARMS((char *str));
Xunsigned char vgetc __PARMS((void));
Xunsigned char vpeekc __PARMS((void));
Xint domap __PARMS((int maptype, char *keys, int mode));
Xint makemap __PARMS((struct __stdio *fd));
END_OF_FILE
if test 832 -ne `wc -c <'vim/src/proto/buffers.pro'`; then
echo shar: \"'vim/src/proto/buffers.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/buffers.pro'
fi
if test -f 'vim/src/proto/charset.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/charset.pro'\"
else
echo shar: Extracting \"'vim/src/proto/charset.pro'\" \(240 characters\)
sed "s/^X//" >'vim/src/proto/charset.pro' <<'END_OF_FILE'
X/* charset.c */
Xchar *transchar __PARMS((unsigned int c));
Xint outtrans __PARMS((char *str, int len));
Xint charsize __PARMS((int c));
Xint strsize __PARMS((char *s));
Xint chartabsize __PARMS((int c, int col));
Xint isidchar __PARMS((int c));
END_OF_FILE
if test 240 -ne `wc -c <'vim/src/proto/charset.pro'`; then
echo shar: \"'vim/src/proto/charset.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/charset.pro'
fi
if test -f 'vim/src/proto/cmdline.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/cmdline.pro'\"
else
echo shar: Extracting \"'vim/src/proto/cmdline.pro'\" \(487 characters\)
sed "s/^X//" >'vim/src/proto/cmdline.pro' <<'END_OF_FILE'
X/* cmdline.c */
Xint getcmdline __PARMS((int firstc, unsigned char *buff));
Xvoid redrawcmdline __PARMS((void));
Xvoid redrawcmd __PARMS((void));
Xvoid docmdline __PARMS((unsigned char *cmdline));
Xint doarglist __PARMS((char *str));
Xvoid gotocmdline __PARMS((int clr, int firstc));
Xint getfile __PARMS((char *fname, int setpm));
Xint samealtfile __PARMS((int n));
Xint getaltfile __PARMS((int n, long lnum, int setpm));
Xchar *getaltfname __PARMS((int n));
Xint dosource __PARMS((char *fname));
END_OF_FILE
if test 487 -ne `wc -c <'vim/src/proto/cmdline.pro'`; then
echo shar: \"'vim/src/proto/cmdline.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/cmdline.pro'
fi
if test -f 'vim/src/proto/csearch.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/csearch.pro'\"
else
echo shar: Extracting \"'vim/src/proto/csearch.pro'\" \(158 characters\)
sed "s/^X//" >'vim/src/proto/csearch.pro' <<'END_OF_FILE'
X/* csearch.c */
Xvoid dosub __PARMS((long lp, long up, char *cmd, unsigned char **nextcommand));
Xvoid doglob __PARMS((int type, long lp, long up, char *cmd));
END_OF_FILE
if test 158 -ne `wc -c <'vim/src/proto/csearch.pro'`; then
echo shar: \"'vim/src/proto/csearch.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/csearch.pro'
fi
if test -f 'vim/src/proto/digraph.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/digraph.pro'\"
else
echo shar: Extracting \"'vim/src/proto/digraph.pro'\" \(137 characters\)
sed "s/^X//" >'vim/src/proto/digraph.pro' <<'END_OF_FILE'
X/* digraph.c */
Xint getdigraph __PARMS((int char1, int char2));
Xvoid putdigraph __PARMS((char *str));
Xvoid listdigraphs __PARMS((void));
END_OF_FILE
if test 137 -ne `wc -c <'vim/src/proto/digraph.pro'`; then
echo shar: \"'vim/src/proto/digraph.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/digraph.pro'
fi
if test -f 'vim/src/proto/edit.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/edit.pro'\"
else
echo shar: Extracting \"'vim/src/proto/edit.pro'\" \(389 characters\)
sed "s/^X//" >'vim/src/proto/edit.pro' <<'END_OF_FILE'
X/* edit.c */
Xvoid edit __PARMS((long count));
Xint get_literal __PARMS((int *nextc));
Xvoid insertchar __PARMS((unsigned int c));
Xint oneright __PARMS((void));
Xint oneleft __PARMS((void));
Xvoid beginline __PARMS((int flag));
Xint oneup __PARMS((long n));
Xint onedown __PARMS((long n));
Xint onepage __PARMS((int dir, long count));
Xvoid stuff_inserted __PARMS((int c, long count, int no_esc));
END_OF_FILE
if test 389 -ne `wc -c <'vim/src/proto/edit.pro'`; then
echo shar: \"'vim/src/proto/edit.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/edit.pro'
fi
if test -f 'vim/src/proto/fileio.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/fileio.pro'\"
else
echo shar: Extracting \"'vim/src/proto/fileio.pro'\" \(205 characters\)
sed "s/^X//" >'vim/src/proto/fileio.pro' <<'END_OF_FILE'
X/* fileio.c */
Xvoid filemess __PARMS((char *name, char *s));
Xint readfile __PARMS((char *fname, long from, int newfile));
Xint writeit __PARMS((char *fname, long start, long end, int append, int forceit));
END_OF_FILE
if test 205 -ne `wc -c <'vim/src/proto/fileio.pro'`; then
echo shar: \"'vim/src/proto/fileio.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/fileio.pro'
fi
if test -f 'vim/src/proto/help.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/help.pro'\"
else
echo shar: Extracting \"'vim/src/proto/help.pro'\" \(72 characters\)
sed "s/^X//" >'vim/src/proto/help.pro' <<'END_OF_FILE'
X/* help.c */
Xvoid help __PARMS((void));
Xint redrawhelp __PARMS((void));
END_OF_FILE
if test 72 -ne `wc -c <'vim/src/proto/help.pro'`; then
echo shar: \"'vim/src/proto/help.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/help.pro'
fi
if test -f 'vim/src/proto/linefunc.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/linefunc.pro'\"
else
echo shar: Extracting \"'vim/src/proto/linefunc.pro'\" \(306 characters\)
sed "s/^X//" >'vim/src/proto/linefunc.pro' <<'END_OF_FILE'
X/* linefunc.c */
Xvoid coladvance __PARMS((unsigned int wcol));
Xint inc __PARMS((struct fpos *lp));
Xint incCurpos __PARMS((void));
Xint incl __PARMS((struct fpos *lp));
Xint dec __PARMS((struct fpos *lp));
Xint decCurpos __PARMS((void));
Xint decl __PARMS((struct fpos *lp));
Xvoid adjustCurpos __PARMS((void));
END_OF_FILE
if test 306 -ne `wc -c <'vim/src/proto/linefunc.pro'`; then
echo shar: \"'vim/src/proto/linefunc.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/linefunc.pro'
fi
if test -f 'vim/src/proto/main.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/main.pro'\"
else
echo shar: Extracting \"'vim/src/proto/main.pro'\" \(87 characters\)
sed "s/^X//" >'vim/src/proto/main.pro' <<'END_OF_FILE'
X/* main.c */
Xvoid main __PARMS((int argc, char **argv));
Xvoid getout __PARMS((int r));
END_OF_FILE
if test 87 -ne `wc -c <'vim/src/proto/main.pro'`; then
echo shar: \"'vim/src/proto/main.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/main.pro'
fi
if test -f 'vim/src/proto/mark.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/mark.pro'\"
else
echo shar: Extracting \"'vim/src/proto/mark.pro'\" \(433 characters\)
sed "s/^X//" >'vim/src/proto/mark.pro' <<'END_OF_FILE'
X/* mark.c */
Xint setmark __PARMS((int c));
Xvoid setpcmark __PARMS((void));
Xstruct fpos *movemark __PARMS((int count));
Xstruct fpos *getmark __PARMS((int c, int changefile));
Xvoid clrallmarks __PARMS((void));
Xvoid incrmarks __PARMS((void));
Xvoid decrmarks __PARMS((void));
Xvoid adjustmark __PARMS((char *old, char *new));
Xchar *fm_getname __PARMS((struct filemark *fmark));
Xvoid domarks __PARMS((void));
Xvoid dojumps __PARMS((void));
END_OF_FILE
if test 433 -ne `wc -c <'vim/src/proto/mark.pro'`; then
echo shar: \"'vim/src/proto/mark.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/mark.pro'
fi
if test -f 'vim/src/proto/message.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/message.pro'\"
else
echo shar: Extracting \"'vim/src/proto/message.pro'\" \(115 characters\)
sed "s/^X//" >'vim/src/proto/message.pro' <<'END_OF_FILE'
X/* message.c */
Xvoid msg __PARMS((char *s));
Xvoid emsg __PARMS((char *s));
Xvoid wait_return __PARMS((int redraw));
END_OF_FILE
if test 115 -ne `wc -c <'vim/src/proto/message.pro'`; then
echo shar: \"'vim/src/proto/message.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/message.pro'
fi
if test -f 'vim/src/proto/misccmds.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/misccmds.pro'\"
else
echo shar: Extracting \"'vim/src/proto/misccmds.pro'\" \(986 characters\)
sed "s/^X//" >'vim/src/proto/misccmds.pro' <<'END_OF_FILE'
X/* misccmds.c */
Xint get_indent __PARMS((void));
Xvoid set_indent __PARMS((int size, int delete));
Xint Opencmd __PARMS((int dir, int redraw));
Xint plines __PARMS((long p));
Xint plines_m __PARMS((long first, long last));
Xvoid fileinfo __PARMS((void));
Xvoid setfname __PARMS((char *s));
Xint otherfile __PARMS((char *s));
Xvoid maketitle __PARMS((void));
Xvoid inschar __PARMS((int c));
Xvoid insstr __PARMS((char *s));
Xint delchar __PARMS((int fixpos));
Xvoid dellines __PARMS((long nlines, int can_update));
Xint gchar __PARMS((struct fpos *pos));
Xint gcharCurpos __PARMS((void));
Xint inindent __PARMS((void));
Xvoid skipspace __PARMS((char **pp));
Xvoid skiptospace __PARMS((char **pp));
Xlong getdigits __PARMS((char **pp));
Xchar *plural __PARMS((long n));
Xvoid set_Changed __PARMS((void));
Xint ask_yesno __PARMS((char *str));
Xvoid msgmore __PARMS((long n));
Xvoid beep __PARMS((void));
Xvoid expand_env __PARMS((char *src, char *dst, int dstlen));
Xint fullpathcmp __PARMS((char *s1, char *s2));
END_OF_FILE
if test 986 -ne `wc -c <'vim/src/proto/misccmds.pro'`; then
echo shar: \"'vim/src/proto/misccmds.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/misccmds.pro'
fi
if test -f 'vim/src/proto/normal.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/normal.pro'\"
else
echo shar: Extracting \"'vim/src/proto/normal.pro'\" \(44 characters\)
sed "s/^X//" >'vim/src/proto/normal.pro' <<'END_OF_FILE'
X/* normal.c */
Xvoid normal __PARMS((void));
END_OF_FILE
if test 44 -ne `wc -c <'vim/src/proto/normal.pro'`; then
echo shar: \"'vim/src/proto/normal.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/normal.pro'
fi
if test -f 'vim/src/proto/ops.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/ops.pro'\"
else
echo shar: Extracting \"'vim/src/proto/ops.pro'\" \(691 characters\)
sed "s/^X//" >'vim/src/proto/ops.pro' <<'END_OF_FILE'
X/* ops.c */
Xvoid doshift __PARMS((int op));
Xvoid shift_line __PARMS((int left));
Xint dorecord __PARMS((int c));
Xint doexecbuf __PARMS((int c));
Xint insertbuf __PARMS((int c));
Xvoid dodelete __PARMS((void));
Xvoid dotilde __PARMS((void));
Xvoid swapchar __PARMS((struct fpos *pos));
Xvoid dochange __PARMS((void));
Xvoid init_yank __PARMS((void));
Xint doyank __PARMS((int deleting));
Xvoid doput __PARMS((int dir, long count));
Xvoid dodis __PARMS((void));
Xvoid dodojoin __PARMS((long count, int flag, int redraw));
Xint dojoin __PARMS((int insert_space));
Xvoid doformat __PARMS((void));
Xvoid startinsert __PARMS((int initstr, int startln, long count));
Xint doaddsub __PARMS((int c, long Prenum1));
END_OF_FILE
if test 691 -ne `wc -c <'vim/src/proto/ops.pro'`; then
echo shar: \"'vim/src/proto/ops.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/ops.pro'
fi
if test -f 'vim/src/proto/param.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/param.pro'\"
else
echo shar: Extracting \"'vim/src/proto/param.pro'\" \(159 characters\)
sed "s/^X//" >'vim/src/proto/param.pro' <<'END_OF_FILE'
X/* param.c */
Xvoid set_init __PARMS((void));
Xvoid doset __PARMS((char *arg));
Xint makeset __PARMS((struct __stdio *fd));
Xvoid clear_termparam __PARMS((void));
END_OF_FILE
if test 159 -ne `wc -c <'vim/src/proto/param.pro'`; then
echo shar: \"'vim/src/proto/param.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/param.pro'
fi
if test -f 'vim/src/proto/quickfix.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/quickfix.pro'\"
else
echo shar: Extracting \"'vim/src/proto/quickfix.pro'\" \(209 characters\)
sed "s/^X//" >'vim/src/proto/quickfix.pro' <<'END_OF_FILE'
X/* quickfix.c */
Xint qf_init __PARMS((char *fname));
Xvoid qf_jump __PARMS((int errornr));
Xvoid qf_list __PARMS((void));
Xvoid qf_clrallmarks __PARMS((void));
Xvoid qf_adjustmark __PARMS((char *old, char *new));
END_OF_FILE
if test 209 -ne `wc -c <'vim/src/proto/quickfix.pro'`; then
echo shar: \"'vim/src/proto/quickfix.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/quickfix.pro'
fi
if test -f 'vim/src/proto/regexp.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/regexp.pro'\"
else
echo shar: Extracting \"'vim/src/proto/regexp.pro'\" \(171 characters\)
sed "s/^X//" >'vim/src/proto/regexp.pro' <<'END_OF_FILE'
X/* regexp.c */
Xstruct regexp *regcomp __PARMS((char *exp));
Xint regexec __PARMS((struct regexp *prog, char *string, int at_bol));
Xchar *cstrchr __PARMS((char *s, int c));
END_OF_FILE
if test 171 -ne `wc -c <'vim/src/proto/regexp.pro'`; then
echo shar: \"'vim/src/proto/regexp.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/regexp.pro'
fi
if test -f 'vim/src/proto/regsub.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/regsub.pro'\"
else
echo shar: Extracting \"'vim/src/proto/regsub.pro'\" \(105 characters\)
sed "s/^X//" >'vim/src/proto/regsub.pro' <<'END_OF_FILE'
X/* regsub.c */
Xint regsub __PARMS((struct regexp *prog, char *source, char *dest, int copy, int magic));
END_OF_FILE
if test 105 -ne `wc -c <'vim/src/proto/regsub.pro'`; then
echo shar: \"'vim/src/proto/regsub.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/regsub.pro'
fi
if test -f 'vim/src/proto/screen.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/screen.pro'\"
else
echo shar: Extracting \"'vim/src/proto/screen.pro'\" \(662 characters\)
sed "s/^X//" >'vim/src/proto/screen.pro' <<'END_OF_FILE'
X/* screen.c */
Xvoid updateline __PARMS((void));
Xvoid updateScreen __PARMS((int type));
Xvoid comp_Botline __PARMS((void));
Xint prt_line __PARMS((char *s));
Xvoid screenalloc __PARMS((void));
Xvoid screenclear __PARMS((void));
Xvoid cursupdate __PARMS((void));
Xvoid curs_columns __PARMS((void));
Xint getvcol __PARMS((struct fpos *pos, int type));
Xvoid scrolldown __PARMS((long nlines));
Xvoid scrollup __PARMS((long nlines));
Xint s_ins __PARMS((int row, int nlines, int invalid));
Xint s_del __PARMS((int row, int nlines, int invalid));
Xvoid showmode __PARMS((void));
Xvoid delmode __PARMS((void));
Xvoid showruler __PARMS((int always));
Xvoid clear_line __PARMS((void));
END_OF_FILE
if test 662 -ne `wc -c <'vim/src/proto/screen.pro'`; then
echo shar: \"'vim/src/proto/screen.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/screen.pro'
fi
if test -f 'vim/src/proto/script.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/script.pro'\"
else
echo shar: Extracting \"'vim/src/proto/script.pro'\" \(315 characters\)
sed "s/^X//" >'vim/src/proto/script.pro' <<'END_OF_FILE'
X/* script.c */
Xvoid startscript __PARMS((void));
Xint stopscript __PARMS((void));
Xint openscript __PARMS((char *name));
Xvoid updatescript __PARMS((int c));
Xvoid openrecover __PARMS((void));
Xchar *modname __PARMS((char *fname, char *ext));
Xvoid script_winsize __PARMS((void));
Xvoid script_winsize_pp __PARMS((void));
END_OF_FILE
if test 315 -ne `wc -c <'vim/src/proto/script.pro'`; then
echo shar: \"'vim/src/proto/script.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/script.pro'
fi
if test -f 'vim/src/proto/search.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/search.pro'\"
else
echo shar: Extracting \"'vim/src/proto/search.pro'\" \(717 characters\)
sed "s/^X//" >'vim/src/proto/search.pro' <<'END_OF_FILE'
X/* search.c */
Xstruct regexp *myregcomp __PARMS((char *pat));
Xint searchit __PARMS((struct fpos *pos, int dir, char *str, long count, int end));
Xint dosearch __PARMS((int dir, char *str, int reverse, long count, int echo));
Xint searchc __PARMS((int c, int dir, int type, long count));
Xstruct fpos *showmatch __PARMS((void));
Xint findfunc __PARMS((int dir, int what, long count));
Xint findsent __PARMS((int dir, long count));
Xint findpar __PARMS((int dir, long count, int what));
Xint startPS __PARMS((long lnum, int para));
Xint fwd_word __PARMS((long count, int type));
Xint bck_word __PARMS((long count, int type));
Xint end_word __PARMS((long count, int type, int stop));
Xint skip_chars __PARMS((int class, int dir));
END_OF_FILE
if test 717 -ne `wc -c <'vim/src/proto/search.pro'`; then
echo shar: \"'vim/src/proto/search.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/search.pro'
fi
if test -f 'vim/src/proto/storage.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/storage.pro'\"
else
echo shar: Extracting \"'vim/src/proto/storage.pro'\" \(705 characters\)
sed "s/^X//" >'vim/src/proto/storage.pro' <<'END_OF_FILE'
X/* storage.c */
Xchar *m_blockalloc __PARMS((unsigned long size, int message));
Xvoid m_blockfree __PARMS((void));
Xvoid free_line __PARMS((char *ptr));
Xchar *alloc_line __PARMS((unsigned int size));
Xchar *save_line __PARMS((char *src));
Xvoid filealloc __PARMS((void));
Xvoid freeall __PARMS((void));
Xchar *nr2ptr __PARMS((long nr));
Xchar *pos2ptr __PARMS((struct fpos *pos));
Xvoid setmarked __PARMS((long lnum));
Xlong firstmarked __PARMS((void));
Xvoid clearmarked __PARMS((void));
Xlong ptr2nr __PARMS((char *ptr, long start));
Xint appendline __PARMS((long after, char *s));
Xchar *delsline __PARMS((long nr, int delmarks));
Xchar *replaceline __PARMS((long lnum, char *new));
Xint canincrease __PARMS((int n));
END_OF_FILE
if test 705 -ne `wc -c <'vim/src/proto/storage.pro'`; then
echo shar: \"'vim/src/proto/storage.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/storage.pro'
fi
if test -f 'vim/src/proto/tag.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/tag.pro'\"
else
echo shar: Extracting \"'vim/src/proto/tag.pro'\" \(187 characters\)
sed "s/^X//" >'vim/src/proto/tag.pro' <<'END_OF_FILE'
X/* tag.c */
Xvoid dotag __PARMS((char *tag, int type, int count));
Xvoid clrtags __PARMS((void));
Xvoid incrtags __PARMS((void));
Xvoid decrtags __PARMS((void));
Xvoid dotags __PARMS((void));
END_OF_FILE
if test 187 -ne `wc -c <'vim/src/proto/tag.pro'`; then
echo shar: \"'vim/src/proto/tag.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/tag.pro'
fi
if test -f 'vim/src/proto/term.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/term.pro'\"
else
echo shar: Extracting \"'vim/src/proto/term.pro'\" \(594 characters\)
sed "s/^X//" >'vim/src/proto/term.pro' <<'END_OF_FILE'
X/* term.c */
Xvoid set_term __PARMS((char *term));
Xchar *tgoto __PARMS((char *cm, int x, int y));
Xvoid termcapinit __PARMS((char *term));
Xvoid outstrn __PARMS((char *s));
Xvoid outstr __PARMS((char *s));
Xvoid windgoto __PARMS((int row, int col));
Xvoid setcursor __PARMS((void));
Xvoid ttest __PARMS((int pairs));
Xint inchar __PARMS((int async, int waitforever));
Xvoid outnum __PARMS((long n));
Xvoid check_winsize __PARMS((void));
Xvoid set_winsize __PARMS((int width, int height, int mustset));
Xvoid settmode __PARMS((int raw));
Xvoid starttermcap __PARMS((void));
Xvoid stoptermcap __PARMS((void));
END_OF_FILE
if test 594 -ne `wc -c <'vim/src/proto/term.pro'`; then
echo shar: \"'vim/src/proto/term.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/term.pro'
fi
if test -f 'vim/src/proto/termlib.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/termlib.pro'\"
else
echo shar: Extracting \"'vim/src/proto/termlib.pro'\" \(300 characters\)
sed "s/^X//" >'vim/src/proto/termlib.pro' <<'END_OF_FILE'
X/* termlib.c */
Xint tgetent __PARMS((char *tbuf, char *term));
Xint tgetflag __PARMS((char *id));
Xint tgetnum __PARMS((char *id));
Xchar *tgetstr __PARMS((char *id, char **buf));
Xchar *tgoto __PARMS((char *cm, int col, int line));
Xint tputs __PARMS((char *cp, int affcnt, void (*outc)(unsigned int)));
END_OF_FILE
if test 300 -ne `wc -c <'vim/src/proto/termlib.pro'`; then
echo shar: \"'vim/src/proto/termlib.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/termlib.pro'
fi
if test -f 'vim/src/proto/undo.pro' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/proto/undo.pro'\"
else
echo shar: Extracting \"'vim/src/proto/undo.pro'\" \(418 characters\)
sed "s/^X//" >'vim/src/proto/undo.pro' <<'END_OF_FILE'
X/* undo.c */
Xint u_saveCurpos __PARMS((void));
Xint u_save __PARMS((long top, long bot));
Xint u_savesub __PARMS((long lnum, char *ptr));
Xint u_savedel __PARMS((long lnum, char *ptr));
Xvoid u_undo __PARMS((int count));
Xvoid u_redo __PARMS((int count));
Xvoid u_sync __PARMS((void));
Xvoid u_clearall __PARMS((void));
Xvoid u_saveline __PARMS((long lnum));
Xvoid u_clearline __PARMS((void));
Xvoid u_undoline __PARMS((void));
END_OF_FILE
if test 418 -ne `wc -c <'vim/src/proto/undo.pro'`; then
echo shar: \"'vim/src/proto/undo.pro'\" unpacked with wrong size!
fi
# end of 'vim/src/proto/undo.pro'
fi
if test -f 'vim/src/ptx_stdlib.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/ptx_stdlib.h'\"
else
echo shar: Extracting \"'vim/src/ptx_stdlib.h'\" \(955 characters\)
sed "s/^X//" >'vim/src/ptx_stdlib.h' <<'END_OF_FILE'
X/*
X * ptx_stdlib.h: declarations which are needed for sequent
X */
X
Xextern void free(void *);
X#ifdef SIZE_T /* sys/types.h */
Xextern void *malloc(size_t);
Xextern off_t lseek(int, off_t, int);
X#else
Xextern void *malloc(unsigned);
Xextern int lseek(int, int, int);
X#endif
X
X#ifndef _FCNTL_H_
Xextern int open(char *, int, ...);
X#endif
Xextern int close(int);
Xextern int read(int, char *, unsigned);
Xextern int write(int, char *, unsigned);
Xextern int ioctl(int, int, ...);
Xextern int unlink(char *);
X
Xextern char *getenv(char *);
Xextern int getuid(void);
Xextern int getgid(void);
X
X#ifdef _NFILE /* stdio.h */
Xextern int _filbuf(FILE *);
Xextern int _flsbuf(unsigned char, FILE *);
X#endif
X
X#ifdef _POLL_H_
Xextern int poll(struct pollfd[], unsigned long, int);
X#endif /* _POLL_H_ */
X
Xextern char *getcwd(char *, int);
X
Xextern int chdir(char *);
X
Xextern int atoi (char *);
Xextern long atol(char *);
Xextern long strtol(char *, char **, int);
X
Xextern int isatty(int);
END_OF_FILE
if test 955 -ne `wc -c <'vim/src/ptx_stdlib.h'`; then
echo shar: \"'vim/src/ptx_stdlib.h'\" unpacked with wrong size!
fi
# end of 'vim/src/ptx_stdlib.h'
fi
if test -f 'vim/src/regexp.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/regexp.h'\"
else
echo shar: Extracting \"'vim/src/regexp.h'\" \(1541 characters\)
sed "s/^X//" >'vim/src/regexp.h' <<'END_OF_FILE'
X/* vi:ts=4:sw=4
X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
X *
X * This is NOT the original regular expression code as written by
X * Henry Spencer. This code has been modified specifically for use
X * with the VIM editor, and should not be used apart from compiling
X * VIM. If you want a good regular expression library, get the
X * original code. The copyright notice that follows is from the
X * original.
X *
X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
X *
X * Definitions etc. for regexp(3) routines.
X *
X * Caveat: this is V8 regexp(3) [actually, a reimplementation thereof],
X * not the System V one.
X */
X
X#ifndef _REGEXP_H
X#define _REGEXP_H
X
X#define NSUBEXP 10
Xtypedef struct regexp {
X char *startp[NSUBEXP];
X char *endp[NSUBEXP];
X char regstart; /* Internal use only. */
X char reganch; /* Internal use only. */
X char *regmust; /* Internal use only. */
X int regmlen; /* Internal use only. */
X char program[1]; /* Unwarranted chumminess with compiler. */
X} regexp;
X
X/* regexp.c */
Xregexp *regcomp __ARGS((char *));
Xint regexec __ARGS((regexp *, char *, int));
X/* int cstrncmp __ARGS((char *, char *, int)); */
Xchar *cstrchr __ARGS((char *, int));
X
X/* regsub.c */
Xint regsub __ARGS((regexp *, char *, char *, int, int));
X
X/* search.c */
Xextern void regerror __ARGS((char *));
X
X#ifndef ORIGINAL
Xextern int reg_ic; /* set non-zero to ignore case in searches */
Xextern int reg_magic; /* set zero to disable magicness of .*[~& */
X#endif
X#endif /* _REGEXP_H */
END_OF_FILE
if test 1541 -ne `wc -c <'vim/src/regexp.h'`; then
echo shar: \"'vim/src/regexp.h'\" unpacked with wrong size!
fi
# end of 'vim/src/regexp.h'
fi
if test -f 'vim/src/regmagic.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/regmagic.h'\"
else
echo shar: Extracting \"'vim/src/regmagic.h'\" \(663 characters\)
sed "s/^X//" >'vim/src/regmagic.h' <<'END_OF_FILE'
X/* vi:ts=4:sw=4
X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
X *
X * This is NOT the original regular expression code as written by
X * Henry Spencer. This code has been modified specifically for use
X * with the VIM editor, and should not be used apart from compiling
X * VIM. If you want a good regular expression library, get the
X * original code. The copyright notice that follows is from the
X * original.
X *
X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
X *
X * The first byte of the regexp internal "program" is actually this magic
X * number; the start node begins in the second byte.
X */
X
X#define MAGIC 0234
END_OF_FILE
if test 663 -ne `wc -c <'vim/src/regmagic.h'`; then
echo shar: \"'vim/src/regmagic.h'\" unpacked with wrong size!
fi
# end of 'vim/src/regmagic.h'
fi
if test -f 'vim/src/termlib.fix.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/termlib.fix.uue'\"
else
echo shar: Extracting \"'vim/src/termlib.fix.uue'\" \(89 characters\)
sed "s/^X//" >'vim/src/termlib.fix.uue' <<'END_OF_FILE'
X
Xbegin 644 termlib.fix
XB#2]O=71C*2@I#6QL;&QL875N<VEG;F5D(&EN=!LZ=W$-"O__5
X``
Xend
Xsize 34
END_OF_FILE
if test 89 -ne `wc -c <'vim/src/termlib.fix.uue'`; then
echo shar: \"'vim/src/termlib.fix.uue'\" unpacked with wrong size!
fi
# end of 'vim/src/termlib.fix.uue'
fi
if test -f 'vim/src/vim.prj' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/vim.prj'\"
else
echo shar: Extracting \"'vim/src/vim.prj'\" \(283 characters\)
sed "s/^X//" >'vim/src/vim.prj' <<'END_OF_FILE'
XALLOC.C
XBUFFERS.C
XCHARSET.C
XCMDLINE.C
XCSEARCH.C
XEDIT.C
XDIGRAPH.C
XFILEIO.C
XHELP.C
XLINEFUNC.C
XMAIN.C
XMARK.C
XMESSAGE.C
XMISCCMDS.C
XMSDOS.C
XNORMAL.C
XOPS.C
XPARAM.C
XQUICKFIX.C
XREGEXP.C
XREGSUB.C
XSCREEN.C
XSCRIPT.C
XSEARCH.C
XSTORAGE.C
XTAG.C
XTERM.C
XUNDO.C
XVERSION.C
END_OF_FILE
if test 283 -ne `wc -c <'vim/src/vim.prj'`; then
echo shar: \"'vim/src/vim.prj'\" unpacked with wrong size!
fi
# end of 'vim/src/vim.prj'
fi
if test -f 'vim/src/vimresp' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/vimresp'\"
else
echo shar: Extracting \"'vim/src/vimresp'\" \(325 characters\)
sed "s/^X//" >'vim/src/vimresp' <<'END_OF_FILE'
Xalloc.obj msdos.obj buffers.obj charset.obj cmdline.obj csearch.obj +
Xdigraph.obj edit.obj fileio.obj help.obj linefunc.obj main.obj mark.obj +
Xmessage.obj misccmds.obj normal.obj ops.obj param.obj quickfix.obj +
Xregexp.obj regsub.obj screen.obj script.obj search.obj storage.obj +
Xtag.obj term.obj undo.obj version.obj
END_OF_FILE
if test 325 -ne `wc -c <'vim/src/vimresp'`; then
echo shar: \"'vim/src/vimresp'\" unpacked with wrong size!
fi
# end of 'vim/src/vimresp'
fi
if test -f 'vim/todo' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/todo'\"
else
echo shar: Extracting \"'vim/todo'\" \(1614 characters\)
sed "s/^X//" >'vim/todo' <<'END_OF_FILE'
XBugs, VI compatibility:
X
XSetting the size of the window does not always work as expected.
XWith quickfix we only get the first 25 errors. How do we get the rest?
XThe ":cq" command does not always abort the compiler.
XWhen editing multiple files, typing :q twice should exit Vim.
X
X
XFurther extentions:
X
XHistory stack for . command?
XWhen there are "Too many files", possibility to insert them all (CTRL-A).
XUse insert/delete char when terminal supports it.
X"edit" option: when off changing the buffer is not possible.
XAdd "-d null" for editing with a script file without a display.
XFor MSDOS use memory mapped screen output (ansi.sys not needed).
XFor MSDOS search for _exrc in the directory where the binary is, instead
X of using $VIM\_exrc.
XIn insert mode: Remember the characters that were removed with backspace and
X re-insert them one at a time with CTRL-x, all together with CTRL-x.
XAdd possibility to set a keymap. The code in amiga.c does not work yet.
XAdd recognition of CR-LF files and correctly write them automatically.
XAdd to quoting: Center, right-adjust, left-adjust, function (e.g. add).
XAdd possibility to re-select previously quoted part.
X
XFrom Elvis:
Xfontchanges recognized "\\fB" etc.
Xparse error messages from many compilers
X
X
XFar future extentions:
X
XOption verbose; when on keep the screen uptodate, when off only redisplay when
X input needed.
XRemember message line for redraw.
XUse disk swap file when editing very large files.
XMode to keep text formatted while inserting/deleting.
XMode to keep C-code formatted (sort of on-line indent)
XOption to choose between line wrap and horizontal scrolling
END_OF_FILE
if test 1614 -ne `wc -c <'vim/todo'`; then
echo shar: \"'vim/todo'\" unpacked with wrong size!
fi
# end of 'vim/todo'
fi
if test ! -d 'vim/tutor' ; then
echo shar: Creating directory \"'vim/tutor'\"
mkdir 'vim/tutor'
fi
if test -f 'vim/tutor/Readme' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/tutor/Readme'\"
else
echo shar: Extracting \"'vim/tutor/Readme'\" \(768 characters\)
sed "s/^X//" >'vim/tutor/Readme' <<'END_OF_FILE'
XVitutor is a "hands on" tutorial for new users of the Vim editor.
X
XMost new users can get through it in less than one hour. The result
Xis that you can do a simple editing task using the Vim editor.
X
XTutor is a file that contains the tutorial lessons. You can simply
Xexecute "vim tutor" and then follow the instructions in the lessons.
XThe lessons tell you to modify the file, so DON'T DO THIS ON YOUR
XORIGINAL COPY.
X
XI have considered adding more advanced lessons but have not found the
Xtime. Please let me know how you like it and send any improvements you
Xmake.
X
XBob Ware, Colorado School of Mines, Golden, Co 80401, USA
X(303) 273-3987
Xbw...@mines.colorado.edu bw...@slate.mines.colorado.edu bw...@mines.bitnet
X
X(This file was modified by Bram Moolenaar for Vim)
END_OF_FILE
if test 768 -ne `wc -c <'vim/tutor/Readme'`; then
echo shar: \"'vim/tutor/Readme'\" unpacked with wrong size!
fi
# end of 'vim/tutor/Readme'
fi
if test -f 'vim/tutor/poster' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/tutor/poster'\"
else
echo shar: Extracting \"'vim/tutor/poster'\" \(860 characters\)
sed "s/^X//" >'vim/tutor/poster' <<'END_OF_FILE'
XArticle 3390 of alt.sources:
XXref: oce-rd1 comp.editors:3231 alt.sources:3390
XPath: oce-rd1!venlo!hp4nl!mcsun!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!csn!pikes!slate!bware
XFrom: bw...@slate.mines.colorado.edu (Ware Bob)
XNewsgroups: comp.editors,alt.sources
XSubject: hands on vi tutor
XKeywords: for new users
XMessage-ID: <1991Jul17.1...@slate.mines.colorado.edu>
XDate: 17 Jul 91 16:13:55 GMT
XSender: bw...@slate.mines.colorado.edu (Ware Bob)
XOrganization: Colorado School of Mines
XLines: 830
X
X
XI posted this a few weeks ago, but a number of people have munged
Xtheir copy, so I am reposting it with better instructions.
X
XThis is a "hand-on" tutor to help new users learn the vi editor.
X
XBob Ware, Colorado School of Mines, Golden, Co 80401, USA
X(303) 273-3987
Xbw...@mines.colorado.edu bw...@slate.mines.colorado.edu bw...@mines.bitnet
END_OF_FILE
if test 860 -ne `wc -c <'vim/tutor/poster'`; then
echo shar: \"'vim/tutor/poster'\" unpacked with wrong size!
fi
# end of 'vim/tutor/poster'
fi
echo shar: End of archive 1 \(of 23\).
cp /dev/null ark1isdone
MISSING=""
for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 ; do
if test ! -f ark${I}isdone ; then
MISSING="${MISSING} ${I}"
fi
done
if test "${MISSING}" = "" ; then
echo You have unpacked all 23 archives.
rm -f ark[1-9]isdone ark[1-9][0-9]isdone
else
echo You still need to unpack the following archives:
echo " " ${MISSING}
fi
## End of shell archive.
exit 0
-------------8<----------------8<----------------8<---------------8<--------
Bram Moolenaar | DISCLAIMER: This note does not
Oce Nederland B.V., Research & Development | necessarily represent the position
p.o. box 101, 5900 MA Venlo | of Oce-Nederland B.V. Therefore
The Netherlands phone +31 77 594077 | no liability or responsibility for
UUCP: mo...@oce.nl fax +31 77 595450 | whatever will be accepted.

exit 0 # Just in case...

Bram Moolenaar

unread,
Apr 23, 1993, 1:27:33 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 2
Archive-name: vim/part02
Environment: UNIX, AMIGA, MS-DOS

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:

# "End of archive 2 (of 23)."
# Contents: vim/README vim/doc/digraph.doc.uue vim/doc/msdos.doc
# vim/src/addcr.bat vim/src/alloc.c vim/src/charset.c vim/src/help.c
# vim/src/linefunc.c vim/src/makefile.dice vim/src/makefile.dos
# vim/src/message.c vim/src/mkcmdtab.c vim/src/msdos.h vim/src/ops.h
# vim/src/sun_stdlib.h vim/src/tcconfig.tc.uue vim/src/unix.h
# vim/termcap
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:05 1993


PATH=/bin:/usr/bin:/usr/ucb ; export PATH

if test -f 'vim/README' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/README'\"
else
echo shar: Extracting \"'vim/README'\" \(2167 characters\)
sed "s/^X//" >'vim/README' <<'END_OF_FILE'
XREADME for version 1.27 of Vim: Vi IMitation.
X
XVim is an almost compatible version of the UNIX editor vi. Only the 'Q'
Xcommand is missing. Many new features have been added: multi level undo,
Xcommand line history, filename completion, quoting, etc. See difference.doc.
X
XThis editor is very useful for editing programs and other plain ASCII files.
XAll commands are given with normal keyboard characters, so those who can type
Xwith ten fingers can work very fast. Function keys can be used for macros.
X
XVim currently runs under Amiga DOS, MSDOS and UNIX. Porting to other systems
Xshould not be very difficult.
X
XDocumentation:
X tutor/readme - one hour training course for beginners
X reference.doc - complete reference of all Vim commands
X difference.doc - summarizes the differences with UNIX vi
X index - alfabetical list of commands
X unix.doc - remarks for unix
X msdos.doc - remarks for MSDOS
X
XVim is Public Domain. You can copy it as much as you like. If you want to
Xdistribute a modified version of the source code please contact me first.
X
XInstallation on the Amiga:
X- Put "arp.library" in "libs:" (not required for Amiga DOS 2.0 and later)
X- Assign "vim:" to the directory where the vim.hlp file is (for the help
X command).
X- With DOS 1.3 or earlier: make sure that newcli and run are in "c:" (for
X executing external commands).
X- Put a shell that accepts a command with "-c" (e.g. "Csh" from Fish disk
X 624) in "c:" or in any other directory that is in your search path (for
X executing external commands).
X
XIf you have sufficient memory you can avoid startup delays by making Vim and
Xcsh resident with the command "rez csh vim". You will have to put
X"rezlib.library" in your "libs:" directory. Under 2.0 you will need rez
Xversion 0.5.
X
XIf you do not use digraphs, you can save some memory by recompiling without
Xthe DIGRAPHS option. If you want to use Vim with other terminals you can
Xrecompile with the TERMCAP option. Vim compiles with Manx 5.x and SAS 6.x.
XSee the makefiles.
X
XPlease send comments, bug reports and suggestions to:
X
X Bram Moolenaar
X Clematisstraat 30
X 5925 BE Venlo
X The Netherlands
X
XUUCP E-mail: mo...@oce.nl
END_OF_FILE
if test 2167 -ne `wc -c <'vim/README'`; then
echo shar: \"'vim/README'\" unpacked with wrong size!
fi
# end of 'vim/README'
fi
if test -f 'vim/doc/digraph.doc.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/digraph.doc.uue'\"
else
echo shar: Extracting \"'vim/doc/digraph.doc.uue'\" \(1961 characters\)
sed "s/^X//" >'vim/doc/digraph.doc.uue' <<'END_OF_FILE'
X
Xbegin 644 digraph.doc
XM5&AE<V4@87)E('1H92!D969A=6QT(&1I9W)A<&@@8VAA<F%C=&5R<R!F;W(@]
XM5FEM+B!4:&4@9FER<W0@='=O(&-H87)A8W1E<G,@:6X@"F5A8V@@8V]L=6UN]
XM(&%R92!T:&4@8VAA<F%C=&5R<R!Y;W4@:&%V92!T;R!T>7!E('1O(&5N=&5R@
XM(&$@9&EG<F%P:"X@26X@=&AE(`IM:61D;&4@;V8@96%C:"!C;VQU;6X@:7,@O
XM=&AE(')E<W5L=&EN9R!C:&%R86-T97(N(%1H:7,@;6%Y(&)E(&UA;F=L960@7
XM:68@>6]U(`IL;V]K(&%T('1H:7,@9FEL92!O;B!S;VUE=&AI;F<@96QS92!T`
XM:&%N(&%N($%M:6=A(&]R('=H96X@>6]U('!R:6YT(&ET+B!4:&4@"F1E8VEM:
XM86P@;G5M8F5R(&ES('1H92!!4T-)22!C;V1E(&9O<B!T:&4@8VAA<F%C=&5RL
XM+@H*?B$@H2`Q-C$@("!C?""B(#$V,B`@("0D(*,@,38S("`@;W@@I"`Q-C0@?
XM("!9+2"E(#$V-2`@('Q\(*8@,38V("`@<&$@IR`Q-C<*(B(@J"`Q-C@@("!CP
XM3R"I(#$V.2`@(&$M(*H@,3<P("`@/#P@JR`Q-S$@("`M+2"M(#$W,R`@(')/'
XM(*X@,3<T("`@+3T@KR`Q-S4*?F\@L"`Q-S8@("`K+2"Q(#$W-R`@(#(R(+(@C
XM,3<X("`@,S,@LR`Q-SD@("`G)R"T(#$X,"`@(&IU(+4@,3@Q("`@<'`@MB`QJ
XM.#(*?BX@MR`Q.#,@("`L+""X(#$X-"`@(#$Q(+D@,3@U("`@;RT@NB`Q.#8@.
XM("`^/B"[(#$X-R`@(#$T(+P@,3@X("`@,3(@O2`Q.#D*,S0@OB`Q.3`@("!^"
XM/R"_(#$Y,2`@($%@(,`@,3DR("`@02<@P2`Q.3,@("!!7B#"(#$Y-"`@($%^:
XM(,,@,3DU("`@02(@Q"`Q.38*04`@Q2`Q.3<@("!!12#&(#$Y."`@($,L(,<@>
XM,3DY("`@16`@R"`R,#`@("!%)R#)(#(P,2`@($5>(,H@,C`R("`@12(@RR`R/
XM,#,*26`@S"`R,#0@("!))R#-(#(P-2`@($E>(,X@,C`V("`@22(@SR`R,#<@L
XM("`M1"#0(#(P."`@($Y^(-$@,C`Y("`@3V`@TB`R,3`*3R<@TR`R,3$@("!/]
XM7B#4(#(Q,B`@($]^(-4@,C$S("`@3R(@UB`R,30@("`O7"#7(#(Q-2`@($\O5
XM(-@@,C$V("`@56`@V2`R,3<*52<@VB`R,3@@("!57B#;(#(Q.2`@(%4B(-P@Q
XM,C(P("`@62<@W2`R,C$@("!)<"#>(#(R,B`@('-S(-\@,C(S("`@86`@X"`RB
XM,C0*82<@X2`R,C4@("!A7B#B(#(R-B`@(&%^(.,@,C(W("`@82(@Y"`R,C@@-
XM("!A0"#E(#(R.2`@(&%E(.8@,C,P("`@8RP@YR`R,S$*96`@Z"`R,S(@("!E#
XM)R#I(#(S,R`@(&5>(.H@,C,T("`@92(@ZR`R,S4@("!I8"#L(#(S-B`@(&DG:
XM(.T@,C,W("`@:5X@[B`R,S@*:2(@[R`R,SD@("`M9"#P(#(T,"`@(&Y^(/$@1
XM,C0Q("`@;V`@\B`R-#(@("!O)R#S(#(T,R`@(&]>(/0@,C0T("`@;WX@]2`R!
XM-#4*;R(@]B`R-#8@("`Z+2#W(#(T-R`@(&\O(/@@,C0X("`@=6`@^2`R-#D@R
XM("!U)R#Z(#(U,"`@('5>(/L@,C4Q("`@=2(@_"`R-3(*>2<@_2`R-3,@("!I)
X3<"#^(#(U-"`@('DB(/\@,C4U"C4Q/
X``
Xend
Xsize 1369
END_OF_FILE
if test 1961 -ne `wc -c <'vim/doc/digraph.doc.uue'`; then
echo shar: \"'vim/doc/digraph.doc.uue'\" unpacked with wrong size!
fi
# end of 'vim/doc/digraph.doc.uue'
fi
if test -f 'vim/doc/msdos.doc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/msdos.doc'\"
else
echo shar: Extracting \"'vim/doc/msdos.doc'\" \(2942 characters\)
sed "s/^X//" >'vim/doc/msdos.doc' <<'END_OF_FILE'
XThis file contains the particularities for the MSDOS version of Vim.
X
XIf Vim produces all kinds of garbage on the screen you need to install
Xansi.sys (or equivalent).
X
XIf the "tx" (textmode) option is set (which is the default), Vim will accept a
Xsingle <LF> or a <CR><LF> pair for end-of-line. When writing a file Vim will
Xuse <CR><LF>. Thus if you edit a file and write it, <LF> is replaced with
X<CR><LF>. Single <CR> characters are lost. If the "tx" option is not set the
Xsingle <LF> will be used for end-of-line. A <CR> will be shown as ^M.
XYou can use Vim to replace <LF> by <CR><LF> by reading in any mode and
Xwriting in text mode. You can use Vim to replace <CR><LF> by <LF> by reading
Xin text mode and writing in non-text mode.
X
XScript files contain single <CR> characters. If you want to edit a script file
Xyou should reset the textmode option before loading the file.
X
XThe default help filename is "$VIM\vim.hlp". If the environment variable $VIM
Xis not defined or the file is not found, the DOS search path is used to
Xsearch for the file "vim.hlp". If you do not want to put "vim.hlp" in your
Xsearch path, use the command ":set helpfile=pathname" to tell Vim where the
Xhelp file is.
X
XThe files "_vimrc" and "_exrc" are used instead of ".vimrc" and ".exrc".
XThe files "$VIM\_vimrc" and "$VIM\_exrc" are used instead of "s:.vimrc" and
X"s:.exrc".
X
XUse CTRL-break instead of CTRL-C to interrupt searches. The CTRL-C is not
Xdetected until a key is read.
X
XUse CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and
XSHIFT-arrow-right. The arrow-up and arrow-down cannot be used with SHIFT or
XCTRL.
X
XTemporary files (for filtering) are put in the current directory.
X
XThe default for the sh (shell) option is "command". External commands are
Xstarted with "command /c <command_name>". Typing CTRL-Z starts a new command
Xshell. Return to Vim with "exit".
X
X
XMS-DOS allows for only one filename extention. Therefore, in the original
Xfilename the '.' is replaced by a '_', the name is truncated to 8 characters
Xand the new extention ".vim" or ".bak" is appended. Two examples: "test.c"
Xbecomes "test_c.bak", "ditiseen.tst" becomes "ditiseen.bak". The 'shortname'
Xoption is not available.
X
XThe MS-DOS binary was compiled with Turbo-C version 2.0 (yes, it's old). You
Xmay get some "argument never used" warning messages. They can be ignored. If
Xyou get all kinds of strange error messages when compiling, you have to add
X<CR> characters at the end of each line. This can be done with the addcr
Xprogram: "make addcr". This will compile addcr.c to addcr.exe and execute
Xthe addcr.bat file.
X
XAll text is kept in memory. This limits the size of the file you can edit,
Xthe number of undo levels that can be remembered, etc.. If Vim gives an "Out
Xof memory" warning you should stop editing. Result of further editing actions
Xis unpredictable.
X
XThe *.info files are for the Amiga. You don't need them with MSDOS.
END_OF_FILE
if test 2942 -ne `wc -c <'vim/doc/msdos.doc'`; then
echo shar: \"'vim/doc/msdos.doc'\" unpacked with wrong size!
fi
# end of 'vim/doc/msdos.doc'
fi
if test -f 'vim/src/addcr.bat' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/addcr.bat'\"
else
echo shar: Extracting \"'vim/src/addcr.bat'\" \(3795 characters\)
sed "s/^X//" >'vim/src/addcr.bat' <<'END_OF_FILE'
Xaddcr <addcr.c >tmp
Xcp tmp addcr.c
Xaddcr <alloc.c >tmp
Xcp tmp alloc.c
Xaddcr <ascii.h >tmp
Xcp tmp ascii.h
Xaddcr <buffers.c >tmp
Xcp tmp buffers.c
Xaddcr <charset.c >tmp
Xcp tmp charset.c
Xaddcr <cmdline.c >tmp
Xcp tmp cmdline.c
Xaddcr <cmdtab.h >tmp
Xcp tmp cmdtab.h
Xaddcr <cmdtab.tab >tmp
Xcp tmp cmdtab.tab
Xaddcr <csearch.c >tmp
Xcp tmp csearch.c
Xaddcr <debug.h >tmp
Xcp tmp debug.h
Xaddcr <digraph.c >tmp
Xcp tmp digraph.c
Xaddcr <edit.c >tmp
Xcp tmp edit.c
Xaddcr <env.h >tmp
Xcp tmp env.h
Xaddcr <fileio.c >tmp
Xcp tmp fileio.c
Xaddcr <globals.h >tmp
Xcp tmp globals.h
Xaddcr <help.c >tmp
Xcp tmp help.c
Xaddcr <keymap.h >tmp
Xcp tmp keymap.h
Xaddcr <linefunc.c >tmp
Xcp tmp linefunc.c
Xaddcr <macros.h >tmp
Xcp tmp macros.h
Xaddcr <main.c >tmp
Xcp tmp main.c
Xaddcr <makefile >tmp
Xcp tmp makefile
Xaddcr <mark.c >tmp
Xcp tmp mark.c
Xaddcr <mark.h >tmp
Xcp tmp mark.h
Xaddcr <message.c >tmp
Xcp tmp message.c
Xaddcr <misccmds.c >tmp
Xcp tmp misccmds.c
Xaddcr <mkcmdtab.c >tmp
Xcp tmp mkcmdtab.c
Xaddcr <msdos.c >tmp
Xcp tmp msdos.c
Xaddcr <msdos.h >tmp
Xcp tmp msdos.h
Xaddcr <normal.c >tmp
Xcp tmp normal.c
Xaddcr <ops.c >tmp
Xcp tmp ops.c
Xaddcr <ops.h >tmp
Xcp tmp ops.h
Xaddcr <param.c >tmp
Xcp tmp param.c
Xaddcr <param.h >tmp
Xcp tmp param.h
Xaddcr <proto.h >tmp
Xcp tmp proto.h
Xaddcr <quickfix.c >tmp
Xcp tmp quickfix.c
Xaddcr <regexp.c >tmp
Xcp tmp regexp.c
Xaddcr <regexp.h >tmp
Xcp tmp regexp.h
Xaddcr <regmagic.h >tmp
Xcp tmp regmagic.h
Xaddcr <regsub.c >tmp
Xcp tmp regsub.c
Xaddcr <screen.c >tmp
Xcp tmp screen.c
Xaddcr <script.c >tmp
Xcp tmp script.c
Xaddcr <search.c >tmp
Xcp tmp search.c
Xaddcr <storage.c >tmp
Xcp tmp storage.c
Xaddcr <tag.c >tmp
Xcp tmp tag.c
Xaddcr <tags >tmp
Xcp tmp tags
Xaddcr <term.c >tmp
Xcp tmp term.c
Xaddcr <term.h >tmp
Xcp tmp term.h
Xaddcr <termlib.c >tmp
Xcp tmp termlib.c
Xaddcr <termlib.fix >tmp
Xcp tmp termlib.fix
Xaddcr <undo.c >tmp
Xcp tmp undo.c
Xaddcr <version.c >tmp
Xcp tmp version.c
Xaddcr <vim.h >tmp
Xcp tmp vim.h
Xaddcr <vim.prj >tmp
Xcp tmp vim.prj
Xaddcr <vimresp >tmp
Xcp tmp vimresp
Xaddcr <proto\alloc.pro >tmp
Xcp tmp proto\alloc.pro
Xaddcr <proto\amiga.pro >tmp
Xcp tmp proto\amiga.pro
Xaddcr <proto\buffers.pro >tmp
Xcp tmp proto\buffers.pro
Xaddcr <proto\charset.pro >tmp
Xcp tmp proto\charset.pro
Xaddcr <proto\cmdline.pro >tmp
Xcp tmp proto\cmdline.pro
Xaddcr <proto\csearch.pro >tmp
Xcp tmp proto\csearch.pro
Xaddcr <proto\digraph.pro >tmp
Xcp tmp proto\digraph.pro
Xaddcr <proto\edit.pro >tmp
Xcp tmp proto\edit.pro
Xaddcr <proto\fileio.pro >tmp
Xcp tmp proto\fileio.pro
Xaddcr <proto\help.pro >tmp
Xcp tmp proto\help.pro
Xaddcr <proto\linefunc.pro >tmp
Xcp tmp proto\linefunc.pro
Xaddcr <proto\main.pro >tmp
Xcp tmp proto\main.pro
Xaddcr <proto\mark.pro >tmp
Xcp tmp proto\mark.pro
Xaddcr <proto\message.pro >tmp
Xcp tmp proto\message.pro
Xaddcr <proto\misccmds.pro >tmp
Xcp tmp proto\misccmds.pro
Xaddcr <proto\normal.pro >tmp
Xcp tmp proto\normal.pro
Xaddcr <proto\ops.pro >tmp
Xcp tmp proto\ops.pro
Xaddcr <proto\param.pro >tmp
Xcp tmp proto\param.pro
Xaddcr <proto\quickfix.pro >tmp
Xcp tmp proto\quickfix.pro
Xaddcr <proto\regexp.pro >tmp
Xcp tmp proto\regexp.pro
Xaddcr <proto\regsub.pro >tmp
Xcp tmp proto\regsub.pro
Xaddcr <proto\screen.pro >tmp
Xcp tmp proto\screen.pro
Xaddcr <proto\script.pro >tmp
Xcp tmp proto\script.pro
Xaddcr <proto\search.pro >tmp
Xcp tmp proto\search.pro
Xaddcr <proto\storage.pro >tmp
Xcp tmp proto\storage.pro
Xaddcr <proto\tag.pro >tmp
Xcp tmp proto\tag.pro
Xaddcr <proto\term.pro >tmp
Xcp tmp proto\term.pro
Xaddcr <proto\termlib.pro >tmp
Xcp tmp proto\termlib.pro
Xaddcr <proto\undo.pro >tmp
Xcp tmp proto\undo.pro
Xaddcr <proto\version.pro >tmp
Xcp tmp proto\version.pro
Xdel tmp
END_OF_FILE
if test 3795 -ne `wc -c <'vim/src/addcr.bat'`; then
echo shar: \"'vim/src/addcr.bat'\" unpacked with wrong size!
fi
# end of 'vim/src/addcr.bat'
fi
if test -f 'vim/src/alloc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/alloc.c'\"
else
echo shar: Extracting \"'vim/src/alloc.c'\" \(2444 characters\)
sed "s/^X//" >'vim/src/alloc.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * alloc.c
X *
X * This file contains various routines dealing with allocation and
X * deallocation of data structures.
X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X
X#ifdef AMIGA
X# undef FALSE /* these are redefined in exec/types.h */
X# undef TRUE
X# include <exec/types.h>
X# include <exec/memory.h>
X# undef FALSE
X# define FALSE 0 /* define FALSE and TRUE as ints instead of longs */
X# undef TRUE
X# define TRUE 1
X#endif /* AMIGA */
X
X#ifdef MSDOS
X# include <alloc.h>
X#endif /* MSDOS */
X
X#define PANIC_FACTOR_CHIP 8192L
X
X char *
Xalloc(size)
X unsigned size;
X{
X return (lalloc((u_long)size, TRUE));
X}
X
X char *
Xlalloc(size, message)
X u_long size;
X int message;
X{
X register char *p; /* pointer to new storage space */
X
X if ((p = (char *)malloc(size)) != NULL)
X {
X#ifdef AMIGA
X if (AvailMem((long)MEMF_CHIP) < PANIC_FACTOR_CHIP)
X { /* System is low... no go! */
X free(p);
X p = NULL;
X }
X#endif
X#ifdef MSDOS
X if (coreleft() < PANIC_FACTOR_CHIP)
X { /* System is low... no go! */
X free(p);
X p = NULL;
X }
X#endif
X }
X if (message && p == NULL)
X emsg(e_outofmem);
X return (p);
X}
X
X/*
X * copy a string into newly allocated memory
X */
X char *
Xstrsave(string)
X char *string;
X{
X char *p;
X
X p = alloc((unsigned) (strlen(string) + 1));
X if (p != NULL)
X strcpy(p, string);
X return p;
X}
X
X char *
Xstrnsave(string, len)
X char *string;
X int len;
X{
X char *p;
X
X p = alloc((unsigned) (len + 1));
X if (p != NULL)
X {
X strncpy(p, string, (size_t)len);
X p[len] = NUL;
X }
X return p;
X}
X
X/*
X * copy a number of spaces
X */
X void
Xcopy_spaces(ptr, count)
X char *ptr;
X size_t count;
X{
X register size_t j;
X
X while (count) /* copy 15 spaces at a time */
X {
X j = count;
X if (j > 15)
X j = 15;
X memmove(ptr, spaces, j);
X ptr += j;
X count -= j;
X }
X}
X
X char *
Xmkstr(c)
X unsigned c;
X{
X static char s[2];
X
X s[0] = c;
X s[1] = NUL;
X
X return s;
X}
X
X#ifdef NO_FREE_NULL
X#undef free
X/*
X * replacement for free() that cannot handle NULL pointers
X */
X void
XnofreeNULL(x)
X void *x;
X{
X if (x != NULL)
X free(x);
X}
X#endif
X
X#ifdef BSD
X char *
Xbsdmemset(ptr, c, size)
X char *ptr;
X int c;
X long size;
X{
X register char *p = ptr;
X
X while (size-- > 0)
X *p++ = c;
X return ptr;
X}
X#endif
END_OF_FILE
if test 2444 -ne `wc -c <'vim/src/alloc.c'`; then
echo shar: \"'vim/src/alloc.c'\" unpacked with wrong size!
fi
# end of 'vim/src/alloc.c'
fi
if test -f 'vim/src/charset.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/charset.c'\"
else
echo shar: Extracting \"'vim/src/charset.c'\" \(1994 characters\)
sed "s/^X//" >'vim/src/charset.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X

X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X#include "param.h"
X
X
X char *
Xtranschar(c)
X unsigned c;
X{
X static char buf[3];
X
X if (c < ' ')
X {
X if (c == NL)
X c = NUL; /* we use newline in place of a NUL */
X buf[0] = '^';
X buf[1] = '@' + c;
X buf[2] = NUL;
X }
X else if (c <= '~' || c > 0xa0 || p_gr)
X {
X buf[0] = c;
X buf[1] = NUL;
X }
X else
X {
X buf[0] = '~';
X buf[1] = c - 0x80 + '@';
X buf[2] = NUL;
X }
X return buf;
X}
X
X/*
X * output 'len' characters in 'str' (including NULs) with translation
X * if 'len' is -1, output upto a NUL character
X * return the number of characters it takes on the screen
X */
X int
Xouttrans(str, len)
X register char *str;
X register int len;
X{
X int retval = 0;
X
X if (len == -1)
X len = strlen(str);
X while (--len >= 0)
X {
X outstrn(transchar(*(u_char *)str));
X retval += charsize(*(u_char *)str);
X ++str;
X }
X return retval;
X}
X
X/*
X * return the number of characters 'c' will take on the screen
X */
X int
Xcharsize(c)
X int c;
X{
X return ((c >= ' ' && (p_gr || c <= '~')) || c > 0xa0 ? 1 : 2);
X}
X
X/*
X * return the number of characters string 's' will take on the screen
X */
X int
Xstrsize(s)
X char *s;
X{
X int len = 0;
X
X while (*s)
X len += charsize(*s++);
X return len;
X}
X
X/*
X * return the number of characters 'c' will take on the screen, taking
X * into account the size of a tab
X */
X int
Xchartabsize(c, col)
X int c, col;
X{
X if ((c >= ' ' && (c <= '~' || p_gr)) || c > 0xa0)
X return 1;
X else if (c == TAB && !p_list)
X return (int)(p_ts - (col % p_ts));
X else
X return 2;
X}
X
X/*
X * return TRUE if 'c' is an identifier character
X */
X int
Xisidchar(c)
X int c;
X{
X#ifdef __STDC__
X return (isalnum(c) || c == '_');
X#else
X return (isalpha(c) || isdigit(c) || c == '_');
X#endif
X}
END_OF_FILE
if test 1994 -ne `wc -c <'vim/src/charset.c'`; then
echo shar: \"'vim/src/charset.c'\" unpacked with wrong size!
fi
# end of 'vim/src/charset.c'
fi
if test -f 'vim/src/help.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/help.c'\"
else
echo shar: Extracting \"'vim/src/help.c'\" \(2810 characters\)
sed "s/^X//" >'vim/src/help.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * help.c: display help from the vim.hlp file
X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X#include "param.h"
X
Xstatic long helpfilepos; /* position in help file */
Xstatic FILE *helpfd; /* file descriptor of help file */
X
X void
Xhelp()
X{
X int c;
X int eof;
X int i;
X long filepos[26]; /* seek position for each screen */
X int screennr; /* screen number; 'c' == 1 */
X char fnamebuf[MAXPATHL];
X#ifdef MSDOS
X char *fnamep;
X#endif
X
X/*
X * try to open the file specified by the "helpfile" option
X */
X expand_env(p_hf, fnamebuf, MAXPATHL);
X if ((helpfd = fopen(fnamebuf, READBIN)) == NULL)
X {
X#ifdef MSDOS
X /*
X * for MSdos: try the DOS search path
X */
X strcpy(fnamebuf, "vim.hlp");
X fnamep = searchpath(fnamebuf);
X if (fnamep == NULL || (helpfd = fopen(fnamep, READBIN)) == NULL)
X {
X#endif
X smsg("Sorry, help file %s not found", fnamebuf);
X return;
X#ifdef MSDOS
X }
X#endif
X }
X helpfilepos = 0;
X screennr = 0;
X for (i = 0; i < 26; ++i)
X filepos[i] = 0;
X State = HELP;
X for (;;)
X {
X eof = redrawhelp();
X if (!eof)
X filepos[screennr + 1] = ftell(helpfd);
X
X if ((c = vgetc()) == '\n' || c == '\r')
X break;
X
X if (c == ' ') /* one screen forwards */
X {
X if (screennr < 25 && !eof)
X ++screennr;
X }
X else if (c == 'a') /* go to first screen */
X screennr = 0;
X else if (c == 'b') /* go one screen backwards */
X {
X if (screennr > 0)
X --screennr;
X }
X else if (c >= 'c' && c <= 'z') /* go to specified screen */
X {
X if (c - 'b' < screennr) /* backwards */
X screennr = c - 'b';
X else /* forwards */
X {
X while (screennr < c - 'b' && filepos[screennr + 1])
X ++screennr;
X fseek(helpfd, filepos[screennr], 0);
X while (screennr < c - 'b')
X {
X while ((i = getc(helpfd)) != '\f' && i != -1)
X ;
X if (i == -1)
X break;
X filepos[++screennr] = ftell(helpfd);
X }
X }
X }
X helpfilepos = filepos[screennr];
X }
X State = NORMAL;
X script_winsize_pp();
X fclose(helpfd);
X updateScreen(CLEAR);
X}
X
X int
Xredrawhelp()
X{
X int nextc;
X int col;
X
X fseek(helpfd, helpfilepos, 0);
X col = Columns - 52;
X if (col < 0)
X col = 0;
X outstr(T_ED);
X while ((nextc = getc(helpfd)) != -1 && nextc != '\f')
X {
X if (nextc == Ctrl('B')) /* begin of invert */
X outstr(T_TI);
X else if (nextc == Ctrl('E')) /* end of invert */
X outstr(T_TP);
X else
X outchar((char)nextc);
X }
X windgoto(0, (int)(Columns - strlen(Version) - 1));
X outstrn(Version);
X windgoto((int)Rows - 1, col);
X outstrn("<space = next; return = quit; a = index; b = back>");
X return (nextc == -1);
X}
END_OF_FILE
if test 2810 -ne `wc -c <'vim/src/help.c'`; then
echo shar: \"'vim/src/help.c'\" unpacked with wrong size!
fi
# end of 'vim/src/help.c'
fi
if test -f 'vim/src/linefunc.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/linefunc.c'\"
else
echo shar: Extracting \"'vim/src/linefunc.c'\" \(2625 characters\)
sed "s/^X//" >'vim/src/linefunc.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * linefunc.c: some functions to move to the next/previous line and
X * to the next/previous character
X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X
X/*
X * coladvance(col)
X *
X * Try to advance the Cursor to the specified column.
X */
X
X void
Xcoladvance(wcol)
X colnr_t wcol;
X{
X int index;
X register u_char *ptr;
X register colnr_t col;
X
X ptr = (u_char *)nr2ptr(Curpos.lnum);
X
X /* try to advance to the specified column */
X index = -1;
X col = 0;
X while (col <= wcol && *ptr)
X {
X ++index;
X /* Count a tab for what it's worth (if list mode not on) */
X col += chartabsize(*ptr, col);
X ++ptr;
X }
X if (index < 0)
X Curpos.col = 0;
X else
X Curpos.col = index;
X}
X
X/*
X * inc(p)
X *
X * Increment the line pointer 'p' crossing line boundaries as necessary. Return
X * 1 when crossing a line, -1 when at end of file, 0 otherwise.
X */
X int
Xinc(lp)
X register FPOS *lp;
X{
X register char *p = pos2ptr(lp);
X
X if (*p != NUL)
X { /* still within line */
X lp->col++;
X return ((p[1] != NUL) ? 0 : 1);
X }
X if (lp->lnum != line_count)
X { /* there is a next line */
X lp->col = 0;
X lp->lnum++;
X return 1;
X }
X return -1;
X}
X
X int
XincCurpos()
X{
X return inc(&Curpos);
X}
X
X/*
X * incl(lp): same as inc(), but skip the NUL at the end of non-empty lines
X */
X int
Xincl(lp)
X register FPOS *lp;
X{
X register int r;
X
X if ((r = inc(lp)) == 1 && lp->col)
X r = inc(lp);
X return r;
X}
X
X/*
X * dec(p)
X *
X * Decrement the line pointer 'p' crossing line boundaries as necessary. Return
X * 1 when crossing a line, -1 when at start of file, 0 otherwise.
X */
X int
Xdec(lp)
X register FPOS *lp;
X{
X if (lp->col > 0)
X { /* still within line */
X lp->col--;
X return 0;
X }
X if (lp->lnum > 1)
X { /* there is a prior line */
X lp->lnum--;
X lp->col = strlen(nr2ptr(lp->lnum));
X return 1;
X }
X return -1; /* at start of file */
X}
X
X int
XdecCurpos()
X{
X return dec(&Curpos);
X}
X
X/*
X * decl(lp): same as dec(), but skip the NUL at the end of non-empty lines
X */
X int
Xdecl(lp)
X register FPOS *lp;
X{
X register int r;
X
X if ((r = dec(lp)) == 1 && lp->col)
X r = dec(lp);
X return r;
X}
X
X/*
X * make sure Curpos in on a valid character
X */
X void
XadjustCurpos()
X{
X int len;
X
X if (Curpos.lnum == 0)
X Curpos.lnum = 1;
X if (Curpos.lnum > line_count)
X Curpos.lnum = line_count;
X
X len = strlen(nr2ptr(Curpos.lnum));
X if (len == 0)
X Curpos.col = 0;
X else if (Curpos.col >= len)
X Curpos.col = len - 1;
X}
END_OF_FILE
if test 2625 -ne `wc -c <'vim/src/linefunc.c'`; then
echo shar: \"'vim/src/linefunc.c'\" unpacked with wrong size!
fi
# end of 'vim/src/linefunc.c'
fi
if test -f 'vim/src/makefile.dice' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/makefile.dice'\"
else
echo shar: Extracting \"'vim/src/makefile.dice'\" \(3130 characters\)
sed "s/^X//" >'vim/src/makefile.dice' <<'END_OF_FILE'
X#
X# Makefile for VIM, using DICE 2.06.40 and 2.06.21
X#
X
X#>>>>> choose options:
X### -DDIGRAPHS digraph support (at the cost of 1.6 Kbyte code)
X### -DWILD_CARDS wildcard expansion code
X### -DNO_ARP do not use arp.library, DOS 2.0 required
X### -DCOMPATIBLE start in vi-compatible mode
X### -DNOBACKUP default is no backup file
X### -DDEBUG output a lot of debugging garbage
X### -DTERMCAP include termcap file support
X### -DNO_BUILTIN_TCAPS do not include builtin termcap entries
X### (use only with -DTERMCAP)
X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)
X### -DALL_BUILTIN_TCAPS include all builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)
XDEFINES = -DWILD_CARDS -DTERMCAP -DDIGRAPHS -DSOME_BUILTIN_TCAPS
X
X#>>>>> if TERMCAP is defined termlib.o has to be used
XTERMLIB = termlib.o
X#TERMLIB =
X
X#>>>>> end of choices
X###########################################################################
X
XCFLAGS = -c -DAMIGA $(DEFINES)
X
XINCL = vim.syms
XPRE = -H${INCL}=vim.h
XLIBS = -lmanx -la
XCC = dcc
XLD = dcc
X
X.c.o:
X ${CC} ${PRE} ${CFLAGS} $*.c -o $@
X
XOBJ = alloc.o amiga.o buffers.o charset.o cmdline.o csearch.o digraph.o \
X edit.o fileio.o help.o linefunc.o main.o mark.o message.o misccmds.o \
X normal.o ops.o param.o quickfix.o regexp.o regsub.o screen.o \
X script.o search.o storage.o tag.o undo.o $(TERMLIB)
X
X/Vim: $(OBJ) version.c
X ${CC} $(CFLAGS) version.c -o version.o
X ${LD} -o /Vim $(OBJ) version.o $(LIBS)
X
Xdebug: $(OBJ) version.c
X ${CC} $(CFLAGS) version.c -o version.o
X ${LD} -s -o /Vim $(OBJ) version.o $(LIBS)
X
Xctags:
X csh -c ctags *.c *.h
X
X# can't use delete here, too many file names
Xclean:
X csh -c rm -f $(OBJ) version.o mkcmdtab.o /Vim $(INCL) mkcmdtab
X
X$(INCL) : vim.h globals.h keymap.h macros.h ascii.h term.h amiga.h
X delete $(INCL)
X
X###########################################################################
X
Xalloc.o: alloc.c $(INCL)
X
Xamiga.o: amiga.c $(INCL) amiga.h
X
Xbuffers.o: buffers.c $(INCL)
X
Xcharset.o: charset.c $(INCL)
X
Xcmdline.o: cmdline.c $(INCL) cmdtab.h
X
Xcsearch.o: csearch.c $(INCL) regexp.h
X
Xdigraph.o: digraph.c $(INCL)
X
Xedit.o: edit.c $(INCL)
X
Xfileio.o: fileio.c $(INCL)
X
Xhelp.o: help.c $(INCL)
X
Xlinefunc.o: linefunc.c $(INCL)
X
Xmain.o: main.c
X ${CC} ${CFLAGS} main.c -o main.o
X
Xmark.o: mark.c $(INCL) mark.h
X
Xmessage.o: message.c $(INCL)
X
Xmisccmds.o: misccmds.c $(INCL)
X
Xnormal.o: normal.c $(INCL) ops.h
X
Xops.o: ops.c $(INCL) ops.h
X
Xparam.o: param.c $(INCL)
X# Because of a bug in DC1 2.06.40, initialisation of unions does not
X# work correctly. dc1-21 is DC1 2.06.21 which does work.
X rename dc1-21 dc1
X ${CC} ${CFLAGS} param.c -o param.o
X rename dc1 dc1-21
X
Xquickfix.o: quickfix.c $(INCL)
X
Xregexp.o: regexp.c $(INCL) regexp.h
X
Xregsub.o: regsub.c $(INCL) regexp.h
X
Xscreen.o: screen.c $(INCL)
X
Xscript.o: script.c $(INCL)
X
Xsearch.o: search.c $(INCL) regexp.h
X
Xtag.o: tags.c $(INCL) mark.h
X
Xtermlib.o: termlib.c $(INCL)
X
Xstorage.o: storage.c $(INCL)
X
Xundo.o: undo.c $(INCL)
X
Xcmdtab.h: cmdtab.tab mkcmdtab
X mkcmdtab cmdtab.tab cmdtab.h
X
Xmkcmdtab: mkcmdtab.o
X ${LD} -o mkcmdtab mkcmdtab.o
END_OF_FILE
if test 3130 -ne `wc -c <'vim/src/makefile.dice'`; then
echo shar: \"'vim/src/makefile.dice'\" unpacked with wrong size!
fi
# end of 'vim/src/makefile.dice'
fi
if test -f 'vim/src/makefile.dos' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/makefile.dos'\"
else
echo shar: Extracting \"'vim/src/makefile.dos'\" \(3966 characters\)
sed "s/^X//" >'vim/src/makefile.dos' <<'END_OF_FILE'
X#
X# Makefile for VIM on MSDOS, using Turbo C
X#
X
X#>>>>> choose options:
X### -DUSE_KBHIT use kbhit() and getch() instead of bioskey()
X### -DDIGRAPHS digraph support (at the cost of 1.6 Kbyte code)
X### -DWILD_CARDS wildcard expansion code
X### -DCOMPATIBLE start in vi-compatible mode
X### -DNOBACKUP default is no backup file
X### -DDEBUG output a lot of debugging garbage
X### -DTERMCAP include termcap file support
X### -DNO_BUILTIN_TCAPS do not include builtin termcap entries
X### (use only with -DTERMCAP)
X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)
X### -DALL_BUILTIN_TCAPS include all builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)
X### -DVIMRC_FILE name of the .vimrc file in current dir
X### -DEXRC_FILE name of the .exrc file in current dir
X### -DSYSVIMRC_FILE name of the global .vimrc file
X### -DSYSEXRC_FILE name of the global .exrc file
X### -DDEFVIMRC_FILE name of the system-wide .vimrc file
X### -DVIM_HLP name of the help file
XDEFINES = -DWILD_CARDS
X
X#>>>>> name of the compiler and linker, name of lib directory
XCC = tcc
XLINK = tlink
XLIB = d:\tc\lib
X
X#>>>>> end of choices
X###########################################################################
X
XINCL = vim.h globals.h param.h keymap.h macros.h ascii.h term.h msdos.h
XCFLAGS = -c -ml -DMSDOS $(DEFINES)
X
XOBJ = alloc.obj msdos.obj buffers.obj charset.obj cmdline.obj csearch.obj \
X digraph.obj edit.obj fileio.obj help.obj linefunc.obj main.obj mark.obj \
X message.obj misccmds.obj normal.obj ops.obj param.obj quickfix.obj \
X regexp.obj regsub.obj screen.obj script.obj search.obj storage.obj \
X tag.obj term.obj undo.obj
X
X..\vim: $(OBJ) version.c
X $(CC) $(CFLAGS) version.c
X $(LINK) /c /m $(LIB)\C0l @vimresp,..\vim,..\vim,$(LIB)\emu $(LIB)\Cl
X
Xctags:
X command /c ctags *.c *.h
X
Xclean:
X del $(OBJ) version.obj mkcmdtab.obj ..\vim mkcmdtab
X
Xaddcr: addcr.c
X $(CC) addcr.c
X command /c addcr.bat
X
X###########################################################################
X
Xalloc.obj: alloc.c $(INCL)
X $(CC) $(CFLAGS) alloc.c
X
Xmsdos.obj: msdos.c $(INCL) msdos.h
X $(CC) $(CFLAGS) msdos.c
X
Xbuffers.obj: buffers.c $(INCL)
X $(CC) $(CFLAGS) buffers.c
X
Xcharset.obj: charset.c $(INCL)
X $(CC) $(CFLAGS) charset.c
X
Xcmdline.obj: cmdline.c $(INCL) cmdtab.h
X $(CC) $(CFLAGS) cmdline.c
X
Xcsearch.obj: csearch.c $(INCL)
X $(CC) $(CFLAGS) csearch.c
X
Xdigraph.obj: digraph.c $(INCL)
X $(CC) $(CFLAGS) digraph.c
X
Xedit.obj: edit.c $(INCL)
X $(CC) $(CFLAGS) edit.c
X
Xfileio.obj: fileio.c $(INCL)
X $(CC) $(CFLAGS) fileio.c
X
Xhelp.obj: help.c $(INCL)
X $(CC) $(CFLAGS) help.c
X
Xlinefunc.obj: linefunc.c $(INCL)
X $(CC) $(CFLAGS) linefunc.c
X
Xmain.obj: main.c $(INCL)
X $(CC) $(CFLAGS) main.c
X
Xmark.obj: mark.c $(INCL)
X $(CC) $(CFLAGS) mark.c
X
Xmessage.obj: message.c $(INCL)
X $(CC) $(CFLAGS) message.c
X
Xmisccmds.obj: misccmds.c $(INCL)
X $(CC) $(CFLAGS) misccmds.c
X
Xnormal.obj: normal.c $(INCL) ops.h
X $(CC) $(CFLAGS) normal.c
X
Xops.obj: ops.c $(INCL) ops.h
X $(CC) $(CFLAGS) ops.c
X
Xparam.obj: param.c $(INCL)
X $(CC) $(CFLAGS) param.c
X
Xquickfix.obj: quickfix.c $(INCL)
X $(CC) $(CFLAGS) quickfix.c
X
Xregexp.obj: regexp.c $(INCL)
X $(CC) $(CFLAGS) regexp.c
X
Xregsub.obj: regsub.c $(INCL)
X $(CC) $(CFLAGS) regsub.c
X
Xscreen.obj: screen.c $(INCL)
X $(CC) $(CFLAGS) screen.c
X
Xscript.obj: script.c $(INCL)
X $(CC) $(CFLAGS) script.c
X
Xsearch.obj: search.c $(INCL)
X $(CC) $(CFLAGS) search.c
X
Xstorage.obj: storage.c $(INCL)
X $(CC) $(CFLAGS) storage.c
X
Xtag.obj: tag.c $(INCL)
X $(CC) $(CFLAGS) tag.c
X
Xterm.obj: term.c $(INCL)
X $(CC) $(CFLAGS) term.c
X
Xundo.obj: undo.c $(INCL)
X $(CC) $(CFLAGS) undo.c
X
Xcmdtab.h: cmdtab.tab mkcmdtab.exe
X mkcmdtab cmdtab.tab cmdtab.h
X
Xmkcmdtab.exe: mkcmdtab.obj
X $(CC) -ml -omkcmdtab mkcmdtab.obj
X
Xmkcmdtab.obj: mkcmdtab.c
X $(CC) $(CFLAGS) mkcmdtab.c
END_OF_FILE
if test 3966 -ne `wc -c <'vim/src/makefile.dos'`; then
echo shar: \"'vim/src/makefile.dos'\" unpacked with wrong size!
fi
# end of 'vim/src/makefile.dos'
fi
if test -f 'vim/src/message.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/message.c'\"
else
echo shar: Extracting \"'vim/src/message.c'\" \(2523 characters\)
sed "s/^X//" >'vim/src/message.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * message.c: functions for displaying messages on the command line
X */
X
X#include "vim.h"
X#include "globals.h"
X#define MESSAGE
X#include "proto.h"
X#include "param.h"
X
Xstatic int msg_invert = FALSE;
X
X/*
X * msg(s) - displays the string 's' on the status line
X */
X void
Xmsg(s)
X char *s;
X{
X int len;
X
X if (Columns == 0) /* terminal not initialized */
X {
X fprintf(stderr, s);
X fflush(stderr);
X return;
X }
X
X gotocmdline(TRUE, NUL);
X if (msg_invert)
X outstr(T_TI);
X len = outtrans(s, -1);
X if (msg_invert)
X {
X outstr(T_TP);
X msg_invert = FALSE;
X }
X flushbuf();
X /*
X * if the string is larger than the window,
X * or the ruler option is set and we run into it,
X * we have to redraw the window.
X * Do not do this if we are abandoning the file.
X */
X if (!exiting && len >= Columns - (p_ru ? 22 : 0))
X {
X outchar('\n');
X wait_return(TRUE);
X }
X}
X
X/* VARARGS */
X#ifndef PROTO /* automatic prototype generation does not understand this */
X void
Xsmsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
X char *s;
X long a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
X{
X sprintf(IObuff, s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
X msg(IObuff);
X}
X#endif
X
X/*
X * emsg() - display an error message
X *
X * Rings the bell, if appropriate, and calls message() to do the real work
X */
X void
Xemsg(s)
X char *s;
X{
X if (p_eb)
X beep(); /* also includes flush_buffers() */
X else
X flush_buffers(); /* delete all typeahead characters */
X msg_invert = TRUE;
X msg(s);
X flushbuf();
X if (got_int) /* remove typeahead now, allow typeadhead during sleep */
X inchar(TRUE, FALSE);
X sleep(1); /* give the user a chance to read the message */
X}
X
X void
Xwait_return(redraw)
X int redraw;
X{
X u_char c;
X int oldstate;
X
X oldstate = State;
X State = HITRETURN;
X if (got_int)
X outstrn("Interrupt: ");
X
X#ifdef ORG_HITRETURN
X outstrn("Press RETURN to continue");
X do {
X c = vgetc();
X } while (strchr("\r\n: ", c) == NULL);
X if (c == ':') /* this can vi too (but not always!) */
X stuffReadbuff(mkstr(c));
X#else
X outstrn("Press RETURN or enter command to continue");
X c = vgetc();
X if (strchr("\r\n ", c) == NULL)
X stuffReadbuff(mkstr(c));
X#endif
X
X if (State == SETWINSIZE)
X {
X State = oldstate;
X set_winsize(0, 0, FALSE);
X }
X State = oldstate;
X script_winsize_pp();
X
X if (redraw)
X updateScreen(CLEAR);
X}
END_OF_FILE
if test 2523 -ne `wc -c <'vim/src/message.c'`; then
echo shar: \"'vim/src/message.c'\" unpacked with wrong size!
fi
# end of 'vim/src/message.c'
fi
if test -f 'vim/src/mkcmdtab.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/mkcmdtab.c'\"
else
echo shar: Extracting \"'vim/src/mkcmdtab.c'\" \(2066 characters\)
sed "s/^X//" >'vim/src/mkcmdtab.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * mkcmdtab.c: separate program that reads cmdtab.tab and produces cmdtab.h
X *
X * call with: mkcmdtab cmdtab.tab cmdtab.h
X */
X
X#include <stdlib.h>
X#include <stdio.h>
X#include "vim.h"
X
X void


Xmain(argc, argv)
X int argc;
X char **argv;
X{

X register int c;
X char buffer[100];
X int count;
X int i;
X FILE *ifp, *ofp;
X
X if (argc != 3)
X {
X fprintf(stderr, "Usage: mkcmdtab cmdtab.tab cmdtab.h\n");
X exit(10);
X }
X ifp = fopen(argv[1], "r");
X if (ifp == NULL)
X {
X perror(argv[1]);
X exit(10);
X }
X ofp = fopen(argv[2], "w");
X if (ofp == NULL)
X {
X perror(argv[2]);
X exit(10);
X }
X
X while ((c = getc(ifp)) != '|' && c != EOF)
X putc(c, ofp);
X fprintf(ofp, "THIS FILE IS AUTOMATICALLY PRODUCED - DO NOT EDIT");
X while ((c = getc(ifp)) != '|' && c != EOF)
X ;
X while ((c = getc(ifp)) != '|' && c != EOF)
X putc(c, ofp);
X
X count = 0;
X while ((c = getc(ifp)) != '|' && c != EOF)
X {
X putc(c, ofp);
X while ((c = getc(ifp)) != '"' && c != EOF)
X putc(c, ofp);
X putc(c, ofp);
X
X i = 0;
X while ((c = getc(ifp)) != '"' && c != EOF)
X {
X putc(c, ofp);
X buffer[i++] = c;
X }
X putc(c, ofp);
X buffer[i] = 0;
X
X while ((c = getc(ifp)) != '\n' && c != EOF)
X putc(c, ofp);
X putc(c, ofp);
X
X switch (buffer[0])
X {
X case '@': strcpy(buffer, "at");
X break;
X case '!': strcpy(buffer, "bang");
X break;
X case '<': strcpy(buffer, "lshift");
X break;
X case '>': strcpy(buffer, "rshift");
X break;
X case '=': strcpy(buffer, "equal");
X break;
X case '&': strcpy(buffer, "and");
X break;
X case '~': strcpy(buffer, "tilde");
X break;
X }
X
X fprintf(ofp, "#define CMD_%s %d\n", buffer, count++);
X }
X
X fprintf(ofp, "#define CMD_SIZE %d\n", count);
X
X while ((c = getc(ifp)) != '|' && c != EOF)
X putc(c, ofp);
X
X if (c != '|')
X {
X fprintf(stderr, "not enough |'s\n");
X exit(1);
X }
X exit(0);
X}
END_OF_FILE
if test 2066 -ne `wc -c <'vim/src/mkcmdtab.c'`; then
echo shar: \"'vim/src/mkcmdtab.c'\" unpacked with wrong size!
fi
# end of 'vim/src/mkcmdtab.c'
fi
if test -f 'vim/src/msdos.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/msdos.h'\"
else
echo shar: Extracting \"'vim/src/msdos.h'\" \(2033 characters\)
sed "s/^X//" >'vim/src/msdos.h' <<'END_OF_FILE'
X/* vi:ts=8:sw=4


X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * MSDOS Machine-dependent filenames.
X */
X#ifdef SYSEXRC_FILE
X# undef SYSEXRC_FILE
X# undef SYSVIMRC_FILE
X#endif /* SYSEXRC_FILE */
X#define SYSEXRC_FILE "$VIM\\_exrc"
X#define SYSVIMRC_FILE "$VIM\\_vimrc"
X
X#ifdef EXRC_FILE
X# undef EXRC_FILE
X# undef VIMRC_FILE
X#endif /* EXRC_FILE */
X#define EXRC_FILE "_exrc"
X#define VIMRC_FILE "_vimrc"
X
X#ifdef VIM_HLP
X# undef VIM_HLP
X#endif /* VIM_HLP */
X#define VIM_HLP "$VIM\\vim.hlp"
X
X#ifdef TMPNAME1
X# undef TMPNAME1
X# undef TMPNAME2
X# undef TMPNAMELEN
X#endif /* TMPNAME1 */
X#define TMPNAME1 "viXXXXXX" /* put it in current dir */
X#define TMPNAME2 "voXXXXXX" /* is there a better place? */
X#define TMPNAMELEN 10
X
X/*
X * MSDOS Machine-dependent routines.
X */
X
X#undef remove /* MSDOS remove()s when not readonly */
X
X/* msdos.c */
Xvoid vim_delay __ARGS((void));
Xint remove __ARGS((char *));
Xvoid flushbuf __ARGS((void));
Xvoid outchar __ARGS((unsigned));
Xvoid outstr __ARGS((char *));
Xint GetChars __ARGS((char *, int, int));
Xvoid textfile __ARGS((int));
Xvoid mch_suspend __ARGS((void));
Xvoid mch_windinit __ARGS((void));
Xvoid check_win __ARGS((int, char **));
Xvoid fname_case __ARGS((char *));
Xvoid settitle __ARGS((char *));
Xvoid resettitle __ARGS((void));
Xint dirname __ARGS((char *, int));
Xint FullName __ARGS((char *, char *, int));
Xlong getperm __ARGS((char *));
Xint setperm __ARGS((char *, int));
Xint isdir __ARGS((char *));
Xvoid mch_windexit __ARGS((int));
Xvoid mch_settmode __ARGS((int));
Xint mch_get_winsize __ARGS((void));
Xvoid mch_set_winsize __ARGS((void));
Xint call_shell __ARGS((char *, int));
Xvoid breakcheck __ARGS((void));
Xchar *modname __ARGS((char *, char *));
X#ifdef WILD_CARDS
Xint has_wildcard __ARGS((char *));
Xint ExpandWildCards __ARGS((int, char **, int *, char ***, int, int));
Xvoid FreeWild __ARGS((int, char **));
X#endif
END_OF_FILE
if test 2033 -ne `wc -c <'vim/src/msdos.h'`; then
echo shar: \"'vim/src/msdos.h'\" unpacked with wrong size!
fi
# end of 'vim/src/msdos.h'
fi
if test -f 'vim/src/ops.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/ops.h'\"
else
echo shar: Extracting \"'vim/src/ops.h'\" \(1963 characters\)
sed "s/^X//" >'vim/src/ops.h' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * ops.h: things shared between normal.c, cmdline.c and ops.c
X */
X
X/*
X * Operators
X */
X#define NOP 0 /* no pending operation */
X#define DELETE 1
X#define YANK 2
X#define CHANGE 3
X#define LSHIFT 4
X#define RSHIFT 5
X#define FILTER 6
X#define TILDE 7
X#define INDENT 8
X#define FORMAT 9
X#define COLON 10
X#define UPPER 11
X#define LOWER 12
X
X/*
X * operator characters; the order must correspond to the defines above
X */
XEXTERN char *opchars INIT(= "dyc<>!~=V:uU");
X
X/*
X * When a cursor motion command is made, it is marked as being a character or
X * line oriented motion. Then, if an operator is in effect, the operation
X * becomes character or line oriented accordingly.
X *
X * Character motions are marked as being inclusive or not. Most char. motions
X * are inclusive, but some (e.g. 'w') are not.
X *
X * Generally speaking, every command in normal() should either clear any pending
X * operator (with CLEAROP), or set the motion type variable.
X */
X
X/*
X * Motion types
X */
X#define MBAD (-1) /* 'bad' motion type marks unusable yank buf */
X#define MCHAR 0
X#define MLINE 1
X#define MBLOCK 2
X
XEXTERN int operator INIT(= NOP); /* current pending operator */
XEXTERN int mtype; /* type of the current cursor motion */
XEXTERN int mincl; /* true if char motion is inclusive */
XEXTERN int oneless; /* 1 if !mincl and startop != endop */
XEXTERN FPOS startop; /* cursor pos. at start of operator */
XEXTERN FPOS endop; /* cursor pos. at end of operator */
XEXTERN colnr_t startvcol; /* start col for block mode operator */
XEXTERN colnr_t endvcol; /* end col for block mode operator */
XEXTERN long nlines; /* lines between startop and endop + 1 */
XEXTERN int yankbuffer INIT(= 0); /* current yank buffer */
END_OF_FILE
if test 1963 -ne `wc -c <'vim/src/ops.h'`; then
echo shar: \"'vim/src/ops.h'\" unpacked with wrong size!
fi
# end of 'vim/src/ops.h'
fi
if test -f 'vim/src/sun_stdlib.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/sun_stdlib.h'\"
else
echo shar: Extracting \"'vim/src/sun_stdlib.h'\" \(1868 characters\)
sed "s/^X//" >'vim/src/sun_stdlib.h' <<'END_OF_FILE'
X/*
X * sun_stdlib.h: declararions used on a sun
X */
X
X#ifndef __stdlib_h
Xextern void free(void *);
Xextern void *malloc(unsigned);
Xextern void *realloc(void *, unsigned);
Xextern void *calloc(unsigned, unsigned);
X#endif
X#ifdef __sys_types_h


Xextern off_t lseek(int, off_t, int);
X

X# ifdef _sys_time_h
Xextern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
X# endif _sys_time_h
X
X#else
Xextern long lseek(int, long, int);
X#endif
X
Xextern long tell(int);
Xextern void perror(char *);
X
X#ifndef __sys_fcntlcom_h


Xextern int open(char *, int, ...);
X#endif
Xextern int close(int);
Xextern int read(int, char *, unsigned);
Xextern int write(int, char *, unsigned);
Xextern int ioctl(int, int, ...);
Xextern int unlink(char *);
X

X#ifdef FILE


Xextern int _filbuf(FILE *);
Xextern int _flsbuf(unsigned char, FILE *);

Xextern int fclose(FILE *);
Xextern int fprintf(FILE *, char *, ...);
Xextern int fscanf(FILE *, char *, ...);
Xextern int fseek(FILE *, long, int);
Xextern int fflush(FILE *);
Xextern int fread(char *, int, int, FILE *);
X#else
Xextern char *sprintf(char *, char *, ...);
X#endif
X
Xextern int printf(char *, ...);
X
Xextern int scanf(char *, ...);
Xextern int sscanf(char *, char *, ...);
X
Xextern int system(char *);
Xextern char *getenv(char *);


X
Xextern char *getcwd(char *, int);

Xextern char *getwd(char *);


X
Xextern int chdir(char *);

Xextern int getuid(void);
Xextern int getgid(void);
X

Xextern int atoi (char *);
Xextern long atol(char *);

Xextern long strtol(char * , char **, int);
X
Xextern void bcopy(char *, char *, int);
Xextern int bcmp(char *, char *, int);
Xextern void bzero(char *, int);
X
Xextern char *memccpy(char *, char *, int, int);
Xextern char *memchr(char *, int, int);
Xextern char *memset(char *, int, int);
X
Xextern int strncmp(char *, char *, int);
Xextern int strcasecmp(char *, char *);
X
Xextern int toupper(int);
Xextern int tolower(int);
Xextern int isatty(int);
END_OF_FILE
if test 1868 -ne `wc -c <'vim/src/sun_stdlib.h'`; then
echo shar: \"'vim/src/sun_stdlib.h'\" unpacked with wrong size!
fi
# end of 'vim/src/sun_stdlib.h'
fi
if test -f 'vim/src/tcconfig.tc.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/tcconfig.tc.uue'\"
else
echo shar: Extracting \"'vim/src/tcconfig.tc.uue'\" \(2410 characters\)
sed "s/^X//" >'vim/src/tcconfig.tc.uue' <<'END_OF_FILE'
X
Xbegin 644 tcconfig.tc
XM5'5R8F\@0R!#;VYF:6=U<F%T:6]N($9I;&4@&@`!#1(7`1H``@$!``(````";
XM``(``0`#``(``@`$``$```4``0``!@`!```(``$`!`D``@````T``@`!``X`2
XM`@```!$``0`($@`"````$P`"`!D`%``"````%0`"``$`%@`"````%P`"``$`^
XM&``"``$`9``!``%E``$``68``0`!9P`!``%H``$``6D``0`!:@`!``%K``$`F
XM`6P``0`!;0`!``%N``$``6\``0`!<``!``%Q``$``7(``0`!<P`!``%T``$`"
XM`74``0`!=@`!``%W``$``7@``0`!>0`!``%Z``$``7L``0``?``!``%]``$`2
XM`7X``0``?P`!``&```$``8(``0``A``!``&%``$``<@``0``R0`!``#*``$`Q
XM`<L``0``S``!``#-``$``,X``0`!SP`!``#0``$`&=$``0!DT@`!`"#5``$`Q
XM`-<``0``V``!``#9``$``=H``0`!VP`!``#<``$``=T``0`!W@`!``#?``$``
XM`.```0``X0`!``#B``$``2P!1```````````````````````````````````8
XM`````````````````````````````````````````````````````````"T!N
XM@`!$.EQ40UQ)3D-,541%````````````````````````````````````````1
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````"X!@`!$S
XM.EQ40UQ,24(`````````````````````````````````````````````````@
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````"\!4`!624TN:
XM4%)*````````````````````````````````````````````````````````L
XM`````````````````````````````````````````#`!!``S,@``,0$%`#(UX
XM````,@$%`#$P,```,P%_`$U31$]3.U=)3$1?0T%21%,`````````````````Y
XM`````````````````````````````````````````````````````````````
XM`````````````````````````````````````````````````````````````
XM```````````T`1X`*@``````````````````````````````````````-0$>1
XM`"H``````````````````````````````````````#8!'@`J````````````I
XM```````````````````````````W`1X`*@```````````````````````````
XM````````````.`$>`"H``````````````````````````````````````#D![
XM'@`J```````````````````````````````````````Z`1X`*@``````````+
XM````````````````````````````.P$>`"H`````````````````````````$
XM`````````````#P!'@`J```````````````````````````````````````]"
XM`8``````````````````````````````````````````````````````````!
XM`````````````````````````````````````````````````````````````
XM```````````````````````````````````````````````````````^`00`#
XM.````#\!4```````````````````````````````````````````````````(
XM`````````````````````````````````````````````````````````$`!!
XM1`!$.EQ40P``````````````````````````````````````````````````U
XM`````````````````````````````````$$!4```````````````````````2
XM`````````````````````````````````````````````````````````````
X9`````````````````````````/__`@`:````:
X``
Xend
Xsize 1690
END_OF_FILE
if test 2410 -ne `wc -c <'vim/src/tcconfig.tc.uue'`; then
echo shar: \"'vim/src/tcconfig.tc.uue'\" unpacked with wrong size!
fi
# end of 'vim/src/tcconfig.tc.uue'
fi
if test -f 'vim/src/unix.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/unix.h'\"
else
echo shar: Extracting \"'vim/src/unix.h'\" \(1925 characters\)
sed "s/^X//" >'vim/src/unix.h' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * Unix system-dependent filenames
X */
X#define BACKUPDIR "~/"
X
X#ifdef TMPNAME1
X# undef TMPNAME1
X# undef TMPNAME2
X# undef TMPNAMELEN
X#endif /* TMPNAME1 */
X#define TMPNAME1 "/tmp/viXXXXXX"
X#define TMPNAME2 "/tmp/voXXXXXX"
X#define TMPNAMELEN 15
X
X#ifdef MAX_COLUMNS
X# undef MAX_COLUMNS
X#endif /* MAX_COLUMNS */
X#define MAX_COLUMNS 1024
X
X#define stricmp vim_stricmp
X
Xvoid flushbuf __ARGS((void));
Xvoid outchar __ARGS((unsigned));
Xvoid outstr __ARGS((char *));
Xint GetChars __ARGS((char *, int, int));
Xvoid vim_delay __ARGS((void));
Xvoid mch_suspend __ARGS((void));
Xvoid mch_windinit __ARGS((void));
Xvoid check_win __ARGS((int, char **));
Xvoid fname_case __ARGS((char *));
Xvoid settitle __ARGS((char *));
Xvoid resettitle __ARGS((void));
Xvoid mch_settmode __ARGS((int));
Xint dirname __ARGS((char *, int));
Xint FullName __ARGS((char *, char *, int));
Xlong getperm __ARGS((char *));
Xint setperm __ARGS((char *, int));
Xint isdir __ARGS((char *));
Xvoid mch_windexit __ARGS((int));
Xint mch_get_winsize __ARGS((void));
Xvoid mch_set_winsize __ARGS((void));
Xint call_shell __ARGS((char *, int));
Xvoid breakcheck __ARGS((void));
X#ifndef linux
Xint remove __ARGS((char *));
X
X/* generic functions, not in unix.c */
Xvoid sleep __ARGS((int));
Xint rename __ARGS((char *, char *));
X#endif
X
Xint stricmp __ARGS((char *, char *));
X
X#ifdef WILD_CARDS
Xint has_wildcard __ARGS((char *));
Xint ExpandWildCards __ARGS((int, char **, int *, char ***, int, int));
Xvoid FreeWild __ARGS((int, char **));
X#endif
X
X/* memmove is not present on all systems, use bcopy or memcpy */
X#ifdef SYSV
X#define memmove(to, from, len) memcpy(to, from, len)
X#else
X#define memmove(to, from, len) bcopy(from, to, len);
X#endif
END_OF_FILE
if test 1925 -ne `wc -c <'vim/src/unix.h'`; then
echo shar: \"'vim/src/unix.h'\" unpacked with wrong size!
fi
# end of 'vim/src/unix.h'
fi
if test -f 'vim/termcap' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/termcap'\"
else
echo shar: Extracting \"'vim/termcap'\" \(2694 characters\)
sed "s/^X//" >'vim/termcap' <<'END_OF_FILE'
X#
X# Demonstration of a termcap file
X#
Xsx|ansi|any ansi terminal with pessimistic assumptions:\
X :co#80:li#24:cl=50\E[;H\E[2J:bs:am:cm=\E[%i%d;%dH:\
X :nd=\E[C:up=\E[A:ce=\E[K:ho=\E[H:pt:
XMu|sun|Sun Microsystems Workstation console:\
X :am:bs:km:mi:ms:pt:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:\
X :ce=\E[K:cd=\E[J:\
X :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:rs=\E[s:\
X :md=\E[1m:mr=\E[7m:me=\E[m:\
X :al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
X :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\
X :up=\E[A:nd=\E[C:ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\
X :k1=\E[224z:k2=\E[225z:k3=\E[226z:k4=\E[227z:k5=\E[228z:\
X :k6=\E[229z:k7=\E[230z:k8=\E[231z:k9=\E[232z:
XM-|sun-e|sun-nic|sune|Sun Microsystems Workstation without insert character:\
X :ic@:im@:ei@:tc=sun:
XMu|sun-s|Sun Microsystems Workstation window with status line:\
X :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun:
XMu|sun-e-s|sun-s-e|Sun Microsystems Workstation with status hacked for emacs:\
X :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun-e:
XM0|sun-48|Sun 48-line window:\
X :li#48:co#80:tc=sun:
XM1|sun-34|Sun 34-line window:\
X :li#34:co#80:tc=sun:
XM2|sun-24|Sun 24-line window:\
X :li#24:co#80:tc=sun:
XM3|sun-17|Sun 17-line window:\
X :li#17:co#80:tc=sun:
Xv9|925a|tvi925a|TeleVideo Model 925:\
X :al=\EE:am:bs:bt=\EI:bw:cd=\EY:ce=\ET:cl=^Z:cm=\E=%+ %+ :co#80:dc=\EW:\
X :dl=\ER:do=^V:ei=:ic=\EQ:if=/usr/share/lib/tabset/std:im=:kb=^H:kd=^V:\
X :kh=^^:kl=^H:kn#12:kr=^L:ku=^K:li#24:nd=^L:pt:se=\EG0:sg#1:so=\EG4:\
X :ue=\EG0:ug#1:ul:up=^K:us=\EG8:is=\El\
X :vb=\Eb\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ed:\
X :ve=\E.4:vs=\E.2:
Xd0|vt100|vt100-am|vt100am|dec vt100:\
X :do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=5\ED:\
X :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
X :ce=3\E[K:cd=50\E[J:so=2\E[7m:se=2\E[m:us=2\E[4m:ue=2\E[m:\
X :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
X :rf=/usr/share/lib/tabset/vt100:\
X :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
X :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
X :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:xn:\
X :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
X# Amiga termcap by Bram Moolenaar
XAA|amiga|Amiga ANSI:\
X :co#80:li#25:am:do=\E[B:ce=\E[K:cd=\E[J:\
X :cl=\014:ku=\233A:kd=\233B:kl=\233D:kr=\233C:kb=^H:\
X :#4=\233 A:%i=\233 @:%1=\233?~:\
X :k1=\2330~:k2=\2331~:k3=\2332~:k4=\2333~:k5=\2334~:\
X :k6=\2335~:k7=\2336~:k8=\2337~:k9=\2338~:k;=\2339~:\
X :F1=\23310~:F2=\23311~:F3=\23312~:F4=\23313~:F5=\23314~:\
X :F6=\23315~:F7=\23316~:F8=\23317~:F9=\23318~:FA=\23319~:\
X :al=\E[L:AL=\E[%dL:dl=\E[M:DL=\E[%dM:le=^H:cm=\E[%i%d;%dH:\
X :nd=\E[C:RI=\E[%dC:up=\E[A:\
X :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:vi=\E[0 p:ve=\E[1 p:\
X :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\E[m:
X#
X# END OF TERMCAP
X#
END_OF_FILE
if test 2694 -ne `wc -c <'vim/termcap'`; then
echo shar: \"'vim/termcap'\" unpacked with wrong size!
fi
# end of 'vim/termcap'
fi
echo shar: End of archive 2 \(of 23\).
cp /dev/null ark2isdone

Bram Moolenaar

unread,
Apr 23, 1993, 1:29:08 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 3
Archive-name: vim/part03
Environment: UNIX, AMIGA, MS-DOS

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:

# "End of archive 3 (of 23)."
# Contents: vim/doc/vim.1 vim/src/arp_proto.h vim/src/cmdtab.h
# vim/src/cmdtab.tab vim/src/makefile.unix vim/src/param.h
# vim/src/quickfix.c vim/src/term.h vim/src/vim.h
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:06 1993


PATH=/bin:/usr/bin:/usr/ucb ; export PATH

if test -f 'vim/doc/vim.1' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/vim.1'\"
else
echo shar: Extracting \"'vim/doc/vim.1'\" \(4378 characters\)
sed "s/^X//" >'vim/doc/vim.1' <<'END_OF_FILE'
X.TH VIM 1 "28 March 1992"
X.SH NAME
Xvim \- Vi IMitation, a programmers text editor
X.SH SYNOPSIS
X.B vim
X[options] [file ..]
X.br
X.B vim
X[options] \-t tag
X.br
X.B vim
X[options] +[command] file ..
X.br
X.B vim
X[options] \-c {command} file ..
X.br
X.B vim
X[options] \-e
X.SH DESCRIPTION
X.B Vim
Xis a text editor that is upwards compatible to vi. It can be used to edit any
XASCII text. It is especially useful for editing programs.
X.PP
XThere are a lot of enhancements above vi: multi level undo, command line
Xediting, filename completion, on line help, quoting, etc.. Read difference.doc
Xfor a summary of the differences between vi and Vim.
X.PP
XMost often
X.B Vim
Xis started to edit a single file with the command
X.PP
X vim file
X.PP
XMore generally VIM is started with:
X.PP
X vim [options] [filelist]
X.PP
XIf the filelist is missing, the editor will start with an empty buffer.
XOtherwise exactly one out of the following four may be used to choose one or
Xmore files to be edited.
X.TP 12
Xfile ..
XA list of file names. The first one (alphabetically) will be
Xthe current file and read into the buffer. The cursor will be
Xpositioned on the first line of the buffer. You can get to the other files
Xwith the ":next" command.
X.TP
X+[num] file ..
XSame as the above, but the cursor will be positioned on line
X"num". If "num" is missing, the cursor will be positioned on
Xthe last line.
X.TP
X+/pat file ..
XSame as the above, but the cursor will be positioned on the
Xfirst occurrence of "pat" in the current file (see reference.doc,
Xsection "pattern searches" for the available search
Xpatterns).
X.TP
X+{command} file ..
X.TP
X-c {command} file ..
XSame as the above, but {command} will be executed after the
Xfile has been read. {command} is interpreted as an Ex
Xcommand. If the {command} contains spaces it must
Xbe enclosed in double quotes (this depends on the shell that
Xis used).
XExample: Vim "+set si" main.c
X.TP
X-t {tag}
XThe file to edit and the initial cursor position depends on a "tag", a sort
Xof goto label. {tag} is looked up in the tags file, the associated file
Xbecomes the current file and the associated command is executed. Mostly this
Xis used for C programs. {tag} then should be a function name. The effect is
Xthat the file containing that function becomes the current file and the
Xcursor is positioned on the start of the function (see reference.doc,
Xsection "tag searches").
X.TP
X-e
XStart in quickFix mode. The error file "AztecC.Err"
Xis read and the first error is displayed. Further errors can be jumped to
Xwith the ":cn" command. See reference.doc section 5.6.
X.SH OPTIONS
XThe options, if present, must precede the filelist. The options may be given
Xin any order.
X.TP 12
X-r
XRecovery mode. The autoscript file is read to recover a
Xcrashed editing session. It has almost the same effect as
X"-s file.vim". See reference.doc, chapter "Recovery after a crash".
X.TP
X-v
XView mode. The 'readonly' option will be set. You can still
Xedit the buffer, but will be prevented from accidental
Xoverwriting a file. If you do want to overwrite a file, add
Xan exclamation mark to the Ex command, as in ":w!". The
X'readonly' option can be reset with ":set noro" (see reference.doc,
Xoptions chapter).
X.TP
X-n
XNo autoscript file will be written. Recovery after a crash
Xwill be impossible. Handy if you want to edit a file on a
Xvery slow medium (e.g. floppy). Can also be done with ":set
Xuc=0".
X.TP
X-s {scriptin}
XThe script file {scriptin} is read. The characters in the
Xfile are interpreted as if you had typed them. The same can
Xbe done with the command ":source! {scriptin}". If the end
Xof the file is reached before the editor exits, further
Xcharacters are read from the keyboard.
X.TP
X-w {scriptout}
XAll the characters that you type are recorded in the file
X{scriptout}, until you exit VIM. This is useful if you want
Xto create a script file to be used with "vim -s" or
X":source!".
X.TP
X-T terminal
XTells Vim the name of the terminal you are using. Should be a terminal known
Xto Vim (builtin) or defined in the termcap file.
X.TP
X-d device
XOpen "device" for use as a terminal. Only on the Amiga. Example:
X"\-d con:20/30/600/150".
X.SH SEE ALSO
XVim documentation: Reference.doc, index, difference.doc, unix.doc, vim.hlp.
X.SH AUTHOR
XMost of VIM was made by Bram Moolenaar.
X.br
XVIM is based on Stevie, worked on by: Tim Thompson,
XTony Andrews and G.R. (Fred) Walter
X.SH BUGS
XProbably.
END_OF_FILE
if test 4378 -ne `wc -c <'vim/doc/vim.1'`; then
echo shar: \"'vim/doc/vim.1'\" unpacked with wrong size!
fi
# end of 'vim/doc/vim.1'
fi
if test -f 'vim/src/arp_proto.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/arp_proto.h'\"
else
echo shar: Extracting \"'vim/src/arp_proto.h'\" \(6655 characters\)
sed "s/^X//" >'vim/src/arp_proto.h' <<'END_OF_FILE'
X#ifndef PROTO_ARP_H
X#define PROTO_ARP_H 1
X
X/*
X ************************************************************************
X * The arp copies of the dos.library calls... *
X ************************************************************************
X */
X
X/* Only include these if you can use ARP.library without dos.library... */
X#ifdef DO_ARP_COPIES
X#pragma amicall(ArpBase, 0x1E, Open(d1, d2))
X#pragma amicall(ArpBase, 0x24, Close(d1))
X#pragma amicall(ArpBase, 0x2A, Read(d1, d2, d3))
X#pragma amicall(ArpBase, 0x30, Write(d1, d2, d3))
X#pragma amicall(ArpBase, 0x36, Input())
X#pragma amicall(ArpBase, 0x3C, Output())
X#pragma amicall(ArpBase, 0x42, Seek(d1, d2, d3))
X#pragma amicall(ArpBase, 0x48, DeleteFile(d1))
X#pragma amicall(ArpBase, 0x4E, Rename(d1, d2))
X#pragma amicall(ArpBase, 0x54, Lock(d1, d2))
X#pragma amicall(ArpBase, 0x5A, UnLock(d1))
X#pragma amicall(ArpBase, 0x60, DupLock(d1))
X#pragma amicall(ArpBase, 0x66, Examine(d1, d2))
X#pragma amicall(ArpBase, 0x6C, ExNext(d1, d2))
X#pragma amicall(ArpBase, 0x72, Info(d1, d2))
X#pragma amicall(ArpBase, 0x78, CreateDir(d1))
X#pragma amicall(ArpBase, 0x7E, CurrentDir(d1))
X#pragma amicall(ArpBase, 0x84, IoErr())
X#pragma amicall(ArpBase, 0x8A, CreateProc(d1, d2, d3, d4))
X#pragma amicall(ArpBase, 0x90, Exit(d1))
X#pragma amicall(ArpBase, 0x96, LoadSeg(d1))
X#pragma amicall(ArpBase, 0x9C, UnLoadSeg(d1))
X#pragma amicall(ArpBase, 0xAE, DeviceProc(d1))
X#pragma amicall(ArpBase, 0xB4, SetComment(d1, d2))
X#pragma amicall(ArpBase, 0xBA, SetProtection(d1, d2))
X#pragma amicall(ArpBase, 0xC0, DateStamp(d1))
X#pragma amicall(ArpBase, 0xC6, Delay(d1))
X#pragma amicall(ArpBase, 0xCC, WaitForChar(d1, d2))
X#pragma amicall(ArpBase, 0xD2, ParentDir(d1))
X#pragma amicall(ArpBase, 0xD8, IsInteractive(d1))
X#pragma amicall(ArpBase, 0xDE, Execute(d1, d2, d3))
X#endif
X
X/*
X ************************************************************************
X * Stuff only in arp.library *
X ************************************************************************
X */
X/* amicall(ArpBase, 0x0E4, Printf(a0, a1)) This does not work without glue */
X/* amicall(ArpBase, 0x0EA, FPrintf(d0, a0, a1)) This does not work without glue */
X#pragma amicall(ArpBase, 0x0F0, Puts(a1))
X#pragma amicall(ArpBase, 0x0F6, Readline(a0))
X#pragma amicall(ArpBase, 0x0FC, GADS(a0, d0, a1, a2, a3))
X#pragma amicall(ArpBase, 0x102, Atol(a0))
X#pragma amicall(ArpBase, 0x108, EscapeString(a0))
X#pragma amicall(ArpBase, 0x10E, CheckAbort(a1))
X#pragma amicall(ArpBase, 0x114, CheckBreak(d1, a1))
X#pragma amicall(ArpBase, 0x11A, Getenv(a0, a1, d0))
X#pragma amicall(ArpBase, 0x120, Setenv(a0, a1))
X#pragma amicall(ArpBase, 0x126, FileRequest(a0))
X#pragma amicall(ArpBase, 0x12C, CloseWindowSafely(a0, a1))
X#pragma amicall(ArpBase, 0x132, CreatePort(a0, d0))
X#pragma amicall(ArpBase, 0x138, DeletePort(a1))
X#pragma amicall(ArpBase, 0x13E, SendPacket(d0, a0, a1))
X#pragma amicall(ArpBase, 0x144, InitStdPacket(d0, a0, a1, a2))
X#pragma amicall(ArpBase, 0x14A, PathName(d0, a0, d1))
X#pragma amicall(ArpBase, 0x150, Assign(a0, a1))
X#pragma amicall(ArpBase, 0x156, DosAllocMem(d0))
X#pragma amicall(ArpBase, 0x15C, DosFreeMem(a1))
X#pragma amicall(ArpBase, 0x162, BtoCStr(a0, d0, d1))
X#pragma amicall(ArpBase, 0x168, CtoBStr(a0, d0, d1))
X#pragma amicall(ArpBase, 0x16E, GetDevInfo(a2))
X#pragma amicall(ArpBase, 0x174, FreeTaskResList())
X#pragma amicall(ArpBase, 0x17A, ArpExit(d0, d2))
X#pragma amicall(ArpBase, 0x180, ArpAlloc(d0))
X/* amicall(ArpBase, 0x186, ArpAllocMem(d0, d1)) Secondary result - IoErr() */
X/* amicall(ArpBase, 0x18C, ArpOpen(d1, d2)) Secondary result - IoErr() */
X/* amicall(ArpBase, 0x192, ArpDupLock(d1)) Secondary result - IoErr() */
X/* amicall(ArpBase, 0x198, ArpLock(d1, d2)) Secondary result - IoErr() */
X/* amicall(ArpBase, 0x19E, RListAlloc(a0, d0)) Secondary result - IoErr() */
X#pragma amicall(ArpBase, 0x1A4, FindCLI(d0))
X#pragma amicall(ArpBase, 0x1AA, QSort(a0, d0, d1, a1))
X
X#pragma amicall(ArpBase, 0x1B0, PatternMatch(a0, a1))
X#pragma amicall(ArpBase, 0x1B6, FindFirst(d0, a0))
X#pragma amicall(ArpBase, 0x1BC, FindNext(a0))
X#pragma amicall(ArpBase, 0x1C2, FreeAnchorChain(a0))
X
X#pragma amicall(ArpBase, 0x1C8, CompareLock(d0, d1))
X
X#pragma amicall(ArpBase, 0x1CE, FindTaskResList())
X#pragma amicall(ArpBase, 0x1D4, CreateTaskResList())
X#pragma amicall(ArpBase, 0x1DA, FreeResList(a1))
X#pragma amicall(ArpBase, 0x1E0, FreeTrackedItem(a1))
X/* amicall(ArpBase, 0x1E6, GetTracker()) Stores the ID in the tracker */
X
X#pragma amicall(ArpBase, 0x1EC, GetAccess(a1))
X#pragma amicall(ArpBase, 0x1F2, FreeAccess(a1))
X
X#pragma amicall(ArpBase, 0x1F8, FreeDAList(a1))
X#pragma amicall(ArpBase, 0x1FE, AddDANode(a0, a1, d0, d1))
X#pragma amicall(ArpBase, 0x204, AddDADevs(a0, d0))
X
X#pragma amicall(ArpBase, 0x20A, Strcmp(a0, a1))
X#pragma amicall(ArpBase, 0x210, Strncmp(a0, a1, d0))
X#pragma amicall(ArpBase, 0x216, Toupper(d0))
X#pragma amicall(ArpBase, 0x21C, SyncRun(a0, a1, d0, d1))
X
X/*
X ************************************************************************
X * Added V32 of arp.library *
X * Note that SpawnShell is ASyncRun but was added at V39 of arp... *
X ************************************************************************
X */
X#pragma amicall(ArpBase, 0x222, ASyncRun(a0, a1, a2))
X#pragma amicall(ArpBase, 0x222, SpawnShell(a0, a1, a2))
X#pragma amicall(ArpBase, 0x228, LoadPrg(d1))
X#pragma amicall(ArpBase, 0x22E, PreParse(a0, a1))
X
X/*
X ************************************************************************
X * Added V33 of arp.library *
X ************************************************************************
X */
X#pragma amicall(ArpBase, 0x234, StamptoStr(a0))
X#pragma amicall(ArpBase, 0x23A, StrtoStamp(a0))
X
X#pragma amicall(ArpBase, 0x240, ObtainResidentPrg(a0))
X#pragma amicall(ArpBase, 0x246, AddResidentPrg(d1, a0))
X#pragma amicall(ArpBase, 0x24C, RemResidentPrg(a0))
X#pragma amicall(ArpBase, 0x252, UnLoadPrg(d1))
X#pragma amicall(ArpBase, 0x258, LMult(d0, d1))
X#pragma amicall(ArpBase, 0x25E, LDiv(d0, d1))
X#pragma amicall(ArpBase, 0x264, LMod(d0, d1))
X
X#pragma amicall(ArpBase, 0x26A, CheckSumPrg(d1))
X#pragma amicall(ArpBase, 0x270, TackOn(a0, a1))
X#pragma amicall(ArpBase, 0x276, BaseName(a0))
X#pragma amicall(ArpBase, 0x27C, ReleaseResidentPrg(d1))
X
X/*
X ************************************************************************
X * Added V36 of arp.library *
X ************************************************************************
X */
X/* amicall(ArpBase, 0x282, SPrintf(d0, a0, a1)) This does not work without glue */
X#pragma amicall(ArpBase, 0x288, GetKeywordIndex(a0, a1))
X/* amicall(ArpBase, 0x28E, ArpOpenLibrary(a1, d0)) Secondary result - IoErr() */
X#pragma amicall(ArpBase, 0x294, ArpAllocFreq())
X
X#endif
END_OF_FILE
if test 6655 -ne `wc -c <'vim/src/arp_proto.h'`; then
echo shar: \"'vim/src/arp_proto.h'\" unpacked with wrong size!
fi
# end of 'vim/src/arp_proto.h'
fi
if test -f 'vim/src/cmdtab.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/cmdtab.h'\"
else
echo shar: Extracting \"'vim/src/cmdtab.h'\" \(5973 characters\)
sed "s/^X//" >'vim/src/cmdtab.h' <<'END_OF_FILE'
X/* vi:ts=4


X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * THIS FILE IS AUTOMATICALLY PRODUCED - DO NOT EDIT
X */
X
X#define RANGE 0x01 /* allow a linespecs */
X#define BANG 0x02 /* allow a ! after the command name */
X#define EXTRA 0x04 /* allow extra args after command name */
X#define XFILE 0x08 /* expand wildcards in extra part */
X#define NOSPC 0x10 /* no spaces allowed in the extra part */
X#define DFLALL 0x20 /* default file range is 1,$ */
X#define NODFL 0x40 /* do not default to the current file name */
X#define NEEDARG 0x80 /* argument required */
X#define TRLBAR 0x100 /* check for trailing vertical bar */
X#define REGSTR 0x200 /* allow "x for register designation */
X#define COUNT 0x400 /* allow count in argument */
X#define NOTRLCOM 0x800 /* no trailing comment allowed */
X#define ZEROR 0x1000 /* zero line number allowed */
X#define USECTRLV 0x2000 /* do not remove CTRL-V from argument */
X#define FILES (XFILE + EXTRA) /* multiple extra files allowed */
X#define WORD1 (EXTRA + NOSPC) /* one extra word allowed */
X#define FILE1 (FILES + NOSPC) /* 1 file allowed, defaults to current file */
X#define NAMEDF (FILE1 + NODFL) /* 1 file allowed, defaults to "" */
X#define NAMEDFS (FILES + NODFL) /* multiple files allowed, default is "" */
X
X/*
X * This array maps ex command names to command codes. The order in which
X * command names are listed below is significant -- ambiguous abbreviations
X * are always resolved to be the first possible match (e.g. "r" is taken
X * to mean "read", not "rewind", because "read" comes before "rewind").
X * Not supported commands are included to avoid ambiguities.
X */
Xstatic struct
X{
X char *cmd_name; /* name of the command */
X short cmd_argt; /* command line arguments permitted/needed/used */
X} cmdnames[] =
X{
X {"append", BANG+RANGE+TRLBAR}, /* not supported */
X#define CMD_append 0
X {"abbreviate", EXTRA+TRLBAR+NOTRLCOM}, /* not supported */
X#define CMD_abbreviate 1
X {"args", TRLBAR},
X#define CMD_args 2
X {"change", BANG+RANGE+COUNT+TRLBAR}, /* not supported */
X#define CMD_change 3
X {"cd", NAMEDF+TRLBAR},
X#define CMD_cd 4
X {"cc", TRLBAR+WORD1+BANG},
X#define CMD_cc 5
X {"cf", TRLBAR+FILE1+BANG},
X#define CMD_cf 6
X {"cl", TRLBAR},
X#define CMD_cl 7
X {"cn", TRLBAR+BANG},
X#define CMD_cn 8
X {"cp", TRLBAR+BANG},
X#define CMD_cp 9
X {"cq", TRLBAR+BANG},
X#define CMD_cq 10
X {"copy", RANGE+EXTRA+TRLBAR},
X#define CMD_copy 11
X {"chdir", NAMEDF+TRLBAR},
X#define CMD_chdir 12
X {"delete", RANGE+REGSTR+COUNT+TRLBAR},
X#define CMD_delete 13
X {"display", TRLBAR},
X#define CMD_display 14
X {"digraph", EXTRA+TRLBAR},
X#define CMD_digraph 15
X {"edit", BANG+FILE1+TRLBAR},
X#define CMD_edit 16
X {"ex", BANG+FILE1+TRLBAR},
X#define CMD_ex 17
X {"file", FILE1+TRLBAR},
X#define CMD_file 18
X {"files", TRLBAR},
X#define CMD_files 19
X {"global", RANGE+BANG+EXTRA+DFLALL},
X#define CMD_global 20
X {"help", TRLBAR},
X#define CMD_help 21
X {"insert", BANG+RANGE+TRLBAR}, /* not supported */
X#define CMD_insert 22
X {"join", RANGE+COUNT+TRLBAR},
X#define CMD_join 23
X {"jumps", TRLBAR},
X#define CMD_jumps 24
X {"k", RANGE+WORD1+TRLBAR},
X#define CMD_k 25
X {"list", RANGE+COUNT+TRLBAR},
X#define CMD_list 26
X {"move", RANGE+EXTRA+TRLBAR},
X#define CMD_move 27
X {"mark", RANGE+WORD1+TRLBAR},
X#define CMD_mark 28
X {"marks", TRLBAR},
X#define CMD_marks 29
X {"map", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
X#define CMD_map 30
X {"mkexrc", BANG+FILE1+TRLBAR},
X#define CMD_mkexrc 31
X {"mkvimrc", BANG+FILE1+TRLBAR},
X#define CMD_mkvimrc 32
X {"next", RANGE+BANG+NAMEDFS+TRLBAR},
X#define CMD_next 33
X {"number", RANGE+COUNT+TRLBAR},
X#define CMD_number 34
X {"noremap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
X#define CMD_noremap 35
X {"Next", RANGE+BANG+TRLBAR},
X#define CMD_Next 36
X {"print", RANGE+COUNT+TRLBAR},
X#define CMD_print 37
X {"pop", RANGE+TRLBAR+ZEROR},
X#define CMD_pop 38
X {"put", RANGE+BANG+REGSTR+TRLBAR},
X#define CMD_put 39
X {"previous", RANGE+BANG+TRLBAR},
X#define CMD_previous 40
X {"quit", BANG+TRLBAR},
X#define CMD_quit 41
X {"read", RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
X#define CMD_read 42
X {"rewind", BANG+TRLBAR},
X#define CMD_rewind 43
X {"recover", FILE1+TRLBAR}, /* not supported */
X#define CMD_recover 44
X {"substitute", RANGE+EXTRA},
X#define CMD_substitute 45
X {"set", EXTRA+TRLBAR},
X#define CMD_set 46
X {"setkeymap", NAMEDF+TRLBAR},
X#define CMD_setkeymap 47
X {"shell", TRLBAR},
X#define CMD_shell 48
X {"source", NAMEDF+NEEDARG+TRLBAR},
X#define CMD_source 49
X {"stop", TRLBAR+BANG},
X#define CMD_stop 50
X {"t", RANGE+EXTRA+TRLBAR},
X#define CMD_t 51
X {"tag", RANGE+BANG+WORD1+TRLBAR+ZEROR},
X#define CMD_tag 52
X {"tags", TRLBAR},
X#define CMD_tags 53
X {"undo", TRLBAR},
X#define CMD_undo 54
X {"unabbreviate", EXTRA+TRLBAR}, /* not supported */
X#define CMD_unabbreviate 55
X {"unmap", BANG+EXTRA+TRLBAR},
X#define CMD_unmap 56
X {"vglobal", RANGE+EXTRA+DFLALL},
X#define CMD_vglobal 57
X {"version", TRLBAR},
X#define CMD_version 58
X {"visual", RANGE+BANG+FILE1+TRLBAR},
X#define CMD_visual 59
X {"write", RANGE+BANG+FILE1+DFLALL+TRLBAR},
X#define CMD_write 60
X {"wnext", RANGE+BANG+FILE1+TRLBAR},
X#define CMD_wnext 61
X {"winsize", EXTRA+NEEDARG+TRLBAR},
X#define CMD_winsize 62
X {"wq", BANG+FILE1+DFLALL+TRLBAR},
X#define CMD_wq 63
X {"xit", BANG+FILE1+DFLALL+TRLBAR},
X#define CMD_xit 64
X {"yank", RANGE+REGSTR+COUNT+TRLBAR},
X#define CMD_yank 65
X {"z", RANGE+COUNT+TRLBAR}, /* not supported */
X#define CMD_z 66
X {"@", RANGE+EXTRA+TRLBAR},
X#define CMD_at 67
X {"!", RANGE+NAMEDFS},
X#define CMD_bang 68
X {"<", RANGE+COUNT+TRLBAR},
X#define CMD_lshift 69
X {">", RANGE+COUNT+TRLBAR},
X#define CMD_rshift 70
X {"=", RANGE+TRLBAR},
X#define CMD_equal 71
X {"&", RANGE+EXTRA},
X#define CMD_and 72
X {"~", RANGE+TRLBAR} /* not supported */
X#define CMD_tilde 73
X#define CMD_SIZE 74
X
X};
END_OF_FILE
if test 5973 -ne `wc -c <'vim/src/cmdtab.h'`; then
echo shar: \"'vim/src/cmdtab.h'\" unpacked with wrong size!
fi
# end of 'vim/src/cmdtab.h'
fi
if test -f 'vim/src/cmdtab.tab' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/cmdtab.tab'\"
else
echo shar: Extracting \"'vim/src/cmdtab.tab'\" \(4518 characters\)
sed "s/^X//" >'vim/src/cmdtab.tab' <<'END_OF_FILE'
X/* vi:ts=4


X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * |This file is read by mkcmdtab to produce cmdtab.h.
X *
X * The bars are used to recognize file positions. Do not insert/delete them.|
X */
X
X#define RANGE 0x01 /* allow a linespecs */
X#define BANG 0x02 /* allow a ! after the command name */
X#define EXTRA 0x04 /* allow extra args after command name */
X#define XFILE 0x08 /* expand wildcards in extra part */
X#define NOSPC 0x10 /* no spaces allowed in the extra part */
X#define DFLALL 0x20 /* default file range is 1,$ */
X#define NODFL 0x40 /* do not default to the current file name */
X#define NEEDARG 0x80 /* argument required */
X#define TRLBAR 0x100 /* check for trailing vertical bar */
X#define REGSTR 0x200 /* allow "x for register designation */
X#define COUNT 0x400 /* allow count in argument */
X#define NOTRLCOM 0x800 /* no trailing comment allowed */
X#define ZEROR 0x1000 /* zero line number allowed */
X#define USECTRLV 0x2000 /* do not remove CTRL-V from argument */
X#define FILES (XFILE + EXTRA) /* multiple extra files allowed */
X#define WORD1 (EXTRA + NOSPC) /* one extra word allowed */
X#define FILE1 (FILES + NOSPC) /* 1 file allowed, defaults to current file */
X#define NAMEDF (FILE1 + NODFL) /* 1 file allowed, defaults to "" */
X#define NAMEDFS (FILES + NODFL) /* multiple files allowed, default is "" */
X
X/*
X * This array maps ex command names to command codes. The order in which
X * command names are listed below is significant -- ambiguous abbreviations
X * are always resolved to be the first possible match (e.g. "r" is taken
X * to mean "read", not "rewind", because "read" comes before "rewind").
X * Not supported commands are included to avoid ambiguities.
X */
Xstatic struct
X{
X char *cmd_name; /* name of the command */
X short cmd_argt; /* command line arguments permitted/needed/used */
X} cmdnames[] =
X{
X| {"append", BANG+RANGE+TRLBAR}, /* not supported */
X {"abbreviate", EXTRA+TRLBAR+NOTRLCOM}, /* not supported */
X {"args", TRLBAR},
X {"change", BANG+RANGE+COUNT+TRLBAR}, /* not supported */
X {"cd", NAMEDF+TRLBAR},
X {"cc", TRLBAR+WORD1+BANG},
X {"cf", TRLBAR+FILE1+BANG},
X {"cl", TRLBAR},
X {"cn", TRLBAR+BANG},
X {"cp", TRLBAR+BANG},
X {"cq", TRLBAR+BANG},
X {"copy", RANGE+EXTRA+TRLBAR},
X {"chdir", NAMEDF+TRLBAR},
X {"delete", RANGE+REGSTR+COUNT+TRLBAR},
X {"display", TRLBAR},
X {"digraph", EXTRA+TRLBAR},
X {"edit", BANG+FILE1+TRLBAR},
X {"ex", BANG+FILE1+TRLBAR},
X {"file", FILE1+TRLBAR},
X {"files", TRLBAR},
X {"global", RANGE+BANG+EXTRA+DFLALL},
X {"help", TRLBAR},
X {"insert", BANG+RANGE+TRLBAR}, /* not supported */
X {"join", RANGE+COUNT+TRLBAR},
X {"jumps", TRLBAR},
X {"k", RANGE+WORD1+TRLBAR},
X {"list", RANGE+COUNT+TRLBAR},
X {"move", RANGE+EXTRA+TRLBAR},
X {"mark", RANGE+WORD1+TRLBAR},
X {"marks", TRLBAR},
X {"map", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
X {"mkexrc", BANG+FILE1+TRLBAR},
X {"mkvimrc", BANG+FILE1+TRLBAR},
X {"next", RANGE+BANG+NAMEDFS+TRLBAR},
X {"number", RANGE+COUNT+TRLBAR},
X {"noremap", BANG+EXTRA+TRLBAR+NOTRLCOM+USECTRLV},
X {"Next", RANGE+BANG+TRLBAR},
X {"print", RANGE+COUNT+TRLBAR},
X {"pop", RANGE+TRLBAR+ZEROR},
X {"put", RANGE+BANG+REGSTR+TRLBAR},
X {"previous", RANGE+BANG+TRLBAR},
X {"quit", BANG+TRLBAR},
X {"read", RANGE+NAMEDF+NEEDARG+TRLBAR+ZEROR},
X {"rewind", BANG+TRLBAR},
X {"recover", FILE1+TRLBAR}, /* not supported */
X {"substitute", RANGE+EXTRA},
X {"set", EXTRA+TRLBAR},
X {"setkeymap", NAMEDF+TRLBAR},
X {"shell", TRLBAR},
X {"source", NAMEDF+NEEDARG+TRLBAR},
X {"stop", TRLBAR+BANG},
X {"t", RANGE+EXTRA+TRLBAR},
X {"tag", RANGE+BANG+WORD1+TRLBAR+ZEROR},
X {"tags", TRLBAR},
X {"undo", TRLBAR},
X {"unabbreviate", EXTRA+TRLBAR}, /* not supported */
X {"unmap", BANG+EXTRA+TRLBAR},
X {"vglobal", RANGE+EXTRA+DFLALL},
X {"version", TRLBAR},
X {"visual", RANGE+BANG+FILE1+TRLBAR},
X {"write", RANGE+BANG+FILE1+DFLALL+TRLBAR},
X {"wnext", RANGE+BANG+FILE1+TRLBAR},
X {"winsize", EXTRA+NEEDARG+TRLBAR},
X {"wq", BANG+FILE1+DFLALL+TRLBAR},
X {"xit", BANG+FILE1+DFLALL+TRLBAR},
X {"yank", RANGE+REGSTR+COUNT+TRLBAR},
X {"z", RANGE+COUNT+TRLBAR}, /* not supported */
X {"@", RANGE+EXTRA+TRLBAR},
X {"!", RANGE+NAMEDFS},
X {"<", RANGE+COUNT+TRLBAR},
X {">", RANGE+COUNT+TRLBAR},
X {"=", RANGE+TRLBAR},
X {"&", RANGE+EXTRA},
X {"~", RANGE+TRLBAR} /* not supported */
X|
X};
X|
END_OF_FILE
if test 4518 -ne `wc -c <'vim/src/cmdtab.tab'`; then
echo shar: \"'vim/src/cmdtab.tab'\" unpacked with wrong size!
fi
# end of 'vim/src/cmdtab.tab'
fi
if test -f 'vim/src/makefile.unix' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/makefile.unix'\"
else
echo shar: Extracting \"'vim/src/makefile.unix'\" \(4829 characters\)
sed "s/^X//" >'vim/src/makefile.unix' <<'END_OF_FILE'
X#
X# Makefile for Vim on Unix, using gcc or standard cc
X#
X
X#>>>>> choose bsd (Sun, Linux, HPUX) or system V (Dynix/PTX)
XMACHINE = -DBSD
X#MACHINE = -DSYSV
X
X#>>>>> choose one compiler
X### standard C compiler, with optimizer or debugger
XCC=cc -O
X#CC=cc -g
X
X### GCC on sun, Dynix
X#CC=gcc -g -Wall -traditional
X
X### GCC 2.2.2d on Linux
X#CC=gcc -O6 -Wall


X
X#>>>>> choose options:
X### -DDIGRAPHS digraph support

X### -DNO_FREE_NULL do not call free() with a null pointer


X### -DWILD_CARDS wildcard expansion code
X### -DCOMPATIBLE start in vi-compatible mode
X### -DNOBACKUP default is no backup file
X### -DDEBUG output a lot of debugging garbage

X### -DSTRNCASECMP use strncasecmp() instead of internal function
X### -DUSE_LOCALE use setlocale() to change ctype() and others
X### -DTERMCAP full termcap file support


X### -DNO_BUILTIN_TCAPS do not include builtin termcap entries
X### (use only with -DTERMCAP)
X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)
X### -DALL_BUILTIN_TCAPS include all builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)

X### -DMAXNAMLEN 31 maximum length of a file name (if not defined in sys/dir.h)


X### -DVIMRC_FILE name of the .vimrc file in current dir
X### -DEXRC_FILE name of the .exrc file in current dir
X### -DSYSVIMRC_FILE name of the global .vimrc file
X### -DSYSEXRC_FILE name of the global .exrc file
X### -DDEFVIMRC_FILE name of the system-wide .vimrc file
X### -DVIM_HLP name of the help file

XDEFS = -DDIGRAPHS -DTERMCAP -DWILD_CARDS -DSOME_BUILTIN_TCAPS -DNO_FREE_NULL \
X -DSYSVIMRC_FILE=\"\$$HOME/.vimrc\" -DSYSEXRC_FILE=\"\$$HOME/.exrc\" \
X -DDEFVIMRC_FILE=\"/etc/vimrc\" -DVIM_HLP=\"/usr/local/doc/vim.hlp\"
X
X#>>>>> link with termlib or termcap only if TERMCAP is defined
X# termcap is for linux, HPUX, etc.
XLIBS = -ltermlib
X#LIBS = -ltermcap
X#LIBS =

X
X#>>>>> end of choices
X###########################################################################
X

XCFLAGS = -c $(MACHINE) $(DEFS)
X
XINCL = vim.h globals.h param.h keymap.h macros.h ascii.h term.h unix.h debug.h
X
XOBJ = alloc.o unix.o buffers.o charset.o cmdline.o csearch.o digraph.o \


X edit.o fileio.o help.o linefunc.o main.o mark.o message.o misccmds.o \
X normal.o ops.o param.o quickfix.o regexp.o regsub.o screen.o \

X script.o search.o storage.o tag.o term.o undo.o
X
X../vim: $(OBJ) version.c
X $(CC) $(CFLAGS) version.c
X $(CC) -o ../vim $(OBJ) version.o $(LIBS)
X
Xdebug: $(OBJ) version.c
X $(CC) $(CFLAGS) version.c
X $(CC) -o ../vim -g $(OBJ) version.o $(LIBS)


X
Xctags:
X csh -c ctags *.c *.h
X

Xclean:
X -rm -f $(OBJ) mkcmdtab.o version.o core ../vim mkcmdtab
X
X#use this in case the files have been transported via an MSDOS system
X
XFILES = *.c *.h makefile makefile.* cmdtab.tab proto/*.pro tags
X
Xdos2unix:
X -mv arp_prot.h arp_proto.h
X -mv ptx_stdl.h ptx_stdlib.h
X -mv sun_stdl.h sun_stdlib.h
X -mv makefile.dic makefile.dice
X -mv makefile.uni makefile.unix
X -mv makefile.man makefile.manx
X -mv makefile.6sa makefile.6sas
X -mv makefile.5sa makefile.5sas
X for i in $(FILES); do tr -d '\r\032' < $$i > ~tmp~; mv ~tmp~ $$i; echo $$i; done


X
X###########################################################################
X
Xalloc.o: alloc.c $(INCL)

X $(CC) $(CFLAGS) alloc.c
X
Xunix.o: unix.c $(INCL) unix.h
X $(CC) $(CFLAGS) unix.c
X
Xbuffers.o: buffers.c $(INCL)
X $(CC) $(CFLAGS) buffers.c
X
Xcharset.o: charset.c $(INCL)
X $(CC) $(CFLAGS) charset.c


X
Xcmdline.o: cmdline.c $(INCL) cmdtab.h

X $(CC) $(CFLAGS) cmdline.c
X
Xcsearch.o: csearch.c $(INCL)


X $(CC) $(CFLAGS) csearch.c
X

Xdigraph.o: digraph.c $(INCL)


X $(CC) $(CFLAGS) digraph.c
X

Xedit.o: edit.c $(INCL)


X $(CC) $(CFLAGS) edit.c
X

Xfileio.o: fileio.c $(INCL)


X $(CC) $(CFLAGS) fileio.c
X

Xhelp.o: help.c $(INCL)


X $(CC) $(CFLAGS) help.c
X

Xlinefunc.o: linefunc.c $(INCL)


X $(CC) $(CFLAGS) linefunc.c
X

Xmain.o: main.c $(INCL)


X $(CC) $(CFLAGS) main.c
X

Xmark.o: mark.c $(INCL)


X $(CC) $(CFLAGS) mark.c
X

Xmessage.o: message.c $(INCL)


X $(CC) $(CFLAGS) message.c
X

Xmisccmds.o: misccmds.c $(INCL)


X $(CC) $(CFLAGS) misccmds.c
X

Xnormal.o: normal.c $(INCL) ops.h
X $(CC) $(CFLAGS) normal.c


X
Xops.o: ops.c $(INCL) ops.h

X $(CC) $(CFLAGS) ops.c
X
Xparam.o: param.c $(INCL)


X $(CC) $(CFLAGS) param.c
X

Xquickfix.o: quickfix.c $(INCL)


X $(CC) $(CFLAGS) quickfix.c
X

Xregexp.o: regexp.c $(INCL)


X $(CC) $(CFLAGS) regexp.c
X

Xregsub.o: regsub.c $(INCL)


X $(CC) $(CFLAGS) regsub.c
X

Xscreen.o: screen.c $(INCL)


X $(CC) $(CFLAGS) screen.c
X

Xscript.o: script.c $(INCL)


X $(CC) $(CFLAGS) script.c
X

Xsearch.o: search.c $(INCL)


X $(CC) $(CFLAGS) search.c
X

Xstorage.o: storage.c $(INCL)


X $(CC) $(CFLAGS) storage.c
X

Xtag.o: tag.c $(INCL)


X $(CC) $(CFLAGS) tag.c
X

Xterm.o: term.c $(INCL)


X $(CC) $(CFLAGS) term.c
X

Xundo.o: undo.c $(INCL)


X $(CC) $(CFLAGS) undo.c
X
Xcmdtab.h: cmdtab.tab mkcmdtab

X ./mkcmdtab cmdtab.tab cmdtab.h
X
Xmkcmdtab: mkcmdtab.o
X $(CC) -o mkcmdtab mkcmdtab.o
END_OF_FILE
if test 4829 -ne `wc -c <'vim/src/makefile.unix'`; then
echo shar: \"'vim/src/makefile.unix'\" unpacked with wrong size!
fi
# end of 'vim/src/makefile.unix'
fi
if test -f 'vim/src/param.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/param.h'\"
else
echo shar: Extracting \"'vim/src/param.h'\" \(5234 characters\)
sed "s/^X//" >'vim/src/param.h' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * param.h: definition of global variables for settable parameters
X *
X * EXTERN is only defined in main.c (and vim.h)
X */
X
X#ifndef EXTERN
X# define EXTERN extern
X# define INIT(x)
X#else
X# ifndef INIT
X# define INIT(x) x
X# endif
X#endif
X
X/*
X * The following are actual variabables for the parameters
X */
X
XEXTERN int p_ai INIT(= FALSE); /* auto-indent */
XEXTERN int p_aw INIT(= FALSE); /* auto-write */
XEXTERN long p_bs INIT(= 0); /* backspace over newlines in insert mode */
X#if defined(COMPATIBLE) || defined(NOBACKUP)
XEXTERN int p_bk INIT(= FALSE); /* make backups when writing out files */
X#else
XEXTERN int p_bk INIT(= TRUE); /* make backups when writing out files */
X#endif
X#ifdef UNIX
XEXTERN char *p_bdir INIT(= BACKUPDIR); /* directory for backups */
X#endif
XEXTERN int p_cp INIT(= FALSE); /* vi-compatible */
X#ifdef DIGRAPHS
XEXTERN int p_dg INIT(= FALSE); /* enable digraphs */
X#endif /* DIGRAPHS */
XEXTERN char *p_dir INIT(= ""); /* directory for autoscript file */
XEXTERN char *p_ep INIT(= "indent"); /* program name for '=' command */
XEXTERN int p_eb INIT(= FALSE); /* ring bell for errors */
X#ifdef AMIGA
XEXTERN char *p_ef INIT(= "AztecC.Err"); /* name of errorfile */
X#else
XEXTERN char *p_ef INIT(= ""); /* name of errorfile */
X#endif
XEXTERN int p_et INIT(= FALSE); /* expand tabs into spaces */
X#ifdef MSDOS
XEXTERN int p_gr INIT(= TRUE); /* display graphic characters */
X#else
XEXTERN int p_gr INIT(= FALSE); /* display graphic characters */
X#endif
XEXTERN long p_hi INIT(= 20); /* command line history size */
XEXTERN char *p_hf INIT(= VIM_HLP); /* name of help file */
XEXTERN int p_ic INIT(= FALSE); /* ignore case in searches */
XEXTERN int p_im INIT(= FALSE); /* start editing in input mode */
XEXTERN char *p_kp INIT(= "ref"); /* keyword program */
XEXTERN int p_js INIT(= TRUE); /* use two spaces after period with Join */
XEXTERN int p_list INIT(= FALSE); /* show tabs and newlines graphically */
XEXTERN int p_magic INIT(= TRUE); /* use some characters for reg exp */
XEXTERN long p_ml INIT(= 5); /* number of mode lines */
XEXTERN int p_nu INIT(= FALSE); /* number lines on the screen */
XEXTERN char *p_para INIT(= "IPLPPPQPP LIpplpipbp"); /* paragraphs */
XEXTERN int p_ro INIT(= FALSE); /* readonly */
XEXTERN int p_remap INIT(= TRUE); /* remap */
XEXTERN int p_rd INIT(= TRUE); /* delete when replacing */
XEXTERN long p_report INIT(= 2); /* minimum number of lines for report */
XEXTERN int p_ru INIT(= FALSE); /* show column/line number */
XEXTERN long p_scroll INIT(= 12); /* scroll size */
XEXTERN long p_sj INIT(= 1); /* scroll jump size */
XEXTERN char *p_sections INIT(= "SHNHH HUnhsh"); /* sections */
X#ifdef MSDOS
XEXTERN char *p_sh INIT(= "command"); /* name of shell to use */
X#else
XEXTERN char *p_sh INIT(= "sh"); /* name of shell to use */
X#endif
XEXTERN long p_st INIT(= 0); /* type of shell */
XEXTERN int p_sr INIT(= FALSE); /* shift round off (for < and >) */
XEXTERN long p_sw INIT(= 8); /* shiftwidth (for < and >) */
X#ifdef COMPATIBLE
XEXTERN int p_sc INIT(= FALSE); /* show command in status line */
X#else
XEXTERN int p_sc INIT(= TRUE); /* show command in status line */
X#endif
X#ifndef MSDOS
XEXTERN int p_sn INIT(= FALSE); /* short names in file system */
X#endif
XEXTERN int p_sm INIT(= FALSE); /* showmatch */
X#ifdef COMPATIBLE
XEXTERN int p_mo INIT(= FALSE); /* show mode */
X#else
XEXTERN int p_mo INIT(= TRUE); /* show mode */
X#endif
XEXTERN int p_si INIT(= FALSE); /* smart-indent for c programs */
XEXTERN char *p_su INIT(= ".bak.o.h.info.vim"); /* suffixes for wildcard expansion */
XEXTERN long p_ts INIT(= 8); /* tab size in the file */
XEXTERN long p_tl INIT(= 0); /* used tag length */
XEXTERN char *p_tags INIT(= "tags"); /* tags search path */
XEXTERN int p_terse INIT(= TRUE); /* terse (not used) */
X#ifdef MSDOS
XEXTERN int p_tx INIT(= TRUE); /* textmode for file I/O */
X#endif
XEXTERN long p_tw INIT(= 9999); /* textwidth */
XEXTERN int p_to INIT(= FALSE); /* tilde is an operator */
XEXTERN int p_timeout INIT(= TRUE); /* mappings entered within one second */
XEXTERN int p_ttimeout INIT(= FALSE); /* key codes entered within one second */
X#ifdef COMPATIBLE
XEXTERN long p_ul INIT(= 0); /* number of Undo Levels */
XEXTERN long p_uc INIT(= 0); /* update count for auto script file */
X#else
XEXTERN long p_ul INIT(= 100); /* number of Undo Levels */
XEXTERN long p_uc INIT(= 100); /* update count for auto script file */
X#endif
XEXTERN long p_ut INIT(= 2000); /* update time for auto script file */
XEXTERN int p_vb INIT(= FALSE); /* visual bell only (no beep) */
XEXTERN int p_warn INIT(= TRUE); /* warn for changes at shell command */
XEXTERN int p_ws INIT(= TRUE); /* wrap scan */
XEXTERN long p_wm INIT(= 0); /* wrapmargin */
XEXTERN int p_wa INIT(= FALSE); /* write any */
X#if defined(COMPATIBLE) || defined(NOBACKUP)
XEXTERN int p_wb INIT(= FALSE); /* write backup files */
X#else
XEXTERN int p_wb INIT(= TRUE); /* write backup files */
X#endif
XEXTERN int p_ye INIT(= FALSE); /* Y yanks to end of line */
END_OF_FILE
if test 5234 -ne `wc -c <'vim/src/param.h'`; then
echo shar: \"'vim/src/param.h'\" unpacked with wrong size!
fi
# end of 'vim/src/param.h'
fi
if test -f 'vim/src/quickfix.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/quickfix.c'\"
else
echo shar: Extracting \"'vim/src/quickfix.c'\" \(5881 characters\)
sed "s/^X//" >'vim/src/quickfix.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * quickfix.c: functions for quickfix mode, using the Manx errorfile


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X

Xstatic void qf_free __ARGS((void));
X
X/*
X * for each error the next struct is allocated and linked in a list
X */
Xstruct qf_line
X{
X struct qf_line *qf_next; /* pointer to next error in the list */
X struct qf_line *qf_prev; /* pointer to previous error in the list */
X linenr_t qf_lnum; /* line number where the error occurred */
X char *qf_mark; /* pointer to that line (if != NULL) */
X int qf_col; /* column where the error occurred */
X char qf_cleared;/* set to TRUE if qf_mark has been cleared */
X char qf_type; /* type of the error (mostly 'E') */
X int qf_nr; /* error number */
X char *qf_fname; /* file name where the error occurred */
X char *qf_text; /* description of the error */
X};
X
Xstatic struct qf_line *qf_start; /* pointer to the first error */
Xstatic struct qf_line *qf_ptr; /* pointer to the current error */
X
Xstatic int qf_count = 0; /* number of errors (0 means no error list) */
X int qf_index; /* current index in the error list */
Xstatic int qf_marksset; /* set to 1 when qf_mark-s have been set */
X
X/*
X * Read the errorfile into memory, line by line, building the error list.
X * Return 1 for error, 0 for success.
X */
X int
Xqf_init(fname)
X char *fname;
X{
X char namebuf[CMDBUFFSIZE];
X char errmsg[CMDBUFFSIZE];
X FILE *fd;
X struct qf_line *qfp = NULL;
X
X if (fname == NULL)
X {
X emsg(e_errorf);
X return 1;
X }
X if ((fd = fopen(fname, "r")) == NULL)
X {
X emsg(e_openerrf);
X return 1;
X }
X qf_free();
X
X while (fgets(IObuff, IOSIZE, fd) != NULL)
X {
X if ((qfp = (struct qf_line *)alloc((unsigned)sizeof(struct qf_line))) == NULL)
X goto error2;
X
X /* parse the line: "filename>linenr:colnr:type:number:text" */
X if (sscanf(IObuff, "%[^>]>%ld:%d:%c:%d:%[^\n]", namebuf,
X &qfp->qf_lnum, &qfp->qf_col, &qfp->qf_type,
X &qfp->qf_nr, errmsg) != 6)
X goto error;
X if ((qfp->qf_fname = strsave(namebuf)) == NULL)
X goto error1;
X if ((qfp->qf_text = strsave(errmsg)) == NULL)
X {
X free(qfp->qf_fname);
X goto error1;
X }
X if (qf_count == 0) /* first element in the list */
X {
X qf_start = qfp;
X qfp->qf_prev = qfp; /* first element points to itself */
X }
X else
X {
X qfp->qf_prev = qf_ptr;
X qf_ptr->qf_next = qfp;
X }
X qfp->qf_next = qfp; /* last element points to itself */
X qfp->qf_mark = NULL;
X qfp->qf_cleared = FALSE;
X qf_ptr = qfp;
X ++qf_count;
X }
X if (!ferror(fd))
X {
X qf_ptr = qf_start;
X qf_index = 1;
X fclose(fd);
X return 0;
X }
Xerror:
X emsg(e_readerrf);
Xerror1:
X free(qfp);
Xerror2:
X fclose(fd);
X qf_free();


X return 1;
X}
X

X/*
X * jump to quickfix line "errornr"; if "errornr" is zero, redisplay the same line
X */
X void
Xqf_jump(errornr)
X int errornr;
X{
X struct qf_line *qfp;
X linenr_t i;
X char *msgp;
X
X if (qf_count == 0)
X {
X emsg(e_quickfix);
X return;
X }
X if (errornr == 0)
X errornr = qf_index;
X while (errornr < qf_index && qf_index > 1)
X {
X --qf_index;
X qf_ptr = qf_ptr->qf_prev;
X }
X while (errornr > qf_index && qf_index < qf_count)
X {
X ++qf_index;
X qf_ptr = qf_ptr->qf_next;
X }
X
X /*
X * read the wanted file if needed, and check autowrite etc.
X */
X if (getfile(qf_ptr->qf_fname, TRUE) <= 0)
X {
X /*
X * use mark if possible, because the line number may be invalid
X * after line inserts / deletes
X */
X i = 0;
X msgp = "";
X if ((qf_ptr->qf_mark != NULL && (i = ptr2nr(qf_ptr->qf_mark, (linenr_t)0)) == 0) || qf_ptr->qf_cleared)
X msgp = "(line changed) ";
X if (i == 0)
X i = qf_ptr->qf_lnum;
X if (i > line_count)
X i = line_count;
X Curpos.lnum = i;
X Curpos.col = qf_ptr->qf_col;
X adjustCurpos();
X cursupdate();
X smsg("(%d of %d) %s%s %d: %s", qf_index, qf_count, msgp, qf_ptr->qf_type == 'E' ? "Error" : "Warning", qf_ptr->qf_nr, qf_ptr->qf_text);
X
X if (!qf_marksset) /* marks not set yet: try to find them for
X the errors in the curren file */
X {
X for (i = 0, qfp = qf_start; i < qf_count; ++i, qfp = qfp->qf_next)
X if (strcmp(qfp->qf_fname, qf_ptr->qf_fname) == 0 && qfp->qf_lnum <= line_count)
X qfp->qf_mark = nr2ptr(qfp->qf_lnum);
X qf_marksset = 1;
X }
X }
X}
X
X/*
X * list all errors
X */
X void
Xqf_list()
X{
X struct qf_line *qfp;
X int i;
X
X if (qf_count == 0)
X {
X emsg(e_quickfix);
X return;
X }
X qfp = qf_start;
X gotocmdline(TRUE, NUL);
X#ifdef AMIGA
X settmode(0); /* set cooked mode so output can be halted */
X#endif
X for (i = 1; i <= qf_count; ++i)
X {
X sprintf(IObuff, "%2d line %ld col %2d %s %3d: %s",
X i,
X (long)qfp->qf_lnum,
X qfp->qf_col,
X qfp->qf_type == 'E' ? "Error" : "Warning",
X qfp->qf_nr,
X qfp->qf_text);
X outstr(IObuff);
X outchar('\n');
X qfp = qfp->qf_next;
X flushbuf();
X }
X#ifdef AMIGA
X settmode(1);
X#endif
X wait_return(TRUE);
X}
X
X/*
X * free the error list
X */
X static void
Xqf_free()
X{
X struct qf_line *qfp;
X
X while (qf_count)
X {
X qfp = qf_start->qf_next;
X free(qf_start->qf_fname);
X free(qf_start->qf_text);
X free(qf_start);
X qf_start = qfp;
X --qf_count;
X }
X qf_marksset = 0;
X}
X
X/*
X * qf_clrallmarks() - clear all marks
X *
X * Used mainly when trashing the entire buffer during ":e" type commands
X */
X void
Xqf_clrallmarks()
X{
X int i;
X struct qf_line *qfp;
X
X if (qf_count)
X for (i = 0, qfp = qf_start; i < qf_count; i++, qfp = qfp->qf_next)
X qfp->qf_mark = NULL;
X qf_marksset = 0;
X}
X
X/*
X * qf_adjustmark: set new ptr for a mark
X */
X void
Xqf_adjustmark(old, new)
X char *old, *new;
X{
X register int i;
X struct qf_line *qfp;
X
X if (qf_count)
X {
X for (i = 0, qfp = qf_start; i < qf_count; ++i, qfp = qfp->qf_next)
X if (qfp->qf_mark == old)
X {
X qfp->qf_mark = new;
X if (new == NULL)
X qfp->qf_cleared = TRUE;
X }
X }
X}
END_OF_FILE
if test 5881 -ne `wc -c <'vim/src/quickfix.c'`; then
echo shar: \"'vim/src/quickfix.c'\" unpacked with wrong size!
fi
# end of 'vim/src/quickfix.c'
fi
if test -f 'vim/src/term.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/term.h'\"
else
echo shar: Extracting \"'vim/src/term.h'\" \(7566 characters\)
sed "s/^X//" >'vim/src/term.h' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *

X * term.h -- VIM - Vi IMitation


X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * This file contains the machine dependent escape sequences that the editor
X * needs to perform various operations. Some of the sequences here are
X * optional. Anything not available should be indicated by a null string. In
X * the case of insert/delete line sequences, the editor checks the capability
X * and works around the deficiency, if necessary.
X */
X
X/*
X * the terminal capabilities are stored in this structure
X * keep in sync with array in term.c
X */
Xtypedef struct _tcarr
X{
X/* output codes */
X char *t_name; /* name of this terminal entry */
X char *t_el; /* el ce clear to end of line */
X char *t_il; /* il1 al add new blank line */
X char *t_cil; /* il AL add number of blank lines */
X char *t_dl; /* dl1 dl delete line */
X char *t_cdl; /* dl DL delete number of lines */
X char *t_ed; /* clear cl clear screen */
X char *t_ci; /* civis vi cursur invisible */
X char *t_cv; /* cnorm ve cursur visible */
X char *t_tp; /* sgr0 me normal mode */
X char *t_ti; /* rev mr reverse mode */
X char *t_cm; /* cup cm cursor motion */
X char *t_sr; /* ri sr scroll reverse (backward) */
X char *t_cri; /* cuf RI cursor number of chars right */
X char *t_vb; /* flash vb visual bell */
X char *t_ks; /* smkx ks put terminal in "keypad transmit" mode */
X char *t_ke; /* rmkx ke out of "keypad transmit" mode */
X char *t_ts; /* ti put terminal in termcap mode */
X char *t_te; /* te out of termcap mode */
X
X/* key codes */
X char *t_ku; /* kcuu1 ku arrow up */
X char *t_kd; /* kcud1 kd arrow down */
X char *t_kl; /* kcub1 kl arrow left */
X char *t_kr; /* kcuf1 kr arrow right */
X char *t_sku; /* shift arrow up */
X char *t_skd; /* shift arrow down */
X char *t_skl; /* kLFT #4 shift arrow left */
X char *t_skr; /* kRIT % shift arrow right */
X char *t_f1; /* kf1 k1 function key 1 */
X char *t_f2; /* kf2 k2 function key 2 */
X char *t_f3; /* kf3 k3 function key 3 */
X char *t_f4; /* kf4 k4 function key 4 */
X char *t_f5; /* kf5 k5 function key 5 */
X char *t_f6; /* kf6 k6 function key 6 */
X char *t_f7; /* kf7 k7 function key 7 */
X char *t_f8; /* kf8 k8 function key 8 */
X char *t_f9; /* kf9 k9 function key 9 */
X char *t_f10; /* kf10 k; function key 10 */
X char *t_sf1; /* kf11 F1 shifted function key 1 */
X char *t_sf2; /* kf12 F2 shifted function key 2 */
X char *t_sf3; /* kf13 F3 shifted function key 3 */
X char *t_sf4; /* kf14 F4 shifted function key 4 */
X char *t_sf5; /* kf15 F5 shifted function key 5 */
X char *t_sf6; /* kf16 F6 shifted function key 6 */
X char *t_sf7; /* kf17 F7 shifted function key 7 */
X char *t_sf8; /* kf18 F8 shifted function key 8 */
X char *t_sf9; /* kf19 F9 shifted function key 9 */
X char *t_sf10; /* kf20 FA shifted function key 10 */
X char *t_help; /* khlp %1 help key */
X char *t_undo; /* kund &8 undo key */
X /* adjust inchar() for last entry! */
X} Tcarr;
X
Xextern Tcarr term_strings; /* currently used terminal strings */
X
X/*
X * strings used for terminal
X */
X#define T_EL (term_strings.t_el)
X#define T_IL (term_strings.t_il)
X#define T_CIL (term_strings.t_cil)
X#define T_DL (term_strings.t_dl)
X#define T_CDL (term_strings.t_cdl)
X#define T_ED (term_strings.t_ed)
X#define T_CI (term_strings.t_ci)
X#define T_CV (term_strings.t_cv)
X#define T_TP (term_strings.t_tp)
X#define T_TI (term_strings.t_ti)
X#define T_CM (term_strings.t_cm)
X#define T_SR (term_strings.t_sr)
X#define T_CRI (term_strings.t_cri)
X#define T_VB (term_strings.t_vb)
X#define T_KS (term_strings.t_ks)
X#define T_KE (term_strings.t_ke)
X#define T_TS (term_strings.t_ts)
X#define T_TE (term_strings.t_te)
X
X
X#ifndef NO_BUILTIN_TCAPS
X/*
X * here are the builtin termcap entries.
X * They not stored as complete Tcarr structures, as such a structure
X * is to big.
X * Each termcap is a concatenated string of entries, where '\0' characters
X * followed by a skip character sepereate the capabilities. The skip
X * character is the relative structure offset for the following entry.
X * See parse_builtin_tcap() in term.c for all details.
X */
X# define AMIGA_TCAP "amiga\0\
X\0\033[K\0\
X\0\033[L\0\
X\0\033[%dL\0\
X\0\033[M\0\
X\0\033[%dM\0\
X\0\014\0\
X\0\033[0 p\0\
X\0\033[1 p\0\
X\0\033[0m\0\
X\0\033[7m\0\
X\0\033[%i%d;%dH\0\
X\1\033[%dC\0\
X\5\233A\0\
X\0\233B\0\
X\0\233D\0\
X\0\233C\0\
X\0\233T\0\
X\0\233S\0\
X\0\233 A\0\
X\0\233 @\0\
X\0\233\060~\0\
X\0\233\061~\0\
X\0\233\062~\0\
X\0\233\063~\0\
X\0\233\064~\0\
X\0\233\065~\0\
X\0\233\066~\0\
X\0\233\067~\0\
X\0\233\070~\0\
X\0\233\071~\0\
X\0\233\061\060~\0\
X\0\233\061\061~\0\
X\0\233\061\062~\0\
X\0\233\061\063~\0\
X\0\233\061\064~\0\
X\0\233\061\065~\0\
X\0\233\061\066~\0\
X\0\233\061\067~\0\
X\0\233\061\070~\0\
X\0\233\061\071~\0\
X\0\233?~\0\
X\0\0"
X
X# define ATARI_TCAP "atari\0\
X\0\033l\0\
X\0\033L\0\
X\1\033M\0\
X\1\033E\0\
X\0\033f\0\
X\0\033e\0\
X\0\0"
X
X# define ANSI_TCAP "ansi\0\
X\0\033[2K\0\
X\0\033[L\0\
X\0\033[%dL\0\
X\0\033[M\0\
X\0\033[%dM\0\
X\0\033[2J\0\
X\2\033[0m\0\
X\0\033[7m\0\
X\0\033[%i%d;%dH\0\
X\1\033[%dC\0\
X\0\0"
X
X/*
X * These codes are valid when ansi.sys or equivalent has been installed.
X * Function keys on a PC are preceded with a NUL. These are converted into
X * K_ZERO '\236' in GetChars(), because we cannot handle NULs in key codes.
X * CTRL-arrow is used instead of SHIFT-arrow.
X */
X# define PCTERM_TCAP "pcterm\0\
X\0\033[K\0\
X\0\033|L\0\
X\1\033|M\0\
X\1\033[2J\0\
X\2\033[0m\0\
X\0\033[7m\0\
X\0\033[%i%d;%dH\0\
X\1\033[%dC\0\
X\5\236H\0\
X\0\236P\0\
X\0\236K\0\
X\0\236M\0\
X\2\236s\0\
X\0\236t\0\
X\0\236;\0\
X\0\236<\0\
X\0\236=\0\
X\0\236>\0\
X\0\236?\0\
X\0\236@\0\
X\0\236A\0\
X\0\236B\0\
X\0\236C\0\
X\0\236D\0\
X\0\236T\0\
X\0\236U\0\
X\0\236V\0\
X\0\236W\0\
X\0\236X\0\
X\0\236Y\0\
X\0\236Z\0\
X\0\236[\0\
X\0\236\\\0\
X\0\236]\0\
X\0\0"
X
X# define VT52_TCAP "vt52\0\
X\0\033K\0\
X\0\033T\0\
X\1\033U\0\
X\1\014\0\
X\2\033SO\0\
X\0\033S2\0\
X\0\033Y%+ %+ \0\
X\0\0"
X
X# define XTERM_TCAP "xterm\0\
X\0\033[K\0\
X\0\033[L\0\
X\0\033[%dL\0\
X\0\033[M\0\
X\0\033[%dM\0\
X\0\033[2J\0\
X\2\033[m\0\
X\0\033[7m\0\
X\0\033[%i%d;%dH\0\
X\0\033M\0\
X\0\033[%dC\0\
X\1\033[?1h\0\
X\0\033[?0h\0\
X\2\033[OA\0\
X\0\033[OB\0\
X\0\033[OD\0\
X\0\033[OC\0\
X\0\033[Ox\0\
X\0\033[Or\0\
X\0\033[Ot\0\
X\0\033[Ov\0\
X\0\033[12~\0\
X\0\033[13~\0\
X\0\033[14~\0\
X\0\033[15~\0\
X\0\033[16~\0\
X\0\033[17~\0\
X\0\033[18~\0\
X\0\033[19~\0\
X\0\033[20~\0\
X\0\033[21~\0\
X\0\033[23~\0\
X\0\033[24~\0\
X\10\033[28~\0\
X\0\033[26~\0\
X\0\0"
X
X# define DEBUG_TCAP "debug\0\
X\0[EL]\0\
X\0[IL]\0\
X\0[CIL%d]\0\
X\0[DL]\0\
X\0[CDL%d]\0\
X\0[ED]\0\
X\0[CI]\0\
X\0[CV]\0\
X\0[TP]\0\
X\0[TI]\0\
X\0[%dCM%d]\0\
X\0[SR]\0\
X\0[CRI%d]\0\
X\0[VB]\0\
X\0[KS]\0\
X\0[KE]\0\
X\0[TI]\0\
X\0[TE]\0\
X\0[KU]\0\
X\0[KD]\0\
X\0[KL]\0\
X\0[KR]\0\
X\0[SKU]\0\
X\0[SKD]\0\
X\0[SKL]\0\
X\0[SKR]\0\
X\0[F1]\0\
X\0[F2]\0\
X\0[F3]\0\
X\0[F4]\0\
X\0[F5]\0\
X\0[F6]\0\
X\0[F7]\0\
X\0[F8]\0\
X\0[F9]\0\
X\0[F10]\0\
X\0[SF1]\0\
X\0[SF2]\0\
X\0[SF3]\0\
X\0[SF4]\0\
X\0[SF5]\0\
X\0[SF6]\0\
X\0[SF7]\0\
X\0[SF8]\0\
X\0[SF9]\0\
X\0[SF10]\0\
X\0[HELP]\0\
X\0[UNDO]\0\
X\0\0"
X
X# ifdef ATARI
X# define DFLT_TCAP ATARI_TCAP
X# endif /* ATARI */
X
X# ifdef AMIGA
X# define DFLT_TCAP AMIGA_TCAP
X# endif /* AMIGA */
X
X# ifdef MSDOS
X# define DFLT_TCAP PCTERM_TCAP
X# endif /* MSDOS */
X
X# ifdef UNIX
X# define DFLT_TCAP ANSI_TCAP
X# endif /* UNIX */
X
X#endif /* NO_BUILTIN_TCAPS */
END_OF_FILE
if test 7566 -ne `wc -c <'vim/src/term.h'`; then
echo shar: \"'vim/src/term.h'\" unpacked with wrong size!
fi
# end of 'vim/src/term.h'
fi
if test -f 'vim/src/vim.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/vim.h'\"
else
echo shar: Extracting \"'vim/src/vim.h'\" \(6430 characters\)
sed "s/^X//" >'vim/src/vim.h' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X

X#if defined(SYSV) || defined(BSD)
X# ifndef UNIX
X# define UNIX
X# endif
X#endif
X
X#include "debug.h"
X
X#include <stdio.h>
X
X#ifndef SYSV
X# include <stdlib.h>
X#endif
X
X#include <ctype.h>
X
X#ifdef BSD
X# include <strings.h>
X#else
X# include <string.h>
X#endif
X
X#include "ascii.h"
X#include "keymap.h"
X#include "term.h"
X#include "macros.h"
X#ifdef LATTICE
X# include <sys/types.h>
X# include <sys/stat.h>
X#else
X# ifdef _DCC
X# include <sys/stat.h>
X# else
X# ifdef MSDOS
X# include <sys\stat.h>
X# else
X# ifdef UNIX
X# ifndef linux
X# define volatile /* needed for gcc */
X# define signed /* needed for gcc */
X# endif
X# include <sys/types.h>
X# include <sys/stat.h>
X# else
X# include <stat.h>
X# endif
X# endif
X# endif
X#endif
X
X#ifdef AMIGA
X/*
X * arpbase.h must be included before functions.h
X */
X# include <libraries/arpbase.h>
X
X/*
X * This won't be needed if you have a version of Lattice 4.01 without broken
X * break signal handling.
X */
X#include <signal.h>
X#endif
X
X#ifndef AMIGA
X/*
X * For the Amiga we use a version of getenv that does local variables under 2.0
X */
X#define vimgetenv(x) getenv(x)
X#endif
X
X#ifdef AZTEC_C
X# include <functions.h>
X# define __ARGS(x) x
X# define __PARMS(x) x
X#endif
X
X#ifdef SASC
X# include <clib/exec_protos.h>
X# define __ARGS(x) x
X# define __PARMS(x) x
X#endif
X
X#ifdef _DCC
X# include <functions.h>
X# define __ARGS(x) x
X# define __PARMS(x) x
X#endif
X
X#ifdef __TURBOC__
X# define __ARGS(x) x
X#endif
X
X#ifdef MSDOS
X# include <dos.h>
X# include <dir.h>
X#endif
X
X#ifdef UNIX
X# include <sys/dir.h> /* for MAXNAMLEN */
X# if defined(UFS_MAXNAMLEN) && !defined(MAXNAMLEN)
X# define MAXNAMLEN UFS_MAXNAMLEN /* for dynix/ptx */
X# endif
X# if defined(NAME_MAX) && !defined(MAXNAMLEN)
X# define MAXNAMLEN NAME_MAX /* for Linux befor .99p3 */
X# endif
X#endif
X
X#if defined(__STDC__) || defined(__GNUC__)
X# ifndef __ARGS
X# define __ARGS(x) x
X# endif /* __ARGS */
X# if defined(_SEQUENT_)
X# include "ptx_stdlib.h"
X# endif
X# if defined(sun)
X# include "sun_stdlib.h"
X# endif
X# if defined(linux)
X# include <unistd.h> /* may make sense for others too. jw. */
X# endif
X#else /*__STDC__*/
X# if defined(_SEQUENT_) && !defined(_STDLIB_H_)
X extern char *getenv();
X extern void *malloc();
X# endif
X#endif /* __STDC__ */
X
X#ifndef __ARGS
X#define __ARGS(x) ()
X#endif
X#ifndef __PARMS
X#define __PARMS(x) ()
X#endif
X
X/*
X * for systems that do not allow free(NULL)
X */
X#ifdef NO_FREE_NULL
X# define free(x) nofreeNULL(x)
X extern void nofreeNULL __ARGS((void *));
X#endif
X
X/*
X * fnamecmp() is used to compare filenames.
X * On some systems case in a filename does not matter, on others it does.
X * (this does not account for maximum name lengths, thus it is not 100% accurate!)
X */
X#if defined(AMIGA) || defined(MSDOS)
X# define fnamecmp(x, y) stricmp((x), (y))
X#else
X# define fnamecmp(x, y) strcmp((x), (y))
X#endif
X
X/* flags for updateScreen() */
X#define VALID 90 /* buffer not changed */
X#define NOT_VALID 91 /* buffer changed */
X#define VALID_TO_CURSCHAR 92 /* buffer before cursor not changed */
X#define INVERTED 93 /* redisplay inverted part */
X#define CLEAR 94 /* first clear screen */
X#define CURSUPD 95 /* update cursor first */
X
X/* values for State */
X#define NORMAL 0
X#define CMDLINE 1
X#define INSERT 2
X#define APPEND 3
X#define REPLACE 4 /* replace mode */
X#define HELP 5
X#define NOMAPPING 6 /* no :mapping mode for vgetc() */
X#define HITRETURN 7
X#define SETWINSIZE 8
X#define NORMAL_BUSY 9 /* busy interpreting a command */
X
X/* directions */
X#define FORWARD 1
X#define BACKWARD -1
X
X/* for GetChars */
X#define T_PEEK 1 /* do not wait at all */
X#define T_WAIT 2 /* wait for a short time */
X#define T_BLOCK 3 /* wait forever */
X
X#define QUOTELINE 29999 /* Quoting is linewise */
X
X/*
X * Names for the EXRC, HELP and temporary files.
X * Some of these may have been defined in the makefile.
X */
X#ifndef SYSVIMRC_FILE
X# define SYSVIMRC_FILE "s:.vimrc"
X#endif
X#ifndef SYSEXRC_FILE
X# define SYSEXRC_FILE "s:.exrc"
X#endif
X#ifndef VIMRC_FILE
X# define VIMRC_FILE ".vimrc"
X#endif
X#ifndef EXRC_FILE
X# define EXRC_FILE ".exrc"
X#endif
X#ifndef VIM_HLP
X# define VIM_HLP "vim:vim.hlp"
X#endif
X#define TMPNAME1 "t:viXXXXXX"
X#define TMPNAME2 "t:voXXXXXX"
X#define TMPNAMELEN 12
X
X/*
X * Boolean constants
X */
X#ifndef TRUE
X#define FALSE (0) /* note: this is an int, not a long! */
X#define TRUE (1)
X#endif
X
X/*
X * Maximum screen dimensions
X */
X#define MAX_COLUMNS 140L
X
X/*
X * Buffer sizes
X */
X#define CMDBUFFSIZE 256 /* size of the command processing buffer */
X
X#define LSIZE 512 /* max. size of a line in the tags file */
X
X#define IOSIZE (1024+1) /* file i/o and sprintf buffer size */
X
X#define TERMBUFSIZE 1024
X
X#ifdef linux
X# define TBUFSZ 2048 /* buffer size for termcap entry */
X#else
X# define TBUFSZ 1024 /* buffer size for termcap entry */
X#endif
X
X/*
X * maximum length of a file name path
X */
X#ifdef UNIX
X# define MAXPATHL 1024 /* Unix has long paths and plenty of memory */
X#else
X# define MAXPATHL 128 /* not too long to put name on stack */
X#endif
X
X#ifdef MSDOS
X# define BASENAMELEN 8 /* length of base of file name */
X#else
X# ifdef UNIX
X# define BASENAMELEN (MAXNAMLEN - 5)
X# else
X# define BASENAMELEN 26 /* Amiga */
X# endif
X#endif
X
X#ifdef MSDOS
X# define WRITEBIN "wb" /* no CR-LF translation */
X# define READBIN "rb"
X#else
X# define WRITEBIN "w"
X# define READBIN "r"
X#endif
X
X#define CHANGED set_Changed()
X#define UNCHANGED Changed = 0
X
X#if !defined(BSD) && !defined(linux) && !defined(SASC)
Xtypedef unsigned char u_char; /* shorthand */
Xtypedef unsigned short u_short; /* shorthand */
Xtypedef unsigned int u_int; /* shorthand */
Xtypedef unsigned long u_long; /* shorthand */
X#endif
X
X#ifdef BSD
X#define strchr(ptr, c) index(ptr, c)
X#define strrchr(ptr, c) rindex(ptr, c)
X#define memset(ptr, c, size) bsdmemset(ptr, c, size)
Xchar *bsdmemset __ARGS((char *, int, long));
X#endif
X
Xtypedef long linenr_t; /* line number type */
Xtypedef unsigned colnr_t; /* column number type */
Xtypedef struct fpos FPOS; /* file position type */
X
X#define INVLNUM (0x7fffffff) /* invalid line number */
X
Xstruct fpos
X{
X linenr_t lnum; /* line number */
X colnr_t col; /* column number */
X};
END_OF_FILE
if test 6430 -ne `wc -c <'vim/src/vim.h'`; then
echo shar: \"'vim/src/vim.h'\" unpacked with wrong size!
fi
# end of 'vim/src/vim.h'
fi
echo shar: End of archive 3 \(of 23\).
cp /dev/null ark3isdone

Bram Moolenaar

unread,
Apr 23, 1993, 1:29:38 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 4
Archive-name: vim/part04
Environment: UNIX, AMIGA, MS-DOS

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:

# "End of archive 4 (of 23)."
# Contents: vim/doc/vim.man.uue vim/src/digraph.c.uue
# vim/src/globals.h vim/src/makefile.6sas vim/src/makefile.manx
# vim/src/regsub.c
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:06 1993


PATH=/bin:/usr/bin:/usr/ucb ; export PATH

if test -f 'vim/doc/vim.man.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/vim.man.uue'\"
else
echo shar: Extracting \"'vim/doc/vim.man.uue'\" \(8781 characters\)
sed "s/^X//" >'vim/doc/vim.man.uue' <<'END_OF_FILE'
X
Xbegin 644 vim.man
XM"@I624TH,2D@("`@("`@("`@("`@("`@("`@("`@("`@(%5315(@0T]-34%.<
XM1%,@("`@("`@("`@("`@("`@("`@("`@("`@("!624TH,2D*"@I."$X(3D$(&
XM00A!30A-"$U%"$4(10H@("`@('9I;2`M(%9I($E-:71A=&EO;BP@82!P<F]GU
XM<F%M;65R<R!T97AT(&5D:71O<@H*4PA3"%-9"%D(64X(3...@A.3PA/"$]0"%`(B
XM4%,(4PA320A)"$E3"%,(4PH@("`@('8(=@AV:0AI"&EM"&T(;2!;;W!T:6]N?
XM<UT@6V9I;&4@+BY="B`@("`@=@AV"'9I"&D(:6T(;0AM(%MO<'1I;VYS72`MS
XM="!T86<*("`@("!V"'8(=FD(:0AI;0AM"&T@6V]P=&EO;G-=("M;8V]M;6%N3
XM9%T@9FEL92`N+@H@("`@('8(=@AV:0AI"&EM"&T(;2!;;W!T:6]N<UT@+6,@O
XM>V-O;6UA;F1](&9I;&4@+BX*("`@("!V"'8(=FD(:0AI;0AM"&T@6V]P=&EOW
XM;G-=("UE"@I$"$0(1$4(10A%4PA3"%-#"$,(0U((4@A220A)"$E0"%`(4%0(N
XM5`A420A)"$E/"$\(3TX(3@A."B`@("`@5@A6"%9I"&D(:6T(;0AM(&ES(&$@-
XM=&5X="!E9&ET;W(@=&AA="!I<R!U<'=A<F1S(&-O;7!A=&EB;&4@=&\@=FDN/
XM($ET(&-A;B!B92!U<V5D("!T;PH@("`@(&5D:70@86YY($%30TE)('1E>'0N>
XM($ET(&ES(&5S<&5C:6%L;'D@=7-E9G5L(&9O<B!E9&ET:6YG('!R;V=R86US.
XM+@H*("`@("!4:&5R92!A<F4@82!L;W0@;V8@96YH86YC96UE;G1S(&%B;W9E=
XM('9I.B!M=6QT:2!L979E;"!U;F1O+"!C;VUM86YD("!L:6YE"B`@("`@961I!
XM=&EN9RP@("!F:6QE;F%M92`@(&-O;7!L971I;VXL("!O;B`@;&EN92`@:&5L#
XM<"P@('%U;W1I;F<L("!E=&,N+B`@4F5A9`H@("`@(&1I9F9E<F5N8V4N9&]C\
XM(&9O<B!A('-U;6UA<GD@;V8@=&AE(&1I9F9E<F5N8V5S(&)E='=E96X@=FD@S
XM86YD(%9I;2X*"B`@("`@36]S="!O9G1E;B!6"%8(5FD(:0AI;0AM"&T@:7,@P
XM<W1A<G1E9"!T;R!E9&ET(&$@<VEN9VQE(&9I;&4@=VET:"!T:&4@8V]M;6%N[
XM9`H*("`@("`@("`@('9I;2!F:6QE"@H@("`@($UO<F4@9V5N97)A;&QY(%9)M
XM32!I<R!S=&%R=&5D('=I=&@Z"@H@("`@("`@("`@=FEM(%MO<'1I;VYS72!;U
XM9FEL96QI<W1="@H@("`@($EF('1H92!F:6QE;&ES="!I<R!M:7-S:6YG+"!T/
XM:&4@961I=&]R('=I;&P@<W1A<G0@=VET:"!A;B`@96UP='D@(&)U9F9E<BX*&
XM("`@("!/=&AE<G=I<V4@97AA8W1L>2!O;F4@;W5T(&]F('1H92!F;VQL;W=I`
XM;F<@9F]U<B!M87D@8F4@=7-E9"!T;R!C:&]O<V4@;VYE"B`@("`@;W(@;6]R/
XM92!F:6QE<R!T;R!B92!E9&ET960N"@H@("`@(&9I;&4@+BX@("`@($$@;&ES8
XM="!O9B!F:6QE(&YA;65S+B!4:&4@9FER<W0@;VYE("AA;'!H86)E=&EC86QL$
XM>2D@=VEL;"`@8F4*("`@("`@("`@("`@("`@("!T:&4@8W5R<F5N="!F:6QE/
XM(&%N9"!R96%D(&EN=&\@=&AE(&)U9F9E<BX@5&AE(&-U<G-O<B!W:6QL(&)E0
XM"B`@("`@("`@("`@("`@("`@<&]S:71I;VYE9"!O;B!T:&4@9FER<W0@;&ENQ
XM92!O9B!T:&4@8G5F9F5R+B!9;W4@(&-A;B`@9V5T("!T;PH@("`@("`@("`@_
XM("`@("`@('1H92!O=&AE<B!F:6QE<R!W:71H('1H92`B.FYE>'0B(&-O;6UA=
XM;F0N"@H@("`@("M;;G5M72!F:6QE("XN"B`@("`@("`@("`@("`@("`@4V%MN
XM92!A<R!T:&4@86)O=F4L(&)U="!T:&4@8W5R<V]R('=I;&P@8F4@<&]S:71I4
XM;VYE9"!O;B`@;&EN90H@("`@("`@("`@("`@("`@(")N=6TB+B`@268@(FYU+
XM;2(@:7,@;6ES<VEN9RP@=&AE(&-U<G-O<B!W:6QL(&)E('!O<VET:6]N960@M
XM;VX*("`@("`@("`@("`@("`@("!T:&4@;&%S="!L:6YE+@H*("`@("`K+W!AQ
XM="!F:6QE("XN"B`@("`@("`@("`@("`@("`@4V%M92!A<R!T:&4@86)O=F4L.
XM(&)U="!T:&4@8W5R<V]R('=I;&P@8F4@<&]S:71I;VYE9"`@;VX@('1H90H@O
XM("`@("`@("`@("`@("`@(&9I<G-T("`@;V-C=7)R96YC92`@(&]F("`@(G!AY
XM="(@(&EN("!T:&4@(&-U<G)E;G0@(&9I;&4@("AS964*("`@("`@("`@("`@`
XM("`@("!R969E<F5N8V4N9&]C+"!S96-T:6]N(")P871T97)N('-E87)C:&5SB
XM(B!F;W(@('1H92`@879A:6QA8FQE"B`@("`@("`@("`@("`@("`@<V5A<F-H+
XM('!A='1E<FYS*2X*"B`@("`@*WMC;VUM86YD?2!F:6QE("XN"@H@("`@("UC>
XM('MC;VUM86YD?2!F:6QE("XN"B`@("`@("`@("`@("`@("`@4V%M92!A<R!TK
XM:&4@86)O=F4L(&)U="![8V]M;6%N9'T@=VEL;"!B92!E>&5C=71E9"`@869TY
XM97(@('1H90H@("`@("`@("`@("`@("`@(&9I;&4@(&AA<R`@8F5E;B`@<F5AP
XM9"X@('MC;VUM86YD?2`@:7,@(&EN=&5R<')E=&5D("!A<R`@86X@17@*("`@5
XM("`@("`@("`@("`@("!C;VUM86YD+B!)9B!T:&4@>V-O;6UA;F1](&-O;G1AI
XM:6YS('-P86-E<R!I="!M=7-T(&)E(&5N8VQO<V5D"B`@("`@("`@("`@("`@M
XM("`@:6X@(&1O=6)L92`@<75O=&5S("`H=&AI<R!D97!E;F1S(&]N('1H92!SG
XM:&5L;"!T:&%T(&ES('5S960I+@H@("`@("`@("`@("`@("`@($5X86UP;&4Z*
XM(%9I;2`B*W-E="!S:2(@;6%I;BYC"@H*"@H@("`@("`@("`@("`@("`@("`@+
XM("`@("`@("`@("`@(#(X($UA<F-H(#$Y.3(@("`@("`@("`@("`@("`@("`@J
XM("`@("`@("`@("`@(#$*"@P*"E9)32@Q*2`@("`@("`@("`@("`@("`@("`@S
XM("`@("`@55-%4B!#3TU-04Y$4R`@("`@("`@("`@("`@("`@("`@("`@("`@Q
XM(%9)32@Q*0H*"B`@("`@+70@>W1A9WT@("`@5&AE(&9I;&4@=&\@961I="!AL
XM;F0@=&AE(&EN:71I86P@8W5R<V]R('!O<VET:6]N(&1E<&5N9',@;VX@80H@[
XM("`@("`@("`@("`@("`@(")T86<B+"`@82`@<V]R="!O9B!G;W1O(&QA8F5L#
XM+B![=&%G?2!I<R!L;V]K960@=7`@:6X@=&AE('1A9W,*("`@("`@("`@("`@2
XM("`@("!F:6QE+"!T:&4@87-S;V-I871E9"!F:6QE(&)E8V]M97,@=&AE(&-UD
XM<G)E;G0@(&9I;&4@(&%N9"`@=&AE"B`@("`@("`@("`@("`@("`@87-S;V-IK
XM871E9"`@8V]M;6%N9"`@:7,@(&5X96-U=&5D+B`@36]S=&QY('1H:7,@:7,@:
XM=7-E9"!F;W(@0PH@("`@("`@("`@("`@("`@('!R;V=R86US+B![=&%G?2!TF
XM:&5N('-H;W5L9"!B92!A(&9U;F-T:6]N(&YA;64N(%1H92!E9F9E8W0@:7,*;
XM("`@("`@("`@("`@("`@("!T:&%T("!T:&4@(&9I;&4@(&-O;G1A:6YI;F<@\
XM=&AA="!F=6YC=&EO;B!B96-O;65S('1H92!C=7)R96YT"B`@("`@("`@("`@C
XM("`@("`@9FEL92!A;F0@=&AE("!C=7)S;W(@(&ES("!P;W-I=&EO;F5D("!O[
XM;B`@=&AE("!S=&%R="`@;V8@('1H90H@("`@("`@("`@("`@("`@(&9U;F-T]
XM:6]N("AS964@<F5F97)E;F-E+F1O8RP@<V5C=&EO;B`B=&%G('-E87)C:&5SK
XM(BDN"@H@("`@("UE("`@("`@("`@(%-T87)T(&EN('%U:6-K1FEX(&UO9&4N;
XM(%1H92!E<G)O<B!F:6QE(")!>G1E8T,N17)R(B`@:7,@(')E860*("`@("`@"
XM("`@("`@("`@("!A;F0@('1H92`@9FER<W0@(&5R<F]R("!I<R`@9&ES<&QA_
XM>65D+B`@1G5R=&AE<B!E<G)O<G,@8V%N(&)E"B`@("`@("`@("`@("`@("`@P
XM:G5M<&5D('1O('=I=&@@=&AE("(Z8VXB(&-O;6UA;F0N(%-E92`@<F5F97)E7
XM;F-E+F1O8R`@<V5C=&EO;@H@("`@("`@("`@("`@("`@(#4N-BX*"D\(3PA/1
XM4`A0"%!4"%0(5$D(20A)3PA/"$]."$X(3E,(4PA3"B`@("`@5&AE(&]P=&EO-
XM;G,L(&EF('!R97-E;G0L(&UU<W0@<')E8V5D92!T:&4@9FEL96QI<W0N(%1H1
XM92`@;W!T:6]N<R`@;6%Y("!B90H@("`@(&=I=F5N(&EN(&%N>2!O<F1E<BX*5
XM"B`@("`@+7(@("`@("`@("`@4F5C;W9E<GD@;6]D92X@5&AE(&%U=&]S8W)I6
XM<'0@(&9I;&4@(&ES("!R96%D("!T;R`@<F5C;W9E<B`@80H@("`@("`@("`@`
XM("`@("`@(&-R87-H960@961I=&EN9R!S97-S:6]N+B!)="!H87,@86QM;W-TY
XM('1H92!S86UE(&5F9F5C="!A<R`B+7,*("`@("`@("`@("`@("`@("!F:6QE4
XM+G9I;2(N("!3964@(')E9F5R96YC92YD;V,L("!C:&%P=&5R("`B4F5C;W9E3
XM<GD@(&%F=&5R("!A"B`@("`@("`@("`@("`@("`@8W)A<V@B+@H*("`@("`M*
XM=B`@("`@("`@("!6:65W(&UO9&4N(%1H92`G<F5A9&]N;'DG(&]P=&EO;B!WA
XM:6QL(&)E('-E="X@66]U("!C86X@('-T:6QL"B`@("`@("`@("`@("`@("`@C
XM961I="`@=&AE("!B=69F97(L("!B=70@('=I;&P@(&)E("!P<F5V96YT960@$
XM(&9R;VT@86-C:61E;G1A;`H@("`@("`@("`@("`@("`@(&]V97)W<FET:6YGF
XM(&$@9FEL92X@268@>6]U(&1O('=A;G0@=&\@;W9E<G=R:71E(&$@(&9I;&4L?
XM("!A9&0*("`@("`@("`@("`@("`@("!A;B`@97AC;&%M871I;VX@(&UA<FL@"
XM('1O("!T:&4@($5X("!C;VUM86YD+"!A<R!I;B`B.G<A(BX@5&AE"B`@("`@&
XM("`@("`@("`@("`@)W)E861O;FQY)R`@;W!T:6]N("!C86X@(&)E("!R97-EM
XM="`@=VET:"`@(CIS970@(&YO<F\B("`@*'-E90H@("`@("`@("`@("`@("`@'
XM(')E9F5R96YC92YD;V,L(&]P=&EO;G,@8VAA<'1E<BDN"@H@("`@("UN("`@8
XM("`@("`@($YO(&%U=&]S8W)I<'0@9FEL92!W:6QL(&)E('=R:71T96XN(%)E\
XM8V]V97)Y("!A9G1E<B`@82`@8W)A<V@*("`@("`@("`@("`@("`@("!W:6QL^
XM("!B92`@:6UP;W-S:6)L92X@($AA;F1Y("!I9B!Y;W4@=V%N="!T;R!E9&ET/
XM(&$@9FEL92!O;B!A"B`@("`@("`@("`@("`@("`@=F5R>2!S;&]W(&UE9&EU(
XM;2`H92YG+B!F;&]P<'DI+B!#86X@86QS;R!B92!D;VYE("!W:71H("`B.G-E,
XM=`H@("`@("`@("`@("`@("`@('5C/3`B+@H*("`@("`M<R![<V-R:7!T:6Y]+
XM"B`@("`@("`@("`@("`@("`@5&AE('-C<FEP="!F:6QE('MS8W)I<'1I;GT@D
XM:7,@<F5A9"X@(%1H92`@8VAA<F%C=&5R<R`@:6X@('1H90H@("`@("`@("`@I
XM("`@("`@(&9I;&4@(&%R92`@:6YT97)P<F5T960@87,@:68@>6]U(&AA9"!T?
XM>7!E9"!T:&5M+B!4:&4@<V%M92!C86X*("`@("`@("`@("`@("`@("!B92!D\
XM;VYE('=I=&@@=&AE(&-O;6UA;F0@(CIS;W5R8V4A('MS8W)I<'1I;GTB+B!)I
XM9B!T:&4@96YD(&]F"B`@("`@("`@("`@("`@("`@=&AE("`@9FEL92`@:7,@Z
XM(')E86-H960@(&)E9F]R92`@=&AE("!E9&ET;W(@(&5X:71S+"`@9G5R=&AE.
XM<@H@("`@("`@("`@("`@("`@(&-H87)A8W1E<G,@87)E(')E860@9G)O;2!TX
XM:&4@:V5Y8F]A<F0N"@H@("`@("UW('MS8W)I<'1O=71]"B`@("`@("`@("`@S
XM("`@("`@06QL('1H92!C:&%R86-T97)S('1H870@>6]U('1Y<&4@87)E("!RT
XM96-O<F1E9"`@:6X@('1H92`@9FEL90H@("`@("`@("`@("`@("`@('MS8W)ID
XM<'1O=71]+"`@=6YT:6P@('EO=2!E>&ET(%9)32X@5&AI<R!I<R!U<V5F=6P@*
XM:68@>6]U('=A;G0*("`@("`@("`@("`@("`@("!T;R!C<F5A=&4@(&$@('-C^
XM<FEP="`@9FEL92`@=&\@(&)E("!U<V5D("!W:71H("`B=FEM("`M<R(@(&]R'
XM"B`@("`@("`@("`@("`@("`@(CIS;W5R8V4A(BX*"B`@("`@+50@=&5R;6ENL
XM86P@5&5L;',@5FEM('1H92!N86UE(&]F('1H92!T97)M:6YA;"!Y;W4@87)E&
XM('5S:6YG+B!3:&]U;&0@8F4@80H@("`@("`@("`@("`@("`@('1E<FUI;F%LQ
XM("!K;F]W;B`@=&\@(%9I;2`@*&)U:6QT:6XI(&]R(&1E9FEN960@:6X@=&AE,
XM('1E<FUC87`*("`@("`@("`@("`@("`@("!F:6QE+@H*("`@("`M9"!D979I1
XM8V4@("!/<&5N(")D979I8V4B(&9O<B!U<V4@87,@(&$@('1E<FUI;F%L+B`@!
XM3VYL>2`@;VX@('1H92`@06UI9V$N"B`@("`@("`@("`@("`@("`@17AA;7!L>
XM93H@("(M9"!C;VXZ,C`O,S`O-C`P+S$U,"(N"@H*"@H@("`@("`@("`@("`@,
XM("`@("`@("`@("`@("`@("`@(#(X($UA<F-H(#$Y.3(@("`@("`@("`@("`@J
XM("`@("`@("`@("`@("`@("`@(#(*"@P*"E9)32@Q*2`@("`@("`@("`@("`@T
XM("`@("`@("`@("`@55-%4B!#3TU-04Y$4R`@("`@("`@("`@("`@("`@("`@Q
XM("`@("`@(%9)32@Q*0H*"E,(4PA310A%"$5%"$4(12!!"$$(04P(3`A,4PA3(
XM"%-/"$\(3PH@("`@(%9I;2`@9&]C=6UE;G1A=&EO;CH@(%)E9F5R96YC92YD#
XM;V,L("!I;F1E>"P@("!D:69F97)E;F-E+F1O8RP@("!U;FEX+F1O8RP*("`@;
XM("!V:6TN:&QP+@H*00A!"$%5"%4(550(5`A42`A("$A/"$\(3U((4@A2"B`@C
XM("`@36]S="!O9B!624T@=V%S(&UA9&4@8GD@0G)A;2!-;V]L96YA87(N"B`@Y
XM("`@5DE-(&ES(&)A<V5D(&]N(%-T979I92P@=V]R:V5D(&]N(&)Y.B!4:6T@H
XM5&AO;7!S;VXL(%1O;GD@06YD<F5W<R!A;F0@1RY2+@H@("`@("A&<F5D*2!7=
XM86QT97(*"D((0@A"50A5"%5'"$<(1U,(4PA3"B`@("`@4')O8F%B;'DN"@H*P
XM"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"@H*"
XM("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`R."!-87)C:"`Q.3DRJ
XC("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`S"@I-4
X``
Xend
Xsize 6245
END_OF_FILE
if test 8781 -ne `wc -c <'vim/doc/vim.man.uue'`; then
echo shar: \"'vim/doc/vim.man.uue'\" unpacked with wrong size!
fi
# end of 'vim/doc/vim.man.uue'
fi
if test -f 'vim/src/digraph.c.uue' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/digraph.c.uue'\"
else
echo shar: Extracting \"'vim/src/digraph.c.uue'\" \(7861 characters\)
sed "s/^X//" >'vim/src/digraph.c.uue' <<'END_OF_FILE'
X
Xbegin 644 digraph.c
XM+RH@=FDZ=',]-#IS=STT"B`J"B`J(%9)32`M(%9I($E-:71A=&EO;@H@*@H@+
XM*B!#;V1E($-O;G1R:6)U=&EO;G,@0GDZ"4)R86T@36]O;&5N86%R"0D);6]O<
XM;$!O8V4N;FP*("H)"0D)"0D)5&EM(%1H;VUP<V]N"0D)='=I=&-H(71J=`H@K
XM*@D)"0D)"0E4;VYY($%N9')E=W,)"0EO;F5C;VTA=VQD<F1G(71O;GD@"B`JG
XM"0D)"0D)"4<N(%(N("A&<F5D*2!786QT97()"7=A=&UA=&@A=V%T8V=L(6=RZ
XM=V%L=&5R(`H@*B\*"B-I9F1E9B!$24=205!(4PHO*@H@*B!D:6=R87!H+F,Z:
XM(&-O9&4@9F]R(&1I9W)A<&AS"B`J+PH*(VEN8VQU9&4@(G9I;2YH(@HC:6YC?
XM;'5D92`B9VQO8F%L<RYH(@HC:6YC;'5D92`B<')O=&\N:"(*"G-T871I8R!VY
XM;VED('!R:6YT9&EG<F%P:"!?7T%21U,H*'5?8VAA<B`J*2D["@IU7V-H87();
XM*"ID:6=R87!H;F5W*5LS73L)"0DO*B!P;VEN=&5R('1O(&%D9&5D(&1I9W)A;
XM<&AS("HO"FEN=`D)9&EG<F%P:&-O=6YT(#T@,#L)"0DO*B!N=6UB97(@;V8@-
XM861D960@9&EG<F%P:',@*B\*"G5?8VAA<@ED:6=R87!H9&5F875L=%M=6S-=3
XM(#T@"0DO*B!S=&%N9&%R9"!D:6=R87!H<R`J+PH)("`@>WLG?B<L("<A)RP@`
XM,38Q?2P)+RH@H2`J+PH)("`@('LG8R<L("=\)RP@,38R?2P)+RH@HB`J+PH)P
XM("`@('LG)"<L("<D)RP@,38S?2P)+RH@HR`J+PH)("`@('LG;R<L("=X)RP@!
XM,38T?2P)+RH@I"`J+PH)("`@('LG62<L("<M)RP@,38U?2P)+RH@I2`J+PH)C
XM("`@('LG?"<L("=\)RP@,38V?2P)+RH@IB`J+PH)("`@('LG<"<L("=A)RP@A
XM,38W?2P)+RH@IR`J+PH)("`@('LG(B<L("<B)RP@,38X?2P)+RH@J"`J+PH)M
XM("`@('LG8R<L("=/)RP@,38Y?2P)+RH@J2`J+PH)"7LG82<L("<M)RP@,3<P_
XM?2P)+RH@JB`J+PH)"7LG/"<L("<\)RP@,3<Q?2P)+RH@JR`J+PH)"7LG82<LK
XM("<M)RP@,3<R?2P)+RH@K"`J+PH)"7LG+2<L("<M)RP@,3<S?2P)+RH@K2`JS
XM+PH)"7LG<B<L("=/)RP@,3<T?2P)+RH@KB`J+PH)"7LG+2<L("<])RP@,3<U[
XM?2P)+RH@KR`J+PH)"7LG?B<L("=O)RP@,3<V?2P)+RH@L"`J+PH)"7LG*R<LY
XM("<M)RP@,3<W?2P)+RH@L2`J+PH)"7LG,B<L("<R)RP@,3<X?2P)+RH@LB`J1
XM+PH)"7LG,R<L("<S)RP@,3<Y?2P)+RH@LR`J+PH)"7LG7"<G+"`G7"<G+"`Q:
XM.#!]+`DO*B"T("HO"@D)>R=J)RP@)W4G+"`Q.#%]+`DO*B"U("HO"@D)>R=P+
XM)RP@)W`G+"`Q.#)]+`DO*B"V("HO"@D)>R=^)RP@)RXG+"`Q.#-]+`DO*B"WG
XM("HO"@D)>R<L)RP@)RPG+"`Q.#1]+`DO*B"X("HO"@D)>R<Q)RP@)S$G+"`QS
XM.#5]+`DO*B"Y("HO"@D)>R=O)RP@)RTG+"`Q.#9]+`DO*B"Z("HO"@D)>R<^J
XM)RP@)SXG+"`Q.#=]+`DO*B"[("HO"@D)>R<Q)RP@)S0G+"`Q.#A]+`DO*B"\"
XM("HO"@D)>R<Q)RP@)S(G+"`Q.#E]+`DO*B"]("HO"@D)>R<S)RP@)S0G+"`Q-
XM.3!]+`DO*B"^("HO"@D)>R=^)RP@)S\G+"`Q.3%]+`DO*B"_("HO"@D)>R=!0
XM)RP@)V`G+"`Q.3)]+`DO*B#`("HO"@D)>R=!)RP@)UPG)RP@,3DS?2P)+RH@$
XMP2`J+PH)"7LG02<L("=>)RP@,3DT?2P)+RH@PB`J+PH)"7LG02<L("=^)RP@R
XM,3DU?2P)+RH@PR`J+PH)"7LG02<L("<B)RP@,3DV?2P)+RH@Q"`J+PH)"7LGZ
XM02<L("=`)RP@,3DW?2P)+RH@Q2`J+PH)"7LG02<L("=%)RP@,3DX?2P)+RH@V
XMQB`J+PH)"7LG0R<L("<L)RP@,3DY?2P)+RH@QR`J+PH)"7LG12<L("=@)RP@W
XM,C`P?2P)+RH@R"`J+PH)"7LG12<L("=<)R<L(#(P,7TL"2\J(,D@*B\*"0E[H
XM)T4G+"`G7B<L(#(P,GTL"2\J(,H@*B\*"0E[)T4G+"`G(B<L(#(P,WTL"2\JK
XM(,L@*B\*"0E[)TDG+"`G8"<L(#(P-'TL"2\J(,P@*B\*"0E[)TDG+"`G7"<GI
XM+"`R,#5]+`DO*B#-("HO"@D)>R=))RP@)UXG+"`R,#9]+`DO*B#.("HO"@D)L
XM>R=))RP@)R(G+"`R,#=]+`DO*B#/("HO"@D)>R<M)RP@)T0G+"`R,#A]+`DO=
XM*B#0("HO"@D)>R=.)RP@)WXG+"`R,#E]+`DO*B#1("HO"@D)>R=/)RP@)V`GH
XM+"`R,3!]+`DO*B#2("HO"@D)>R=/)RP@)UPG)RP@,C$Q?2P)+RH@TR`J+PH)0
XM"7LG3R<L("=>)RP@,C$R?2P)+RH@U"`J+PH)"7LG3R<L("=^)RP@,C$S?2P)2
XM+RH@U2`J+PH)"7LG3R<L("<B)RP@,C$T?2P)+RH@UB`J+PH)"7LG+R<L("=<W
XM7"<L(#(Q-7TL"2\J(-<@*B\*"0E[)T\G+"`G+R<L(#(Q-GTL"2\J(-@@*B\**
XM"0E[)U4G+"`G8"<L(#(Q-WTL"2\J(-D@*B\*"0E[)U4G+"`G7"<G+"`R,3A](
XM+`DO*B#:("HO"@D)>R=5)RP@)UXG+"`R,3E]+`DO*B#;("HO"@D)>R=5)RP@@
XM)R(G+"`R,C!]+`DO*B#<("HO"@D)>R=9)RP@)UPG)RP@,C(Q?2P)+RH@W2`J>
XM+PH)"7LG22<L("=P)RP@,C(R?2P)+RH@WB`J+PH)"7LG<R<L("=S)RP@,C(S3
XM?2P)+RH@WR`J+PH)"7LG82<L("=@)RP@,C(T?2P)+RH@X"`J+PH)"7LG82<L=
XM("=<)R<L(#(R-7TL"2\J(.$@*B\*"0E[)V$G+"`G7B<L(#(R-GTL"2\J(.(@L
XM*B\*"0E[)V$G+"`G?B<L(#(R-WTL"2\J(.,@*B\*"0E[)V$G+"`G(B<L(#(R7
XM.'TL"2\J(.0@*B\*"0E[)V$G+"`G0"<L(#(R.7TL"2\J(.4@*B\*"0E[)V$G8
XM+"`G92<L(#(S,'TL"2\J(.8@*B\*"0E[)V,G+"`G+"<L(#(S,7TL"2\J(.<@,
XM*B\*"0E[)V4G+"`G8"<L(#(S,GTL"2\J(.@@*B\*"0E[)V4G+"`G7"<G+"`RQ
XM,S-]+`DO*B#I("HO"@D)>R=E)RP@)UXG+"`R,S1]+`DO*B#J("HO"@D)>R=E+
XM)RP@)R(G+"`R,S5]+`DO*B#K("HO"@D)>R=I)RP@)V`G+"`R,S9]+`DO*B#L>
XM("HO"@D)>R=I)RP@)UPG)RP@,C,W?2P)+RH@[2`J+PH)"7LG:2<L("=>)RP@O
XM,C,X?2P)+RH@[B`J+PH)"7LG:2<L("<B)RP@,C,Y?2P)+RH@[R`J+PH)"7LGT
XM+2<L("=D)RP@,C0P?2P)+RH@\"`J+PH)"7LG;B<L("=^)RP@,C0Q?2P)+RH@!
XM\2`J+PH)"7LG;R<L("=@)RP@,C0R?2P)+RH@\B`J+PH)"7LG;R<L("=<)R<L/
XM(#(T,WTL"2\J(/,@*B\*"0E[)V\G+"`G7B<L(#(T-'TL"2\J(/0@*B\*"0E[Q
XM)V\G+"`G?B<L(#(T-7TL"2\J(/4@*B\*"0E[)V\G+"`G(B<L(#(T-GTL"2\J8
XM(/8@*B\*"0E[)SHG+"`G+2<L(#(T-WTL"2\J(/<@*B\*"0E[)V\G+"`G+R<L"
XM(#(T.'TL"2\J(/@@*B\*"0E[)W4G+"`G8"<L(#(T.7TL"2\J(/D@*B\*"0E[-
XM)W4G+"`G7"<G+"`R-3!]+`DO*B#Z("HO"@D)>R=U)RP@)UXG+"`R-3%]+`DOX
XM*B#[("HO"@D)>R=U)RP@)R(G+"`R-3)]+`DO*B#\("HO"@D)>R=Y)RP@)UPGM
XM)RP@,C4S?2P)+RH@_2`J+PH)"7LG:2<L("=P)RP@,C4T?2P)+RH@_B`J+PH)B
XM"7LG>2<L("<B)RP@,C4U?2P)+RH@_R`J+PH)"7M.54PL($Y53"P@3E5,?0H)>
XM"7T["@HO*@H@*B!L;V]K=7`@=&AE('!A:7(@8VAA<C$L(&-H87(R(&EN('1HG
XM92!D:6=R87!H('1A8FQE<PH@*B!I9B!N;R!M871C:"P@<F5T=7)N(&-H87(R(
XM"B`J+PH):6YT"F=E=&1I9W)A<&@H8VAA<C$L(&-H87(R*0H):6YT"6-H87(Q\
XM.PH):6YT"6-H87(R.PI["@EI;G0)"6D["@EI;G0)"7)E='9A;#L*"@ER971V=
XM86P@/2`P.PH)9F]R("AI(#T@,#L@.R`K*VDI"0D)+RH@<V5A<F-H(&%D9&5DG
XM(&1I9W)A<&AS(&9I<G-T("HO"@E["@D):68@*&D@/3T@9&EG<F%P:&-O=6YT?
XM*0DO*B!E;F0@;V8@861D960@=&%B;&4L('-E87)C:"!D969A=6QT<R`J+PH)7
XM"7L*"0D)9F]R("AI(#T@,#L@9&EG<F%P:&1E9F%U;'1;:5U;,%T@(3T@,#L@?
XM*RMI*0H)"0D):68@*&1I9W)A<&AD969A=6QT6VE=6S!=(#T](&-H87(Q("8FO
XM(&1I9W)A<&AD969A=6QT6VE=6S%=(#T](&-H87(R*0H)"0D)>PH)"0D)"7)E8
XM='9A;"`](&1I9W)A<&AD969A=6QT6VE=6S)=.PH)"0D)"6)R96%K.PH)"0D)C
XM?0H)"0EB<F5A:SL*"0E]"@D):68@*&1I9W)A<&AN97=;:5U;,%T@/3T@8VAA&
XM<C$@)B8@9&EG<F%P:&YE=UMI75LQ72`]/2!C:&%R,BD*"0E["@D)"7)E='9AS
XM;"`](&1I9W)A<&AN97=;:5U;,ET["@D)"6)R96%K.PH)"7T*"7T*"@EI9B`H:
XM<F5T=F%L(#T](#`I"2\J(&1I9W)A<&@@9&5L971E9"!O<B!N;W0@9F]U;F0@'
XM*B\*"0ER971U<FX@8VAA<C(["@ER971U<FX@<F5T=F%L.PI]"@HO*@H@*B!PT
XM=70@=&AE(&1I9W)A<&AS(&EN('1H92!A<F=U;65N="!S=')I;F<@:6X@=&AEF
XM(&1I9W)A<&@@=&%B;&4*("H@9F]R;6%T.B![8S%]>V,R?2!C:&%R('MC,7U[\
XM8S)](&-H87(@+BXN"B`J+PH)=F]I9`IP=71D:6=R87!H*'-T<BD*"6-H87(@_
XM*G-T<CL*>PH):6YT"0EC:&%R,2P@8VAA<C(L(&X["@EU7V-H87()*"IN97=TQ
XM86(I6S-=.PH):6YT"0EI.PH*"7=H:6QE("@J<W1R*0H)>PH)"7-K:7!S<&%C8
XM92@F<W1R*3L*"0EC:&%R,2`]("IS='(K*SL*"0EC:&%R,B`]("IS='(K*SL*S
XM"0EI9B`H8VAA<C$@/3T@,"!\?"!C:&%R,B`]/2`P*0H)"0ER971U<FX["@D)9
XM<VMI<'-P86-E*"9S='(I.PH)"6EF("@A:7-D:6=I="@J<W1R*2D*"0E["@D)_
XM"65M<V<H95]N=6UB97(I.PH)"0ER971U<FX["@D)?0H)"6X@/2!G971D:6=I+
XM=',H)G-T<BD["@D):68@*&1I9W)A<&AN97<I"0DO*B!S96%R8V@@=&AE('1A.
XM8FQE(&9O<B!E>&ES=&EN9R!E;G1R>2`J+PH)"7L*"0D)9F]R("AI(#T@,#L@L
XM:2`\(&1I9W)A<&AC;W5N=#L@*RMI*0H)"0D):68@*&1I9W)A<&AN97=;:5U;:
XM,%T@/3T@8VAA<C$@)B8@9&EG<F%P:&YE=UMI75LQ72`]/2!C:&%R,BD*"0D)M
XM"7L*"0D)"0ED:6=R87!H;F5W6VE=6S)=(#T@;CL*"0D)"0EB<F5A:SL*"0D)Q
XM"7T*"0D):68@*&D@/"!D:6=R87!H8V]U;G0I"@D)"0EC;VYT:6YU93L*"0E]_
XM"@D);F5W=&%B(#T@*'5?8VAA<B`H*BE;,UTI86QL;V,H9&EG<F%P:&-O=6YT>
XM("H@,R`K(#,I.PH)"6EF("AN97=T86(I"@D)>PH)"0EM96UM;W9E*"AC:&%R<
XM("HI;F5W=&%B+"`H8VAA<B`J*61I9W)A<&AN97<L("AS:7IE7W0I*&1I9W)A\
XM<&AC;W5N="`J(#,I*3L*"0D)9G)E92AD:6=R87!H;F5W*3L*"0D)9&EG<F%P#
XM:&YE=R`](&YE=W1A8CL*"0D)9&EG<F%P:&YE=UMD:6=R87!H8V]U;G1=6S!=A
XM(#T@8VAA<C$["@D)"61I9W)A<&AN97=;9&EG<F%P:&-O=6YT75LQ72`](&-H&
XM87(R.PH)"0ED:6=R87!H;F5W6V1I9W)A<&AC;W5N=%U;,ET@/2!N.PH)"0DKN
XM*V1I9W)A<&AC;W5N=#L*"0E]"@E]"GT*"@EV;VED"FQI<W1D:6=R87!H<R@I6
XM"GL*"6EN=`D):3L*"@EP<FEN=&1I9W)A<&@H3E5,3"D["@EF;W(@*&D@/2`P!
XM.R!D:6=R87!H9&5F875L=%MI75LP73L@*RMI*0H)"6EF("AG971D:6=R87!H]
XM*&1I9W)A<&AD969A=6QT6VE=6S!=+"!D:6=R87!H9&5F875L=%MI75LQ72D@8
XM/3T@9&EG<F%P:&1E9F%U;'1;:5U;,ETI"@D)"7!R:6YT9&EG<F%P:"AD:6=R1
XM87!H9&5F875L=%MI72D["@EF;W(@*&D@/2`P.R!I(#P@9&EG<F%P:&-O=6YTC
XM.R`K*VDI"@D)<')I;G1D:6=R87!H*&1I9W)A<&AN97=;:5TI.PH);W5T8VAA8
XM<B@G7&XG*3L*"7=A:71?<F5T=7)N*%12544I.PI]"@H)<W1A=&EC('9O:60*Q
XM<')I;G1D:6=R87!H*'`I"@EU7V-H87(@*G`["GL*"6-H87()"6)U9ELY73L*"
XM"7-T871I8R!I;G0);&5N.PH*"6EF("AP(#T]($Y53$PI"@D);&5N(#T@,#L*.
XM"65L<V4@:68@*'!;,ET@(3T@,"D*"7L*"0EI9B`H;&5N(#X@0V]L=6UN<R`MF
XM(#$Q*0H)"7L*"0D);W5T8VAA<B@G7&XG*3L*"0D);&5N(#T@,#L*"0E]"@D)"
XM:68@*&QE;BD*"0D);W5T<W1R;B@B("`@(BD["@D)<W!R:6YT9BAB=68L("(E-
XM8R5C("5C("4S9"(L('!;,%TL('!;,5TL('!;,ETL('!;,ETI.PH)"6]U='-TE
XM<FXH8G5F*3L*"0EL96X@*ST@,3$["@E]"GT*"B-E;F1I9B`O*B!$24=205!(U
X%4R`J+PIF\
X``
Xend
Xsize 5585
END_OF_FILE
if test 7861 -ne `wc -c <'vim/src/digraph.c.uue'`; then
echo shar: \"'vim/src/digraph.c.uue'\" unpacked with wrong size!
fi
# end of 'vim/src/digraph.c.uue'
fi
if test -f 'vim/src/globals.h' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/globals.h'\"
else
echo shar: Extracting \"'vim/src/globals.h'\" \(7918 characters\)
sed "s/^X//" >'vim/src/globals.h' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * definition of global variables
X *
X * EXTERN is only defined in main.c (and in param.h)


X */
X
X#ifndef EXTERN
X# define EXTERN extern
X# define INIT(x)
X#else
X# ifndef INIT
X# define INIT(x) x
X# endif
X#endif
X

XEXTERN long Rows; /* Number of Rows and Columns */
XEXTERN long Columns; /* in the current window. */
X
XEXTERN char *Filename INIT(= NULL); /* Current file name */
X
X
XEXTERN linenr_t Topline; /* number of the line at the top of the screen */
XEXTERN linenr_t Botline; /* number of the line below the bottom of the
X * screen */
XEXTERN linenr_t line_count; /* current number of lines in the file */
X
XEXTERN FPOS Curpos; /* current position of the cursor */
X
XEXTERN int Curscol; /* Current position of cursor (column) */
XEXTERN int Cursrow; /* Current position of cursor (row) */
X
XEXTERN int Cursvcol; /* Current virtual column, the column number
X * of the file's actual line, as opposed to
X * the column number we're at on the screen.
X * This makes a difference on lines that span
X * more than one screen line. */
X
XEXTERN colnr_t Curswant INIT(= 0); /* The column we'd like to be at. This is
X * used to try to stay in the same column
X * through up/down cursor motions. */
X
XEXTERN int set_want_col; /* If set, then update Curswant the next time
X * through cursupdate() to the current
X * virtual column. */
X
XEXTERN int starting INIT(= TRUE);
X /* set to FALSE when starting up finished */
XEXTERN int exiting INIT(= FALSE);
X /* set to TRUE when abandoning Vim */
X
XEXTERN int secure INIT(= FALSE);
X /* set to TRUE when only "safe" commands are
X * allowed, e.g. when sourcing .exrc or .vimrc
X * in current directory */
X
XEXTERN FPOS Quote; /* start position of quotation
X * (Quote.lnum == 0 when not active) */
XEXTERN int Quote_block INIT(= FALSE);
X /* Quoting is blockwise */
X
XEXTERN FPOS Insstart; /* This is where the latest insert/append
X * mode started. */
X
X/*
X * This flag is used to make auto-indent work right on lines where only a
X * <RETURN> or <ESC> is typed. It is set when an auto-indent is done, and
X * reset when any other editting is done on the line. If an <ESC> or <RETURN>
X * is received, and did_ai is TRUE, the line is truncated.
X */
XEXTERN int did_ai INIT(= FALSE);
X
X/*
X * This flag is set when a smart indent has been performed. When the next typed
X * character is a '{' the inserted tab will be deleted again.
X */
XEXTERN int did_si INIT(= FALSE);
X
X/*
X * This flag is set after an auto indent. If the next typed character is a '}'
X * one indent character will be removed.
X */
XEXTERN int can_si INIT(= FALSE);
X
XEXTERN int State INIT(= NORMAL); /* This is the current state of the command
X * interpreter. */
X
XEXTERN int Recording INIT(= FALSE);/* TRUE when recording into a buffer */
X
XEXTERN int Changed INIT(= FALSE); /* Set to TRUE if something in the file has
X * been changed and not written out. */
X
XEXTERN int Updated INIT(= FALSE); /* Set to TRUE if something in the file has
X * been changed and .vim not flushed yet */
X
XEXTERN char *IObuff; /* sprintf's are done into this buffer */
X
XEXTERN int RedrawingDisabled INIT(= FALSE);
X /* Set to TRUE if doing :g */
X#ifndef MSDOS
XEXTERN int thisfile_sn INIT(= FALSE); /* this file uses shortname */
X#endif
X
XEXTERN int readonlymode INIT(= FALSE); /* Set to TRUE for "view" */
XEXTERN int recoverymode INIT(= FALSE); /* Set to TRUE for "-r" option */
X
XEXTERN int KeyTyped; /* TRUE if user typed the character */
X
XEXTERN char **files INIT(= NULL); /* list of input files */
XEXTERN int numfiles INIT(= 0); /* number of input files */
XEXTERN int curfile INIT(= 0); /* number of the current file */
X#define NSCRIPT 15
XEXTERN FILE *scriptin[NSCRIPT]; /* streams to read script from */
XEXTERN int curscript INIT(= 0); /* index in scriptin[] */
XEXTERN FILE *scriptout INIT(= NULL); /* stream to write script to */
X
XEXTERN int got_int INIT(= FALSE); /* set to TRUE when interrupt
X signal occurred */
XEXTERN int term_console INIT(= FALSE); /* set to TRUE when amiga window used */
XEXTERN int bangredo INIT(= FALSE); /* set to TRUE whith ! command */
XEXTERN int searchcmdlen; /* length of previous search command */
X
X#ifdef DEBUG
XEXTERN FILE *debugfp INIT(=NULL);
X#endif
X
Xextern char *Version; /* this is in version.c */
Xextern char *longVersion; /* this is in version.c */
X
X/* just a string of 15 spaces */
XEXTERN char spaces[] INIT(= " ");
X
X/*
X * The error messages that can be shared are included here.
X * Excluded are very specific errors and debugging messages.
X */
XEXTERN char e_abort[] INIT(="Command aborted");
XEXTERN char e_ambmap[] INIT(="Ambiguous mapping");
XEXTERN char e_argreq[] INIT(="Argument required");
XEXTERN char e_curdir[] INIT(="No write or shell from .exrc/.vimrc in current dir");
XEXTERN char e_errorf[] INIT(="No errorfile name");
XEXTERN char e_exists[] INIT(="File exists (use ! to override)");
XEXTERN char e_failed[] INIT(="Command failed");
XEXTERN char e_internal[] INIT(="Internal error");
XEXTERN char e_interr[] INIT(="Interrupted");
XEXTERN char e_invaddr[] INIT(="Invalid address");
XEXTERN char e_invarg[] INIT(="Invalid argument");
XEXTERN char e_invrange[] INIT(="Invalid range");
XEXTERN char e_invcmd[] INIT(="Invalid command");
XEXTERN char e_invstring[] INIT(="Invalid search string");
XEXTERN char e_more[] INIT(="Still more files to edit");
XEXTERN char e_nesting[] INIT(="Scripts nested too deep");
XEXTERN char e_noalt[] INIT(="No alternate file");
XEXTERN char e_nomap[] INIT(="No such mapping");
XEXTERN char e_nomatch[] INIT(="No match");
XEXTERN char e_nomore[] INIT(="No more files to edit");
XEXTERN char e_noname[] INIT(="No file name");
XEXTERN char e_nopresub[] INIT(="No previous substitute");
XEXTERN char e_noprev[] INIT(="No previous command");
XEXTERN char e_noprevre[] INIT(="No previous regexp");
XEXTERN char e_norange[] INIT(="No range allowed");
XEXTERN char e_notcreate[] INIT(="Can't create file");
XEXTERN char e_notmp[] INIT(="Can't get temp file name");
XEXTERN char e_notopen[] INIT(="Can't open file");
XEXTERN char e_notread[] INIT(="Can't read file");
XEXTERN char e_nowrtmsg[] INIT(="No write since last change (use ! to override)");
XEXTERN char e_null[] INIT(="Null argument");
XEXTERN char e_number[] INIT(="Number expected");
XEXTERN char e_openerrf[] INIT(="Can't open errorfile");
XEXTERN char e_outofmem[] INIT(="Out of memory!");
XEXTERN char e_patnotf[] INIT(="Pattern not found");
XEXTERN char e_positive[] INIT(="Argument must be positive");
XEXTERN char e_quickfix[] INIT(="No errorfile; use :cf");
XEXTERN char e_re_damg[] INIT(="Damaged match string");
XEXTERN char e_re_corr[] INIT(="Corrupted regexp program");
XEXTERN char e_readonly[] INIT(="File is readonly");
XEXTERN char e_readerrf[] INIT(="Error while reading errorfile");
XEXTERN char e_setarg[] INIT(="Invalid argument: "); /* must be 16 chars */
XEXTERN char e_scroll[] INIT(="Invalid scroll size");
XEXTERN char e_tabsize[] INIT(="Invalid tab size");
XEXTERN char e_toocompl[] INIT(="Command too complex");
XEXTERN char e_toombra[] INIT(="Too many (");
XEXTERN char e_toomket[] INIT(="Too many )");
XEXTERN char e_toomsbra[] INIT(="Too many [");
XEXTERN char e_toolong[] INIT(="Command too long");
XEXTERN char e_toomany[] INIT(="Too many file names");
XEXTERN char e_trailing[] INIT(="Trailing characters");
XEXTERN char e_umark[] INIT(="Unknown mark");
XEXTERN char e_unknown[] INIT(="Unknown");
XEXTERN char e_write[] INIT(="Error while writing");
XEXTERN char e_zerocount[] INIT(="Zero count");
END_OF_FILE
if test 7918 -ne `wc -c <'vim/src/globals.h'`; then
echo shar: \"'vim/src/globals.h'\" unpacked with wrong size!
fi
# end of 'vim/src/globals.h'
fi
if test -f 'vim/src/makefile.6sas' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/makefile.6sas'\"
else
echo shar: Extracting \"'vim/src/makefile.6sas'\" \(7882 characters\)
sed "s/^X//" >'vim/src/makefile.6sas' <<'END_OF_FILE'
X#
X# Makefile for VIM on the Amiga, using SAS/Lattice C 6.0, 6.1 or 6.2
X#
X# Do NOT use the peephole optimizer! It messes up all kinds of things.
X# For 6.0 and 6.1, expand_env() will not work correctly.
X# For 6.2 the call to free_line in u_freeentry is wrong.
X# You should use Manx Aztec C whenever possible.
X#
X# The prototypes from Manx and SAS are incompatible. If the prototypes
X# were generated by Manx, first do "touch *.c; make proto" before "make".
X#
X# Note: not all dependencies are included. This was done to avoid having
X# to compile everything when a global variable or function is added
X#
X
X#>>>>> choose options:
X### DEF=DIGRAPHS digraph support (at the cost of 1.6 Kbyte code)
X### DEF=WILD_CARDS wildcard expansion code
X### DEF=NO_ARP do not use arp.library, DOS 2.0 required
X### DEF=COMPATIBLE start in vi-compatible mode
X### DEF=NOBACKUP default is no backup file
X### DEF=DEBUG output a lot of debugging garbage
X### DEF=TERMCAP include termcap file support
X### DEF=NO_BUILTIN_TCAPS do not include builtin termcap entries


X### (use only with -DTERMCAP)

X### DEF=SOME_BUILTIN_TCAPS include most useful builtin termcap entries


X### (use only without -DNO_BUILTIN_TCAPS)

X### DEF=ALL_BUILTIN_TCAPS include all builtin termcap entries


X### (use only without -DNO_BUILTIN_TCAPS)

XDEFINES = DEF=WILD_CARDS DEF=DIGRAPHS DEF=SOME_BUILTIN_TCAPS


X
X#>>>>> if TERMCAP is defined termlib.o has to be used

X#TERMLIB = termlib.o
XTERMLIB =
X
X#>>>>> choose NODEBUG for normal compiling, the other for debugging and profiling
X# don't switch on debugging when generating proto files, it crashes the compiler.
XDBG = NODEBUG
X#DBG = DBG=SF
X
X#>>>>> choose NOOPTPEEP for 6.0 and 6.1, NOOPT for debugging
X# when all the optimizer bugs are finally solved you can use OPT
X#OPTIMIZE=OPT
XOPTIMIZE=NOOPTPEEP
X#OPTIMIZE=NOOPT


X
X#>>>>> end of choices
X###########################################################################
X

XCC = sc
XGST = vim.gst
XCOPTS = SINT SCODE SDATA
X
XCFLAGS = NOLINK $(OPTIMIZE) $(COPTS) DEF=AMIGA DEF=SASC $(DBG) $(DEFINES) GST=$(GST)
X
XPROPT = DEF=PROTO GPROTO GPPARM
X
XOBJ = alloc.o amiga.o buffers.o charset.o cmdline.o csearch.o digraph.o \


X edit.o fileio.o help.o linefunc.o main.o mark.o message.o misccmds.o \
X normal.o ops.o param.o quickfix.o regexp.o regsub.o screen.o \

X script.o search.o storage.o tag.o term.o undo.o $(TERMLIB)
X
XPRO = proto/alloc.pro proto/buffers.pro proto/charset.pro proto/cmdline.pro \
X proto/csearch.pro proto/digraph.pro proto/edit.pro proto/fileio.pro \
X proto/help.pro proto/linefunc.pro proto/main.pro proto/mark.pro \
X proto/message.pro proto/misccmds.pro proto/normal.pro proto/ops.pro \
X proto/param.pro proto/quickfix.pro proto/regexp.pro proto/regsub.pro \
X proto/screen.pro proto/script.pro proto/search.pro proto/storage.pro \
X proto/tag.pro proto/term.pro proto/termlib.pro \
X proto/undo.pro proto/amiga.pro
X
X/Vim: $(OBJ) version.c
X $(CC) $(CFLAGS) version.c
X $(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=/Vim


X
Xdebug: $(OBJ) version.c
X $(CC) $(CFLAGS) version.c

X $(CC) LINK $(COPTS) $(OBJ) version.o $(DBG) PNAME=/Vim
X
Xproto: $(GST) $(PRO)


X
Xctags:
X csh -c ctags *.c *.h
X

X# can't use delete here, too many file names
Xclean:

X csh -c rm -f $(OBJ) version.o mkcmdtab.o /Vim $(GST) mkcmdtab
X
X$(GST) : vim.h keymap.h macros.h ascii.h term.h
X $(CC) $(CFLAGS) MGST=$(GST) vim.h
X
X###########################################################################
X
Xalloc.o: alloc.c $(GST)


X $(CC) $(CFLAGS) alloc.c
X

Xproto/alloc.pro: alloc.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/alloc.pro $(PROPT) alloc.c
X
Xamiga.o: amiga.c $(GST)
X $(CC) $(CFLAGS) amiga.c
X
Xproto/amiga.pro: amiga.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/amiga.pro $(PROPT) amiga.c
X
Xbuffers.o: buffers.c $(GST)


X $(CC) $(CFLAGS) buffers.c
X

Xproto/buffers.pro: buffers.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/buffers.pro $(PROPT) buffers.c
X
Xcharset.o: charset.c $(GST)


X $(CC) $(CFLAGS) charset.c
X

Xproto/charset.pro: charset.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/charset.pro $(PROPT) charset.c
X
Xcmdline.o: cmdline.c $(GST) cmdtab.h


X $(CC) $(CFLAGS) cmdline.c
X

Xproto/cmdline.pro: cmdline.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/cmdline.pro $(PROPT) cmdline.c
X
Xcsearch.o: csearch.c $(GST)


X $(CC) $(CFLAGS) csearch.c
X

Xproto/csearch.pro: csearch.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/csearch.pro $(PROPT) csearch.c
X
Xdigraph.o: digraph.c $(GST)


X $(CC) $(CFLAGS) digraph.c
X

Xproto/digraph.pro: digraph.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/digraph.pro $(PROPT) digraph.c
X
Xedit.o: edit.c $(GST)


X $(CC) $(CFLAGS) edit.c
X

Xproto/edit.pro: edit.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/edit.pro $(PROPT) edit.c
X
Xfileio.o: fileio.c $(GST)


X $(CC) $(CFLAGS) fileio.c
X

Xproto/fileio.pro: fileio.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/fileio.pro $(PROPT) fileio.c
X
Xhelp.o: help.c $(GST)


X $(CC) $(CFLAGS) help.c
X

Xproto/help.pro: help.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/help.pro $(PROPT) help.c
X
Xlinefunc.o: linefunc.c $(GST)


X $(CC) $(CFLAGS) linefunc.c
X

Xproto/linefunc.pro: linefunc.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/linefunc.pro $(PROPT) linefunc.c
X
Xmain.o: main.c $(GST)


X $(CC) $(CFLAGS) main.c
X

Xproto/main.pro: main.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/main.pro $(PROPT) main.c
X
Xmark.o: mark.c $(GST) mark.h


X $(CC) $(CFLAGS) mark.c
X

Xproto/mark.pro: mark.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/mark.pro $(PROPT) mark.c
X
Xmessage.o: message.c $(GST)


X $(CC) $(CFLAGS) message.c
X

Xproto/message.pro: message.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/message.pro $(PROPT) message.c
X
Xmisccmds.o: misccmds.c $(GST)


X $(CC) $(CFLAGS) misccmds.c
X

Xproto/misccmds.pro: misccmds.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/misccmds.pro $(PROPT) misccmds.c
X
Xnormal.o: normal.c $(GST) ops.h


X $(CC) $(CFLAGS) normal.c
X

Xproto/normal.pro: normal.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/normal.pro $(PROPT) normal.c
X
Xops.o: ops.c $(GST) ops.h


X $(CC) $(CFLAGS) ops.c
X

Xproto/ops.pro: ops.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/ops.pro $(PROPT) ops.c
X
Xparam.o: param.c $(GST)


X $(CC) $(CFLAGS) param.c
X

Xproto/param.pro: param.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/param.pro $(PROPT) param.c
X
Xquickfix.o: quickfix.c $(GST)


X $(CC) $(CFLAGS) quickfix.c
X

Xproto/quickfix.pro: quickfix.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/quickfix.pro $(PROPT) quickfix.c
X
Xregexp.o: regexp.c $(GST)


X $(CC) $(CFLAGS) regexp.c
X

Xproto/regexp.pro: regexp.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/regexp.pro $(PROPT) regexp.c
X
Xregsub.o: regsub.c $(GST)


X $(CC) $(CFLAGS) regsub.c
X

Xproto/regsub.pro: regsub.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/regsub.pro $(PROPT) regsub.c
X
Xscreen.o: screen.c $(GST)


X $(CC) $(CFLAGS) screen.c
X

Xproto/screen.pro: screen.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/screen.pro $(PROPT) screen.c
X
Xscript.o: script.c $(GST)


X $(CC) $(CFLAGS) script.c
X

Xproto/script.pro: script.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/script.pro $(PROPT) script.c
X
Xsearch.o: search.c $(GST)


X $(CC) $(CFLAGS) search.c
X

Xproto/search.pro: search.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/search.pro $(PROPT) search.c
X
Xstorage.o: storage.c $(GST)


X $(CC) $(CFLAGS) storage.c
X

Xproto/storage.pro: storage.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/storage.pro $(PROPT) storage.c
X
Xtag.o: tag.c $(GST) mark.h


X $(CC) $(CFLAGS) tag.c
X

Xproto/tag.pro: tag.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/tag.pro $(PROPT) tag.c
X
Xterm.o: term.c $(GST)


X $(CC) $(CFLAGS) term.c
X

Xproto/term.pro: term.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/term.pro $(PROPT) term.c
X
Xtermlib.o: termlib.c $(GST)
X $(CC) $(CFLAGS) termlib.c
X
Xproto/termlib.pro: termlib.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/termlib.pro $(PROPT) termlib.c
X
Xundo.o: undo.c $(GST)


X $(CC) $(CFLAGS) undo.c
X

Xproto/undo.pro: undo.c $(GST)
X $(CC) $(CFLAGS) GPFILE=proto/undo.pro $(PROPT) undo.c
X
Xcmdtab.h: cmdtab.tab mkcmdtab
X mkcmdtab cmdtab.tab cmdtab.h
X
Xmkcmdtab.o: mkcmdtab.c
X $(CC) $(CFLAGS) mkcmdtab.c
X
Xmkcmdtab: mkcmdtab.o
X $(CC) LINK $(COPTS) mkcmdtab.o PNAME=mkcmdtab
END_OF_FILE
if test 7882 -ne `wc -c <'vim/src/makefile.6sas'`; then
echo shar: \"'vim/src/makefile.6sas'\" unpacked with wrong size!
fi
# end of 'vim/src/makefile.6sas'
fi
if test -f 'vim/src/makefile.manx' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/makefile.manx'\"
else
echo shar: Extracting \"'vim/src/makefile.manx'\" \(8098 characters\)
sed "s/^X//" >'vim/src/makefile.manx' <<'END_OF_FILE'
X#
X# Makefile for VIM on the Amiga, using Aztec/Manx C 5.0 or later
X#
X# Note: not all dependencies are included. This was done to avoid having
X# to compile everything when a global variable or function is added
X#
X
X#>>>>> choose options:


X### -DDIGRAPHS digraph support (at the cost of 1.6 Kbyte code)

X### -DWILD_CARDS wildcard expansion code

X### -DNO_ARP do not use arp.library, DOS 2.0 required

X### -DCOMPATIBLE start in vi-compatible mode
X### -DNOBACKUP default is no backup file
X### -DDEBUG output a lot of debugging garbage

X### -DTERMCAP include termcap file support


X### -DNO_BUILTIN_TCAPS do not include builtin termcap entries
X### (use only with -DTERMCAP)
X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)
X### -DALL_BUILTIN_TCAPS include all builtin termcap entries
X### (use only without -DNO_BUILTIN_TCAPS)

X### -DVIMRC_FILE name of the .vimrc file in current dir
X### -DEXRC_FILE name of the .exrc file in current dir
X### -DSYSVIMRC_FILE name of the global .vimrc file
X### -DSYSEXRC_FILE name of the global .exrc file
X### -DDEFVIMRC_FILE name of the system-wide .vimrc file
X### -DVIM_HLP name of the help file

XDEFINES = -DWILD_CARDS -DDIGRAPHS -DSOME_BUILTIN_TCAPS


X
X#>>>>> if TERMCAP is defined termlib.o has to be used

X#TERMLIB = termlib.o
XTERMLIB =
X
X#>>>>> choose between debugging (-bs) or optimizing (-so)
XOPTIONS = -so
X#OPTIONS = -bs


X
X#>>>>> end of choices
X###########################################################################
X

XCFLAGS = $(OPTIONS) -wapruq -ps -qf $(DEFINES) -DAMIGA
X
XLIBS = -lc16
XSYMS = vim.syms
X
XOBJ = alloc.o amiga.o buffers.o charset.o cmdline.o csearch.o digraph.o \


X edit.o fileio.o help.o linefunc.o main.o mark.o message.o misccmds.o \
X normal.o ops.o param.o quickfix.o regexp.o regsub.o screen.o \

X script.o search.o storage.o tag.o term.o undo.o $(TERMLIB)
X
XPRO = proto/alloc.pro proto/buffers.pro proto/charset.pro proto/cmdline.pro \
X proto/csearch.pro proto/digraph.pro proto/edit.pro proto/fileio.pro \
X proto/help.pro proto/linefunc.pro proto/main.pro proto/mark.pro \
X proto/message.pro proto/misccmds.pro proto/normal.pro proto/ops.pro \
X proto/param.pro proto/quickfix.pro proto/regexp.pro proto/regsub.pro \
X proto/screen.pro proto/script.pro proto/search.pro proto/storage.pro \
X proto/tag.pro proto/term.pro proto/termlib.pro \
X proto/undo.pro proto/amiga.pro
X
X/Vim: $(OBJ) version.c
X cc $(CFLAGS) version.c
X ln +q -m -o /Vim $(OBJ) version.o $(LIBS)
X
Xdebug: $(OBJ) version.c
X cc $(CFLAGS) version.c
X ln +q -m -g -o /Vim $(OBJ) version.o $(LIBS)
X
Xproto: $(SYMS) $(PRO)


X
Xctags:
X csh -c ctags *.c *.h
X

X# can't use delete here, too many file names
Xclean:

X csh -c rm -f $(OBJ) version.o mkcmdtab.o /Vim $(SYMS) mkcmdtab
X
X$(SYMS) : vim.h keymap.h macros.h ascii.h term.h
X cc $(CFLAGS) -ho$(SYMS) vim.h
X
X###########################################################################
X
Xalloc.o: alloc.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) alloc.c
X
Xproto/alloc.pro: alloc.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) alloc.c
X csh -c mv -f alloc.pro proto
X
Xamiga.o: amiga.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) amiga.c
X
Xproto/amiga.pro: amiga.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) amiga.c
X csh -c mv -f amiga.pro proto
X
Xbuffers.o: buffers.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) buffers.c
X
Xproto/buffers.pro: buffers.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) buffers.c
X csh -c mv -f buffers.pro proto
X
Xcharset.o: charset.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) charset.c
X
Xproto/charset.pro: charset.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) charset.c
X csh -c mv -f charset.pro proto
X
Xcmdline.o: cmdline.c $(SYMS) cmdtab.h
X cc $(CFLAGS) -hi$(SYMS) cmdline.c
X
Xproto/cmdline.pro: cmdline.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) cmdline.c
X csh -c mv -f cmdline.pro proto
X
Xcsearch.o: csearch.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) csearch.c
X
Xproto/csearch.pro: csearch.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) csearch.c
X csh -c mv -f csearch.pro proto
X
Xdigraph.o: digraph.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) digraph.c
X
Xproto/digraph.pro: digraph.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) digraph.c
X csh -c mv -f digraph.pro proto
X
Xedit.o: edit.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) edit.c
X
Xproto/edit.pro: edit.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) edit.c
X csh -c mv -f edit.pro proto
X
Xfileio.o: fileio.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) fileio.c
X
Xproto/fileio.pro: fileio.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) fileio.c
X csh -c mv -f fileio.pro proto
X
Xhelp.o: help.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) help.c
X
Xproto/help.pro: help.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) help.c
X csh -c mv -f help.pro proto
X
Xlinefunc.o: linefunc.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) linefunc.c
X
Xproto/linefunc.pro: linefunc.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) linefunc.c
X csh -c mv -f linefunc.pro proto
X
Xmain.o: main.c $(SYMS) param.h globals.h
X cc $(CFLAGS) -hi$(SYMS) main.c
X
Xproto/main.pro: main.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) main.c
X csh -c mv -f main.pro proto
X
Xmark.o: mark.c $(SYMS) mark.h
X cc $(CFLAGS) -hi$(SYMS) mark.c
X
Xproto/mark.pro: mark.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) mark.c
X csh -c mv -f mark.pro proto
X
Xmessage.o: message.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) message.c
X
Xproto/message.pro: message.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) message.c
X csh -c mv -f message.pro proto
X
Xmisccmds.o: misccmds.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) misccmds.c
X
Xproto/misccmds.pro: misccmds.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) misccmds.c
X csh -c mv -f misccmds.pro proto
X
Xnormal.o: normal.c $(SYMS) ops.h
X cc $(CFLAGS) -hi$(SYMS) normal.c
X
Xproto/normal.pro: normal.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) normal.c
X csh -c mv -f normal.pro proto
X
Xops.o: ops.c $(SYMS) ops.h
X cc $(CFLAGS) -hi$(SYMS) ops.c
X
Xproto/ops.pro: ops.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) ops.c
X csh -c mv -f ops.pro proto
X
Xparam.o: param.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) param.c
X
Xproto/param.pro: param.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) param.c
X csh -c mv -f param.pro proto
X
Xquickfix.o: quickfix.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) quickfix.c
X
Xproto/quickfix.pro: quickfix.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) quickfix.c
X csh -c mv -f quickfix.pro proto
X
Xregexp.o: regexp.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) regexp.c
X
Xproto/regexp.pro: regexp.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) regexp.c
X csh -c mv -f regexp.pro proto
X
Xregsub.o: regsub.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) regsub.c
X
Xproto/regsub.pro: regsub.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) regsub.c
X csh -c mv -f regsub.pro proto
X
Xscreen.o: screen.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) screen.c
X
Xproto/screen.pro: screen.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) screen.c
X csh -c mv -f screen.pro proto
X
Xscript.o: script.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) script.c
X
Xproto/script.pro: script.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) script.c
X csh -c mv -f script.pro proto
X
Xsearch.o: search.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) search.c
X
Xproto/search.pro: search.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) search.c
X csh -c mv -f search.pro proto
X
Xstorage.o: storage.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) storage.c
X
Xproto/storage.pro: storage.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) storage.c
X csh -c mv -f storage.pro proto
X
Xtag.o: tag.c $(SYMS) mark.h
X cc $(CFLAGS) -hi$(SYMS) tag.c
X
Xproto/tag.pro: tag.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) tag.c
X csh -c mv -f tag.pro proto
X
Xterm.o: term.c $(SYMS) term.h
X cc $(CFLAGS) -hi$(SYMS) term.c
X
Xproto/term.pro: term.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) term.c
X csh -c mv -f term.pro proto
X
Xtermlib.o: termlib.c $(SYMS)
X cc $(CFLAGS) termlib.c
X
Xproto/termlib.pro: termlib.c
X cc -qa -qp $(CFLAGS) -DPROTO termlib.c
X#the manx compiler generates a wrong prototype for tputs
X vim -s termlib.fix termlib.pro
X csh -c mv -f termlib.pro proto
X
Xundo.o: undo.c $(SYMS)
X cc $(CFLAGS) -hi$(SYMS) undo.c
X
Xproto/undo.pro: undo.c
X cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) undo.c
X csh -c mv -f undo.pro proto
X
Xcmdtab.h: cmdtab.tab mkcmdtab
X mkcmdtab cmdtab.tab cmdtab.h
X
Xmkcmdtab: mkcmdtab.o
X ln +q -o mkcmdtab mkcmdtab.o -lc16
END_OF_FILE
if test 8098 -ne `wc -c <'vim/src/makefile.manx'`; then
echo shar: \"'vim/src/makefile.manx'\" unpacked with wrong size!
fi
# end of 'vim/src/makefile.manx'
fi
if test -f 'vim/src/regsub.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/regsub.c'\"
else
echo shar: Extracting \"'vim/src/regsub.c'\" \(8431 characters\)
sed "s/^X//" >'vim/src/regsub.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
X *
X * This is NOT the original regular expression code as written by
X * Henry Spencer. This code has been modified specifically for use
X * with the VIM editor, and should not be used apart from compiling
X * VIM. If you want a good regular expression library, get the
X * original code. The copyright notice that follows is from the
X * original.
X *
X * NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE
X *

X * regsub
X *
X * Copyright (c) 1986 by University of Toronto.
X * Written by Henry Spencer. Not derived from licensed software.
X *
X * Permission is granted to anyone to use this software for any
X * purpose on any computer system, and to redistribute it freely,
X * subject to the following restrictions:
X *
X * 1. The author is not responsible for the consequences of use of
X * this software, no matter how awful, even if they arise
X * from defects in it.
X *
X * 2. The origin of this software must not be misrepresented, either
X * by explicit claim or by omission.
X *
X * 3. Altered versions must be plainly marked as such, and must not
X * be misrepresented as being the original software.
X *
X * $Log: regsub.c,v $
X * Revision 1.2 88/04/28 08:11:25 tony
X * First modification of the regexp library. Added an external variable
X * 'reg_ic' which can be set to indicate that case should be ignored.
X * Added a new parameter to regexec() to indicate that the given string
X * comes from the beginning of a line and is thus eligible to match
X * 'beginning-of-line'.
X *
X * Revisions by Olaf 'Rhialto' Seibert, rhi...@cs.kun.nl:
X * Changes for vi: (the semantics of several things were rather different)
X * - Added lexical analyzer, because in vi magicness of characters
X * is rather difficult, and may change over time.
X * - Added support for \< \> \1-\9 and ~
X * - Left some magic stuff in, but only backslashed: \| \+
X * - * and \+ still work after \) even though they shouldn't.


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X

X#ifdef MSDOS
X# define __ARGS(a) a
X#endif
X
X/*
X * Short explanation of the tilde: it stands for the previous replacement
X * pattern. If that previous pattern also contains a ~ we should go back
X * a step further... or insert the previous pattern into the current one
X * and remember that.
X * This still does not handle the case where "magic" changes. TODO?
X *
X * On the other hand, this definition is not so useful. We can always retype
X * the previous pattern... especially with command history or in files.
X *
X * It would seem much more useful to remember the previously substituted
X * text. There is generally no other way to get at this. This is useful
X * when you want to do several substitutions on one line, and skip for
X * the second whatever you changed in the first.
X *
X * mool: The last solution is not very useful in combination with the 'g'
X * option, the replacement pattern would get bigger at each replacement.
X * I prefer the original VI method, also for compatibility.
X */
X#define TILDE
X#define VITILDE
X#define CASECONVERT
X
X#include <stdio.h>
X#include "regexp.h"
X#include "regmagic.h"
X
X#ifdef LATTICE
X# include <sys/types.h> /* for size_t */
X#endif
X
X#ifndef CHARBITS
X#define UCHARAT(p) ((int)*(unsigned char *)(p))
X#else
X#define UCHARAT(p) ((int)*(p)&CHARBITS)
X#endif
X
Xextern char *reg_prev_sub;
X
X#ifdef CASECONVERT
Xtypedef void *(*fptr) __ARGS((char *, int));
Xstatic fptr strnfcpy __ARGS((fptr, char *, char *, int));
X
Xstatic fptr do_copy __ARGS((char *, int));
Xstatic fptr do_upper __ARGS((char *, int));
Xstatic fptr do_Upper __ARGS((char *, int));
Xstatic fptr do_lower __ARGS((char *, int));
Xstatic fptr do_Lower __ARGS((char *, int));
X
X static fptr
Xdo_copy(d, c)
X char *d;
X int c;
X{
X *d = c;
X
X return (fptr)do_copy;
X}
X
X static fptr
Xdo_upper(d, c)
X char *d;
X int c;
X{
X *d = toupper(c);
X
X return (fptr)do_copy;
X}
X
X static fptr
Xdo_Upper(d, c)
X char *d;
X int c;
X{
X *d = toupper(c);
X
X return (fptr)do_Upper;
X}
X
X static fptr
Xdo_lower(d, c)
X char *d;
X int c;
X{
X *d = tolower(c);
X
X return (fptr)do_copy;
X}
X
X static fptr
Xdo_Lower(d, c)
X char *d;
X int c;
X{
X *d = tolower(c);
X
X return (fptr)do_Lower;
X}
X
X static fptr
Xstrnfcpy(f, d, s, n)
X fptr f;
X char *d;
X char *s;
X int n;
X{
X while (n-- > 0) {
X f = (fptr)(f(d, *s)); /* Turbo C complains without the typecast */
X if (!*s++)
X break;
X d++;
X }
X
X return f;
X}
X#endif
X
X/*
X - regsub - perform substitutions after a regexp match
X *
X * Returns the size of the replacement, including terminating \0.
X */
X int
Xregsub(prog, source, dest, copy, magic)
X regexp *prog;
X char *source;
X char *dest;
X int copy;
X int magic;
X{
X register char *src;
X register char *dst;
X register char c;
X register int no;
X register int len;
X#ifdef CASECONVERT
X fptr func = (fptr)do_copy;
X#endif
X#ifdef VITILDE
X char *tmp_sub = NULL;
X#endif
X
X if (prog == NULL || source == NULL || dest == NULL)
X {
X emsg(e_null);
X return 0;
X }
X if (UCHARAT(prog->program) != MAGIC)
X {
X emsg(e_re_corr);
X return 0;
X }
X src = source;
X dst = dest;
X
X while ((c = *src++) != '\0')
X {
X no = -1;
X if (c == '&' && magic)
X no = 0;
X else if (c == '\\')
X {
X if (*src == '&' && !magic)
X {
X ++src;
X no = 0;
X }
X else if ('0' <= *src && *src <= '9')
X {
X no = *src++ - '0';
X }
X#ifdef CASECONVERT
X else if (strchr("uUlLeE", *src))
X {
X switch (*src++)
X {
X case 'u': func = (fptr)do_upper;
X continue;
X case 'U': func = (fptr)do_Upper;
X continue;
X case 'l': func = (fptr)do_lower;
X continue;
X case 'L': func = (fptr)do_Lower;
X continue;
X case 'e':
X case 'E': func = (fptr)do_copy;
X continue;
X }
X }
X#endif
X }
X#ifdef TILDE
X if ((c == '~' && magic) || (c == '\\' && *src == '~' && !magic))


X {
X if (c == '\\')

X ++src;
X if (reg_prev_sub)
X {
X# ifdef VITILDE
X /*
X * We should now insert the previous pattern at
X * this location in the current pattern, and remember that
X * for next time... this is very painful to do right.
X */
X if (copy)
X {
X char *newsub;
X int len;
X
X#ifdef DEBUG
X printf("Old ~: '%s'\r\n", reg_prev_sub);
X#endif
X /* length = len(current) - 1 + len(previous) + 1 */
X newsub = alloc((unsigned)(strlen(source) + strlen(reg_prev_sub)));
X if (newsub)
X {
X /* copy prefix */
X len = (src - source) - 1; /* not including ~ */
X if (!magic)
X len--; /* back off \ */
X strncpy(newsub, source, (size_t)len);
X /* interpretate tilde */
X strcpy(newsub + len, reg_prev_sub);
X /* copy postfix */
X strcat(newsub + len, src);
X
X if (tmp_sub)
X free(tmp_sub);
X tmp_sub = newsub;
X source = newsub;
X src = newsub + len;
X }
X#ifdef DEBUG
X printf("New : '%s'\r\n", newsub);
X printf("Todo : '%s'\r\n", src);
X#endif
X }
X else
X {
X dst += regsub(prog, reg_prev_sub, dst, copy, magic) - 1;
X }
X# else /* no VITILDE */
X if (copy)
X {
X# ifdef CASECONVERT
X func = strnfcpy(func, dst, reg_prev_sub, ((unsigned)~0)>>1);
X# else
X (void) strcpy(dst, reg_prev_sub);
X# endif
X }
X dst += strlen(reg_prev_sub);
X# endif /* def VITILDE */
X }
X }
X else
X#endif /* def TILDE */
X if (no < 0) /* Ordinary character. */
X {
X if (c == '\\')
X c = *src++;
X if (copy)
X {
X#ifdef CASECONVERT
X func = (fptr)(func(dst, c));
X /* Turbo C complains without the typecast */
X#else
X *dst = c;
X#endif
X }
X dst++;
X }
X else if (prog->startp[no] != NULL && prog->endp[no] != NULL)
X {
X len = prog->endp[no] - prog->startp[no];
X if (copy)
X {
X#ifdef CASECONVERT
X func = strnfcpy(func, dst, prog->startp[no], len);
X#else
X (void) strncpy(dst, prog->startp[no], len);
X#endif
X }
X dst += len;
X if (copy && len != 0 && *(dst - 1) == '\0') { /* strncpy hit NUL. */
X emsg(e_re_damg);
X goto exit;
X }
X }
X }
X if (copy)
X *dst = '\0';
X
X#ifdef TILDE
X# ifdef VITILDE
X /*
X * Save the substitute string for future ~.
X * if reg_prev_sub == source, then regsub was called with reg_prev_sub,
X * so we don't have to save it again.
X */
X if (copy && reg_prev_sub != source)
X {
X free(reg_prev_sub);
X if (tmp_sub)
X reg_prev_sub = tmp_sub; /* tmp_sub == source */
X else
X reg_prev_sub = strsave(source);
X }
X# else
X if (copy) {
X free(reg_prev_sub);
X reg_prev_sub = strsave(dest);
X }
X# endif
X#endif
X
Xexit:
X return (int)((dst - dest) + 1);
X}
END_OF_FILE
if test 8431 -ne `wc -c <'vim/src/regsub.c'`; then
echo shar: \"'vim/src/regsub.c'\" unpacked with wrong size!
fi
# end of 'vim/src/regsub.c'
fi
echo shar: End of archive 4 \(of 23\).
cp /dev/null ark4isdone

Bram Moolenaar

unread,
Apr 23, 1993, 1:29:58 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 5
Archive-name: vim/part05
Environment: UNIX, AMIGA, MS-DOS

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:

# "End of archive 5 (of 23)."
# Contents: vim/src/csearch.c vim/src/main.c vim/src/mark.c
# vim/src/script.c vim/src/tag.c
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:07 1993


PATH=/bin:/usr/bin:/usr/ucb ; export PATH

if test -f 'vim/src/csearch.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/csearch.c'\"
else
echo shar: Extracting \"'vim/src/csearch.c'\" \(9336 characters\)
sed "s/^X//" >'vim/src/csearch.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*
X *

X * csearch.c: command line searching commands


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"

X#include "param.h"
X
X/* we use modified Henry Spencer's regular expression routines */
X#include "regexp.h"
X
Xint global_busy = 0; /* set to 1 if global busy, 2 if global has
X been called during a global command */
Xint global_wait; /* set to 1 if wait_return has to be called
X after global command */
Xextern regexp *myregcomp __ARGS((char *));
X
X/* dosub(lp, up, cmd)
X *
X * Perform a substitution from line 'lp' to line 'up' using the
X * command pointed to by 'cmd' which should be of the form:
X *
X * /pattern/substitution/gc
X *
X * The trailing 'g' is optional and, if present, indicates that multiple
X * substitutions should be performed on each line, if applicable.
X * The trailing 'c' is optional and, if present, indicates that a confirmation
X * will be asked for each replacement.
X * The usual escapes are supported as described in the regexp docs.
X */
X
Xextern char *reg_prev_sub; /* this is in regexp.c */
X
X void
Xdosub(lp, up, cmd, nextcommand)
X linenr_t lp;
X linenr_t up;
X char *cmd;
X u_char **nextcommand;
X{
X linenr_t lnum;
X long i;
X char *ptr;
X regexp *prog;
X long nsubs = 0;
X linenr_t nlines = 0;
X int do_all; /* do multiple substitutions per line */
X int do_ask; /* ask for confirmation */
X char *pat, *sub = NULL;
X static char *old_sub = NULL;
X int delimiter;
X int sublen;
X
X if (strchr("0123456789gc|\"#", *cmd) == NULL) /* new pattern and substitution */
X {
X delimiter = *cmd++; /* remember delimiter character */
X pat = cmd; /* remember the start of the regexp */
X
X /*
X * do the next loop twice:
X * i == 0: find the end of the regexp
X * i == 1: find the end of the substitution
X */
X for (i = 0; ; ++i)
X {
X while (cmd[0])
X {
X if (cmd[0] == delimiter) /* end delimiter found */
X {
X *cmd++ = NUL; /* replace it by a NUL */
X break;
X }
X if (cmd[0] == '\\' && cmd[1] != 0) /* skip escaped characters */
X ++cmd;
X ++cmd;
X }
X if (i == 1)
X break;
X sub = cmd; /* remember the start of the substitution */
X }
X free(old_sub);
X old_sub = strsave(sub);
X }
X else /* use previous pattern and substitution */
X {
X if (old_sub == NULL) /* there is no previous command */
X {
X beep();
X return;
X }
X pat = NULL; /* myregcomp() will use previous pattern */
X sub = old_sub;
X }
X
X /*
X * find trailing options
X */
X do_all = FALSE;
X do_ask = FALSE;
X while (*cmd)
X {
X if (*cmd == 'g')
X do_all = TRUE;
X else if (*cmd == 'c')
X do_ask = TRUE;
X else
X break;
X ++cmd;
X }
X
X /*
X * check for a trailing count
X */
X skipspace(&cmd);
X if (isdigit(*cmd))
X {
X i = getdigits(&cmd);
X if (i <= 0)
X {
X emsg(e_zerocount);
X return;
X }
X lp = up;
X up += i - 1;
X }
X
X /*
X * check for trailing '|', '"' or '#'
X */
X skipspace(&cmd);
X if (*cmd)
X {
X if (strchr("|\"#", *cmd) != NULL)
X {
X *nextcommand = (u_char *)cmd;
X }
X else
X {
X emsg(e_trailing);
X return;
X }
X }
X
X if ((prog = myregcomp(pat)) == NULL)
X {
X emsg(e_invcmd);
X return;
X }
X
X for (lnum = lp; lnum <= up && !got_int; ++lnum)
X {
X ptr = nr2ptr(lnum);
X if (regexec(prog, ptr, (int)TRUE)) /* a match on this line */
X {
X char *ns, *sns = NULL, *p, *prevp, *oldp = NULL;
X int did_sub = FALSE;
X
X if (nsubs == 0)
X setpcmark();
X /*
X * Save the line that was last changed for the final cursor
X * position (just like the real vi).
X */
X Curpos.lnum = lnum;
X
X prevp = p = ptr;
X do
X {
X Curpos.col = prog->startp[0] - ptr;
X /*
X * First match empty string does not count, except for first match.
X * This reproduces the strange vi behaviour.
X * This also catches endless loops.
X */
X if (did_sub && p == oldp && p == prog->endp[0])
X {
X ++p;
X goto skip2;
X }
X if (do_ask)
X {
X updateScreen(CURSUPD);
X smsg("replace by %s (y/n/q)? ", sub);
X setcursor();
X if ((i = vgetc()) == 'q')
X {
X got_int = TRUE;
X break;
X }
X else if (i != 'y')
X goto skip;
X }
X
X /* get length of substitution part */
X sublen = regsub(prog, sub, ptr, 0, (int)p_magic);
X if (did_sub == FALSE)
X {
X /*
X * Get some space for a temporary buffer to do the substitution
X * into.
X */
X if ((sns = alloc((unsigned)(strlen(ptr) + sublen + 5))) == NULL)
X goto outofmem;
X *sns = NUL;
X did_sub = TRUE;
X }
X else
X {
X /*
X * extend the temporary buffer to do the substitution into.
X */
X if ((ns = alloc((unsigned)(strlen(sns) + strlen(prevp) + sublen + 1))) == NULL)
X goto outofmem;
X strcpy(ns, sns);
X free(sns);
X sns = ns;
X }
X
X for (ns = sns; *ns; ns++)
X ;
X /*
X * copy up to the part that matched
X */
X while (prevp < prog->startp[0])
X *ns++ = *prevp++;
X
X regsub(prog, sub, ns, 1, (int)p_magic);
X nsubs++;
X /*
X * Regsub may have replaced a ~ by the old sub.
X * We have to use the result, otherwise the ~ is replaced
X * over and over again.
X */
X sub = reg_prev_sub;
X
X prevp = prog->endp[0]; /* remember last copied character */
X /*
X * continue searching after the match
X * prevent endless loop with patterns that match empty strings,
X * e.g. :s/$/pat/g or :s/[a-z]* /(&)/g
X */
Xskip:
X p = prog->endp[0];
X oldp = p;
X if (*p == NUL) /* end of line: quit here */
X break;
X
Xskip2:
X /* breakcheck is slow, don't call it too often */
X if ((nsubs & 15) == 0)
X breakcheck();
X
X } while (!got_int && do_all && regexec(prog, p, (int)FALSE));
X
X if (did_sub)
X {
X /*
X * copy the rest of the line, that didn't match
X */
X strcat(sns, prevp);
X
X if ((ptr = save_line(sns)) != NULL)
X u_savesub(lnum, replaceline(lnum, ptr));
X
X free(sns); /* free the temp buffer */
X ++nlines;
X }
X }
X /* breakcheck is slow, don't call it too often */
X if ((lnum & 15) == 0)
X breakcheck();
X }
X
Xoutofmem:
X if (nsubs)
X {
X CHANGED;
X updateScreen(CURSUPD); /* need this to update LineSizes */
X beginline(TRUE);
X if (nsubs > p_report)
X smsg("%s%ld substitution%s on %ld line%s",
X got_int ? "(Interrupted) " : "",
X nsubs, plural(nsubs),
X (long)nlines, plural((long)nlines));
X else if (got_int)
X msg(e_interr);
X else if (do_ask)
X msg("");
X }
X else if (got_int)
X msg(e_interr);
X else
X msg("No match");
X
X free((char *) prog);
X}
X
X/*
X * doglob(cmd)
X *
X * Execute a global command of the form:
X *
X * g/pattern/X : execute X on all lines where pattern matches
X * v/pattern/X : execute X on all lines where pattern does not match
X *
X * where 'X' is an EX command
X *
X * The command character (as well as the trailing slash) is optional, and
X * is assumed to be 'p' if missing.
X *
X * This is implemented in two passes: first we scan the file for the pattern and
X * set a mark for each line that (not) matches. secondly we execute the command
X * for each line that has a mark. This is required because after deleting
X * lines we do not know where to search for the next match.


X */
X
X void

Xdoglob(type, lp, up, cmd)
X int type;
X linenr_t lp, up;
X char *cmd;
X{
X linenr_t lnum; /* line number according to old situation */
X linenr_t old_lcount; /* line_count before the command */
X int ndone;
X
X char delim; /* delimiter, normally '/' */
X char *pat;
X regexp *prog;
X int match;
X
X if (global_busy)
X {
X emsg("Cannot do :global recursive");
X ++global_busy;
X return;
X }
X
X delim = *cmd++; /* skip the delimiter */
X pat = cmd;
X
X while (cmd[0])
X {
X if (cmd[0] == delim) /* end delimiter found */
X {
X *cmd++ = NUL; /* replace it by a NUL */
X break;
X }
X if (cmd[0] == '\\' && cmd[1] != 0) /* skip escaped characters */
X ++cmd;
X ++cmd;
X }
X
X reg_ic = p_ic; /* set "ignore case" flag appropriately */
X
X if ((prog = myregcomp(pat)) == NULL)
X {
X emsg(e_invcmd);
X return;
X }
X msg("");
X
X/*
X * pass 1: set marks for each (not) matching line
X */
X ndone = 0;
X for (lnum = lp; lnum <= up && !got_int; ++lnum)
X {
X match = regexec(prog, nr2ptr(lnum), (int)TRUE); /* a match on this line? */
X if ((type == 'g' && match) || (type == 'v' && !match))
X {
X setmarked(lnum);
X ndone++;
X }
X /* breakcheck is slow, don't call it too often */
X if ((lnum & 15) == 0)
X breakcheck();
X }
X
X/*
X * pass 2: execute the command for each line that has been marked
X */
X if (got_int)
X msg("Interrupted");
X else if (ndone == 0)
X msg("No match");
X else
X {
X global_busy = 1;
X global_wait = 0;
X RedrawingDisabled = TRUE;
X old_lcount = line_count;
X while (!got_int && (lnum = firstmarked()) != 0 && global_busy == 1)
X {
X Curpos.lnum = lnum;
X Curpos.col = 0;
X if (*cmd == NUL)
X docmdline((u_char *)"p");
X else
X docmdline((u_char *)cmd);
X breakcheck();
X }
X
X RedrawingDisabled = FALSE;
X if (global_wait) /* wait for return */
X wait_return(FALSE);
X updateScreen(CLEAR);
X msgmore(line_count - old_lcount);
X }
X
X clearmarked(); /* clear rest of the marks */
X global_busy = 0;
X free((char *) prog);
X}
END_OF_FILE
if test 9336 -ne `wc -c <'vim/src/csearch.c'`; then
echo shar: \"'vim/src/csearch.c'\" unpacked with wrong size!
fi
# end of 'vim/src/csearch.c'
fi
if test -f 'vim/src/main.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/main.c'\"
else
echo shar: Extracting \"'vim/src/main.c'\" \(9338 characters\)
sed "s/^X//" >'vim/src/main.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X

X#define EXTERN


X#include "vim.h"
X#include "globals.h"
X#include "proto.h"

X#include "param.h"
X
Xstatic void usage __PARMS((int));
X
X static void
Xusage(n)
X int n;
X{
X register int i;
X static char *(use[]) = {"[file ..]\n",
X "-t tag\n",
X "+[command] file ..\n",
X "-c {command} file ..\n",
X "-e\n"};
X static char *(errors[]) = {"Unknown option\n", /* 0 */
X "Too many arguments\n", /* 1 */
X "Argument missing\n", /* 2 */
X };
X
X fprintf(stderr, errors[n]);
X fprintf(stderr, "usage:");
X for (i = 0; ; ++i)
X {
X fprintf(stderr, " vim [options] ");
X fprintf(stderr, use[i]);
X if (i == (sizeof(use) / sizeof(char *)) - 1)
X break;
X fprintf(stderr, " or:");
X }
X#ifdef AMIGA
X fprintf(stderr, "\noptions: -v -n -r -d device -s scriptin -w scriptout -T terminal\n");
X#else
X fprintf(stderr, "\noptions: -v -n -r -s scriptin -w scriptout -T terminal\n");
X#endif
X mch_windexit(1);
X}
X
X void


Xmain(argc, argv)
X int argc;
X char **argv;
X{

X char *initstr; /* init string from the environment */
X char *term = NULL; /* specified terminal name */
X char *fname = NULL; /* file name from command line */
X char *command = NULL; /* command from + option */
X char *tagname = NULL; /* tag from -t option */
X int c;
X int doqf = 0;
X int i;
X
X#ifdef DEBUG
X# ifdef MSDOS
X OPENDEBUG("#debug#");
X# else
X OPENDEBUG("/tmp/debug/vim");
X# endif
X#endif
X
X/*
X * Check if we have an interactive window.
X * If not, open one with a newcli command (needed for :! to work).
X * check_win will also handle the -d argument (for the Amiga).
X */
X check_win(argc, argv);
X
X ++argv;
X /*
X * Process the command line arguments
X * '-s scriptin'
X * '-w scriptout'
X * '-v'
X * '-n'
X * '-r'
X * '-T terminal'
X */
X while (argc > 1 && argv[0][0] == '-' &&
X strchr("swvnrTd", c = argv[0][1]) != NULL && c)
X {
X --argc;
X switch (c)
X {
X case 'v':
X readonlymode = TRUE;
X p_ro = TRUE;
X /*FALLTHROUGH*/
X
X case 'n':
X p_uc = 0;
X break;
X
X case 'r':
X recoverymode = 1;
X break;
X
X default: /* options with argument */
X ++argv;
X --argc;
X if (argc < 1)
X usage(2);
X
X switch (c)
X {
X case 's':
X if ((scriptin[0] = fopen(argv[0], READBIN)) == NULL)
X {
X fprintf(stderr, "cannot open %s for reading\n", argv[0]);
X mch_windexit(2);
X }
X break;
X
X case 'w':
X if ((scriptout = fopen(argv[0],
X#ifdef MSDOS
X "ab"
X#else
X "a"
X#endif
X )) == NULL)
X {
X fprintf(stderr, "cannot open %s for output\n", argv[0]);
X mch_windexit(2);
X }
X break;
X
X/*
X * The -T term option is always available and when TERMCAP is supported it
X * overrides the environment variable TERM.
X */
X case 'T':
X term = *argv;
X break;
X
X /* case 'd': This is ignored as it is handled in check_win() */
X }
X }
X ++argv;
X }
X
X /*
X * Allocate space for the generic buffer
X */
X if ((IObuff = alloc(IOSIZE)) == NULL)
X mch_windexit(0);
X
X /* note that we may use mch_windexit() before mch_windinit()! */
X mch_windinit();
X set_init(); /* after mch_windinit because Rows is used */
X
X /*
X * Process the other command line arguments.
X */
X if (argc > 1)
X {
X c = argv[0][1];
X switch (argv[0][0])
X {
X case '-':
X switch (c)
X {
X case 'e': /* -e QuickFix mode */
X if (argc != 2)
X usage(1);
X doqf = 1;
X break;
X
X case 'c': /* -c {command} file .. */
X if (argc <= 3)
X usage(2);
X ++argv;
X --argc;
X command = &(argv[0][0]);
X goto getfiles;
X
X case 't': /* -t tag */
X if (argc < 3)
X usage(2);
X if (argc > 3)
X usage(1);
X ++argv;
X tagname = argv[0];
X break;
X
X default:
X usage(0);
X }
X break;
X
X case '+': /* + or +{number} or +/{pat} or +{command} */
X if (argc < 3) /* no filename */
X usage(2);
X if (c == NUL)
X command = "$";
X else
X command = &(argv[0][1]);
X
Xgetfiles:
X ++argv;
X --argc;
X /*FALLTHROUGH*/
X
X default: /* must be a file name */
X#if defined(WILD_CARDS) && !defined(UNIX)
X ExpandWildCards(argc - 1, argv, &numfiles, &files, TRUE, TRUE);
X if (numfiles != 0)
X fname = files[0];
X
X#else
X files = argv;
X numfiles = argc - 1;
X fname = argv[0];
X#endif
X if (numfiles > 1)
X printf("%d files to edit\n", numfiles);
X break;
X }
X }
X
X if (numfiles == 0)
X numfiles = 1;
X
X RedrawingDisabled = TRUE;
X filealloc(); /* Initialize storage structure */
X init_yank(); /* init yank buffers */
X termcapinit(term); /* get terminal capabilities */
X
X#ifdef USE_LOCALE
X#include <locale.h>
X setlocale(LC_ALL, ""); /* for ctype() and the like */
X#endif
X
X#ifdef MSDOS /* default mapping for some often used keys */
X domap(0, "#1 :help\r", 0); /* F1 is help key */
X domap(0, "\236R i", 0); /* INSERT is 'i' */
X domap(0, "\236S x", 0); /* DELETE is 'x' */
X domap(0, "\236G 0", 0); /* HOME is '0' */
X domap(0, "\236w H", 0); /* CTRL-HOME is 'H' */
X domap(0, "\236O $", 0); /* END is '$' */
X domap(0, "\236u L", 0); /* CTRL-END is 'L' */
X domap(0, "\236I \002", 0); /* PageUp is '^B' */
X domap(0, "\236\204 1G", 0); /* CTRL-PageUp is '1G' */
X domap(0, "\236Q \006", 0); /* PageDown is '^F' */
X domap(0, "\236v G", 0); /* CTRL-PageDown is 'G' */
X /* insert mode */
X domap(0, "\236S \017x", INSERT); /* DELETE is '^Ox' */
X domap(0, "\236G \017""0", INSERT); /* HOME is '^O0' */
X domap(0, "\236w \017H", INSERT); /* CTRL-HOME is '^OH' */
X domap(0, "\236O \017$", INSERT); /* END is '^O$' */
X domap(0, "\236u \017L", INSERT); /* CTRL-END is '^OL' */
X domap(0, "\236I \017\002", INSERT); /* PageUp is '^O^B' */
X domap(0, "\236\204 \017\061G", INSERT); /* CTRL-PageUp is '^O1G' */
X domap(0, "\236Q \017\006", INSERT); /* PageDown is '^O^F' */
X domap(0, "\236v \017G", INSERT); /* CTRL-PageDown is '^OG' */
X#endif
X
X/*
X * get system wide defaults (for unix)
X */
X#ifdef DEFVIMRC_FILE
X dosource(DEFVIMRC_FILE);
X#endif
X
X/*
X * Try to read initialization commands from the following places:
X * - environment variable VIMINIT
X * - file s:.vimrc ($HOME/.vimrc for Unix)
X * - environment variable EXINIT
X * - file s:.exrc ($HOME/.exrc for Unix)
X * The first that exists is used, the rest is ignored.
X */
X if ((initstr = (char *)vimgetenv("VIMINIT")) != NULL)
X docmdline((u_char *)initstr);
X else if (dosource(SYSVIMRC_FILE))
X {
X if ((initstr = (char *)vimgetenv("EXINIT")) != NULL)
X docmdline((u_char *)initstr);
X else
X dosource(SYSEXRC_FILE);
X }
X
X/*
X * Read initialization commands from ".vimrc" or ".exrc" in current directory.
X * Because of security reasons we disallow shell and write commands now,
X * except for unix if the file is owned by the user.
X * Only do this if VIMRC_FILE is not the same as SYSVIMRC_FILE or DEFVIMRC_FILE.
X */
X#ifdef UNIX
X {
X struct stat s;
X
X stat(VIMRC_FILE, &s);
X if (s.st_uid != getuid()) /* ".vimrc" file is not owned by user */
X secure = 1;
X }
X#else
X secure = 1;
X#endif
X
X i = 1;
X if (fullpathcmp(SYSVIMRC_FILE, VIMRC_FILE)
X#ifdef DEFVIMRC_FILE
X && fullpathcmp(DEFVIMRC_FILE, VIMRC_FILE)
X#endif
X )
X i = dosource(VIMRC_FILE);
X#ifdef UNIX
X if (i)
X {
X struct stat s;
X
X stat(EXRC_FILE, &s);
X if (s.st_uid != getuid()) /* ".exrc" file is not owned by user */
X secure = 1;
X else
X secure = 0;
X }
X#endif
X if (i && fullpathcmp(SYSEXRC_FILE, EXRC_FILE))
X dosource(EXRC_FILE);
X
X/*
X * Call settmode and starttermcap here, so the T_KS and T_TS may be defined
X * by termcapinit and redifined in .exrc.
X */
X settmode(1);
X starttermcap();
X
X if (secure == 2) /* done something that is not allowed */
X wait_return(TRUE); /* must be called after settmode(1) */
X secure = 0;
X
X#ifdef AMIGA
X fname_case(fname); /* set correct case for file name */
X#endif
X setfname(fname);
X maketitle();
X
X/*
X * start putting things on the screen
X */
X starting = FALSE;
X screenalloc();
X screenclear();
X if (Filename != NULL)
X readfile(Filename, (linenr_t)0, TRUE);
X else
X msg("Empty Buffer");
X
X setpcmark();
X if (!tagname)
X startscript(); /* start writing to auto script file */
X
X if (recoverymode && !scriptin[curscript]) /* first do script file, then recover */
X openrecover();
X
X /* position the display and the cursor at the top of the file. */
X Topline = 1;
X Curpos.lnum = 1;
X Curpos.col = 0;
X Cursrow = Curscol = 0;
X
X if (doqf)
X {
X if (qf_init(p_ef))
X mch_windexit(3);
X qf_jump(0);
X }
X
X if (command)
X docmdline((u_char *)command);
X /*
X * put the :ta command in the stuff buffer here, so that it will not
X * be erased by an emsg().
X */
X if (tagname)
X {
X stuffReadbuff(":ta ");
X stuffReadbuff(tagname);
X stuffReadbuff("\n");
X }
X
X RedrawingDisabled = FALSE;
X updateScreen(NOT_VALID);
X
X /* start in insert mode (already taken care of for :ta command) */
X if (p_im && stuff_empty())
X stuffReadbuff("i");
X/*
X * main command loop
X */


X for (;;)
X {

X adjustCurpos();
X cursupdate(); /* Figure out where the cursor is based on Curpos. */
X
X if (Quote.lnum)
X updateScreen(INVERTED); /* update inverted part */
X setcursor();
X
X normal(); /* get and execute a command */
X }
X /*NOTREACHED*/
X}
X
X void
Xgetout(r)
X int r;
X{
X windgoto((int)Rows - 1, 0);
X outchar('\r');
X outchar('\n');
X mch_windexit(r);
X}
END_OF_FILE
if test 9338 -ne `wc -c <'vim/src/main.c'`; then
echo shar: \"'vim/src/main.c'\" unpacked with wrong size!
fi
# end of 'vim/src/main.c'
fi
if test -f 'vim/src/mark.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/mark.c'\"
else
echo shar: Extracting \"'vim/src/mark.c'\" \(8995 characters\)
sed "s/^X//" >'vim/src/mark.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * mark.c: functions for setting marks and jumping to them


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"

X#include "mark.h"
X#include "ops.h" /* for endop and startop */
X
X/*
X * This file contains routines to maintain and manipulate marks.
X */
X
X#define NMARKS 26 /* max. # of named marks */
X#define JUMPLISTSIZE 50 /* max. # of marks in jump list */
X
Xstatic struct mark pcmark; /* previous context mark */
Xstatic struct mark namedm[NMARKS]; /* original vi marks */
Xstatic struct filemark namedfm[NMARKS]; /* new marks with file nr */
Xstatic struct filemark jumplist[JUMPLISTSIZE]; /* list of old pcmarks */
X
Xstatic int jumplistlen = 0;
Xstatic int jumplistidx = 0;
X
Xstatic FPOS *mark2pos __ARGS((struct mark *));
X
X/*
X * setmark(c) - set named mark 'c' at current cursor position
X *
X * Returns TRUE on success, FALSE if no room for mark or bad name given.
X */
X int
Xsetmark(c)
X int c;
X{
X int i;
X
X if (islower(c))
X {
X i = c - 'a';
X namedm[i].ptr = nr2ptr(Curpos.lnum);
X namedm[i].col = Curpos.col;
X return TRUE;
X }
X if (isupper(c))
X {
X i = c - 'A';
X namedfm[i].mark.ptr = nr2ptr(Curpos.lnum);
X namedfm[i].mark.col = Curpos.col;
X namedfm[i].lnum = Curpos.lnum;
X namedfm[i].fnum = 0;
X return TRUE;
X }
X return FALSE;
X}
X
X/*
X * setpcmark() - set the previous context mark to the current position
X * and insert it into the jump list
X */
X void
Xsetpcmark()
X{
X int i;
X#ifdef ROTATE
X struct filemark tempmark;
X#endif
X
X pcmark.ptr = nr2ptr(Curpos.lnum);
X pcmark.col = Curpos.col;
X
X#ifndef ROTATE
X /*
X * simply add the new entry at the end of the list
X */
X jumplistidx = jumplistlen;
X#else
X /*
X * If last used entry is not at the top, put it at the top by rotating
X * the stack until it is (the newer entries will be at the bottom).
X * Keep one entry (the last used one) at the top.
X */
X if (jumplistidx < jumplistlen)
X ++jumplistidx;
X while (jumplistidx < jumplistlen)
X {
X tempmark = jumplist[jumplistlen - 1];
X for (i = jumplistlen - 1; i > 0; --i)
X jumplist[i] = jumplist[i - 1];
X jumplist[0] = tempmark;
X ++jumplistidx;
X }
X#endif
X
X /* only add new entry if it differs from the last one */
X if (jumplistlen == 0 || jumplist[jumplistidx - 1].mark.ptr != pcmark.ptr)
X {
X /* if jumplist is full: remove oldest entry */
X if (++jumplistlen > JUMPLISTSIZE)
X {
X jumplistlen = JUMPLISTSIZE;
X for (i = 1; i < jumplistlen; ++i)
X jumplist[i - 1] = jumplist[i];
X --jumplistidx;
X }
X
X jumplist[jumplistidx].mark = pcmark;
X jumplist[jumplistidx].lnum = Curpos.lnum;
X jumplist[jumplistidx].fnum = 0;
X ++jumplistidx;
X }
X}
X
X/*
X * move "count" positions in the jump list (count may be negative)
X */
X FPOS *
Xmovemark(count)
X int count;
X{
X FPOS *pos;
X
X if (jumplistlen == 0) /* nothing to jump to */
X return (FPOS *)NULL;
X
X if (jumplistidx + count < 0 || jumplistidx + count >= jumplistlen)
X return (FPOS *)NULL;
X
X /*
X * if first CTRL-O or CTRL-I command after a jump, add cursor position to list
X */
X if (jumplistidx == jumplistlen)
X {
X setpcmark();
X --jumplistidx; /* skip the new entry */
X }
X
X jumplistidx += count;
X if (jumplist[jumplistidx].mark.ptr == NULL) /* jump to other file */
X {
X if (getaltfile(jumplist[jumplistidx].fnum - 1, jumplist[jumplistidx].lnum, FALSE))
X return (FPOS *)NULL;
X Curpos.col = jumplist[jumplistidx].mark.col;
X jumplist[jumplistidx].fnum = 0;
X jumplist[jumplistidx].mark.ptr = nr2ptr(Curpos.lnum);
X pos = (FPOS *)-1;
X }
X else
X pos = mark2pos(&jumplist[jumplistidx].mark);
X return pos;
X}
X
X/*
X * getmark(c) - find mark for char 'c'
X *
X * Return pointer to FPOS if found
X * NULL if no such mark.
X * -1 if mark is in other file (only if changefile is TRUE)
X */
X FPOS *
Xgetmark(c, changefile)
X int c;
X int changefile;
X{
X FPOS *posp;
X
X posp = NULL;
X if (c == '\'' || c == '`') /* previous context mark */
X posp = mark2pos(&pcmark);
X else if (c == '[') /* to start of previous operator */
X {
X if (startop.lnum > 0 && startop.lnum <= line_count)
X posp = &startop;
X }
X else if (c == ']') /* to end of previous operator */
X {
X if (endop.lnum > 0 && endop.lnum <= line_count)
X posp = &endop;
X }
X else if (islower(c)) /* normal named mark */
X posp = mark2pos(&(namedm[c - 'a']));
X else if (isupper(c)) /* named file mark */
X {
X c -= 'A';
X posp = mark2pos(&(namedfm[c].mark));
X if (posp == NULL && namedfm[c].lnum != 0 && (changefile || samealtfile(namedfm[c].fnum - 1)))
X {
X if (!getaltfile(namedfm[c].fnum - 1, namedfm[c].lnum, TRUE))
X {
X Curpos.col = namedfm[c].mark.col;
X namedfm[c].fnum = 0;
X namedfm[c].mark.ptr = nr2ptr(Curpos.lnum);
X posp = (FPOS *)-1;
X }
X }
X }
X return posp;
X}
X
X static FPOS *
Xmark2pos(markp)
X struct mark *markp;
X{
X static FPOS pos;
X
X if (markp->ptr != NULL && (pos.lnum = ptr2nr(markp->ptr, (linenr_t)1)) != 0)
X {
X pos.col = markp->col;
X return (&pos);
X }
X return (FPOS *)NULL;
X}
X
X/*
X * clrallmarks() - clear all marks


X *
X * Used mainly when trashing the entire buffer during ":e" type commands
X */
X void

Xclrallmarks()
X{
X static int i = -1;
X
X if (i == -1) /* first call ever: initialize */
X for (i = 0; i < NMARKS; i++)
X namedfm[i].lnum = 0;
X
X for (i = 0; i < NMARKS; i++)
X {
X namedm[i].ptr = NULL;
X namedfm[i].mark.ptr = NULL;
X }
X pcmark.ptr = NULL;
X qf_clrallmarks();
X for (i = 0; i < jumplistlen; ++i)
X jumplist[i].mark.ptr = NULL;
X}
X
X/*
X * increment the file number for all filemarks
X * called when adding a file to the file stack
X */
X void
Xincrmarks()


X{
X int i;
X

X for (i = 0; i < NMARKS; i++)
X ++namedfm[i].fnum;
X
X for (i = 0; i < jumplistlen; ++i)
X {
X#if 0 /* this would take too much time */
X if (jumplist[i].fnum == 0) /* current file */
X jumplist[i].lnum = ptr2nr(jumplist[i].mark.ptr, 1);
X#endif
X ++jumplist[i].fnum;
X }
X}
X
X/*
X * decrement the file number for the filemarks of the current file
X * called when not adding the current file name to the file stack
X */
X void
Xdecrmarks()


X{
X int i;
X

X for (i = 0; i < NMARKS; i++)
X if (namedfm[i].fnum == 1)
X namedfm[i].fnum = 0;
X
X for (i = 0; i < jumplistlen; ++i)
X if (jumplist[i].fnum == 1)
X jumplist[i].fnum = 0;
X}
X
X/*
X * adjustmark: set new ptr for a mark
X * if new == NULL the mark is effectively deleted
X */
X void
Xadjustmark(old, new)


X char *old, *new;
X{
X register int i;
X

X for (i = 0; i < NMARKS; ++i)
X {
X if (namedm[i].ptr == old)
X namedm[i].ptr = new;
X if (namedfm[i].mark.ptr == old)
X {
X namedfm[i].mark.ptr = new;


X if (new == NULL)

X namedfm[i].lnum = 0; /* delete this mark */
X }
X }
X if (pcmark.ptr == old)
X pcmark.ptr = new;
X for (i = 0; i < jumplistlen; ++i)
X if (jumplist[i].mark.ptr == old)
X jumplist[i].mark.ptr = new;
X qf_adjustmark(old, new);
X}
X
X/*
X * get name of file from a filemark (use the occasion to update the lnum)


X */
X char *

Xfm_getname(fmark)
X struct filemark *fmark;
X{
X linenr_t nr;
X char *name;
X
X if (fmark->fnum != 0) /* maybe not current file */
X {
X name = getaltfname(fmark->fnum - 1);
X if (name == NULL)
X return "-none-";
X if (Filename == NULL || fnamecmp(name, Filename) != 0) /* not current file */
X return name;
X fmark->fnum = 0;
X }
X if (fmark->mark.ptr == NULL)
X fmark->mark.ptr = nr2ptr(fmark->lnum); /* update ptr */
X else
X {
X nr = ptr2nr(fmark->mark.ptr, (linenr_t)1);
X if (nr != 0)
X fmark->lnum = nr; /* update lnum */
X }
X return "-current-";
X}
X
X/*
X * print the marks (use the occasion to update the line numbers)
X */
X void
Xdomarks()
X{
X int i;
X char *name;
X
X#ifdef AMIGA
X settmode(0); /* set cooked mode, so output can be halted */
X#endif
X outstrn("\nmark line file\n");
X for (i = 0; i < NMARKS; ++i)
X {
X if (namedm[i].ptr != NULL)
X {
X sprintf(IObuff, " %c %5ld\n",
X i + 'a',
X ptr2nr(namedm[i].ptr, (linenr_t)1));
X outstrn(IObuff);
X }
X flushbuf();
X }
X for (i = 0; i < NMARKS; ++i)
X {
X if (namedfm[i].lnum != 0)
X {
X name = fm_getname(&namedfm[i]);
X if (name == NULL) /* file name not available */
X continue;
X
X sprintf(IObuff, " %c %5ld %s\n",
X i + 'A',
X namedfm[i].lnum,
X name);
X outstrn(IObuff);
X }


X flushbuf();
X }
X#ifdef AMIGA
X settmode(1);
X#endif
X wait_return(TRUE);
X}
X
X/*

X * print the jumplist (use the occasion to update the line numbers)
X */
X void
Xdojumps()
X{
X int i;
X char *name;
X
X#ifdef AMIGA
X settmode(0); /* set cooked mode, so output can be halted */
X#endif
X outstrn("\n jump line file\n");
X for (i = 0; i < jumplistlen; ++i)
X {
X if (jumplist[i].lnum != 0)
X {
X name = fm_getname(&jumplist[i]);
X if (name == NULL) /* file name not available */
X continue;
X
X sprintf(IObuff, "%c %2d %5ld %s\n",
X i == jumplistidx ? '>' : ' ',
X i + 1,
X jumplist[i].lnum,
X name);
X outstrn(IObuff);
X }
X flushbuf();
X }
X if (jumplistidx == jumplistlen)
X outstrn(">\n");


X#ifdef AMIGA
X settmode(1);
X#endif
X wait_return(TRUE);
X}

END_OF_FILE
if test 8995 -ne `wc -c <'vim/src/mark.c'`; then
echo shar: \"'vim/src/mark.c'\" unpacked with wrong size!
fi
# end of 'vim/src/mark.c'
fi
if test -f 'vim/src/script.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/script.c'\"
else
echo shar: Extracting \"'vim/src/script.c'\" \(11660 characters\)
sed "s/^X//" >'vim/src/script.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * script.c: functions for handling script files


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"

X#include "param.h"
X
Xstatic char *scriptname; /* name of the script in use */
Xstatic FILE *autoscriptfd = NULL;
Xstatic char *makescriptname __ARGS((void));
Xstatic void Supdatescript __ARGS((char *));
X
Xextern int global_busy; /* this is in csearch.c */
X
X/*
X * for Amiga Dos 2.0x we use Open/Close/Flush instead of fopen/fclose
X */
X#ifdef AMIGA
X# ifndef NO_ARP
Xextern int dos2; /* this is in amiga.c */
X# endif
X# ifdef SASC
X# include <proto/dos.h>
X# endif
X#endif
X
X/*
X * We use this flag to avoid writing :win to commands to the script file
X * during startup.
X */
Xstatic int script_started = FALSE;
X
X/*
X * startscript(): open automatic script file
X */
X void
Xstartscript()
X{
X int n;
X char buf[25];
X#ifdef AMIGA
X int r;
X FILE *dummyfd = NULL;
X#endif
X
X script_started = TRUE;
X
X#ifdef AMIGA
X/*
X * With Amiga DOS 2.0 the system may lockup with the sequence: write to .vim
X * file, close it, delete it, create a new .vim file and write to it.
X * This is a problem in the filesystem hash chains (solved in version 39.xx).
X * The Delay seems to solve this problem, maybe because DOS gets a chance to
X * finish closing and deleting the old .vim file. Also do this for DOS 1.3,
X * just in case.
X */
X if (stopscript())
X Delay(10L); /* This should fix the lockup bug */
X#else
X stopscript(); /* stop any old script */
X#endif
X
X if (p_uc == 0 || exiting) /* no auto script wanted/needed */
X return;
X if (Changed)
X emsg("Warning: buffer already changed, auto script file will be incomplete");
X
X#ifdef AMIGA
X/*
X * If we start editing a new file, e.g. "test.doc", which resides on an MSDOS
X * compatible filesystem, it is possible that the file "test.doc.vim" which we
X * create will be exactly the same file. To avoid this problem we temporarily
X * create "test.doc".
X */
X if (!(p_sn || thisfile_sn) && Filename && getperm(Filename) < 0)
X dummyfd = fopen(Filename, "w");
X#endif
X
X/*
X * we try different names until we find one that does not exist yet
X */
X scriptname = makescriptname();


X for (;;)
X {

X if (scriptname == NULL) /* must be out of memory */
X break;
X if ((n = strlen(scriptname)) == 0) /* safety check */
X {
X free(scriptname);
X break;
X }
X
X /*
X * check if the scriptfile already exists
X */
X if (getperm(scriptname) < 0) /* it does not exist */
X {
X /*
X * Create the autoscript file.
X */
X#ifdef AMIGA
X# ifndef NO_ARP
X if (dos2)
X# endif
X autoscriptfd = (FILE *)Open((UBYTE *)scriptname, (long)MODE_NEWFILE);
X# ifndef NO_ARP
X else
X autoscriptfd = fopen(scriptname, "w");
X# endif
X#else /* !AMIGA */
X autoscriptfd = fopen(scriptname, WRITEBIN);


X#endif /* AMIGA */
X

X#ifdef AMIGA
X /*
X * on the Amiga getperm() will return -1 when the file exists but
X * is being used by another program. This happens if you edit
X * a file twice.
X */
X if (autoscriptfd != NULL || (IoErr() != ERROR_OBJECT_IN_USE && IoErr() != ERROR_OBJECT_EXISTS))
X#endif
X break;
X }
X /*
X * get here when file already exists
X */
X if (scriptname[n - 1] == 'm') /* first try */
X {
X#ifdef AMIGA
X /*
X * on MS-DOS compatible filesystems (e.g. messydos) file.doc.vim
X * and file.doc are the same file. To guess if this problem is
X * present try if file.doc.vix exists. If it does, we set thisfile_sn
X * and try file_doc.vim (dots replaced by underscores for this file),
X * and try again. If it doesn't we assume that "file.doc.vim" already
X * exists.
X */
X if (!(p_sn || thisfile_sn)) /* not tried yet */
X {
X scriptname[n - 1] = 'x';
X r = getperm(scriptname); /* try "file.vix" */
X scriptname[n - 1] = 'm';
X if (r >= 0) /* it seems to exist */
X {
X thisfile_sn = TRUE;
X free(scriptname);
X scriptname = makescriptname(); /* '.' replaced by '_' */
X continue; /* try again */
X }
X }
X#endif
X /* if we get here ".vim" file really exists */
X emsg(".vim file exists: an edit of this file has not been finished");
X }
X
X if (scriptname[n - 1] == 'a') /* tried enough names, give up */
X {
X free(scriptname);
X break;
X }
X --scriptname[n - 1]; /* change last char of the name */
X }
X if (autoscriptfd != NULL) /* ".vim" file has been created */
X {
X script_winsize(); /* always start with a :win command */
X /* output cursor position if neccessary */
X if (Curpos.lnum > 1 || Curpos.col > 0)
X {
X sprintf(buf, "%ldG0%dl", (long)Curpos.lnum, (int)Curpos.col);
X Supdatescript(buf);
X }
X }
X
X#ifdef AMIGA
X if (dummyfd) /* file has been created temporarily */
X {
X fclose(dummyfd);
X remove(Filename);
X }
X#endif
X}
X
X int
Xstopscript()
X{
X if (!autoscriptfd)
X return FALSE; /* nothing to stop */
X
X#ifdef AMIGA
X# ifndef NO_ARP
X if (dos2)
X# endif
X Close((BPTR)autoscriptfd);
X# ifndef NO_ARP
X else
X fclose(autoscriptfd);
X# endif
X#else
X fclose(autoscriptfd);
X#endif
X remove(scriptname); /* delete the file */
X autoscriptfd = NULL;
X free(scriptname);
X return TRUE;
X}
X
X/*
X * open new script file
X * return 0 on success, 1 on error
X */
X int
Xopenscript(name)
X char *name;
X{
X int oldcurscript;
X
X if (curscript + 1 == NSCRIPT)
X {
X emsg(e_nesting);
X return 1;
X }
X else
X {
X if (scriptin[curscript] != NULL) /* already reading script */
X ++curscript;
X if ((scriptin[curscript] = fopen((char *)name, READBIN)) == NULL)
X {
X emsg(e_notopen);
X if (curscript)
X --curscript;
X return 1;
X }
X /*
X * With command ":g/pat/so! file" we have to execute the
X * commands from the file now.
X */
X if (global_busy)


X {
X State = NORMAL;

X oldcurscript = curscript;
X do
X {
X normal();
X vpeekc(); /* check for end of file */
X }
X while (scriptin[oldcurscript]);
X State = CMDLINE;
X }
X }


X return 0;
X}
X

X/*
X * updatescipt() is called when a character has to be written into the script file
X * or when we have waited some time for a character (c == 0)
X */
X void
Xupdatescript(c)
X int c;
X{
X static int count = 0;
X
X if (c && scriptout)
X putc(c, scriptout);
X if (autoscriptfd == NULL || (c == 0 && count == 0)) /* nothing to do */
X return;
X if (c)
X {
X#ifdef AMIGA
X# ifndef NO_ARP
X if (dos2)
X# endif
X FPutC((BPTR)autoscriptfd, (unsigned long)c);
X# ifndef NO_ARP
X else
X putc(c, autoscriptfd);
X# endif
X#else
X putc(c, autoscriptfd);
X#endif
X ++count;
X }
X if ((c == 0 || count >= p_uc) && Updated)
X {
X /*
X * Before DOS 2.0x we have to close and open the file in order to really
X * get the characters in the file to disk!
X * With DOS 2.0x Flush() can be used for that
X */
X#ifdef AMIGA
X# ifndef NO_ARP
X if (dos2)
X# endif
X Flush((BPTR)autoscriptfd);
X# ifndef NO_ARP
X else
X {
X fclose(autoscriptfd);
X autoscriptfd = fopen(scriptname, "a");
X }
X# endif
X#else /* !AMIGA */
X fclose(autoscriptfd);
X# ifdef MSDOS
X autoscriptfd = fopen(scriptname, "ab");
X# else
X autoscriptfd = fopen(scriptname, "a");
X# endif
X#endif
X count = 0;
X Updated = 0;
X }
X}
X
X static void
XSupdatescript(str)
X char *str;
X{
X while (*str)
X updatescript(*str++);
X}
X
X/*
X * try to open the ".vim" file for recovery
X * if recoverymode is 1: start recovery, set recoverymode to 2
X * if recoverymode is 2: stop recovery mode
X */
X void
Xopenrecover()
X{
X char *fname;
X struct stat efile, rfile;
X
X if (recoverymode == 2) /* end of recovery */
X {
X if (got_int)
X {
X emsg("Recovery Interrupted");
X /* somehow the cursor ends up in the wrong place (why?) */
X setcursor();
X flushbuf();
X }
X else
X msg("Recovery completed");
X recoverymode = 0;
X }
X else
X {
X fname = makescriptname();
X if (fname)
X {
X recoverymode = 2;
X if (Filename != NULL &&
X stat(Filename, &efile) != -1 &&
X stat(fname, &rfile) != -1 &&
X efile.st_mtime > rfile.st_mtime)
X emsg(".vim file is older; file not recovered");
X else
X {
X if (openscript(fname))
X emsg("Cannot open .vim file; file not recovered");
X }
X free(fname);


X }
X }
X}
X
X/*

X * make script name out of the filename
X */
X static char *
Xmakescriptname()
X{
X char *r, *s, *fname;
X
X r = modname(Filename, ".vim");
X if (*p_dir == 0 || r == NULL)
X return r;
X
X for (fname = s = r; *s; ++s) /* skip path */
X {
X#ifdef UNIX
X if (*s == '/') /* UNIX has ':' inside file names */
X#else
X if (*s == ':' || *s == PATHSEP)
X#endif
X fname = s + 1;
X }
X
X s = alloc((unsigned)(strlen(p_dir) + strlen(fname) + 1));
X if (s != NULL)
X {
X strcpy(s, p_dir);
X strcat(s, fname);
X }
X free(r);
X return s;
X}
X
X/*
X * add extention to filename - change path/fo.o.h to path/fo.o.h.ext or
X * fo_o_h.ext for MSDOS or when dotfname option reset.
X *
X * Assumed that fname is a valid name found in the filesystem we assure that
X * the return value is a different name and ends in ".ext".
X * "ext" MUST start with a "." and MUST be at most 4 characters long.
X * Space for the returned name is allocated, must be freed later.
X */
X
X char *
Xmodname(fname, ext)
X char *fname, *ext;
X{
X char *retval;
X register char *s;
X register char *ptr;
X register int fnamelen, extlen;
X char currentdir[512];
X
X extlen = strlen(ext);
X
X /*
X * if there is no filename we must get the name of the current directory
X * (we need the full path in case :cd is used)
X */
X if (fname == NULL || *fname == NUL)
X {
X (void)dirname(currentdir, 511);
X strcat(currentdir, PATHSEPSTR);
X fnamelen = strlen(currentdir);
X }
X else
X fnamelen = strlen(fname);
X retval = alloc((unsigned) (fnamelen + extlen + 1));
X if (retval != NULL)
X {
X if (fname == NULL || *fname == NUL)
X strcpy(retval, currentdir);
X else
X strcpy(retval, fname);
X /*
X * search backwards until we hit a '\' or ':' replacing all '.' by '_'
X * for MSDOS or when dotfname option reset.
X * Then truncate what is after the '\' or ':' to 8 characters for MSDOS
X * and 26 characters for AMIGA and UNIX.
X */
X for (ptr = retval + fnamelen; ptr >= retval; ptr--)
X {
X#ifndef MSDOS
X if (p_sn || thisfile_sn)
X#endif
X if (*ptr == '.') /* replace '.' by '_' */
X *ptr = '_';
X#ifdef UNIX
X if (*ptr == '/') /* UNIX has ':' inside file names */
X#else
X if (*ptr == ':' || *ptr == PATHSEP)
X#endif
X break;
X }
X ptr++;
X
X /* the filename has at most BASENAMELEN characters. */
X if (strlen(ptr) > BASENAMELEN)
X ptr[BASENAMELEN] = '\0';
X#ifndef MSDOS
X if ((p_sn || thisfile_sn) && strlen(ptr) > 8)
X ptr[8] = '\0';
X#endif
X s = ptr + strlen(ptr);
X
X /*
X * Append the extention.
X * ext must start with '.' and cannot exceed 3 more characters.
X */
X strcpy(s, ext);
X if (fname != NULL && strcmp(fname, retval) == 0)
X {
X /* after modification still the same name? */
X /* we search for a character that can be replaced by '_' */
X while (--s >= ptr)
X {
X if (*s != '_')
X {
X *s = '_';
X break;
X }
X }
X if (s < ptr)
X {
X /* fname was "________.<ext>" how tricky! */
X *ptr = 'v';
X }
X }
X }
X return retval;
X}
X
X/*
X * the new window size must be used in scripts;
X * write a ":winsize width height" command to the (auto)script
X * Postpone this action if not in NORMAL State, otherwise we may insert the
X * command halfway another command.
X */
Xint script_winsize_postponed = FALSE;
X
X void
Xscript_winsize()
X{
X char buf[25];
X
X if (!script_started || State != NORMAL) /* postpone action */
X {
X script_winsize_postponed = TRUE;
X return;
X }
X
X sprintf(buf, ":win %d %d\r", (int)Columns, (int)Rows);
X Supdatescript(buf);
X script_winsize_postponed = FALSE;
X}
X
X/*
X * This function is called after each "State = NORMAL"
X */
X void
Xscript_winsize_pp()
X{
X if (script_winsize_postponed)
X script_winsize();
X}
END_OF_FILE
if test 11660 -ne `wc -c <'vim/src/script.c'`; then
echo shar: \"'vim/src/script.c'\" unpacked with wrong size!
fi
# end of 'vim/src/script.c'
fi
if test -f 'vim/src/tag.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/tag.c'\"
else
echo shar: Extracting \"'vim/src/tag.c'\" \(9119 characters\)
sed "s/^X//" >'vim/src/tag.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * Code to handle tags and the tag stack


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"

X#include "param.h"
X#include "mark.h"
X
X#define TAGSTACKSIZE 20
X
X/*
X * the taggy struct is used to store the information about a :tag command:
X * the tag name and the cursor position BEFORE the :tag command
X */
Xstruct taggy
X{
X char *tagname; /* tag name */
X struct filemark fmark; /* cursor position */
X};
X
X/*
X * the tagstack grows from 0 upwards:
X * entry 0: older
X * entry 1: newer
X * entry 2: newest
X */
Xstatic struct taggy tagstack[TAGSTACKSIZE]; /* the tag stack */
Xstatic int tagstackidx = 0; /* index just below active entry */
Xstatic int tagstacklen = 0; /* number of tags on the stack */
X
Xstatic int findtag __ARGS((char *));
Xstatic char *firsttaborspace __ARGS((char *));
X
Xstatic char bottommsg[] = "at bottom of tag stack";
Xstatic char topmsg[] = "at top of tag stack";
X
X/*
X * Jump to tag; handling of tag stack
X *
X * *tag != NUL (:tag): jump to new tag, add to tag stack
X * type == 1 (:pop) || type == 2 (CTRL-T): jump to old position
X * type == 0 (:tag): jump to old tag
X */
X void
Xdotag(tag, type, count)
X char *tag;
X int type;
X int count;
X{
X int i;
X struct taggy temptag;
X
X if (*tag != NUL) /* new pattern, add to the stack */
X {
X /*
X * if last used entry is not at the top, put it at the top by rotating
X * the stack until it is (the newer entries will be at the bottom)
X */
X while (tagstackidx < tagstacklen)
X {
X temptag = tagstack[tagstacklen - 1];
X for (i = tagstacklen - 1; i > 0; --i)
X tagstack[i] = tagstack[i - 1];
X tagstack[0] = temptag;
X ++tagstackidx;
X }
X /* if tagstack is full: remove oldest entry */
X if (++tagstacklen > TAGSTACKSIZE)
X {
X tagstacklen = TAGSTACKSIZE;
X free(tagstack[0].tagname);
X for (i = 1; i < tagstacklen; ++i)
X tagstack[i - 1] = tagstack[i];
X --tagstackidx;
X }
X /*
X * remember the tag and the position before the jump
X */
X tagstack[tagstackidx].tagname = strsave(tag);
X tagstack[tagstackidx].fmark.lnum = Curpos.lnum;
X tagstack[tagstackidx].fmark.mark.col = Curpos.col;
X tagstack[tagstackidx].fmark.mark.ptr = nr2ptr(Curpos.lnum);
X tagstack[tagstackidx].fmark.fnum = 0;
X }
X else if (tagstacklen == 0) /* empty stack */
X {
X emsg("tag stack empty");
X return;
X }
X else if (type) /* go to older position */
X {
X if ((tagstackidx -= count) < 0)
X {
X tagstackidx = 0;
X emsg(bottommsg);
X }
X else if (tagstackidx >= tagstacklen) /* must have been count == 0 */
X {
X emsg(topmsg);
X return;
X }
X if (tagstack[tagstackidx].fmark.mark.ptr == NULL) /* jump to other file */
X {
X if (getaltfile(tagstack[tagstackidx].fmark.fnum - 1, tagstack[tagstackidx].fmark.lnum, TRUE))
X {
X emsg(e_notopen);
X return;
X }
X /* "refresh" this position, so we will not fall off the altfile array */
X tagstack[tagstackidx].fmark.fnum = 0;
X tagstack[tagstackidx].fmark.mark.ptr = nr2ptr(Curpos.lnum);
X }
X else
X Curpos.lnum = ptr2nr(tagstack[tagstackidx].fmark.mark.ptr, (linenr_t)1);
X Curpos.col = tagstack[tagstackidx].fmark.mark.col;
X return;
X }
X else /* go to newer pattern */
X {
X if ((tagstackidx += count - 1) >= tagstacklen)
X {
X tagstackidx = tagstacklen - 1;
X emsg(topmsg);
X }
X else if (tagstackidx < 0) /* must have been count == 0 */
X {
X emsg(bottommsg);
X tagstackidx = 0;
X return;
X }
X }
X if (findtag(tagstack[tagstackidx].tagname) > 0)
X ++tagstackidx;
X else if (bufempty()) /* "vim -t tag" failed, start script now */
X startscript();
X}
X
X/*
X * invalidate the line pointer for all tags
X * called when abandoning the current file
X */
X void
Xclrtags()


X{
X int i;
X

X for (i = 0; i < tagstacklen; ++i)
X tagstack[i].fmark.mark.ptr = NULL;
X}
X
X/*
X * increment the file number for all tags
X * called when adding a file to the file stack
X */
X void
Xincrtags()


X{
X int i;
X

X for (i = 0; i < tagstacklen; ++i)
X {
X#if 0 /* this would take too much time */
X if (tagstack[i].fmark.fnum == 0) /* current file */
X tagstack[i].fmark.lnum = ptr2nr(tagstack[i].fmark.mark.ptr, 1);
X#endif
X ++tagstack[i].fmark.fnum;
X }
X}
X
X/*
X * decrement the file number for the tags of the current file
X * called when not adding the current file name to the file stack
X */
X void
Xdecrtags()


X{
X int i;
X

X for (i = 0; i < tagstacklen; ++i)
X if (tagstack[i].fmark.fnum == 1)
X tagstack[i].fmark.fnum = 0;
X}
X
X/*
X * Print the tag stack (use the occasion to update the line numbers)
X */
X void
Xdotags()
X{
X int i;
X char *name;
X


X#ifdef AMIGA
X settmode(0); /* set cooked mode so output can be halted */
X#endif

X outstrn("\n # TO tag FROM line in file\n");
X for (i = 0; i < tagstacklen; ++i)
X {
X if (tagstack[i].tagname != NULL)
X {
X name = fm_getname(&(tagstack[i].fmark));
X if (name == NULL) /* file name not available */
X continue;
X
X sprintf(IObuff, "%c%2d %-15s %4ld %s\n",
X i == tagstackidx ? '>' : ' ',
X i + 1,
X tagstack[i].tagname,
X tagstack[i].fmark.lnum,
X name);
X outstrn(IObuff);
X }
X flushbuf();
X }
X if (tagstackidx == tagstacklen) /* idx at top of stack */
X outstrn(">\n");


X#ifdef AMIGA
X settmode(1);
X#endif
X wait_return(TRUE);
X}
X
X/*

X * findtag(tag) - goto tag
X * return 0 for failure, 1 for success
X */
X static int
Xfindtag(tag)
X char *tag;
X{
X FILE *tp, *fopen();
X char lbuf[LSIZE];
X char pbuf[LSIZE]; /* search pattern buffer */
X char *fname, *str;
X int cmplen;
X char *m = NULL;
X register char *p;
X char *np; /* pointer into file name string */
X char sbuf[CMDBUFFSIZE + 1]; /* tag file name */
X int i;
X int save_secure;
X
X if (tag == NULL) /* out of memory condition */
X return 0;
X
X if ((cmplen = p_tl) == 0)
X cmplen = 999;
X
X /* get stack of tag file names from tags option */
X for (np = p_tags; *np; )
X {
X for (i = 0; i < CMDBUFFSIZE && *np; ++i) /* copy next file name into lbuf */
X {
X if (*np == ' ')
X {
X ++np;
X break;
X }
X sbuf[i] = *np++;
X }
X sbuf[i] = 0;
X if ((tp = fopen(sbuf, "r")) == NULL)
X {
X m = "Can't open tags file %s";
X goto erret2;
X }
X while (fgets(lbuf, LSIZE, tp) != NULL)
X {
X m = "Format error in tags file %s"; /* default error message */
X
X /* find start of file name, after first TAB or space */
X fname = firsttaborspace(lbuf);


X if (fname == NULL)

X goto erret;
X *fname++ = '\0';
X
X /* find start of search command, after second TAB or space */
X str = firsttaborspace(fname);
X if (str == NULL)
X goto erret;
X *str++ = '\0';
X
X if (strncmp(lbuf, tag, (size_t)cmplen) == 0)
X {
X fclose(tp);
X /*
X * Tag found!
X * If the command is a string like "/^function fname"
X * scan through the search string. If we see a magic
X * char, we have to quote it. This lets us use "real"
X * implementations of ctags.
X */
X if (*str == '/' || *str == '?')
X {
X p = pbuf;
X *p++ = *str++; /* copy the '/' or '?' */
X if (*str == '^')
X *p++ = *str++; /* copy the '^' */
X
X while (*str)
X {
X switch (*str)
X {
X case '\\': if (str[1] == '(') /* remove '\' before '(' */
X ++str;
X else
X *p++ = *str++;
X break;
X
X case '\n': *p++ = pbuf[0]; /* copy '/' or '?' */
X *str = 'n'; /* no setpcmark() for search */
X break;
X
X /*
X * if string ends in search character: skip it
X * else escape it with '\'
X */
X case '/':
X case '?': if (*str != pbuf[0]) /* not a search char */
X break;
X if (str[1] == '\n') /* last char */
X {
X ++str;
X continue;
X }
X case '[':
X if (!p_magic)
X break;
X case '^':
X case '*':
X case '.': *p++ = '\\';
X break;
X }
X *p++ = *str++;
X }
X }
X else /* not a search command, just copy it */
X for (p = pbuf; *str && *str != '\n'; )
X *p++ = *str++;
X *p = NUL;
X
X RedrawingDisabled = TRUE;
X if ((i = getfile(fname, TRUE)) <= 0)
X {
X set_want_col = TRUE;
X
X RedrawingDisabled = FALSE;
X /* dosearch(pbuf[0] == '/' ? FORWARD : BACKWARD, pbuf + 1, FALSE, 1L); */
X save_secure = secure;
X secure = 1;
X docmdline((u_char *)pbuf);
X if (secure == 2) /* done something that is not allowed */
X wait_return(TRUE);
X secure = save_secure;
X
X if (p_im && i == -1)
X stuffReadbuff("\033\007i"); /* ESC CTRL-G i */
X else
X stuffReadbuff("\007"); /* CTRL-G */
X return 1;
X }
X RedrawingDisabled = FALSE;


X return 0;
X }
X }

X m = NULL;
X
Xerret:
X fclose(tp);
Xerret2:
X if (m)
X {
X smsg(m, sbuf);
X sleep(1);
X }
X }
X if (m == NULL)
X emsg("tag not found");


X return 0;
X}
X

X/*
X * find first TAB or space
X */
X static char *
Xfirsttaborspace(str)
X char *str;
X{
X char *p1, *p2;
X
X p1 = strchr(str, TAB); /* find first TAB */
X p2 = strchr(str, ' '); /* find first space */
X if (p1 == NULL || (p2 != NULL && p2 < p1))
X return p2; /* space comes first */
X return p1;
X}
END_OF_FILE
if test 9119 -ne `wc -c <'vim/src/tag.c'`; then
echo shar: \"'vim/src/tag.c'\" unpacked with wrong size!
fi
# end of 'vim/src/tag.c'
fi
echo shar: End of archive 5 \(of 23\).
cp /dev/null ark5isdone

Bram Moolenaar

unread,
Apr 23, 1993, 1:30:36 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 6
Archive-name: vim/part06
Environment: UNIX, AMIGA, MS-DOS

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:

# "End of archive 6 (of 23)."
# Contents: vim/src/misccmds.c vim/src/msdos.c vim/src/undo.c
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:08 1993


PATH=/bin:/usr/bin:/usr/ucb ; export PATH

if test -f 'vim/src/misccmds.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/misccmds.c'\"
else
echo shar: Extracting \"'vim/src/misccmds.c'\" \(13737 characters\)
sed "s/^X//" >'vim/src/misccmds.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * misccmds.c: functions that didn't seem to fit elsewhere


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X#include "param.h"
X

Xstatic char *(si_tab[]) = {"if", "else", "while", "for", "do"};
X
X/*
X * count the size of the indent in the current line
X */
X int
Xget_indent()
X{
X register char *ptr;
X register int count = 0;
X
X for (ptr = nr2ptr(Curpos.lnum); *ptr; ++ptr)
X {
X if (*ptr == TAB) /* count a tab for what it is worth */
X count += p_ts - (count % p_ts);
X else if (*ptr == ' ')
X ++count; /* count a space for one */


X else
X break;
X }

X return (count);
X}
X
X/*
X * set the indent of the current line
X * leaves the cursor on the first non-blank in the line
X */
X void
Xset_indent(size, delete)
X register int size;
X int delete;
X{
X int oldstate = State;
X
X State = INSERT; /* don't want REPLACE for State */
X Curpos.col = 0;
X if (delete)
X {
X while (isspace(gcharCurpos())) /* delete old indent */
X delchar(FALSE);
X }
X while (size >= p_ts)
X {
X inschar(TAB);
X size -= p_ts;
X }
X while (size)
X {
X inschar(' ');
X --size;


X }
X State = oldstate;
X script_winsize_pp();

X}
X
X/*
X * Opencmd
X *
X * Add a blank line below or above the current line.
X */
X
X int
XOpencmd(dir, redraw)
X int dir;
X int redraw;
X{
X char *l;
X char *ptr;
X FPOS oldCurpos; /* old cursor position */
X int newcol = 0; /* new cursor column */
X int newindent = 0; /* auto-indent of the new line */
X int extra = 0; /* number of bytes to be copied from current line */
X int n;
X int truncate = FALSE; /* truncate current line afterwards */
X int no_si = FALSE; /* reset did_si afterwards */
X
X ptr = nr2ptr(Curpos.lnum);
X u_clearline(); /* cannot do "U" command when adding lines */
X did_si = FALSE;
X if (p_ai || p_si)
X {
X /*
X * count white space on current line
X */
X newindent = get_indent();
X
X /*
X * If we just did an auto-indent, then we didn't type anything on the
X * prior line, and it should be truncated.
X */
X if (dir == FORWARD && did_ai)
X truncate = TRUE;
X else if (p_si)
X {
X char *p;
X char *pp;
X int i, save;
X
X p = ptr;
X skipspace(&p);
X if (dir == FORWARD)
X {
X if (*p == '{')
X {
X did_si = TRUE;
X no_si = TRUE;
X }
X else
X {
X for (pp = p; islower(*pp); ++pp) ;
X if (!isidchar(*pp))
X {
X save = *pp;
X *pp = NUL;
X for (i = sizeof(si_tab)/sizeof(char *); --i >= 0; )
X if (strcmp(p, si_tab[i]) == 0)
X {
X did_si = TRUE;
X break;
X }
X *pp = save;
X }
X }
X }
X else
X {
X if (*p == '}')
X did_si = TRUE;
X }
X }
X did_ai = TRUE;
X if (p_si)
X can_si = TRUE;
X }
X if (State == INSERT || State == REPLACE) /* only when dir == FORWARD */
X extra = strlen(ptr + Curpos.col);
X if ((l = alloc_line(extra)) == NULL)
X return (FALSE);
X if (extra)
X {
X strcpy(l, ptr + Curpos.col);
X did_ai = FALSE; /* don't trucate now */
X }
X
X oldCurpos = Curpos;
X if (dir == BACKWARD)
X --Curpos.lnum;
X if (appendline(Curpos.lnum, l) == FALSE)
X return FALSE;
X if (newindent || did_si)
X {
X ++Curpos.lnum;
X if (did_si)
X {
X if (p_sr)
X newindent -= newindent % p_sw;
X newindent += p_sw;
X }
X set_indent(newindent, FALSE);
X newcol = Curpos.col;
X if (no_si)
X did_si = FALSE;
X }
X Curpos = oldCurpos;
X
X if (dir == FORWARD)
X {
X if (truncate)
X *ptr = NUL;
X else if (extra)
X {
X truncate = TRUE;
X *(ptr + Curpos.col) = NUL; /* truncate current line at cursor */
X }
X if (truncate)
X canincrease(0);
X
X /*
X * Get the cursor to the start of the line, so that 'Cursrow' gets
X * set to the right physical line number for the stuff that
X * follows...
X */


X Curpos.col = 0;
X

X if (redraw)
X {
X cursupdate();
X
X /*
X * If we're doing an open on the last logical line, then go ahead and
X * scroll the screen up. Otherwise, just insert a blank line at the
X * right place. We use calls to plines() in case the cursor is
X * resting on a long line.
X */
X n = Cursrow + plines(Curpos.lnum);
X if (n == (Rows - 1))
X scrollup(1L);
X else
X s_ins(n, 1, TRUE);
X }
X ++Curpos.lnum; /* cursor moves down */
X }
X else if (redraw)
X s_ins(Cursrow, 1, TRUE); /* insert physical line */
X
X Curpos.col = newcol;
X if (redraw)
X {
X updateScreen(VALID_TO_CURSCHAR);
X cursupdate(); /* update Cursrow */
X }
X CHANGED;
X
X return (TRUE);
X}
X
X/*
X * plines(p) - return the number of physical screen lines taken by line 'p'
X */
X int
Xplines(p)
X linenr_t p;
X{
X register int col = 0;
X register u_char *s;
X
X#ifdef DEBUG
X if (p == 0)
X {
X emsg("plines(0) ????");
X return (0);
X }
X#endif
X s = (u_char *)nr2ptr(p);
X
X if (*s == NUL) /* empty line */
X return 1;
X
X while (*s != NUL)
X col += chartabsize(*s++, col);
X
X /*
X * If list mode is on, then the '$' at the end of the line takes up one
X * extra column.
X */
X if (p_list)
X col += 1;
X
X /*
X * If 'number' mode is on, add another 8.
X */
X if (p_nu)
X col += 8;
X
X return ((col + ((int)Columns - 1)) / (int)Columns);
X}
X
X/*
X * Count the physical lines (rows) for the lines "first" to "last" inclusive.
X */
X int
Xplines_m(first, last)
X linenr_t first, last;
X{
X int count = 0;
X
X while (first <= last)
X count += plines(first++);
X return (count);
X}
X
X void
Xfileinfo()
X{
X if (bufempty())
X {
X msg("Buffer Empty");
X return;
X }
X sprintf(IObuff, "\"%s\"%s line %ld of %ld -- %d %% --",
X (Filename != NULL) ? Filename : "No File",
X Changed ? " [Modified]" : "",
X (long)Curpos.lnum,
X (long)line_count,
X (int)(((long)Curpos.lnum * 100L) / (long)line_count));
X
X if (numfiles > 1)
X sprintf(IObuff + strlen(IObuff), " (file %d of %d)", curfile + 1, numfiles);
X msg(IObuff);
X}
X
X void
Xsetfname(s)
X char *s;
X{


X if (Filename != NULL)

X free(Filename);
X if (s == NULL || *s == NUL)
X Filename = NULL;
X else
X {
X FullName(s, IObuff, IOSIZE);
X Filename = (char *)strsave(IObuff);
X }
X#ifndef MSDOS
X thisfile_sn = FALSE;
X#endif
X}
X
X/*
X * return nonzero if "s" is not the same file as current file
X */
X int
Xotherfile(s)
X char *s;
X{
X if (s == NULL || *s == NUL || Filename == NULL) /* no name is different */
X return TRUE;
X FullName(s, IObuff, IOSIZE);
X return fnamecmp(IObuff, Filename);
X}
X
X/*
X * put filename in title bar of window
X */
X void
Xmaketitle()
X{
X#ifdef AMIGA
X if (Filename == NULL)
X settitle("");
X else
X {
X if (numfiles == 1)
X settitle(Filename);
X else
X {
X sprintf(IObuff, "%s (%d of %d)", Filename, curfile + 1, numfiles);
X settitle(IObuff);
X }
X }
X#endif
X}
X
X void
Xinschar(c)
X int c;
X{
X register char *p;
X register char *pend;
X
X p = nr2ptr(Curpos.lnum);
X pend = p + Curpos.col;
X if (State != REPLACE || *pend == NUL)
X {
X /* make room for the new char. */
X if (!canincrease(1))
X return;
X
X p = nr2ptr(Curpos.lnum);
X pend = p + Curpos.col;
X p += strlen(p) + 1;
X
X for (; p > pend; p--)
X *p = *(p - 1);
X }
X *pend = c;
X
X /*
X * If we're in insert mode and showmatch mode is set, then check for
X * right parens and braces. If there isn't a match, then beep. If there
X * is a match AND it's on the screen, then flash to it briefly. If it
X * isn't on the screen, don't do anything.
X */
X if (p_sm && State == INSERT && (c == ')' || c == '}' || c == ']'))
X {
X FPOS *lpos, csave;
X
X if ((lpos = showmatch()) == NULL) /* no match, so beep */
X beep();
X else if (lpos->lnum >= Topline)
X {
X updateScreen(VALID_TO_CURSCHAR); /* show the new char first */
X csave = Curpos;
X Curpos = *lpos; /* move to matching char */
X cursupdate();
X setcursor();
X flushbuf();
X vim_delay(); /* brief pause */
X Curpos = csave; /* restore cursor position */
X cursupdate();
X }
X }
X ++Curpos.col;
X
X CHANGED;
X}
X
X void
Xinsstr(s)
X register char *s;
X{
X register char *p;
X register char *pend;
X register int n = strlen(s);
X
X /* Move everything in the file over to make */
X /* room for the new string. */
X if (!canincrease(n))
X return;
X
X p = nr2ptr(Curpos.lnum);
X pend = p + Curpos.col;
X p += strlen(p) + n;
X
X for (; p > pend; p--)
X *p = *(p - n);
X
X Curpos.col += n;
X while (--n >= 0)
X *p++ = *s++;
X
X CHANGED;
X}
X
X int
Xdelchar(fixpos)
X int fixpos; /* if TRUE fix the cursor position when done */
X{
X char *ptr;
X int lastchar;
X
X ptr = pos2ptr(&Curpos);
X
X if (*ptr == NUL) /* can't do anything */
X return FALSE;
X
X lastchar = (*++ptr == NUL);
X /* Delete the char. at Curpos by shifting everything in the line down. */
X do
X *(ptr - 1) = *ptr;
X while (*ptr++);
X
X /*
X * If we just took off the last character of a non-blank line, we don't
X * want to end up positioned at the newline.
X */
X if (fixpos && Curpos.col > 0 && lastchar && State != INSERT)
X --Curpos.col;
X
X (void)canincrease(0);
X CHANGED;


X return TRUE;
X}
X

X void
Xdellines(nlines, can_update)
X long nlines;
X int can_update;
X{
X int doscreen; /* if true, update the screen */
X int num_plines = 0;
X
X doscreen = can_update;
X /*
X * There's no point in keeping the screen updated if we're deleting more
X * than a screen's worth of lines.
X */
X if (nlines > (Rows - 1) && can_update)
X {
X doscreen = FALSE;
X /* flaky way to clear rest of screen */
X s_del(Cursrow, (int)Rows - 1, TRUE);
X }
X while (nlines-- > 0)
X {
X if (bufempty()) /* nothing to delete */


X break;
X
X /*

X * Set up to delete the correct number of physical lines on the
X * screen
X */
X if (doscreen)
X num_plines += plines(Curpos.lnum);
X
X free_line(delsline(Curpos.lnum, TRUE));
X
X CHANGED;
X
X /* If we delete the last line in the file, stop */
X if (Curpos.lnum > line_count)
X {
X Curpos.lnum = line_count;
X break;
X }
X }
X Curpos.col = 0;
X /*
X * Delete the correct number of physical lines on the screen
X */
X if (doscreen && num_plines > 0)
X s_del(Cursrow, num_plines, TRUE);
X}
X
X int
Xgchar(pos)
X FPOS *pos;
X{
X return (int)(*(pos2ptr(pos)));
X}
X
X int
XgcharCurpos()
X{
X return (int)(*(pos2ptr(&Curpos)));
X}
X
X/*
X * return TRUE if the cursor is before or on the first non-blank in the line
X */
X int
Xinindent()
X{
X register char *ptr;
X register int col;
X
X for (col = 0, ptr = nr2ptr(Curpos.lnum); isspace(*ptr++); ++col)
X ;
X if (col >= Curpos.col)
X return TRUE;
X else


X return FALSE;
X}
X
X/*

X * skipspace: skip over ' ' and '\t'.
X *
X * note: you must give a pointer to a char pointer!
X */
X void
Xskipspace(pp)
X char **pp;
X{


X register char *p;
X

X for (p = *pp; *p == ' ' || *p == '\t'; ++p) /* skip to next non-white */
X ;
X *pp = p;
X}
X
X/*
X * skiptospace: skip over text until ' ' or '\t'.
X *
X * note: you must give a pointer to a char pointer!
X */
X void
Xskiptospace(pp)
X char **pp;
X{


X register char *p;
X

X for (p = *pp; *p != ' ' && *p != '\t' && *p != NUL; ++p)
X ;
X *pp = p;
X}
X
X/*
X * getdigits: get a number from a string and skip over it
X *
X * note: you must give a pointer to a char pointer!
X */
X
X long
Xgetdigits(pp)
X char **pp;
X{
X register char *p;
X long retval;
X
X p = *pp;
X retval = atol(p);
X while (isdigit(*p)) /* skip to next non-digit */
X ++p;
X *pp = p;


X return retval;
X}
X

X char *
Xplural(n)
X long n;
X{
X static char buf[2] = "s";
X
X if (n == 1)
X return &(buf[1]);
X return &(buf[0]);
X}
X
X/*
X * set_Changed is called whenever something in the file is changed
X * If the file is readonly, give a warning message with the first change.
X */
X void
Xset_Changed()
X{
X if (Changed == 0 && p_ro)
X emsg("Warning: Changing a readonly file");
X Changed = 1;
X Updated = 1;
X}
X
X int
Xask_yesno(str)
X char *str;
X{
X int r = ' ';
X
X while (r != 'y' && r != 'n')
X {
X smsg("%s (y/n)? ", str);
X r = vgetc();
X outchar(r); /* show what you typed */
X flushbuf();
X }


X return r;
X}
X

X void
Xmsgmore(n)
X long n;
X{
X long pn;
X
X if (n > 0)
X pn = n;
X else
X pn = -n;
X
X if (pn > p_report)
X smsg("%ld %s line%s %s", pn, n > 0 ? "more" : "fewer", plural(pn),
X got_int ? "(Interrupted)" : "");
X}
X
X/*
X * give a warning for an error
X */
X void
Xbeep()
X{
X flush_buffers();
X if (p_vb)
X {
X if (T_VB && *T_VB)
X outstr(T_VB);
X else
X { /* very primitive visual bell */
X msg(" ^G");
X msg(" ^G");
X msg(" ^G ");
X msg(" ^G");


X msg(" ");
X }
X }

X else
X outchar('\007');
X}
X
X/*
X * Expand environment variable with path name.
X * If anything fails no expansion is done and dst equals src.
X */
X void
Xexpand_env(src, dst, dstlen)
X char *src; /* input string e.g. "$HOME/vim.hlp" */
X char *dst; /* where to put the result */
X int dstlen; /* maximum length of the result */
X{
X char *tail;
X int c;
X char *var;
X
X if (*src == '$')
X {
X/*
X * The variable name is copied into dst temporarily, because it may be
X * a string in read-only memory.
X */
X tail = src + 1;
X var = dst;
X c = dstlen;
X while (c-- > 0 && *tail && *tail != PATHSEP)
X *var++ = *tail++;
X *var = NUL;
X var = (char *)vimgetenv(dst);
X if (*tail)
X ++tail;
X if (var && (strlen(var) + strlen(tail) + 1 < dstlen))
X {
X sprintf(dst, "%s%c%s", var, PATHSEP, tail);
X return;
X }
X }
X strncpy(dst, src, (size_t)dstlen);
X}
X
X/*
X * Compare two file names and return TRUE if they are different files.
X * For the first name environment variables are expanded
X */
X int
Xfullpathcmp(s1, s2)
X char *s1, *s2;
X{
X#ifdef UNIX
X struct stat st1, st2;
X char buf1[MAXPATHL];
X
X expand_env(s1, buf1, MAXPATHL);
X st1.st_dev = 99; /* if stat fails, st1 and st2 will be different */
X st2.st_dev = 100;
X stat(buf1, &st1);
X stat(s2, &st2);
X if (st1.st_dev == st2.st_dev && st1.st_ino == st2.st_ino)
X return FALSE;
X return TRUE;
X#else
X char buf1[MAXPATHL];
X char buf2[MAXPATHL];
X
X expand_env(s1, buf2, MAXPATHL);
X if (FullName(buf2, buf1, MAXPATHL) && FullName(s2, buf2, MAXPATHL))
X return strcmp(buf1, buf2);
X /*
X * one of the FullNames() failed, file probably doesn't exist.
X */
X return TRUE;
X#endif
X}
END_OF_FILE
if test 13737 -ne `wc -c <'vim/src/misccmds.c'`; then
echo shar: \"'vim/src/misccmds.c'\" unpacked with wrong size!
fi
# end of 'vim/src/misccmds.c'
fi
if test -f 'vim/src/msdos.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/msdos.c'\"
else
echo shar: Extracting \"'vim/src/msdos.c'\" \(13589 characters\)
sed "s/^X//" >'vim/src/msdos.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * msdos.c
X *
X * MSDOS system-dependent routines.
X * A cheap plastic imitation of the amiga dependent code.
X * A lot in this file was made by Juergen Weigert (jw).


X */
X
X#include "vim.h"
X#include "globals.h"

X#include "param.h"
X#include "proto.h"
X#include <conio.h>
X#include <fcntl.h>
X#include <bios.h>
X
Xstatic int WaitForChar __ARGS((int));
Xstatic int cbrk_handler __ARGS(());
X
X#ifdef WILD_CARDS
Xtypedef struct filelist
X{
X char **file;
X int nfiles;
X int maxfiles;
X} FileList;
X
Xstatic void addfile __ARGS((FileList *, char *));
Xstatic int pstrcmp __ARGS((char **, char **));
Xstatic void strlowcpy __ARGS((char *, char *));
Xstatic int expandpath __ARGS((FileList *, char *, int, int, int));
X#endif
X
Xstatic int cbrk_pressed = FALSE; /* set by ctrl-break interrupt */
Xstatic int ctrlc_pressed = FALSE; /* set when ctrl-C or ctrl-break detected */
Xstatic int delayed_redraw = FALSE; /* set when ctrl-C detected */
X
X/*
X * the number of calls to Write is reduced by using the buffer "outbuf"
X */
X#define BSIZE 2048
Xstatic u_char outbuf[BSIZE];
Xstatic int bpos = 0;
X
X#ifdef DEBUG
X/*
X * Put two characters in the video buffer without calling BIOS or DOS.
X */
Xblink(n)
X int n;
X{
X char far *p;
X static int counter;
X
X p = MK_FP(0xb800, 0x10 + n); /* p points in screen buffer */
X *p = counter;
X *(p + 1) = counter;
X *(p + 2) = counter;
X *(p + 3) = counter;
X ++counter;
X}
X#endif
X
X void
Xvim_delay()
X{
X delay(500);
X}
X
X/*
X * this version of remove is not scared by a readonly (backup) file
X */
X int
Xremove(name)
X char *name;
X{
X setperm(name, 0); /* default permissions */
X return unlink(name);
X}
X
X/*
X * flushbuf(): flush the output buffer
X */
X void
Xflushbuf()
X{
X if (bpos != 0)
X {
X write(1, (char *)outbuf, (long)bpos);
X bpos = 0;
X }
X}
X
X/*
X * outchar(c): put a character into the output buffer.
X * Flush it if it becomes full.
X */
X void
Xoutchar(c)
X unsigned c;
X{
X outbuf[bpos] = c;
X ++bpos;
X if (bpos >= BSIZE)
X flushbuf();
X}
X
X/*
X * outstr(s): put a string character at a time into the output buffer.
X */
X void
Xoutstr(s)
X register char *s;
X{
X if (!s) /* s is NULL in case of not defined termcap entry */
X return;
X /*
X * The prefix ESC| is used to emulate capabilities
X * missing in ansi.sys by direct calls to conio routines.
X * If we want to avoid this we need the nansi.sys driver. (jw)
X * Only works if the string starts with ESC!
X */
X if (s[0] == ESC && s[1] == '|')
X {
X flushbuf();
X switch (s[2])
X {
X case 'L': insline();
X return;
X
X case 'M': delline();
X return;
X
X default: outstr("OOPS");
X return;
X }
X }
X#ifdef TERMCAP
X tputs(s, 1, outchar);
X#else
X while (*s)
X outchar(*s++);
X#endif
X}
X
X#define POLL_SPEED 10 /* milliseconds between polls */
X
X/*
X * Simulate WaitForChar() by slowly polling with bioskey(1).
X *
X * If Vim should work over the serial line after a 'ctty com1' we must use
X * kbhit() and getch(). (jw)
X * Usually kbhit() is not used, because then CTRL-C will be catched by DOS (mool).
X */
X
X static int
XWaitForChar(msec)
X int msec;
X{
X do
X {
X#ifdef USE_KBHIT
X if (kbhit() || cbrk_pressed)
X#else
X if (bioskey(1) || cbrk_pressed)
X#endif
X return 1;
X delay(POLL_SPEED);
X msec -= POLL_SPEED;
X }
X while (msec >= 0);


X return 0;
X}
X
X/*

X * GetChars(): low level input function.
X * Get characters from the keyboard.
X * If type == T_PEEK do not wait for characters.
X * If type == T_WAIT wait a short time for characters.
X * If type == T_BLOCK wait for characters.
X */
X int
XGetChars(buf, maxlen, type)
X char *buf;
X int maxlen;
X int type;


X{
X int len = 0;

X int time = 1000; /* one second */
X int c;
X
X/*
X * if we got a ctrl-C when we were busy, there will be a "^C" somewhere
X * on the sceen, so we need to redisplay it.
X */
X if (delayed_redraw)
X {
X delayed_redraw = FALSE;
X updateScreen(CLEAR);


X setcursor();
X flushbuf();
X }
X

X switch (type)
X {
X case T_PEEK:
X time = 1;
X /* FALLTHROUGH */
X
X case T_WAIT:
X if (WaitForChar(time) == 0) /* no character available */
X return 0;
X break;
X
X case T_BLOCK:
X /*
X * If there is no character available within 2 seconds (default)
X * write the autoscript file to disk
X */
X if (WaitForChar((int)p_ut) == 0)
X updatescript(0);
X }
X
X/*
X * Try to read as many characters as there are.
X * Works for the controlling tty only.
X */
X --maxlen; /* may get two chars at once */
X /*
X * we will get at least one key. Get more if they are available
X * After a ctrl-break we have to read a 0 (!) from the buffer.
X * bioskey(1) will return 0 if no key is available and when a
X * ctrl-break was typed. When ctrl-break is hit, this does not always
X * implies a key hit.
X */
X cbrk_pressed = FALSE;
X#ifdef USE_KBHIT
X while ((len == 0 || kbhit()) && len < maxlen)
X {
X switch (c = getch())
X {
X case 0:
X *buf++ = K_NUL;
X break;
X case 3:
X cbrk_pressed = TRUE;
X /*FALLTHROUGH*/
X default:
X *buf++ = c;
X }
X len++;
X }
X#else
X while ((len == 0 || bioskey(1)) && len < maxlen)
X {
X c = bioskey(0); /* get the key */
X if (c == 0) /* ctrl-break */
X c = 3; /* return a CTRL-C */
X if ((c & 0xff) == 0)
X {
X if (c == 0x0300) /* CTRL-@ is 0x0300, translated into K_ZERO */
X c = K_ZERO;
X else /* extended key code 0xnn00 translated into K_NUL, nn */
X {
X c >>= 8;
X *buf++ = K_NUL;
X ++len;
X }
X }
X
X *buf++ = c;
X len++;
X }
X#endif


X return len;
X}
X

Xextern int _fmode;
X
X void
Xtextfile(on)
X int on;
X{
X /*
X * in O_TEXT mode we read and write files with CR/LF translation.
X */
X _fmode = on ? O_TEXT : O_BINARY;
X}
X
X/*
X * We have no job control, fake it by starting a new shell.
X */
X void
Xmch_suspend()
X{
X outstr("new shell started\n");
X stoptermcap();
X call_shell(NULL, 0);
X starttermcap();
X}
X
X/*
X * we do not use windows, there is not much to do here
X */
X void
Xmch_windinit()
X{
X textfile(p_tx);
X flushbuf();
X}
X
X void
Xcheck_win(argc, argv)


X int argc;
X char **argv;
X{

X if (!isatty(0) || !isatty(1))
X {
X fprintf(stderr, "VIM: no controlling terminal\n");
X exit(2);
X }
X}
X
X/*
X * fname_case(): Set the case of the filename, if it already exists.
X * msdos filesystem is far to primitive for that. do nothing.
X */
X void
Xfname_case(name)


X char *name;
X{
X}

X
X/*
X * settitle(): set titlebar of our window.
X * Dos console has no title.
X */
X void
Xsettitle(str)


X char *str;
X{
X}

X
X void
Xresettitle()
X{
X}
X
X/*
X * get name of current directory into buffer 'buf' of length 'len' bytes
X */
X int
Xdirname(buf, len)
X char *buf;
X int len;
X{
X return (int)getcwd(buf, len);
X}
X
X/*
X * get absolute filename into buffer 'buf' of length 'len' bytes
X */
X int
XFullName(fname, buf, len)
X char *fname, *buf;
X int len;
X{
X /* failed, because we are under MSDOS */
X strncpy(buf, fname, len);


X return 0;
X}
X
X/*

X * get file permissions for 'name'
X * -1 : error
X * else FA_attributes defined in dos.h
X */
X long
Xgetperm(name)
X char *name;
X{
X int r;
X
X r = _chmod(name, 0, 0); /* get file mode */


X return r;
X}
X

X/*
X * set file permission for 'name' to 'perm'
X */
X int
Xsetperm(name, perm)
X char *name;
X int perm;
X{
X perm &= ~FA_ARCH;
X return _chmod(name, 1, perm);
X}
X
X/*
X * check if "name" is a directory
X */
X int
Xisdir(name)
X char *name;
X{
X return (_chmod(name, 0, 0) & FA_DIREC) ? 1 : 0;
X}
X
X/*
X * Careful: mch_windexit() may be called before mch_windinit()!
X */
X void
Xmch_windexit(r)
X int r;
X{
X settmode(0);
X stoptermcap();
X flushbuf();
X stopscript(); /* remove autoscript file */
X exit(r);
X}
X
X/*
X * function for ctrl-break interrupt
X */
X void interrupt
Xcatch_cbrk()
X{
X cbrk_pressed = TRUE;
X ctrlc_pressed = TRUE;
X}
X
X/*
X * ctrl-break handler for DOS. Never called when a ctrl-break is typed, because
X * we catch interrupt 1b. If you type ctrl-C while Vim is waiting for a
X * character this function is not called. When a ctrl-C is typed while Vim is
X * busy this function may be called. By that time a ^C has been displayed on
X * the screen, so we have to redisplay the screen. We can't do that here,
X * because we may be called by DOS. The redraw is in GetChars().


X */
X static int

Xcbrk_handler()
X{
X delayed_redraw = TRUE;
X return 1; /* resume operation after ctrl-break */
X}
X
X/*
X * function for critical error interrupt
X * For DOS 1 and 2 return 0 (Ignore).
X * For DOS 3 and later return 3 (Fail)
X */
X void interrupt
Xcatch_cint(bp, di, si, ds, es, dx, cx, bx, ax)
X unsigned bp, di, si, ds, es, dx, cx, bx, ax;
X{
X ax = (ax & 0xff00); /* set AL to 0 */
X if (_osmajor >= 3)
X ax |= 3; /* set AL to 3 */
X}
X
X/*
X * set the tty in (raw) ? "raw" : "cooked" mode
X *
X * Does not change the tty, as bioskey() works raw all the time.
X */
X
Xextern void interrupt CINT_FUNC();
X
X void
Xmch_settmode(raw)
X int raw;
X{
X static int saved_cbrk;
X static void interrupt (*old_cint)();
X static void interrupt (*old_cbrk)();
X
X if (raw)
X {
X saved_cbrk = getcbrk(); /* save old ctrl-break setting */
X setcbrk(0); /* do not check for ctrl-break */
X old_cint = getvect(0x24); /* save old critical error interrupt */
X setvect(0x24, catch_cint); /* install our critical error interrupt */
X old_cbrk = getvect(0x1B); /* save old ctrl-break interrupt */
X setvect(0x1B, catch_cbrk); /* install our ctrl-break interrupt */
X ctrlbrk(cbrk_handler); /* vim's ctrl-break handler */
X }
X else
X {
X setcbrk(saved_cbrk); /* restore ctrl-break setting */
X setvect(0x24, old_cint); /* restore critical error interrupt */
X setvect(0x1B, old_cbrk); /* restore ctrl-break interrupt */
X /* restore ctrl-break handler, how ??? */
X }
X}
X
X int
Xmch_get_winsize()
X{
X struct text_info ti;
X
X debug("mch_get_winsize\n");
X if (!term_console)
X return 1;
X gettextinfo(&ti);
X Columns = ti.screenwidth;
X Rows = ti.screenheight;
X if (Columns < 5 || Columns > MAX_COLUMNS ||
X Rows < 2 || Rows > MAX_COLUMNS)
X {
X /* these values are not used. overwritten by termcap size or default */
X Columns = 80;
X Rows = 24;
X return 1;
X }


X return 0;
X}
X

X void
Xmch_set_winsize()
X{
X /* should try to set the window size to Rows and Columns */
X /* may involve switching display mode.... */
X}
X
X int
Xcall_shell(cmd, filter)
X char *cmd;
X int filter; /* if != 0: called by dofilter() */
X{
X int x;
X char newcmd[200];
X
X flushbuf();
X
X settmode(0); /* set to cooked mode */
X
X if (cmd == NULL)
X x = system(p_sh);
X else
X { /* we use "command" to start the shell, slow but easy */
X sprintf(newcmd, "%s /c %s", p_sh, cmd);
X x = system(newcmd);
X }
X outchar('\n');
X settmode(1); /* set to raw mode */
X
X if (x)
X {
X smsg("%d returned", x);


X outchar('\n');
X }

X
X resettitle();
X return x;
X}
X
X/*
X * check for an "interrupt signal": CTRL-break or CTRL-C
X */
X void
Xbreakcheck()
X{
X if (ctrlc_pressed)
X {
X ctrlc_pressed = FALSE;
X got_int = TRUE;
X flush_buffers(); /* remove all typeahead and macro stuff */
X }
X}
X
X#ifdef WILD_CARDS
X#define FL_CHUNK 32
X
X static void
Xaddfile(fl, f)
X FileList *fl;
X char *f;
X{
X if (!fl->file)
X {
X fl->file = (char **)alloc(sizeof(char *) * FL_CHUNK);
X if (!fl->file)
X return;
X fl->nfiles = 0;
X fl->maxfiles = FL_CHUNK;
X }
X if (fl->nfiles >= fl->maxfiles)
X {
X char **t;
X int i;
X
X t = (char **)alloc(sizeof(char *) * (fl->maxfiles + FL_CHUNK));
X if (!t)
X return;
X for (i = fl->nfiles - 1; i >= 0; i--)
X t[i] = fl->file[i];
X free(fl->file);
X fl->file = t;
X fl->maxfiles += FL_CHUNK;
X }
X fl->file[fl->nfiles++] = f;
X}
X
X static int
Xpstrcmp(a, b)
X char **a, **b;
X{
X return (strcmp(*a, *b));
X}
X
X int
Xhas_wildcard(s)
X char *s;
X{
X if (s)
X for ( ; *s; ++s)
X if (*s == '?' || *s == '*')
X return 1;


X return 0;
X}
X

X static void
Xstrlowcpy(d, s)
X char *d, *s;
X{
X while (*s)
X *d++ = tolower(*s++);
X *d = '\0';
X}
X
X static int
Xexpandpath(fl, path, fonly, donly, notf)
X FileList *fl;
X char *path;
X int fonly, donly, notf;
X{
X char buf[MAXPATH];
X char *p, *s, *e;
X int lastn, c, r;
X struct ffblk fb;
X
X lastn = fl->nfiles;
X
X/*
X * Find the first part in the path name that contains a wildcard.
X * Copy it into buf, including the preceding characters.
X */
X p = buf;
X s = NULL;
X e = NULL;
X while (*path)
X {
X if (*path == '\\' || *path == ':' || *path == '/')
X {
X if (e)
X break;
X else
X s = p;
X }
X if (*path == '*' || *path == '?')
X e = p;
X *p++ = *path++;
X }
X e = p;
X if (s)
X s++;
X else
X s = buf;
X
X /* now we have one wildcard component between s and e */
X *e = '\0';
X r = 0;
X if ((c = findfirst(buf, &fb, *path ? FA_DIREC : 0)) != 0)
X {
X /* not found */
X strcpy(e, path);
X if (notf)
X addfile(fl, strsave(buf));
X return 1; /* unexpanded or empty */
X }
X while (!c)
X {
X strlowcpy(s, fb.ff_name);
X if (*s != '.' || (s[1] != '\0' && (s[1] != '.' || s[2] != '\0')))
X {
X strcat(buf, path);
X if (!has_wildcard(path))
X addfile(fl, strsave(buf));
X else
X r |= expandpath(fl, buf, fonly, donly, notf);
X }
X c = findnext(&fb);
X }
X qsort(fl->file + lastn, fl->nfiles - lastn, sizeof(char *), pstrcmp);


X return r;
X}
X

X/*
X * MSDOS rebuilt of Scott Ballantynes ExpandWildCard for amiga/arp.
X * jw
X */
X
X int
XExpandWildCards(num_pat, pat, num_file, file, files_only, list_notfound)
X int num_pat;
X char **pat;
X int *num_file;
X char ***file;
X int files_only, list_notfound;
X{
X int i, r = 0;
X FileList f;
X
X f.file = NULL;
X f.nfiles = 0;
X for (i = 0; i < num_pat; i++)
X {
X if (!has_wildcard(pat[i]))
X addfile(&f, strsave(pat[i]));
X else
X r |= expandpath(&f, pat[i], files_only, 0, list_notfound);
X }
X if (r == 0)
X {
X *num_file = f.nfiles;
X *file = f.file;
X }


X return r;
X}
X

X void
XFreeWild(num, file)
X int num;
X char **file;
X{
X if (file == NULL || num <= 0)
X return;
X while (num--)
X free(file[num]);
X free(file);
X}
X#endif /* WILD_CARDS */
END_OF_FILE
if test 13589 -ne `wc -c <'vim/src/msdos.c'`; then
echo shar: \"'vim/src/msdos.c'\" unpacked with wrong size!
fi
# end of 'vim/src/msdos.c'
fi
if test -f 'vim/src/undo.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/undo.c'\"
else
echo shar: Extracting \"'vim/src/undo.c'\" \(13273 characters\)
sed "s/^X//" >'vim/src/undo.c' <<'END_OF_FILE'


X/* vi:ts=4:sw=4
X *
X * VIM - Vi IMitation
X *
X * Code Contributions By: Bram Moolenaar mo...@oce.nl
X * Tim Thompson twitch!tjt
X * Tony Andrews onecom!wldrdg!tony
X * G. R. (Fred) Walter watmath!watcgl!grwalter
X */
X
X/*

X * undo.c: multi level undo facility
X *
X * The saved lines are stored in a list of lists:
X *
X * u_oldhead----------------------------------------------+
X * |
X * V
X * +--------------+ +--------------+ +--------------+
X * u_newhead--->| u_header | | u_header | | u_header |
X * | uh_next------>| uh_next------>| uh_next---->NULL
X * NULL<--------uh_prev |<---------uh_prev |<---------uh_prev |
X * | uh_entry | | uh_entry | | uh_entry |
X * +--------|-----+ +--------|-----+ +--------|-----+
X * | | |
X * V V V
X * +--------------+ +--------------+ +--------------+
X * | u_entry | | u_entry | | u_entry |
X * | ue_next | | ue_next | | ue_next |
X * +--------|-----+ +--------|-----+ +--------|-----+
X * | | |
X * V V V
X * +--------------+ NULL NULL
X * | u_entry |
X * | ue_next |
X * +--------|-----+
X * |
X * V
X * etc.
X *
X * Each u_entry list contains the information for one undo or redo.
X * u_curhead points to the header of the last undo (the next redo), or is
X * NULL if nothing has been undone.
X *
X * All data is allocated with alloc_line(), thus it will be freed as soon as
X * we switch files!


X */
X
X#include "vim.h"
X#include "globals.h"
X#include "proto.h"
X#include "param.h"

X#include "ops.h" /* for endop and startop */
X

Xstruct u_entry
X{
X struct u_entry *ue_next; /* pointer to next entry in list */
X linenr_t ue_top; /* number of line above undo block */
X linenr_t ue_bot; /* number of line below undo block */
X char *ue_botptr; /* pointer to line below undo block */
X char **ue_array; /* array of lines in undo block */
X long ue_size; /* number of lines in ue_array */
X};
X
Xstruct u_header
X{
X struct u_header *uh_next; /* pointer to next header in list */
X struct u_header *uh_prev; /* pointer to previous header in list */
X struct u_entry *uh_entry; /* pointer to first entry */
X FPOS uh_curpos; /* cursor position before saving */
X};
X
Xstatic struct u_header *u_oldhead = NULL; /* pointer to oldest header */
Xstatic struct u_header *u_newhead = NULL; /* pointer to newest header */
Xstatic struct u_header *u_curhead = NULL; /* pointer to current header */
Xstatic int u_numhead = 0; /* current number of headers */
Xstatic int u_synced = TRUE; /* entry lists are synced */
X
X/*
X * variables for "U" command
X */
Xstatic char *u_line_ptr = NULL; /* saved line for "U" command */
Xstatic linenr_t u_line_lnum; /* line number of line in u_line */
Xstatic colnr_t u_line_colnr; /* optional column number */
X
Xstatic void u_getbot __ARGS((void));
Xstatic int u_savecommon __ARGS((linenr_t, linenr_t, int, char *));
Xstatic void u_undoredo __ARGS((void));
Xstatic void u_freelist __ARGS((struct u_header *));
Xstatic void u_freeentry __ARGS((struct u_entry *, long));
X
X/*
X * save the current line for both the "u" and "U" command
X */
X int
Xu_saveCurpos()
X{
X return (u_save((linenr_t)(Curpos.lnum - 1), (linenr_t)(Curpos.lnum + 1)));
X}
X
X/*
X * Save the lines between "top" and "bot" for both the "u" and "U" command.
X * "top" may be 0 and bot may be line_count + 1.
X * Returns FALSE when lines could not be saved.
X */
X int
Xu_save(top, bot)
X linenr_t top, bot;
X{
X if (top > line_count || top >= bot || bot > line_count + 1)
X return FALSE; /* rely on caller to do error messages */
X
X if (top + 2 == bot)
X u_saveline((linenr_t)(top + 1));
X
X return (u_savecommon(top, bot, 0, (char *)0));
X}
X
X/*
X * save the line "lnum", pointed at by "ptr" (used by :g//s commands)
X * "ptr" is handed over to the undo routines
X */
X int
Xu_savesub(lnum, ptr)
X linenr_t lnum;
X char *ptr;
X{
X return (u_savecommon(lnum - 1, lnum + 1, 1, ptr));
X}
X
X/*
X * save the line "lnum", pointed at by "ptr" (used by :g//d commands)
X * "ptr" is handed over to the undo routines
X */
X int
Xu_savedel(lnum, ptr)
X linenr_t lnum;
X char *ptr;
X{
X return (u_savecommon(lnum - 1, lnum, 1, ptr));
X}
X
X static int
Xu_savecommon(top, bot, flag, ptr)
X linenr_t top, bot;
X int flag;
X char *ptr;


X{
X linenr_t lnum;
X long i;

X struct u_header *uhp;
X struct u_entry *uep;
X long size;
X
X /*
X * if u_synced == TRUE make a new header
X */
X if (u_synced)
X {
X /*
X * if we undid more than we redid, free the entry lists before and
X * including u_curhead
X */
X while (u_curhead != NULL)
X u_freelist(u_newhead);
X
X /*
X * free headers to keep the size right
X */
X while (u_numhead > p_ul && u_oldhead != NULL)
X u_freelist(u_oldhead);
X
X /*
X * make a new header entry
X */
X uhp = (struct u_header *)alloc_line((unsigned)sizeof(struct u_header));
X if (uhp == NULL)
X goto nomem;
X uhp->uh_prev = NULL;
X uhp->uh_next = u_newhead;
X if (u_newhead != NULL)
X u_newhead->uh_prev = uhp;
X uhp->uh_entry = NULL;
X uhp->uh_curpos = Curpos; /* save cursor position for undo */
X u_newhead = uhp;
X if (u_oldhead == NULL)
X u_oldhead = uhp;
X ++u_numhead;
X }
X else /* find line number for ue_botptr for previous u_save() */
X u_getbot();
X
X /*
X * add lines in front of entry list
X */
X uep = (struct u_entry *)alloc_line((unsigned)sizeof(struct u_entry));
X if (uep == NULL)
X goto nomem;
X
X if (flag)
X size = 1;
X else
X size = bot - top - 1;
X uep->ue_size = size;
X uep->ue_top = top;
X uep->ue_botptr = NULL;
X if (flag)
X uep->ue_bot = bot;
X /*
X * use 0 for ue_bot if bot is below last line or if the buffer is empty, in
X * which case the last line may be replaced (e.g. with 'O' command).
X */
X else if (bot > line_count || bufempty())
X uep->ue_bot = 0;
X else
X uep->ue_botptr = nr2ptr(bot); /* we have to do ptr2nr(ue_botptr) later */
X
X if (size)
X {
X if ((uep->ue_array = (char **)alloc_line((unsigned)(sizeof(char *) * size))) == NULL)
X {
X u_freeentry(uep, 0L);
X goto nomem;
X }
X if (flag)
X uep->ue_array[0] = ptr;
X else
X for (i = 0, lnum = top + 1; i < size; ++i)
X if ((uep->ue_array[i] = save_line(nr2ptr(lnum++))) == NULL)
X {
X u_freeentry(uep, i);
X goto nomem;
X }
X }
X uep->ue_next = u_newhead->uh_entry;
X u_newhead->uh_entry = uep;
X u_synced = FALSE;
X return TRUE;
X
Xnomem:
X if (flag)
X free_line(ptr);
X else if (ask_yesno("no undo possible; continue anyway") == 'y')
X return TRUE;


X return FALSE;
X}
X

X void
Xu_undo(count)
X int count;
X{
X startop.lnum = 0; /* unset '[ mark */
X endop.lnum = 0; /* unset '] mark */
X while (count--)
X {
X if (u_curhead == NULL) /* first undo */
X u_curhead = u_newhead;
X else if (p_ul != 0) /* multi level undo */
X u_curhead = u_curhead->uh_next; /* get next undo */
X
X if (u_numhead == 0 || u_curhead == NULL) /* nothing to undo */
X {
X u_curhead = u_oldhead; /* stick u_curhead at end */


X beep();
X return;
X }
X

X u_undoredo();
X }
X}
X
X void
Xu_redo(count)
X int count;
X{
X while (count--)
X {
X if (u_curhead == NULL || p_ul == 0) /* nothing to redo */


X {
X beep();
X return;
X }
X

X u_undoredo();
X
X u_curhead = u_curhead->uh_prev; /* advance for next redo */
X }
X}
X
X/*
X * u_undoredo: common code for undo and redo
X *
X * The lines in the file are replaced by the lines in the entry list at u_curhead.
X * The replaced lines in the file are saved in the entry list for the next undo/redo.


X */
X static void

Xu_undoredo()
X{
X char **newarray = NULL;
X linenr_t oldsize;
X linenr_t newsize;
X linenr_t top, bot;
X linenr_t lnum = 0;
X linenr_t newlnum = INVLNUM;
X long i;
X long newcount = 0, oldcount = 0;
X struct u_entry *uep, *nuep;
X struct u_entry *newlist = NULL;
X
X if (u_synced == FALSE)
X {
X emsg("undo not synced");
X return;
X }
X
X CHANGED;
X for (uep = u_curhead->uh_entry; uep != NULL; uep = nuep)
X {
X top = uep->ue_top;
X bot = uep->ue_bot;
X if (bot == 0)
X bot = line_count + 1;
X if (top > line_count || top >= bot)
X {
X emsg("u_undo: line numbers wrong");
X return;
X }
X
X if (top < newlnum)
X {
X newlnum = top;
X Curpos.lnum = top + 1;
X }
X oldsize = bot - top - 1; /* number of lines before undo */
X
X newsize = uep->ue_size; /* number of lines after undo */
X
X /* delete the lines between top and bot and save them in newarray */
X if (oldsize)
X {
X if ((newarray = (char **)alloc_line((unsigned)(sizeof(char *) * oldsize))) == NULL)
X {
X /*
X * We have messed up the entry list, repair is impossible.
X * we have to free the rest of the list.
X */
X while (uep != NULL)
X {
X nuep = uep->ue_next;
X u_freeentry(uep, uep->ue_size);
X uep = nuep;
X }
X break;
X }
X /* delete backwards, it goes faster in some cases */
X for (lnum = bot - 1, i = oldsize; --i >= 0; --lnum)
X newarray[i] = delsline(lnum, TRUE);
X }
X /* insert the lines in u_array between top and bot */
X if (newsize)
X {
X for (lnum = top, i = 0; i < newsize; ++i, ++lnum)
X appendline(lnum, uep->ue_array[i]);
X free_line((char *)uep->ue_array);
X }
X newcount += newsize;
X oldcount += oldsize;
X uep->ue_size = oldsize;
X uep->ue_array = newarray;
X uep->ue_bot = lnum + 1;
X
X /*
X * insert this entry in front of the new entry list
X */
X nuep = uep->ue_next;
X uep->ue_next = newlist;
X newlist = uep;
X }
X
X u_curhead->uh_entry = newlist;
X
X /*
X * If we deleted or added lines, report the number of less/more lines.
X * Otherwise, report the number of changed lines (this may be incorrect
X * in some cases, but it's better than nothing).
X */
X if ((oldcount -= newcount) != 0)
X msgmore(-oldcount);
X else if (newcount > p_report)
X smsg("%ld line%s changed", newcount, plural(newcount));
X
X if (u_curhead->uh_curpos.lnum == Curpos.lnum)
X Curpos.col = u_curhead->uh_curpos.col;
X else
X Curpos.col = 0;
X updateScreen(CURSUPD);
X}
X
X/*
X * u_sync: stop adding to the current entry list
X */
X void
Xu_sync()
X{
X if (u_synced)
X return; /* already synced */
X u_getbot(); /* compute ue_bot of previous u_undo */
X u_curhead = NULL;
X}
X
X/*
X * u_getbot(): compute the line number of the previous u_undo


X */
X static void

Xu_getbot()
X{
X register struct u_entry *uep;
X
X if (u_newhead == NULL || (uep = u_newhead->uh_entry) == NULL)
X {
X emsg("undo list corrupt");
X return;
X }
X
X if (uep->ue_botptr != NULL)
X if ((uep->ue_bot = ptr2nr(uep->ue_botptr, uep->ue_top)) == 0)
X {
X emsg("undo line missing");
X uep->ue_bot = uep->ue_top + 1; /* guess what it is */
X }
X
X u_synced = TRUE;
X}
X
X/*
X * u_freelist: free one entry list and adjust the pointers


X */
X static void

Xu_freelist(uhp)
X struct u_header *uhp;
X{
X register struct u_entry *uep, *nuep;
X
X for (uep = uhp->uh_entry; uep != NULL; uep = nuep)
X {
X nuep = uep->ue_next;
X u_freeentry(uep, uep->ue_size);
X }
X
X if (u_curhead == uhp)
X u_curhead = NULL;
X
X if (uhp->uh_next == NULL)
X u_oldhead = uhp->uh_prev;
X else
X uhp->uh_next->uh_prev = uhp->uh_prev;
X
X if (uhp->uh_prev == NULL)
X u_newhead = uhp->uh_next;
X else
X uhp->uh_prev->uh_next = uhp->uh_next;
X
X free_line((char *)uhp);
X --u_numhead;
X}
X
X/*
X * free entry 'uep' and 'n' lines in uep->ue_array[]


X */
X static void

Xu_freeentry(uep, n)
X struct u_entry *uep;
X register long n;
X{
X while (n)
X free_line(uep->ue_array[--n]);
X free_line((char *)uep);
X}
X
X/*
X * invalidate the undo buffer; called when storage has already been released


X */
X
X void

Xu_clearall()
X{
X u_newhead = u_oldhead = u_curhead = NULL;
X u_synced = TRUE;
X u_numhead = 0;
X u_line_ptr = NULL;
X u_line_lnum = 0;
X}
X
X/*
X * save the line "lnum" for the "U" command
X */
X void
Xu_saveline(lnum)
X linenr_t lnum;
X{
X if (lnum == u_line_lnum) /* line is already saved */
X return;
X if (lnum < 1 || lnum > line_count) /* should never happen */
X return;
X u_clearline();
X u_line_lnum = lnum;
X if (Curpos.lnum == lnum)
X u_line_colnr = Curpos.col;
X else
X u_line_colnr = 0;
X u_line_ptr = save_line(nr2ptr(lnum)); /* when out of mem alloc() will give a warning */
X}
X
X/*
X * clear the line saved for the "U" command
X * (this is used externally for crossing a line while in insert mode)
X */
X void
Xu_clearline()
X{
X if (u_line_ptr != NULL)
X {
X free_line(u_line_ptr);
X u_line_ptr = NULL;
X u_line_lnum = 0;
X }
X}
X
X/*
X * Implementation of the "U" command.
X * Differentiation from vi: "U" can be undone with the next "U".
X * We also allow the cursor to be in another line.
X */
X void
Xu_undoline()
X{
X colnr_t t;
X
X if (u_line_ptr == NULL || u_line_lnum > line_count)


X {
X beep();
X return;
X }

X /* first save the line for the 'u' command */
X u_savecommon(u_line_lnum - 1, u_line_lnum + 1, 0, (char *)0);
X u_line_ptr = replaceline(u_line_lnum, u_line_ptr);
X
X t = u_line_colnr;
X if (Curpos.lnum == u_line_lnum)
X u_line_colnr = Curpos.col;
X Curpos.col = t;
X Curpos.lnum = u_line_lnum;
X cursupdate();
X updateScreen(VALID_TO_CURSCHAR);
X}
END_OF_FILE
if test 13273 -ne `wc -c <'vim/src/undo.c'`; then
echo shar: \"'vim/src/undo.c'\" unpacked with wrong size!
fi
# end of 'vim/src/undo.c'
fi
echo shar: End of archive 6 \(of 23\).
cp /dev/null ark6isdone

Bram Moolenaar

unread,
Apr 23, 1993, 1:31:05 PM4/23/93
to
Submitted-by: mo...@oce.nl (Bram Moolenaar)
Posting-number: Volume 37, Issue 7
Archive-name: vim/part07
Environment: UNIX, AMIGA, MS-DOS

#! /bin/sh
# This is a shell archive. Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file". To overwrite existing
# files, type "sh file -c". You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g.. If this archive is complete, you
# will see the following message at the end:

# "End of archive 7 (of 23)."
# Contents: vim/doc/difference.doc vim/src/termlib.c vim/src/version.c
# Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:08 1993


PATH=/bin:/usr/bin:/usr/ucb ; export PATH

if test -f 'vim/doc/difference.doc' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/doc/difference.doc'\"
else
echo shar: Extracting \"'vim/doc/difference.doc'\" \(14014 characters\)
sed "s/^X//" >'vim/doc/difference.doc' <<'END_OF_FILE'
XThis is a summary of the differences between VIM and vi.
X
X
XThe most interesting additions:
X
XMulti level undo.
X'u' goes backward in time, 'ctrl-R' goes forward again. Set option
X'undolines' to the number of changes to be remembered (default 100). Set
X'undolines' to 0 for vi-compatible one level undo.
X
X
XRepeat a series of commands.
X'v'<c> starts recording typed characters into named buffer <c> (append to the
Xbuffer if buffer name is upper case). A subsequent 'v' stops recording. The
Xbuffer can then be executed with the '@'<c> command. This is very useful to
Xrepeat a complex action.
X
X
XFlexible insert mode.
XThe arrow keys can be used in insert mode to move around in the file. This
Xbreaks the insert in two parts as far as undo and redo is concerned.
X
XCTRL-O can be used to execute a single command-mode command. This is almost
Xthe same as hitting ESC, typing the command and hitting 'a'. For undo/redo
Xonly those inserts are remembered where something was actually inserted.
X
X
XQuoting.
XQuoting can be used to first choose a piece of text and then give a command
Xto do something with it. This is an (easy to use) alternative to first giving
Xthe operator and then moving to the end of the text to be operated upon. 'q'
Xand 'Q' are used to start quoting a piece of text. 'q' works on characters
Xand 'Q' on lines. Move the cursor to extend the quoted part. It is shown
Xhighlighted on the screen. By typing 'o' the other end of the quoted text can
Xbe moved. The quoted text can be affected by an operator:
X d delete
X c change
X y yank
X > or < insert or delete indent
X ! filter through external program
X = filter through indent
X : start ":" command for the quoted lines.
X V format text to 'textwidth' columns
X J join lines
X ~ swap case
X u make uppercase
X U make lowercase
X
X
XBlock operators.
XWith quoting a rectangular block of text can be selected. Start quoting with
XCTRL-Q. The block can be deleted ('d'), yanked ('d') or its case can be
Xswapped ('~'). A deleted or yanked block can be put into the text with the
X'p' and 'P' commands.
X
X
XOnline help.
X':help' command and help key (F1 for MSDOS) display several pages of concise
Xhelp. The name of the help file can be set with the "helpfile" option.
X
X
XCommand line editing.
XYou can insert or delete at any place in the command line using the cursor
Xkeys. The right/left cursor keys can be used to move forward/backward one
Xcharacter. The shifted right/left cursor keys can be used to move
Xforward/backward one word.
X
XThe command lines are remembered. The up/down cursor keys can be used to
Xrecall previous command lines. The 'history' option can be set to the number
Xof lines that will be remembered.
X
X
XFilename completion.
XWhile entering a command line (on the bottom line of the screen) <ESC> can be
Xtyped after an (incomplete) file name wildcard; the wildcard will be
Xexpanded. If there are multiple matches, CTRL-N (next) and CTRL-P (previous)
Xwill walk through the matches. CTRL-D can be typed after an (incomplete) file
Xname wildcard; all matching files will be listed.
X
X
XText formatting.
XThe 'textwidth' (tw) option can be used to automatically limit the line
Xlength. This replaces the 'wrapmargin' option of Vi, which was not very
Xuseful. The 'V' operator can be used to format a piece of text ("V}" formats
Xa paragraph).
X
X
XCommand line options:
X
XWhen Vim is started with "-v" (View) then readonly mode is used (includes
X"-n").
X
XWhen Vim is started with "-s scriptfile", the characters read from
X"scriptfile" are treated as if you typed them. If end of file is reached
Xbefore the editor exits, further characters are read from the console.
X
XThe "-w" option can be used to record all typed characters in a script file.
XThis file can then be used to redo the editing, possibly on another file or
Xafter changing some commands in the script file.
X
XThe "-n" option disables the writing of a ".vim" file (see below).
X
XThe "-c command" option does the same as the the "+command" option.
X
XThe "-T terminal" option sets the terminal type.
X
X
XIn command mode:
X
XMissing command: 'Q' (go to Ex mode).
XMissing Ex commands: append, change, insert, open, preserve, recover,
X(un)abbreviate, visual, z and ~.
X
XThe command characters are shown in the last line of the screen. They are
Xremoved when the command is finished. If you do not want this (on a slow
Xterminal) reset the 'showcmd' option.
X
XIf the 'ruler' option is set, the current cursor position is shown in the
Xlast line of the screen.
X
X'u' and CTRL-R accept a count for the number of undos/redos.
X
X'U' still works after having moved off of the last changed line and after
X'u'.
X
XNulls in the file are replaced by newlines internally. This allows editing of
Xbinary files (more or less). When searching for nulls, use a newline in the
Xsearch pattern.
X
XCharacters with the 8th bit set are displayed. The characters between '~' and
X0xa0 are displayed as "~?", "~@", "~A", etc., unless the "graphic' option is
Xset.
X
X'=' is an operator to filter lines through an external command (vi: lisp
Xstuff). The name of the command can be set with the 'equalprg' option. The
Xdefault is "indent".
X
X'][' goes to the next ending of a C function ('}' in column 1).
X'[]' goes to the previous ending of a C function ('}' in column 1).
X
X'*' searches forward for the identifier under the cursor, '#' backward.
X'K' runs the program defined by the "keywordprg" option, with the identifier
Xunder the cursor as argument.
X
X'%' can be preceded with a count. The cursor jumps to the line that
Xpercentage down in the file.
X
XWith the CTRL-] command, the cursor may be in the middle of the identifier.
X
XThe used tags are remembered. Commands that can be used with the tag stack
Xare CTRL-T, ':pop' and ':tag'. ':tags' lists the tag stack.
X
XThe 'tags' option can be set to a list of tag file names. Thus multiple
Xtag files can be used.
X
XPreviously used file names are remembered in the alternate file name list.
XCTRL-^ accepts a count, which is an index in this list.
X
XSearch patterns have more features.
X
XSearches can find the end of a match and may include a character offset.
X
XCount added to '~', ':next', ':Next', 'n' and 'N'.
X
XAdded :wnext command. Same as ":write" followed by ":next".
X
XIf option "tildeop" has been set, '~' is an operator (must be followed by a
Xmovement command).
X
XWith the 'J' (join) command you can reset the 'joinspaces' (js) option to
Xhave only one space after a period (Vi inserts two spaces).
X
X'cw' can be used to change white space formed by several characters (Vi is
Xconfusing: 'cw' only changes one space, while 'dw' deletes all white space).
X
X'o' and 'O' accept a count for repeating the insert (Vi clears a part of
Xdisplay).
X
X':dis' command shows the contents of the yank buffers.
X
XPreviously used file names are remembered in the alternate file name list.
X':files' command shows the list of alternate filenames.
X'#'<N> means <N>th alternate filename in the list.
X
XFlags after command not supported (no plans to include it).
X
XQuickFix commands included, almost the same as with Manx's Z editor.
XThe 'errorfile' option has the name of the file with error messages.
X
X":cd" command shows current directory instead of going to the home directory.
X":cd ~" goes to home directory.
X
X':source!' command reads Vi commands from a file.
X
X':mkexrc' command writes current modified options and mappings to a ".exrc"
Xfile. ':mkvimrc' writes to a ".vimrc" file.
X
XThe :put! command inserts the contents of a register above the current line.
X
XThe named register '.' can be used with commands p, P and :put. The contents
Xof the register is the last inserted text.
X
X':noremap' command can be used to enter a mapping that will not be remapped.
XThis is useful to exchange the meaning of two keys.
X
X':@r' command executes buffer r (is in some versions of vi).
X
XCTRL-O/CTRL-I can be used to jump to older/newer positions. These are the
Xsame positions as used with the '' command, but may be in another file. The
X':jumps' command lists the older positions.
X
XIf the 'shiftround' option is set, an indent is rounded to a multiple of
X'shiftwidth' with '>' and '<' commands.
X
XThe 'scrolljump' option can be set to the minimal number of lines to scroll
Xwhen the cursor gets off the screen. Use this when scrolling is slow.
X
XUppercase marks can be used to jump between files. The ':marks' command lists
Xall currently set marks. The commands "']" and "`]" jump to the end of the
Xprevious operator or end of the text inserted with the put command. "'[" and
X"`[" do jump to the start.
X
XThe 'shelltype' option can be set to reflect the type of shell used.
X
XThe CTRL-A (add) and CTRL-S (subtract) commands are new. The count to the
Xcommand (default 1) is added to/subtracted from the number at or after the
Xcursor. That number may be decimal, octal (starts with a '0') or hexadecimal
X(starts with '0x'). Very useful in macros.
X
XWith the :set command the prefix "inv" can be used to invert toggle options.
X
X
XIn insert mode:
X
XThe backspace key can be used just like CTRL-D to remove auto-indents.
X
XYou can backspace, ctrl-U and CTRL-W over newlines if the 'backspace' (bs)
Xoption is set to non-zero. You can backspace over the start of insert if the
X'backspace' option is set to 2.
X
XIf the 'repdel' option is reset, a <BS> in replace mode will not delete a
Xcharacter.
X
XCTRL-T/CTRL-D always insert/delete an indent in the current line, no matter
Xwhat column the cursor is in. '0' and '^' before CTRL-D are ignored.
X
XCTRL-@ (insert previously inserted text) works always (Vi: only when typed as
Xfirst character).
X
XCTRL-A works like CTRL-@ but does not leave insert mode.
X
XCTRL-B <0-9a-z> can be used to insert the contents of a register.
X
XWhen the 'smartindent' (si) option is set, C programs will be better
Xauto-indented.
X
XCTRL-R and CTRL-E can be used to copy a character from above/below the
Xcurrent cursor position.
X
XAfter CTRL-V you can enter a three digit decimal number. This byte value is
Xinserted in the text as a single character. Useful for international
Xcharacters that are not on your keyboard.
X
XWhen the 'expandtab' (et) option is set, a <TAB> is expanded to the
Xappropriate number of spaces.
X
XThe window always reflects the contents of the buffer (Vi does not do this
Xwhen changing text and in some other cases).
X
XIf Vim is compiled with DIGRAPHS defined, digraphs are supported. A set of
Xnormal Amiga digraphs is included. They are shown with the :digraph" command.
XMore can be added with ":digraph {char1}{char2} {number}". A digraph is
Xentered with "CTRL-K {char1} {char2}" or "{char1} BS {char2}" (only when
X'digraph' option is set).
X
X
Xgeneral:
X
XMissing options: autoprint (ap), beautify (bf), edcompatible, hardtabs (ht),
Xlisp, mesg, open, optimize (op), prompt, redraw, slowopen (slow),
Xwarn, window, w300, w1200 and w9600. Terse option ignored.
X
XWhen the 'compatible' option is set, all options are set for maximum
Xvi-compatibility
X
XThe 'ttimeout' option is like 'timeout', but only works for cursor and
Xfunction keys, not for ordinary mapped characters.
X
XThere is an option for each terminal string. Can be used when termcap is not
Xsupported or to change individual strings.
X
XOn systems that have no job control (most systems but BSD-UNIX) the CTRL-Z
Xand ":stop" command starts a new shell.
X
XIf Vim is started on the Amiga without an interactive window for output, a
Xwindow is opened (and :sh still works). You can give a device to use for
Xediting with the '-d' argument, e.g. "-d con:20/20/600/150".
X
XOn startup the VIMINIT or EXINIT environment variables, the file s:.vimrc or
Xs:.exrc and .vimrc or .exrc are read for initialization commands. When
Xreading .vimrc and .exrc some commands are not allowed because of security
Xreasons (shell commands and writing to a file, :map commands are echoed).
X
XLine lenght can be upto 32767 characters, file length upto 2147483646 lines.
XIf a line is larger than the screen, the last line is filled with <@>s and
Xonly the part of the line before that is shown.
X
XThe 'columns' option is used to set or get the width of the display.
X
XThe name of the current file name is shown in the title bar of the window.
X
XWildcards in file names are expanded.
X
XOption settings are read from the first and last few lines of the file.
XOption 'modelines' determines how many lines are tried (default is 5). Note
Xthat this is different from the Vi versions that can execute any Ex command
Xin a modeline (a major security problem).
X
XIf the 'insertmode' option is set (e.g. in .exrc), Vim starts in insert mode.
X
XAll text is kept in memory. Available memory limits the file size (and other
Xthings such as undo). This may be a problem with MSDOS, is hardly a problem
Xont the Amiga and almost never with Unix.
X
XIf the "backup" or "writebackup" option is set: Before a file is overwritten,
Xa backup file (.bak) is made. If the "backup" option is set it is left
Xbehind.
X
XAll entered commands and text is written into a script file, ending in
X".vim". This can be used to recover your work if the machine crashes during
Xan edit session. This can be switched off by setting the 'updatecount' option
Xto 0 or starting Vim with the "-n" option. Use the 'directory' option for
Xplacing the .vim file somewhere else.
X
XThe 'shortname' (sn) option, when set, tells Vim that ".bak" and ".vim"
Xfilenames are to be MSDOS-like: 8 characters plus 3 for extention. This
Xshould be used on messydos or crossdos filesystems on the Amiga. If this
Xoption is off, Vim tries to guess if MSDOS filename restrictions are
Xeffective.
X
XRecovery after a crash has a smaller chance for success, because there is no
Xtemporary file.
X
XError messages are shown at least one second (Vi overwrites error messages).
X
XIf Vim asks to "Hit RETURN to continue", you can hit any key. Characters
Xother than <CR>, <NL> and <SPACE> are interpreted as the (start of) a
Xcommand. (Vi only accepts a command starting with ':').
X
XThe contents of the numbered registers is remembered when changing files.
X
XThe AUX: device of the Amiga is supported.
X
Xvi:tw=77:
END_OF_FILE
if test 14014 -ne `wc -c <'vim/doc/difference.doc'`; then
echo shar: \"'vim/doc/difference.doc'\" unpacked with wrong size!
fi
# end of 'vim/doc/difference.doc'
fi
if test -f 'vim/src/termlib.c' -a "${1}" != "-c" ; then
echo shar: Will not clobber existing file \"'vim/src/termlib.c'\"
else
echo shar: Extracting \"'vim/src/termlib.c'\" \(15527 characters\)
sed "s/^X//" >'vim/src/termlib.c' <<'END_OF_FILE'
X/* vi:sw=4:ts=4:
X The following software is (C) 1984 Peter da Silva,
X the Mad Australian, in the public domain. It may
X be re-distributed for any purpose with the inclusion
X of this notice. */
X/* modified by Bram Moolenaar */
X
X/* TERMLIB: Terminal independant database. */
X
X#include "vim.h"
X#include "proto.h"
X#include "proto/termlib.pro"
X
X#ifndef AMIGA
X# include <sgtty.h>
X#endif
X
Xstatic int getent __PARMS((char *, char *, FILE *, int));
Xstatic int nextent __PARMS((char *, FILE *, int));
Xstatic int _match __PARMS((char *, char *));
Xstatic char *_addfmt __PARMS((char *, char *, int));
Xstatic char *_find __PARMS((char *, char *));
X
X/*
X * Global variables for termlib
X */
X
Xchar *tent; /* Pointer to terminal entry, set by tgetent */
Xchar PC = 0; /* Pad character, default NULL */
Xchar *UP = 0, *BC = 0; /* Pointers to UP and BC strings from database */
Xshort ospeed; /* Baud rate (1-16, 1=300, 16=19200), as in stty */
X
X/*
X * Module: tgetent
X *
X * Purpose: Get termcap entry for <term> into buffer at <tbuf>.
X *
X * Calling conventions: char tbuf[TBUFSZ+], term=canonical name for
X * terminal.
X *
X * Returned values: 1 = success, -1 = can't open file,
X * 0 = can't find terminal.
X *
X * Notes
X * Should probably supply static buffer.
X *
X * Uses environment variables "TERM" and
X * "TERMCAP". If TERM = term (that is, if the argument
X * matches the environment) then it looks at TERMCAP.
X * If TERMCAP begins with a slash, then it assumes
X * this is the file to search rather than /etc/termcap.
X * If TERMCAP does not begin with a slash, and it
X * matches TERM, then this is used as the entry.
X *
X * This could be simplified considerably for non-UNIX
X * systems.
X */
X
X#ifdef AMIGA
X# define TERMCAPFILE "s:termcap"
X#else
X# define TERMCAPFILE "/etc/termcap"
X#endif
X
Xtgetent(tbuf, term)
X char *tbuf; /* Buffer to hold termcap entry, TBUFSZ bytes max */
X char *term; /* Name of terminal */
X{
X char tcbuf[32]; /* Temp buffer to handle */
X char *tcptr = tcbuf; /* extended entries */
X char *tcap = TERMCAPFILE; /* Default termcap file */
X char *tmp;
X FILE *termcap;


X int retval = 0;

X int len;
X
X if ((tmp = (char *)vimgetenv("TERMCAP")) != NULL)
X {
X if (*tmp == '/') /* TERMCAP = name of termcap file */
X tcap = tmp ;
X else /* TERMCAP = termcap entry itself */
X {
X int tlen = strlen(term);
X
X while (*tmp && *tmp != ':') /* Check if TERM matches */
X {
X while (*tmp == '|')
X tmp++;
X if (_match(tmp, term) == tlen)
X {
X strcpy(tbuf, tmp);
X tent = tbuf;
X return 1;
X }
X else
X tmp = _find(tmp, ":|");
X }
X }
X }
X if (!(termcap = fopen(tcap, "r")))
X {
X strcpy(tbuf, tcap);


X return -1;
X }
X

X len = 0;
X while (getent(tbuf + len, term, termcap, TBUFSZ - len))
X {
X if ((term = tgetstr("tc", &tcptr))) /* extended entry */
X {
X rewind(termcap);
X len = strlen(tbuf);
X }
X else
X {
X retval = 1;
X tent = tbuf;
X break;
X }
X }
X fclose(termcap);


X return retval;
X}
X

X static int
Xgetent(tbuf, term, termcap, buflen)
X char *tbuf, *term;
X FILE *termcap;
X int buflen;
X{
X char *tptr;
X int tlen = strlen(term);
X
X while (nextent(tbuf, termcap, buflen)) /* For each possible entry */
X {
X tptr = tbuf;
X while (*tptr && *tptr != ':') /* : terminates name field */
X {
X while (*tptr == '|') /* | seperates names */
X tptr++;
X if (_match(tptr, term) == tlen) /* FOUND! */
X {
X tent = tbuf;
X return 1;
X }
X else /* Look for next name */
X tptr = _find(tptr, ":|");
X }


X }
X return 0;
X}
X

X static int
Xnextent(tbuf, termcap, buflen) /* Read 1 entry from TERMCAP file */
X char *tbuf;
X FILE *termcap;
X int buflen;
X{
X char *lbuf = tbuf; /* lbuf=line buffer */
X /* read lines straight into buffer */
X
X while (lbuf < tbuf+buflen && /* There's room and */
X fgets(lbuf, (int)(tbuf+buflen-lbuf), termcap)) /* another line */
X {
X int llen = strlen(lbuf);
X
X if (*lbuf == '#') /* eat comments */
X continue;
X if (lbuf[-1] == ':' && /* and whitespace */
X lbuf[0] == '\t' &&
X lbuf[1] == ':')
X {
X strcpy(lbuf, lbuf+2);
X llen -= 2;
X }
X if (lbuf[llen-2] == '\\') /* and continuations */
X lbuf += llen-2;
X else
X {
X lbuf[llen-1]=0; /* no continuation, return */


X return 1;
X }
X }

X
X return 0; /* ran into end of file */
X}
X
X/*
X * Module: tgetflag
X *
X * Purpose: returns flag true or false as to the existence of a given
X * entry. used with 'bs', 'am', etc...
X *
X * Calling conventions: id is the 2 character capability id.
X *
X * Returned values: 1 for success, 0 for failure.
X */
X
Xtgetflag(id)
X char *id;
X{
X char buf[256], *ptr = buf;
X
X return tgetstr(id, &ptr) ? 1 : 0;
X}
X
X/*
X * Module: tgetnum
X *
X * Purpose: get numeric value such as 'li' or 'co' from termcap.
X *
X * Calling conventions: id = 2 character id.
X *
X * Returned values: -1 for failure, else numerical value.
X */
X
Xtgetnum(id)
Xchar *id;
X{
X char *ptr, buf[256];
X ptr = buf;
X
X if (tgetstr(id, &ptr))
X return atoi(buf);
X else


X return 0;
X}
X
X/*

X * Module: tgetstr
X *
X * Purpose: get terminal capability string from database.
X *
X * Calling conventions: id is the two character capability id.
X * (*buf) points into a hold buffer for the
X * id. the capability is copied into the buffer
X * and (*buf) is advanced to point to the next
X * free byte in the buffer.
X *
X * Returned values: 0 = no such entry, otherwise returns original
X * (*buf) (now a pointer to the string).
X *
X * Notes
X * It also decodes certain escape sequences in the buffer.
X * they should be obvious from the code:
X * \E = escape.
X * \n, \r, \t, \f, \b match the 'c' escapes.
X * ^x matches control-x (^@...^_).
X * \nnn matches nnn octal.
X * \x, where x is anything else, matches x. I differ
X * from the standard library here, in that I allow ^: to match
X * :.
X *
X */
X
Xchar *
Xtgetstr(id, buf)
Xchar *id, **buf;
X{
X int len = strlen(id);
X char *tmp=tent;
X char *hold;
X int i;
X
X do {
X tmp = _find(tmp, ":"); /* For each field */
X while (*tmp == ':') /* skip empty fields */
X tmp++;
X if (!*tmp)
X break;
X
X if (_match(id, tmp) == len) {
X tmp += len; /* find '=' '@' or '#' */
X if (*tmp == '@') /* :xx@: entry for tc */
X return 0; /* deleted entry */
X hold= *buf;
X while (*++tmp && *tmp != ':') {/* not at end of field */
X switch(*tmp) {
X case '\\': /* Expand escapes here */
X switch(*++tmp) {
X case 0: /* ignore backslashes */
X tmp--; /* at end of entry */
X break; /* shouldn't happen */
X case 'e':
X case 'E': /* ESC */
X *(*buf)++ = '\033';
X break;
X case 'n': /* \n */
X *(*buf)++ = '\n';
X break;
X case 'r': /* \r */
X *(*buf)++ = '\r';
X break;
X case 't': /* \t */
X *(*buf)++ = '\t';
X break;
X case 'b': /* \b */
X *(*buf)++ = '\b';
X break;
X case 'f': /* \f */
X *(*buf)++ = '\f';
X break;