home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume37 / vim / part02 < prev    next >
Encoding:
Text File  |  1993-04-22  |  55.1 KB  |  2,077 lines

  1. Newsgroups: comp.sources.misc
  2. From: mool@oce.nl (Bram Moolenaar)
  3. Subject: v37i002:  vim - Vi IMitation editor v1.27, Part02/24
  4. Message-ID: <1993Apr23.172733.15476@sparky.imd.sterling.com>
  5. X-Md4-Signature: 6a7b4dc1d9f1d324ab40d11172cda86e
  6. Date: Fri, 23 Apr 1993 17:27:33 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: mool@oce.nl (Bram Moolenaar)
  10. Posting-number: Volume 37, Issue 2
  11. Archive-name: vim/part02
  12. Environment: UNIX, AMIGA, MS-DOS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then unpack
  16. # it by saving it into a file and typing "sh file".  To overwrite existing
  17. # files, type "sh file -c".  You can also feed this as standard input via
  18. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  19. # will see the following message at the end:
  20. #        "End of archive 2 (of 23)."
  21. # Contents:  vim/README vim/doc/digraph.doc.uue vim/doc/msdos.doc
  22. #   vim/src/addcr.bat vim/src/alloc.c vim/src/charset.c vim/src/help.c
  23. #   vim/src/linefunc.c vim/src/makefile.dice vim/src/makefile.dos
  24. #   vim/src/message.c vim/src/mkcmdtab.c vim/src/msdos.h vim/src/ops.h
  25. #   vim/src/sun_stdlib.h vim/src/tcconfig.tc.uue vim/src/unix.h
  26. #   vim/termcap
  27. # Wrapped by mool@oce-rd2 on Mon Apr 19 15:50:05 1993
  28. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  29. if test -f 'vim/README' -a "${1}" != "-c" ; then 
  30.   echo shar: Will not clobber existing file \"'vim/README'\"
  31. else
  32. echo shar: Extracting \"'vim/README'\" \(2167 characters\)
  33. sed "s/^X//" >'vim/README' <<'END_OF_FILE'
  34. XREADME for version 1.27 of Vim: Vi IMitation.
  35. X
  36. XVim is an almost compatible version of the UNIX editor vi. Only the 'Q' 
  37. Xcommand is missing. Many new features have been added: multi level undo, 
  38. Xcommand line history, filename completion, quoting, etc. See difference.doc.
  39. X
  40. XThis editor is very useful for editing programs and other plain ASCII files. 
  41. XAll commands are given with normal keyboard characters, so those who can type 
  42. Xwith ten fingers can work very fast. Function keys can be used for macros.
  43. X
  44. XVim currently runs under Amiga DOS, MSDOS and UNIX. Porting to other systems 
  45. Xshould not be very difficult.
  46. X
  47. XDocumentation:
  48. X      tutor/readme - one hour training course for beginners
  49. X     reference.doc - complete reference of all Vim commands
  50. X    difference.doc - summarizes the differences with UNIX vi
  51. X         index - alfabetical list of commands
  52. X          unix.doc - remarks for unix
  53. X         msdos.doc - remarks for MSDOS
  54. X
  55. XVim is Public Domain. You can copy it as much as you like. If you want to 
  56. Xdistribute a modified version of the source code please contact me first.
  57. X
  58. XInstallation on the Amiga:
  59. X- Put "arp.library" in "libs:" (not required for Amiga DOS 2.0 and later)
  60. X- Assign "vim:" to the directory where the vim.hlp file is (for the help 
  61. X  command).
  62. X- With DOS 1.3 or earlier: make sure that newcli and run are in "c:" (for 
  63. X  executing external commands).
  64. X- Put a shell that accepts a command with "-c" (e.g. "Csh" from Fish disk 
  65. X  624) in "c:" or in any other directory that is in your search path (for 
  66. X  executing external commands).
  67. X
  68. XIf you have sufficient memory you can avoid startup delays by making Vim and 
  69. Xcsh resident with the command "rez csh vim". You will have to put 
  70. X"rezlib.library" in your "libs:" directory. Under 2.0 you will need rez 
  71. Xversion 0.5.
  72. X
  73. XIf you do not use digraphs, you can save some memory by recompiling without 
  74. Xthe DIGRAPHS option. If you want to use Vim with other terminals you can 
  75. Xrecompile with the TERMCAP option. Vim compiles with Manx 5.x and SAS 6.x.
  76. XSee the makefiles.
  77. X
  78. XPlease send comments, bug reports and suggestions to:
  79. X
  80. X    Bram Moolenaar
  81. X    Clematisstraat 30
  82. X    5925 BE  Venlo
  83. X    The Netherlands
  84. X
  85. XUUCP E-mail:    mool@oce.nl
  86. END_OF_FILE
  87. if test 2167 -ne `wc -c <'vim/README'`; then
  88.     echo shar: \"'vim/README'\" unpacked with wrong size!
  89. fi
  90. # end of 'vim/README'
  91. fi
  92. if test -f 'vim/doc/digraph.doc.uue' -a "${1}" != "-c" ; then 
  93.   echo shar: Will not clobber existing file \"'vim/doc/digraph.doc.uue'\"
  94. else
  95. echo shar: Extracting \"'vim/doc/digraph.doc.uue'\" \(1961 characters\)
  96. sed "s/^X//" >'vim/doc/digraph.doc.uue' <<'END_OF_FILE'
  97. X
  98. Xbegin 644 digraph.doc
  99. XM5&AE<V4@87)E('1H92!D969A=6QT(&1I9W)A<&@@8VAA<F%C=&5R<R!F;W(@]
  100. XM5FEM+B!4:&4@9FER<W0@='=O(&-H87)A8W1E<G,@:6X@"F5A8V@@8V]L=6UN]
  101. XM(&%R92!T:&4@8VAA<F%C=&5R<R!Y;W4@:&%V92!T;R!T>7!E('1O(&5N=&5R@
  102. XM(&$@9&EG<F%P:"X@26X@=&AE(`IM:61D;&4@;V8@96%C:"!C;VQU;6X@:7,@O
  103. XM=&AE(')E<W5L=&EN9R!C:&%R86-T97(N(%1H:7,@;6%Y(&)E(&UA;F=L960@7
  104. XM:68@>6]U(`IL;V]K(&%T('1H:7,@9FEL92!O;B!S;VUE=&AI;F<@96QS92!T`
  105. XM:&%N(&%N($%M:6=A(&]R('=H96X@>6]U('!R:6YT(&ET+B!4:&4@"F1E8VEM:
  106. XM86P@;G5M8F5R(&ES('1H92!!4T-)22!C;V1E(&9O<B!T:&4@8VAA<F%C=&5RL
  107. XM+@H*?B$@H2`Q-C$@("!C?""B(#$V,B`@("0D(*,@,38S("`@;W@@I"`Q-C0@?
  108. XM("!9+2"E(#$V-2`@('Q\(*8@,38V("`@<&$@IR`Q-C<*(B(@J"`Q-C@@("!CP
  109. XM3R"I(#$V.2`@(&$M(*H@,3<P("`@/#P@JR`Q-S$@("`M+2"M(#$W,R`@(')/'
  110. XM(*X@,3<T("`@+3T@KR`Q-S4*?F\@L"`Q-S8@("`K+2"Q(#$W-R`@(#(R(+(@C
  111. XM,3<X("`@,S,@LR`Q-SD@("`G)R"T(#$X,"`@(&IU(+4@,3@Q("`@<'`@MB`QJ
  112. XM.#(*?BX@MR`Q.#,@("`L+""X(#$X-"`@(#$Q(+D@,3@U("`@;RT@NB`Q.#8@.
  113. XM("`^/B"[(#$X-R`@(#$T(+P@,3@X("`@,3(@O2`Q.#D*,S0@OB`Q.3`@("!^"
  114. XM/R"_(#$Y,2`@($%@(,`@,3DR("`@02<@P2`Q.3,@("!!7B#"(#$Y-"`@($%^:
  115. XM(,,@,3DU("`@02(@Q"`Q.38*04`@Q2`Q.3<@("!!12#&(#$Y."`@($,L(,<@>
  116. XM,3DY("`@16`@R"`R,#`@("!%)R#)(#(P,2`@($5>(,H@,C`R("`@12(@RR`R/
  117. XM,#,*26`@S"`R,#0@("!))R#-(#(P-2`@($E>(,X@,C`V("`@22(@SR`R,#<@L
  118. XM("`M1"#0(#(P."`@($Y^(-$@,C`Y("`@3V`@TB`R,3`*3R<@TR`R,3$@("!/]
  119. XM7B#4(#(Q,B`@($]^(-4@,C$S("`@3R(@UB`R,30@("`O7"#7(#(Q-2`@($\O5
  120. XM(-@@,C$V("`@56`@V2`R,3<*52<@VB`R,3@@("!57B#;(#(Q.2`@(%4B(-P@Q
  121. XM,C(P("`@62<@W2`R,C$@("!)<"#>(#(R,B`@('-S(-\@,C(S("`@86`@X"`RB
  122. XM,C0*82<@X2`R,C4@("!A7B#B(#(R-B`@(&%^(.,@,C(W("`@82(@Y"`R,C@@-
  123. XM("!A0"#E(#(R.2`@(&%E(.8@,C,P("`@8RP@YR`R,S$*96`@Z"`R,S(@("!E#
  124. XM)R#I(#(S,R`@(&5>(.H@,C,T("`@92(@ZR`R,S4@("!I8"#L(#(S-B`@(&DG:
  125. XM(.T@,C,W("`@:5X@[B`R,S@*:2(@[R`R,SD@("`M9"#P(#(T,"`@(&Y^(/$@1
  126. XM,C0Q("`@;V`@\B`R-#(@("!O)R#S(#(T,R`@(&]>(/0@,C0T("`@;WX@]2`R!
  127. XM-#4*;R(@]B`R-#8@("`Z+2#W(#(T-R`@(&\O(/@@,C0X("`@=6`@^2`R-#D@R
  128. XM("!U)R#Z(#(U,"`@('5>(/L@,C4Q("`@=2(@_"`R-3(*>2<@_2`R-3,@("!I)
  129. X3<"#^(#(U-"`@('DB(/\@,C4U"C4Q/
  130. X``
  131. Xend
  132. Xsize 1369
  133. END_OF_FILE
  134. if test 1961 -ne `wc -c <'vim/doc/digraph.doc.uue'`; then
  135.     echo shar: \"'vim/doc/digraph.doc.uue'\" unpacked with wrong size!
  136. fi
  137. # end of 'vim/doc/digraph.doc.uue'
  138. fi
  139. if test -f 'vim/doc/msdos.doc' -a "${1}" != "-c" ; then 
  140.   echo shar: Will not clobber existing file \"'vim/doc/msdos.doc'\"
  141. else
  142. echo shar: Extracting \"'vim/doc/msdos.doc'\" \(2942 characters\)
  143. sed "s/^X//" >'vim/doc/msdos.doc' <<'END_OF_FILE'
  144. XThis file contains the particularities for the MSDOS version of Vim.
  145. X
  146. XIf Vim produces all kinds of garbage on the screen you need to install
  147. Xansi.sys (or equivalent).
  148. X
  149. XIf the "tx" (textmode) option is set (which is the default), Vim will accept a 
  150. Xsingle <LF> or a <CR><LF> pair for end-of-line. When writing a file Vim will 
  151. Xuse <CR><LF>. Thus if you edit a file and write it, <LF> is replaced with 
  152. X<CR><LF>. Single <CR> characters are lost. If the "tx" option is not set the 
  153. Xsingle <LF> will be used for end-of-line. A <CR> will be shown as ^M.
  154. XYou can use Vim to replace <LF> by <CR><LF> by reading in any mode and 
  155. Xwriting in text mode. You can use Vim to replace <CR><LF> by <LF> by reading 
  156. Xin text mode and writing in non-text mode.
  157. X
  158. XScript files contain single <CR> characters. If you want to edit a script file 
  159. Xyou should reset the textmode option before loading the file.
  160. X
  161. XThe default help filename is "$VIM\vim.hlp". If the environment variable $VIM 
  162. Xis not defined or the file is not found, the DOS search path is used to 
  163. Xsearch for the file "vim.hlp". If you do not want to put "vim.hlp" in your 
  164. Xsearch path, use the command ":set helpfile=pathname" to tell Vim where the 
  165. Xhelp file is.
  166. X
  167. XThe files "_vimrc" and "_exrc" are used instead of ".vimrc" and ".exrc".
  168. XThe files "$VIM\_vimrc" and "$VIM\_exrc" are used instead of "s:.vimrc" and 
  169. X"s:.exrc".
  170. X
  171. XUse CTRL-break instead of CTRL-C to interrupt searches. The CTRL-C is not
  172. Xdetected until a key is read.
  173. X
  174. XUse CTRL-arrow-left and CTRL-arrow-right instead of SHIFT-arrow-left and 
  175. XSHIFT-arrow-right. The arrow-up and arrow-down cannot be used with SHIFT or 
  176. XCTRL.
  177. X
  178. XTemporary files (for filtering) are put in the current directory.
  179. X
  180. XThe default for the sh (shell) option is "command". External commands are 
  181. Xstarted with "command /c <command_name>". Typing CTRL-Z starts a new command 
  182. Xshell. Return to Vim with "exit".
  183. X
  184. X
  185. XMS-DOS allows for only one filename extention. Therefore, in the original 
  186. Xfilename the '.' is replaced by a '_', the name is truncated to 8 characters 
  187. Xand the new extention ".vim" or ".bak" is appended. Two examples: "test.c" 
  188. Xbecomes "test_c.bak", "ditiseen.tst" becomes "ditiseen.bak". The 'shortname' 
  189. Xoption is not available.
  190. X
  191. XThe MS-DOS binary was compiled with Turbo-C version 2.0 (yes, it's old). You 
  192. Xmay get some "argument never used" warning messages. They can be ignored. If 
  193. Xyou get all kinds of strange error messages when compiling, you have to add 
  194. X<CR> characters at the end of each line. This can be done with the addcr 
  195. Xprogram: "make addcr". This will compile addcr.c to addcr.exe and execute 
  196. Xthe addcr.bat file.
  197. X
  198. XAll text is kept in memory. This limits the size of the file you can edit,
  199. Xthe number of undo levels that can be remembered, etc.. If Vim gives an "Out 
  200. Xof memory" warning you should stop editing. Result of further editing actions 
  201. Xis unpredictable.
  202. X
  203. XThe *.info files are for the Amiga. You don't need them with MSDOS.
  204. END_OF_FILE
  205. if test 2942 -ne `wc -c <'vim/doc/msdos.doc'`; then
  206.     echo shar: \"'vim/doc/msdos.doc'\" unpacked with wrong size!
  207. fi
  208. # end of 'vim/doc/msdos.doc'
  209. fi
  210. if test -f 'vim/src/addcr.bat' -a "${1}" != "-c" ; then 
  211.   echo shar: Will not clobber existing file \"'vim/src/addcr.bat'\"
  212. else
  213. echo shar: Extracting \"'vim/src/addcr.bat'\" \(3795 characters\)
  214. sed "s/^X//" >'vim/src/addcr.bat' <<'END_OF_FILE'
  215. Xaddcr <addcr.c >tmp
  216. Xcp tmp addcr.c 
  217. Xaddcr <alloc.c >tmp
  218. Xcp tmp alloc.c 
  219. Xaddcr <ascii.h >tmp
  220. Xcp tmp ascii.h 
  221. Xaddcr <buffers.c >tmp
  222. Xcp tmp buffers.c 
  223. Xaddcr <charset.c >tmp
  224. Xcp tmp charset.c 
  225. Xaddcr <cmdline.c >tmp
  226. Xcp tmp cmdline.c 
  227. Xaddcr <cmdtab.h >tmp
  228. Xcp tmp cmdtab.h 
  229. Xaddcr <cmdtab.tab >tmp
  230. Xcp tmp cmdtab.tab 
  231. Xaddcr <csearch.c >tmp
  232. Xcp tmp csearch.c 
  233. Xaddcr <debug.h >tmp
  234. Xcp tmp debug.h 
  235. Xaddcr <digraph.c >tmp
  236. Xcp tmp digraph.c 
  237. Xaddcr <edit.c >tmp
  238. Xcp tmp edit.c 
  239. Xaddcr <env.h >tmp
  240. Xcp tmp env.h 
  241. Xaddcr <fileio.c >tmp
  242. Xcp tmp fileio.c 
  243. Xaddcr <globals.h >tmp
  244. Xcp tmp globals.h 
  245. Xaddcr <help.c >tmp
  246. Xcp tmp help.c 
  247. Xaddcr <keymap.h >tmp
  248. Xcp tmp keymap.h 
  249. Xaddcr <linefunc.c >tmp
  250. Xcp tmp linefunc.c 
  251. Xaddcr <macros.h >tmp
  252. Xcp tmp macros.h 
  253. Xaddcr <main.c >tmp
  254. Xcp tmp main.c 
  255. Xaddcr <makefile >tmp
  256. Xcp tmp makefile 
  257. Xaddcr <mark.c >tmp
  258. Xcp tmp mark.c 
  259. Xaddcr <mark.h >tmp
  260. Xcp tmp mark.h 
  261. Xaddcr <message.c >tmp
  262. Xcp tmp message.c 
  263. Xaddcr <misccmds.c >tmp
  264. Xcp tmp misccmds.c 
  265. Xaddcr <mkcmdtab.c >tmp
  266. Xcp tmp mkcmdtab.c 
  267. Xaddcr <msdos.c >tmp
  268. Xcp tmp msdos.c 
  269. Xaddcr <msdos.h >tmp
  270. Xcp tmp msdos.h 
  271. Xaddcr <normal.c >tmp
  272. Xcp tmp normal.c 
  273. Xaddcr <ops.c >tmp
  274. Xcp tmp ops.c 
  275. Xaddcr <ops.h >tmp
  276. Xcp tmp ops.h 
  277. Xaddcr <param.c >tmp
  278. Xcp tmp param.c 
  279. Xaddcr <param.h >tmp
  280. Xcp tmp param.h 
  281. Xaddcr <proto.h >tmp
  282. Xcp tmp proto.h 
  283. Xaddcr <quickfix.c >tmp
  284. Xcp tmp quickfix.c 
  285. Xaddcr <regexp.c >tmp
  286. Xcp tmp regexp.c 
  287. Xaddcr <regexp.h >tmp
  288. Xcp tmp regexp.h 
  289. Xaddcr <regmagic.h >tmp
  290. Xcp tmp regmagic.h 
  291. Xaddcr <regsub.c >tmp
  292. Xcp tmp regsub.c 
  293. Xaddcr <screen.c >tmp
  294. Xcp tmp screen.c 
  295. Xaddcr <script.c >tmp
  296. Xcp tmp script.c 
  297. Xaddcr <search.c >tmp
  298. Xcp tmp search.c 
  299. Xaddcr <storage.c >tmp
  300. Xcp tmp storage.c 
  301. Xaddcr <tag.c >tmp
  302. Xcp tmp tag.c 
  303. Xaddcr <tags >tmp
  304. Xcp tmp tags 
  305. Xaddcr <term.c >tmp
  306. Xcp tmp term.c 
  307. Xaddcr <term.h >tmp
  308. Xcp tmp term.h 
  309. Xaddcr <termlib.c >tmp
  310. Xcp tmp termlib.c 
  311. Xaddcr <termlib.fix >tmp
  312. Xcp tmp termlib.fix 
  313. Xaddcr <undo.c >tmp
  314. Xcp tmp undo.c 
  315. Xaddcr <version.c >tmp
  316. Xcp tmp version.c 
  317. Xaddcr <vim.h >tmp
  318. Xcp tmp vim.h 
  319. Xaddcr <vim.prj >tmp
  320. Xcp tmp vim.prj 
  321. Xaddcr <vimresp >tmp
  322. Xcp tmp vimresp 
  323. Xaddcr <proto\alloc.pro >tmp
  324. Xcp tmp proto\alloc.pro 
  325. Xaddcr <proto\amiga.pro >tmp
  326. Xcp tmp proto\amiga.pro 
  327. Xaddcr <proto\buffers.pro >tmp
  328. Xcp tmp proto\buffers.pro 
  329. Xaddcr <proto\charset.pro >tmp
  330. Xcp tmp proto\charset.pro 
  331. Xaddcr <proto\cmdline.pro >tmp
  332. Xcp tmp proto\cmdline.pro 
  333. Xaddcr <proto\csearch.pro >tmp
  334. Xcp tmp proto\csearch.pro 
  335. Xaddcr <proto\digraph.pro >tmp
  336. Xcp tmp proto\digraph.pro 
  337. Xaddcr <proto\edit.pro >tmp
  338. Xcp tmp proto\edit.pro 
  339. Xaddcr <proto\fileio.pro >tmp
  340. Xcp tmp proto\fileio.pro 
  341. Xaddcr <proto\help.pro >tmp
  342. Xcp tmp proto\help.pro 
  343. Xaddcr <proto\linefunc.pro >tmp
  344. Xcp tmp proto\linefunc.pro 
  345. Xaddcr <proto\main.pro >tmp
  346. Xcp tmp proto\main.pro 
  347. Xaddcr <proto\mark.pro >tmp
  348. Xcp tmp proto\mark.pro 
  349. Xaddcr <proto\message.pro >tmp
  350. Xcp tmp proto\message.pro 
  351. Xaddcr <proto\misccmds.pro >tmp
  352. Xcp tmp proto\misccmds.pro 
  353. Xaddcr <proto\normal.pro >tmp
  354. Xcp tmp proto\normal.pro 
  355. Xaddcr <proto\ops.pro >tmp
  356. Xcp tmp proto\ops.pro 
  357. Xaddcr <proto\param.pro >tmp
  358. Xcp tmp proto\param.pro 
  359. Xaddcr <proto\quickfix.pro >tmp
  360. Xcp tmp proto\quickfix.pro 
  361. Xaddcr <proto\regexp.pro >tmp
  362. Xcp tmp proto\regexp.pro 
  363. Xaddcr <proto\regsub.pro >tmp
  364. Xcp tmp proto\regsub.pro 
  365. Xaddcr <proto\screen.pro >tmp
  366. Xcp tmp proto\screen.pro 
  367. Xaddcr <proto\script.pro >tmp
  368. Xcp tmp proto\script.pro 
  369. Xaddcr <proto\search.pro >tmp
  370. Xcp tmp proto\search.pro 
  371. Xaddcr <proto\storage.pro >tmp
  372. Xcp tmp proto\storage.pro 
  373. Xaddcr <proto\tag.pro >tmp
  374. Xcp tmp proto\tag.pro 
  375. Xaddcr <proto\term.pro >tmp
  376. Xcp tmp proto\term.pro 
  377. Xaddcr <proto\termlib.pro >tmp
  378. Xcp tmp proto\termlib.pro 
  379. Xaddcr <proto\undo.pro >tmp
  380. Xcp tmp proto\undo.pro 
  381. Xaddcr <proto\version.pro >tmp
  382. Xcp tmp proto\version.pro 
  383. Xdel tmp
  384. END_OF_FILE
  385. if test 3795 -ne `wc -c <'vim/src/addcr.bat'`; then
  386.     echo shar: \"'vim/src/addcr.bat'\" unpacked with wrong size!
  387. fi
  388. # end of 'vim/src/addcr.bat'
  389. fi
  390. if test -f 'vim/src/alloc.c' -a "${1}" != "-c" ; then 
  391.   echo shar: Will not clobber existing file \"'vim/src/alloc.c'\"
  392. else
  393. echo shar: Extracting \"'vim/src/alloc.c'\" \(2444 characters\)
  394. sed "s/^X//" >'vim/src/alloc.c' <<'END_OF_FILE'
  395. X/* vi:ts=4:sw=4
  396. X *
  397. X * VIM - Vi IMitation
  398. X *
  399. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  400. X *                            Tim Thompson            twitch!tjt
  401. X *                            Tony Andrews            onecom!wldrdg!tony 
  402. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  403. X */
  404. X
  405. X/*
  406. X * alloc.c
  407. X *
  408. X * This file contains various routines dealing with allocation and
  409. X * deallocation of data structures.
  410. X */
  411. X
  412. X#include "vim.h"
  413. X#include "globals.h"
  414. X#include "proto.h"
  415. X
  416. X#ifdef AMIGA
  417. X# undef FALSE            /* these are redefined in exec/types.h */
  418. X# undef TRUE
  419. X# include <exec/types.h>
  420. X# include <exec/memory.h>
  421. X# undef FALSE
  422. X# define FALSE 0        /* define FALSE and TRUE as ints instead of longs */
  423. X# undef TRUE
  424. X# define TRUE 1
  425. X#endif /* AMIGA */
  426. X
  427. X#ifdef MSDOS
  428. X# include <alloc.h>
  429. X#endif /* MSDOS */
  430. X
  431. X#define PANIC_FACTOR_CHIP 8192L
  432. X
  433. X    char *
  434. Xalloc(size)
  435. X    unsigned        size;
  436. X{
  437. X    return (lalloc((u_long)size, TRUE));
  438. X}
  439. X
  440. X    char *
  441. Xlalloc(size, message)
  442. X    u_long            size;
  443. X    int                message;
  444. X{
  445. X    register char   *p;            /* pointer to new storage space */
  446. X
  447. X    if ((p = (char *)malloc(size)) != NULL)
  448. X    {
  449. X#ifdef AMIGA
  450. X        if (AvailMem((long)MEMF_CHIP) < PANIC_FACTOR_CHIP)
  451. X        {                                 /* System is low... no go! */
  452. X                free(p);
  453. X                p = NULL;
  454. X        }
  455. X#endif
  456. X#ifdef MSDOS
  457. X        if (coreleft() < PANIC_FACTOR_CHIP)
  458. X        {                                 /* System is low... no go! */
  459. X                free(p);
  460. X                p = NULL;
  461. X        }
  462. X#endif
  463. X    }
  464. X    if (message && p == NULL)
  465. X        emsg(e_outofmem);
  466. X    return (p);
  467. X}
  468. X
  469. X/*
  470. X * copy a string into newly allocated memory
  471. X */
  472. X    char *
  473. Xstrsave(string)
  474. X    char           *string;
  475. X{
  476. X    char *p;
  477. X
  478. X    p = alloc((unsigned) (strlen(string) + 1));
  479. X    if (p != NULL)
  480. X        strcpy(p, string);
  481. X    return p;
  482. X}
  483. X
  484. X    char *
  485. Xstrnsave(string, len)
  486. X    char        *string;
  487. X    int         len;
  488. X{
  489. X    char *p;
  490. X
  491. X    p = alloc((unsigned) (len + 1));
  492. X    if (p != NULL)
  493. X    {
  494. X        strncpy(p, string, (size_t)len);
  495. X        p[len] = NUL;
  496. X    }
  497. X    return p;
  498. X}
  499. X
  500. X/*
  501. X * copy a number of spaces
  502. X */
  503. X    void
  504. Xcopy_spaces(ptr, count)
  505. X    char    *ptr;
  506. X    size_t    count;
  507. X{
  508. X    register size_t    j;
  509. X
  510. X    while (count)        /* copy 15 spaces at a time */
  511. X    {
  512. X        j = count;
  513. X        if (j > 15)
  514. X            j = 15;
  515. X        memmove(ptr, spaces, j);
  516. X        ptr += j;
  517. X        count -= j;
  518. X    }
  519. X}
  520. X
  521. X    char *
  522. Xmkstr(c)
  523. X    unsigned      c;
  524. X{
  525. X    static char      s[2];
  526. X
  527. X    s[0] = c;
  528. X    s[1] = NUL;
  529. X
  530. X    return s;
  531. X}
  532. X
  533. X#ifdef NO_FREE_NULL
  534. X#undef free
  535. X/*
  536. X * replacement for free() that cannot handle NULL pointers
  537. X */
  538. X    void
  539. XnofreeNULL(x)
  540. X    void *x;
  541. X{
  542. X    if (x != NULL)
  543. X        free(x);
  544. X}
  545. X#endif
  546. X
  547. X#ifdef BSD
  548. X    char *
  549. Xbsdmemset(ptr, c, size)
  550. X    char    *ptr;
  551. X    int        c;
  552. X    long    size;
  553. X{
  554. X    register char *p = ptr;
  555. X
  556. X    while (size-- > 0)
  557. X        *p++ = c;
  558. X    return ptr;
  559. X}
  560. X#endif
  561. END_OF_FILE
  562. if test 2444 -ne `wc -c <'vim/src/alloc.c'`; then
  563.     echo shar: \"'vim/src/alloc.c'\" unpacked with wrong size!
  564. fi
  565. # end of 'vim/src/alloc.c'
  566. fi
  567. if test -f 'vim/src/charset.c' -a "${1}" != "-c" ; then 
  568.   echo shar: Will not clobber existing file \"'vim/src/charset.c'\"
  569. else
  570. echo shar: Extracting \"'vim/src/charset.c'\" \(1994 characters\)
  571. sed "s/^X//" >'vim/src/charset.c' <<'END_OF_FILE'
  572. X/* vi:ts=4:sw=4
  573. X *
  574. X * VIM - Vi IMitation
  575. X *
  576. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  577. X *                            Tim Thompson            twitch!tjt
  578. X *                            Tony Andrews            onecom!wldrdg!tony 
  579. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  580. X */
  581. X
  582. X#include "vim.h"
  583. X#include "globals.h"
  584. X#include "proto.h"
  585. X#include "param.h"
  586. X
  587. X
  588. X    char *
  589. Xtranschar(c)
  590. X    unsigned c;
  591. X{
  592. X        static char buf[3];
  593. X
  594. X        if (c < ' ')
  595. X        {
  596. X                if (c == NL)
  597. X                        c = NUL;        /* we use newline in place of a NUL */
  598. X                buf[0] = '^';
  599. X                buf[1] = '@' + c;
  600. X                buf[2] = NUL;
  601. X        }
  602. X        else if (c <= '~' || c > 0xa0 || p_gr)
  603. X        {
  604. X                buf[0] = c;
  605. X                buf[1] = NUL;
  606. X        }
  607. X        else
  608. X        {
  609. X                buf[0] = '~';
  610. X                buf[1] = c - 0x80 + '@';
  611. X                buf[2] = NUL;
  612. X        }
  613. X        return buf;
  614. X}
  615. X
  616. X/*
  617. X * output 'len' characters in 'str' (including NULs) with translation
  618. X * if 'len' is -1, output upto a NUL character
  619. X * return the number of characters it takes on the screen
  620. X */
  621. X    int
  622. Xouttrans(str, len)
  623. X    register char *str;
  624. X    register int   len;
  625. X{
  626. X    int retval = 0;
  627. X
  628. X    if (len == -1)
  629. X        len = strlen(str);
  630. X    while (--len >= 0)
  631. X    {
  632. X        outstrn(transchar(*(u_char *)str));
  633. X        retval += charsize(*(u_char *)str);
  634. X        ++str;
  635. X    }
  636. X    return retval;
  637. X}
  638. X
  639. X/*
  640. X * return the number of characters 'c' will take on the screen
  641. X */
  642. X    int
  643. Xcharsize(c)
  644. X    int c;
  645. X{
  646. X    return ((c >= ' ' && (p_gr || c <= '~')) || c > 0xa0 ? 1 : 2);
  647. X}
  648. X
  649. X/*
  650. X * return the number of characters string 's' will take on the screen
  651. X */
  652. X    int
  653. Xstrsize(s)
  654. X    char *s;
  655. X{
  656. X    int    len = 0;
  657. X
  658. X    while (*s)
  659. X        len += charsize(*s++);
  660. X    return len;
  661. X}
  662. X
  663. X/*
  664. X * return the number of characters 'c' will take on the screen, taking
  665. X * into account the size of a tab
  666. X */
  667. X    int
  668. Xchartabsize(c, col)
  669. X    int c, col;
  670. X{
  671. X    if ((c >= ' ' && (c <= '~' || p_gr)) || c > 0xa0)
  672. X           return 1;
  673. X       else if (c == TAB && !p_list)
  674. X           return (int)(p_ts - (col % p_ts));
  675. X       else
  676. X        return 2;
  677. X}
  678. X
  679. X/*
  680. X * return TRUE if 'c' is an identifier character
  681. X */
  682. X    int
  683. Xisidchar(c)
  684. X    int c;
  685. X{
  686. X#ifdef __STDC__
  687. X        return (isalnum(c) || c == '_');
  688. X#else
  689. X        return (isalpha(c) || isdigit(c) || c == '_');
  690. X#endif
  691. X}
  692. END_OF_FILE
  693. if test 1994 -ne `wc -c <'vim/src/charset.c'`; then
  694.     echo shar: \"'vim/src/charset.c'\" unpacked with wrong size!
  695. fi
  696. # end of 'vim/src/charset.c'
  697. fi
  698. if test -f 'vim/src/help.c' -a "${1}" != "-c" ; then 
  699.   echo shar: Will not clobber existing file \"'vim/src/help.c'\"
  700. else
  701. echo shar: Extracting \"'vim/src/help.c'\" \(2810 characters\)
  702. sed "s/^X//" >'vim/src/help.c' <<'END_OF_FILE'
  703. X/* vi:ts=4:sw=4
  704. X *
  705. X * VIM - Vi IMitation
  706. X *
  707. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  708. X *                            Tim Thompson            twitch!tjt
  709. X *                            Tony Andrews            onecom!wldrdg!tony 
  710. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  711. X */
  712. X
  713. X/*
  714. X * help.c: display help from the vim.hlp file
  715. X */
  716. X
  717. X#include "vim.h"
  718. X#include "globals.h"
  719. X#include "proto.h"
  720. X#include "param.h"
  721. X
  722. Xstatic long helpfilepos;        /* position in help file */
  723. Xstatic FILE *helpfd;            /* file descriptor of help file */
  724. X
  725. X    void
  726. Xhelp()
  727. X{
  728. X    int        c;
  729. X    int        eof;
  730. X    int        i;
  731. X    long    filepos[26];    /* seek position for each screen */
  732. X    int        screennr;        /* screen number; 'c' == 1 */
  733. X    char    fnamebuf[MAXPATHL];
  734. X#ifdef MSDOS
  735. X    char    *fnamep;
  736. X#endif
  737. X
  738. X/*
  739. X * try to open the file specified by the "helpfile" option
  740. X */
  741. X    expand_env(p_hf, fnamebuf, MAXPATHL);
  742. X    if ((helpfd = fopen(fnamebuf, READBIN)) == NULL)
  743. X    {
  744. X#ifdef MSDOS
  745. X    /*
  746. X     * for MSdos: try the DOS search path
  747. X     */
  748. X        strcpy(fnamebuf, "vim.hlp");
  749. X        fnamep = searchpath(fnamebuf);
  750. X        if (fnamep == NULL || (helpfd = fopen(fnamep, READBIN)) == NULL)
  751. X        {
  752. X#endif
  753. X            smsg("Sorry, help file %s not found", fnamebuf);
  754. X            return;
  755. X#ifdef MSDOS
  756. X        }
  757. X#endif
  758. X    }
  759. X    helpfilepos = 0;
  760. X    screennr = 0;
  761. X    for (i = 0; i < 26; ++i)
  762. X        filepos[i] = 0;
  763. X    State = HELP;
  764. X    for (;;)
  765. X    {
  766. X        eof = redrawhelp();
  767. X        if (!eof)
  768. X            filepos[screennr + 1] = ftell(helpfd);
  769. X
  770. X        if ((c = vgetc()) == '\n' || c == '\r')
  771. X            break;
  772. X
  773. X        if (c == ' ')                        /* one screen forwards */
  774. X        {
  775. X            if (screennr < 25 && !eof)
  776. X                ++screennr;
  777. X        }
  778. X        else if (c == 'a')                    /* go to first screen */
  779. X            screennr = 0;
  780. X        else if (c == 'b')                    /* go one screen backwards */
  781. X        {
  782. X            if (screennr > 0)
  783. X                --screennr;
  784. X        }
  785. X        else if (c >= 'c' && c <= 'z')        /* go to specified screen */
  786. X        {
  787. X            if (c - 'b' < screennr)            /* backwards */
  788. X                screennr = c - 'b';
  789. X            else                            /* forwards */
  790. X            {
  791. X                while (screennr < c - 'b' && filepos[screennr + 1])
  792. X                    ++screennr;
  793. X                fseek(helpfd, filepos[screennr], 0);
  794. X                while (screennr < c - 'b')
  795. X                {
  796. X                    while ((i = getc(helpfd)) != '\f' && i != -1)
  797. X                        ;
  798. X                    if (i == -1)
  799. X                        break;
  800. X                    filepos[++screennr] = ftell(helpfd);
  801. X                }
  802. X            }
  803. X        }
  804. X        helpfilepos = filepos[screennr];
  805. X    }
  806. X    State = NORMAL;
  807. X    script_winsize_pp();
  808. X    fclose(helpfd);
  809. X    updateScreen(CLEAR);
  810. X}
  811. X
  812. X    int
  813. Xredrawhelp()
  814. X{
  815. X        int nextc;
  816. X        int col;
  817. X
  818. X        fseek(helpfd, helpfilepos, 0);
  819. X        col = Columns - 52;
  820. X        if (col < 0)
  821. X                col = 0;
  822. X        outstr(T_ED);
  823. X        while ((nextc = getc(helpfd)) != -1 && nextc != '\f')
  824. X        {
  825. X            if (nextc == Ctrl('B'))        /* begin of invert */
  826. X                outstr(T_TI);
  827. X            else if (nextc == Ctrl('E'))    /* end of invert */
  828. X                outstr(T_TP);
  829. X            else
  830. X                outchar((char)nextc);
  831. X        }
  832. X        windgoto(0, (int)(Columns - strlen(Version) - 1));
  833. X        outstrn(Version);
  834. X        windgoto((int)Rows - 1, col);
  835. X        outstrn("<space = next; return = quit; a = index; b = back>");
  836. X        return (nextc == -1);
  837. X}
  838. END_OF_FILE
  839. if test 2810 -ne `wc -c <'vim/src/help.c'`; then
  840.     echo shar: \"'vim/src/help.c'\" unpacked with wrong size!
  841. fi
  842. # end of 'vim/src/help.c'
  843. fi
  844. if test -f 'vim/src/linefunc.c' -a "${1}" != "-c" ; then 
  845.   echo shar: Will not clobber existing file \"'vim/src/linefunc.c'\"
  846. else
  847. echo shar: Extracting \"'vim/src/linefunc.c'\" \(2625 characters\)
  848. sed "s/^X//" >'vim/src/linefunc.c' <<'END_OF_FILE'
  849. X/* vi:ts=4:sw=4
  850. X *
  851. X * VIM - Vi IMitation
  852. X *
  853. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  854. X *                            Tim Thompson            twitch!tjt
  855. X *                            Tony Andrews            onecom!wldrdg!tony 
  856. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  857. X */
  858. X
  859. X/*
  860. X * linefunc.c: some functions to move to the next/previous line and
  861. X *               to the next/previous character
  862. X */
  863. X
  864. X#include "vim.h"
  865. X#include "globals.h"
  866. X#include "proto.h"
  867. X
  868. X/*
  869. X * coladvance(col)
  870. X *
  871. X * Try to advance the Cursor to the specified column.
  872. X */
  873. X
  874. X    void
  875. Xcoladvance(wcol)
  876. X    colnr_t         wcol;
  877. X{
  878. X    int                 index;
  879. X    register u_char        *ptr;
  880. X    register colnr_t    col;
  881. X
  882. X    ptr = (u_char *)nr2ptr(Curpos.lnum);
  883. X
  884. X    /* try to advance to the specified column */
  885. X    index = -1;
  886. X    col = 0;
  887. X    while (col <= wcol && *ptr)
  888. X    {
  889. X        ++index;
  890. X        /* Count a tab for what it's worth (if list mode not on) */
  891. X        col += chartabsize(*ptr, col);
  892. X        ++ptr;
  893. X    }
  894. X    if (index < 0)
  895. X        Curpos.col = 0;
  896. X    else
  897. X        Curpos.col = index;
  898. X}
  899. X
  900. X/*
  901. X * inc(p)
  902. X *
  903. X * Increment the line pointer 'p' crossing line boundaries as necessary. Return
  904. X * 1 when crossing a line, -1 when at end of file, 0 otherwise.
  905. X */
  906. X    int
  907. Xinc(lp)
  908. X    register FPOS  *lp;
  909. X{
  910. X    register char  *p = pos2ptr(lp);
  911. X
  912. X    if (*p != NUL)
  913. X    {            /* still within line */
  914. X        lp->col++;
  915. X        return ((p[1] != NUL) ? 0 : 1);
  916. X    }
  917. X    if (lp->lnum != line_count)
  918. X    {            /* there is a next line */
  919. X        lp->col = 0;
  920. X        lp->lnum++;
  921. X        return 1;
  922. X    }
  923. X    return -1;
  924. X}
  925. X
  926. X    int
  927. XincCurpos()
  928. X{
  929. X    return inc(&Curpos);
  930. X}
  931. X
  932. X/*
  933. X * incl(lp): same as inc(), but skip the NUL at the end of non-empty lines
  934. X */
  935. X    int
  936. Xincl(lp)
  937. X        register FPOS *lp;
  938. X{
  939. X        register int r;
  940. X
  941. X        if ((r = inc(lp)) == 1 && lp->col)
  942. X                r = inc(lp);
  943. X        return r;
  944. X}
  945. X
  946. X/*
  947. X * dec(p)
  948. X *
  949. X * Decrement the line pointer 'p' crossing line boundaries as necessary. Return
  950. X * 1 when crossing a line, -1 when at start of file, 0 otherwise.
  951. X */
  952. X    int
  953. Xdec(lp)
  954. X    register FPOS  *lp;
  955. X{
  956. X    if (lp->col > 0)
  957. X    {            /* still within line */
  958. X        lp->col--;
  959. X        return 0;
  960. X    }
  961. X    if (lp->lnum > 1)
  962. X    {            /* there is a prior line */
  963. X        lp->lnum--;
  964. X        lp->col = strlen(nr2ptr(lp->lnum));
  965. X        return 1;
  966. X    }
  967. X    return -1;                    /* at start of file */
  968. X}
  969. X
  970. X    int
  971. XdecCurpos()
  972. X{
  973. X    return dec(&Curpos);
  974. X}
  975. X
  976. X/*
  977. X * decl(lp): same as dec(), but skip the NUL at the end of non-empty lines
  978. X */
  979. X    int
  980. Xdecl(lp)
  981. X        register FPOS *lp;
  982. X{
  983. X        register int r;
  984. X
  985. X        if ((r = dec(lp)) == 1 && lp->col)
  986. X                r = dec(lp);
  987. X        return r;
  988. X}
  989. X
  990. X/*
  991. X * make sure Curpos in on a valid character
  992. X */
  993. X    void
  994. XadjustCurpos()
  995. X{
  996. X    int len;
  997. X
  998. X    if (Curpos.lnum == 0)
  999. X        Curpos.lnum = 1;
  1000. X    if (Curpos.lnum > line_count)
  1001. X        Curpos.lnum = line_count;
  1002. X
  1003. X    len = strlen(nr2ptr(Curpos.lnum));
  1004. X    if (len == 0)
  1005. X        Curpos.col = 0;
  1006. X    else if (Curpos.col >= len)
  1007. X        Curpos.col = len - 1;
  1008. X}
  1009. END_OF_FILE
  1010. if test 2625 -ne `wc -c <'vim/src/linefunc.c'`; then
  1011.     echo shar: \"'vim/src/linefunc.c'\" unpacked with wrong size!
  1012. fi
  1013. # end of 'vim/src/linefunc.c'
  1014. fi
  1015. if test -f 'vim/src/makefile.dice' -a "${1}" != "-c" ; then 
  1016.   echo shar: Will not clobber existing file \"'vim/src/makefile.dice'\"
  1017. else
  1018. echo shar: Extracting \"'vim/src/makefile.dice'\" \(3130 characters\)
  1019. sed "s/^X//" >'vim/src/makefile.dice' <<'END_OF_FILE'
  1020. X#
  1021. X# Makefile for VIM, using DICE 2.06.40 and 2.06.21
  1022. X#
  1023. X
  1024. X#>>>>> choose options:
  1025. X### -DDIGRAPHS        digraph support (at the cost of 1.6 Kbyte code)
  1026. X### -DWILD_CARDS    wildcard expansion code
  1027. X### -DNO_ARP        do not use arp.library, DOS 2.0 required
  1028. X### -DCOMPATIBLE    start in vi-compatible mode
  1029. X### -DNOBACKUP        default is no backup file
  1030. X### -DDEBUG        output a lot of debugging garbage
  1031. X### -DTERMCAP        include termcap file support
  1032. X### -DNO_BUILTIN_TCAPS    do not include builtin termcap entries
  1033. X###                (use only with -DTERMCAP)
  1034. X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
  1035. X###                (use only without -DNO_BUILTIN_TCAPS)
  1036. X### -DALL_BUILTIN_TCAPS    include all builtin termcap entries
  1037. X###                (use only without -DNO_BUILTIN_TCAPS)
  1038. XDEFINES = -DWILD_CARDS -DTERMCAP -DDIGRAPHS -DSOME_BUILTIN_TCAPS
  1039. X
  1040. X#>>>>> if TERMCAP is defined termlib.o has to be used
  1041. XTERMLIB = termlib.o
  1042. X#TERMLIB = 
  1043. X
  1044. X#>>>>> end of choices
  1045. X###########################################################################
  1046. X
  1047. XCFLAGS = -c -DAMIGA $(DEFINES)
  1048. X
  1049. XINCL = vim.syms
  1050. XPRE = -H${INCL}=vim.h
  1051. XLIBS = -lmanx -la
  1052. XCC = dcc
  1053. XLD = dcc
  1054. X
  1055. X.c.o:
  1056. X    ${CC} ${PRE} ${CFLAGS} $*.c -o $@
  1057. X
  1058. XOBJ =    alloc.o amiga.o buffers.o charset.o cmdline.o csearch.o digraph.o \
  1059. X    edit.o fileio.o help.o linefunc.o main.o mark.o message.o misccmds.o \
  1060. X    normal.o ops.o param.o quickfix.o regexp.o regsub.o screen.o \
  1061. X    script.o search.o storage.o tag.o undo.o $(TERMLIB)
  1062. X
  1063. X/Vim: $(OBJ) version.c
  1064. X    ${CC} $(CFLAGS) version.c -o version.o
  1065. X    ${LD} -o /Vim $(OBJ) version.o $(LIBS)
  1066. X
  1067. Xdebug: $(OBJ) version.c
  1068. X    ${CC} $(CFLAGS) version.c -o version.o
  1069. X    ${LD} -s -o /Vim $(OBJ) version.o $(LIBS)
  1070. X
  1071. Xctags:
  1072. X    csh -c ctags *.c *.h
  1073. X
  1074. X# can't use delete here, too many file names
  1075. Xclean:
  1076. X    csh -c rm -f $(OBJ) version.o mkcmdtab.o /Vim $(INCL) mkcmdtab
  1077. X
  1078. X$(INCL)  : vim.h globals.h keymap.h macros.h ascii.h term.h amiga.h
  1079. X    delete $(INCL)
  1080. X
  1081. X###########################################################################
  1082. X
  1083. Xalloc.o:    alloc.c  $(INCL)
  1084. X
  1085. Xamiga.o:    amiga.c  $(INCL) amiga.h
  1086. X
  1087. Xbuffers.o:    buffers.c  $(INCL)
  1088. X
  1089. Xcharset.o:    charset.c  $(INCL)
  1090. X
  1091. Xcmdline.o:    cmdline.c  $(INCL) cmdtab.h
  1092. X
  1093. Xcsearch.o:    csearch.c  $(INCL) regexp.h
  1094. X
  1095. Xdigraph.o: digraph.c    $(INCL)
  1096. X
  1097. Xedit.o: edit.c    $(INCL)
  1098. X
  1099. Xfileio.o:    fileio.c  $(INCL)
  1100. X
  1101. Xhelp.o: help.c    $(INCL)
  1102. X
  1103. Xlinefunc.o:    linefunc.c  $(INCL)
  1104. X
  1105. Xmain.o: main.c
  1106. X    ${CC} ${CFLAGS} main.c -o main.o
  1107. X
  1108. Xmark.o: mark.c    $(INCL) mark.h
  1109. X
  1110. Xmessage.o:    message.c  $(INCL)
  1111. X
  1112. Xmisccmds.o:    misccmds.c  $(INCL)
  1113. X
  1114. Xnormal.o:    normal.c  $(INCL) ops.h
  1115. X
  1116. Xops.o:    ops.c  $(INCL) ops.h
  1117. X
  1118. Xparam.o:    param.c  $(INCL)
  1119. X# Because of a bug in DC1 2.06.40, initialisation of unions does not
  1120. X# work correctly. dc1-21 is DC1 2.06.21 which does work.
  1121. X    rename dc1-21 dc1
  1122. X    ${CC} ${CFLAGS} param.c -o param.o
  1123. X    rename dc1 dc1-21
  1124. X
  1125. Xquickfix.o:    quickfix.c  $(INCL)
  1126. X
  1127. Xregexp.o:    regexp.c  $(INCL) regexp.h
  1128. X
  1129. Xregsub.o:    regsub.c  $(INCL) regexp.h
  1130. X
  1131. Xscreen.o:    screen.c  $(INCL)
  1132. X
  1133. Xscript.o:    script.c  $(INCL)
  1134. X
  1135. Xsearch.o:    search.c  $(INCL) regexp.h
  1136. X
  1137. Xtag.o:    tags.c  $(INCL) mark.h
  1138. X
  1139. Xtermlib.o:    termlib.c $(INCL)
  1140. X
  1141. Xstorage.o:    storage.c  $(INCL)
  1142. X
  1143. Xundo.o: undo.c    $(INCL)
  1144. X
  1145. Xcmdtab.h: cmdtab.tab mkcmdtab
  1146. X    mkcmdtab cmdtab.tab cmdtab.h
  1147. X
  1148. Xmkcmdtab: mkcmdtab.o
  1149. X    ${LD} -o mkcmdtab mkcmdtab.o
  1150. END_OF_FILE
  1151. if test 3130 -ne `wc -c <'vim/src/makefile.dice'`; then
  1152.     echo shar: \"'vim/src/makefile.dice'\" unpacked with wrong size!
  1153. fi
  1154. # end of 'vim/src/makefile.dice'
  1155. fi
  1156. if test -f 'vim/src/makefile.dos' -a "${1}" != "-c" ; then 
  1157.   echo shar: Will not clobber existing file \"'vim/src/makefile.dos'\"
  1158. else
  1159. echo shar: Extracting \"'vim/src/makefile.dos'\" \(3966 characters\)
  1160. sed "s/^X//" >'vim/src/makefile.dos' <<'END_OF_FILE'
  1161. X#
  1162. X# Makefile for VIM on MSDOS, using Turbo C
  1163. X#
  1164. X
  1165. X#>>>>> choose options:
  1166. X### -DUSE_KBHIT        use kbhit() and getch() instead of bioskey()
  1167. X### -DDIGRAPHS        digraph support (at the cost of 1.6 Kbyte code)
  1168. X### -DWILD_CARDS    wildcard expansion code
  1169. X### -DCOMPATIBLE    start in vi-compatible mode
  1170. X### -DNOBACKUP        default is no backup file
  1171. X### -DDEBUG        output a lot of debugging garbage
  1172. X### -DTERMCAP        include termcap file support
  1173. X### -DNO_BUILTIN_TCAPS    do not include builtin termcap entries
  1174. X###                (use only with -DTERMCAP)
  1175. X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
  1176. X###                (use only without -DNO_BUILTIN_TCAPS)
  1177. X### -DALL_BUILTIN_TCAPS    include all builtin termcap entries
  1178. X###                (use only without -DNO_BUILTIN_TCAPS)
  1179. X### -DVIMRC_FILE    name of the .vimrc file in current dir
  1180. X### -DEXRC_FILE        name of the .exrc file in current dir
  1181. X### -DSYSVIMRC_FILE    name of the global .vimrc file
  1182. X### -DSYSEXRC_FILE    name of the global .exrc file
  1183. X### -DDEFVIMRC_FILE    name of the system-wide .vimrc file
  1184. X### -DVIM_HLP        name of the help file
  1185. XDEFINES = -DWILD_CARDS
  1186. X
  1187. X#>>>>> name of the compiler and linker, name of lib directory
  1188. XCC = tcc
  1189. XLINK = tlink
  1190. XLIB = d:\tc\lib
  1191. X
  1192. X#>>>>> end of choices
  1193. X###########################################################################
  1194. X
  1195. XINCL = vim.h globals.h param.h keymap.h macros.h ascii.h term.h msdos.h
  1196. XCFLAGS = -c -ml -DMSDOS $(DEFINES)
  1197. X
  1198. XOBJ =    alloc.obj msdos.obj buffers.obj charset.obj cmdline.obj csearch.obj \
  1199. X    digraph.obj edit.obj fileio.obj help.obj linefunc.obj main.obj mark.obj \
  1200. X    message.obj misccmds.obj normal.obj ops.obj param.obj quickfix.obj \
  1201. X    regexp.obj regsub.obj screen.obj script.obj search.obj storage.obj \
  1202. X    tag.obj term.obj undo.obj
  1203. X
  1204. X..\vim: $(OBJ) version.c
  1205. X    $(CC) $(CFLAGS) version.c
  1206. X    $(LINK) /c /m $(LIB)\C0l @vimresp,..\vim,..\vim,$(LIB)\emu $(LIB)\Cl
  1207. X
  1208. Xctags:
  1209. X    command /c ctags *.c *.h
  1210. X
  1211. Xclean:
  1212. X    del $(OBJ) version.obj mkcmdtab.obj ..\vim mkcmdtab
  1213. X
  1214. Xaddcr:    addcr.c
  1215. X    $(CC) addcr.c
  1216. X    command /c addcr.bat
  1217. X
  1218. X###########################################################################
  1219. X
  1220. Xalloc.obj:    alloc.c  $(INCL)
  1221. X    $(CC) $(CFLAGS) alloc.c
  1222. X
  1223. Xmsdos.obj:    msdos.c  $(INCL) msdos.h
  1224. X    $(CC) $(CFLAGS) msdos.c
  1225. X
  1226. Xbuffers.obj:    buffers.c  $(INCL)
  1227. X    $(CC) $(CFLAGS) buffers.c
  1228. X
  1229. Xcharset.obj:    charset.c  $(INCL)
  1230. X    $(CC) $(CFLAGS) charset.c
  1231. X
  1232. Xcmdline.obj:    cmdline.c  $(INCL) cmdtab.h
  1233. X    $(CC) $(CFLAGS) cmdline.c
  1234. X
  1235. Xcsearch.obj:    csearch.c  $(INCL)
  1236. X    $(CC) $(CFLAGS) csearch.c
  1237. X
  1238. Xdigraph.obj:    digraph.c  $(INCL)
  1239. X    $(CC) $(CFLAGS) digraph.c
  1240. X
  1241. Xedit.obj:    edit.c  $(INCL)
  1242. X    $(CC) $(CFLAGS) edit.c
  1243. X
  1244. Xfileio.obj:    fileio.c  $(INCL)
  1245. X    $(CC) $(CFLAGS) fileio.c
  1246. X
  1247. Xhelp.obj:    help.c  $(INCL)
  1248. X    $(CC) $(CFLAGS) help.c
  1249. X
  1250. Xlinefunc.obj:    linefunc.c  $(INCL)
  1251. X    $(CC) $(CFLAGS) linefunc.c
  1252. X
  1253. Xmain.obj:    main.c  $(INCL)
  1254. X    $(CC) $(CFLAGS) main.c
  1255. X
  1256. Xmark.obj:    mark.c  $(INCL)
  1257. X    $(CC) $(CFLAGS) mark.c
  1258. X
  1259. Xmessage.obj:    message.c  $(INCL)
  1260. X    $(CC) $(CFLAGS) message.c
  1261. X
  1262. Xmisccmds.obj:    misccmds.c  $(INCL)
  1263. X    $(CC) $(CFLAGS) misccmds.c
  1264. X
  1265. Xnormal.obj:    normal.c  $(INCL) ops.h
  1266. X    $(CC) $(CFLAGS) normal.c
  1267. X
  1268. Xops.obj:    ops.c  $(INCL) ops.h
  1269. X    $(CC) $(CFLAGS) ops.c
  1270. X
  1271. Xparam.obj:    param.c  $(INCL)
  1272. X    $(CC) $(CFLAGS) param.c
  1273. X
  1274. Xquickfix.obj:    quickfix.c  $(INCL)
  1275. X    $(CC) $(CFLAGS) quickfix.c
  1276. X
  1277. Xregexp.obj:    regexp.c  $(INCL)
  1278. X    $(CC) $(CFLAGS) regexp.c
  1279. X
  1280. Xregsub.obj:    regsub.c  $(INCL)
  1281. X    $(CC) $(CFLAGS) regsub.c
  1282. X
  1283. Xscreen.obj:    screen.c  $(INCL)
  1284. X    $(CC) $(CFLAGS) screen.c
  1285. X
  1286. Xscript.obj:    script.c  $(INCL)
  1287. X    $(CC) $(CFLAGS) script.c
  1288. X
  1289. Xsearch.obj:    search.c  $(INCL)
  1290. X    $(CC) $(CFLAGS) search.c
  1291. X
  1292. Xstorage.obj:    storage.c  $(INCL)
  1293. X    $(CC) $(CFLAGS) storage.c
  1294. X
  1295. Xtag.obj:    tag.c  $(INCL)
  1296. X    $(CC) $(CFLAGS) tag.c
  1297. X
  1298. Xterm.obj:    term.c  $(INCL)
  1299. X    $(CC) $(CFLAGS) term.c
  1300. X
  1301. Xundo.obj:    undo.c  $(INCL)
  1302. X    $(CC) $(CFLAGS) undo.c
  1303. X
  1304. Xcmdtab.h: cmdtab.tab mkcmdtab.exe
  1305. X    mkcmdtab cmdtab.tab cmdtab.h
  1306. X
  1307. Xmkcmdtab.exe: mkcmdtab.obj
  1308. X    $(CC) -ml -omkcmdtab mkcmdtab.obj
  1309. X
  1310. Xmkcmdtab.obj: mkcmdtab.c
  1311. X    $(CC) $(CFLAGS) mkcmdtab.c
  1312. END_OF_FILE
  1313. if test 3966 -ne `wc -c <'vim/src/makefile.dos'`; then
  1314.     echo shar: \"'vim/src/makefile.dos'\" unpacked with wrong size!
  1315. fi
  1316. # end of 'vim/src/makefile.dos'
  1317. fi
  1318. if test -f 'vim/src/message.c' -a "${1}" != "-c" ; then 
  1319.   echo shar: Will not clobber existing file \"'vim/src/message.c'\"
  1320. else
  1321. echo shar: Extracting \"'vim/src/message.c'\" \(2523 characters\)
  1322. sed "s/^X//" >'vim/src/message.c' <<'END_OF_FILE'
  1323. X/* vi:ts=4:sw=4
  1324. X *
  1325. X * VIM - Vi IMitation
  1326. X *
  1327. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  1328. X *                            Tim Thompson            twitch!tjt
  1329. X *                            Tony Andrews            onecom!wldrdg!tony 
  1330. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  1331. X */
  1332. X
  1333. X/*
  1334. X * message.c: functions for displaying messages on the command line
  1335. X */
  1336. X
  1337. X#include "vim.h"
  1338. X#include "globals.h"
  1339. X#define MESSAGE
  1340. X#include "proto.h"
  1341. X#include "param.h"
  1342. X
  1343. Xstatic int msg_invert = FALSE;
  1344. X
  1345. X/*
  1346. X * msg(s) - displays the string 's' on the status line
  1347. X */
  1348. X    void
  1349. Xmsg(s)
  1350. X    char           *s;
  1351. X{
  1352. X    int len;
  1353. X
  1354. X    if (Columns == 0)    /* terminal not initialized */
  1355. X    {
  1356. X        fprintf(stderr, s);
  1357. X        fflush(stderr);
  1358. X        return;
  1359. X    }
  1360. X
  1361. X    gotocmdline(TRUE, NUL);
  1362. X    if (msg_invert)
  1363. X        outstr(T_TI);
  1364. X    len = outtrans(s, -1);
  1365. X    if (msg_invert)
  1366. X    {
  1367. X        outstr(T_TP);
  1368. X        msg_invert = FALSE;
  1369. X    }
  1370. X    flushbuf();
  1371. X    /*
  1372. X     * if the string is larger than the window,
  1373. X     * or the ruler option is set and we run into it,
  1374. X     * we have to redraw the window.
  1375. X     * Do not do this if we are abandoning the file.
  1376. X     */
  1377. X    if (!exiting && len >= Columns - (p_ru ? 22 : 0))
  1378. X    {
  1379. X        outchar('\n');
  1380. X        wait_return(TRUE);
  1381. X    }
  1382. X}
  1383. X
  1384. X/* VARARGS */
  1385. X#ifndef PROTO        /* automatic prototype generation does not understand this */
  1386. X    void
  1387. Xsmsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
  1388. X    char        *s;
  1389. X    long        a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
  1390. X{
  1391. X    sprintf(IObuff, s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
  1392. X    msg(IObuff);
  1393. X}
  1394. X#endif
  1395. X
  1396. X/*
  1397. X * emsg() - display an error message
  1398. X *
  1399. X * Rings the bell, if appropriate, and calls message() to do the real work
  1400. X */
  1401. X    void
  1402. Xemsg(s)
  1403. X    char           *s;
  1404. X{
  1405. X    if (p_eb)
  1406. X        beep();                /* also includes flush_buffers() */
  1407. X    else
  1408. X        flush_buffers();        /* delete all typeahead characters */
  1409. X    msg_invert = TRUE;
  1410. X    msg(s);
  1411. X    flushbuf();
  1412. X    if (got_int)        /* remove typeahead now, allow typeadhead during sleep */
  1413. X        inchar(TRUE, FALSE);
  1414. X    sleep(1);    /* give the user a chance to read the message */
  1415. X}
  1416. X
  1417. X    void
  1418. Xwait_return(redraw)
  1419. X    int        redraw;
  1420. X{
  1421. X    u_char            c;
  1422. X    int                oldstate;
  1423. X
  1424. X    oldstate = State;
  1425. X    State = HITRETURN;
  1426. X    if (got_int)
  1427. X        outstrn("Interrupt: ");
  1428. X
  1429. X#ifdef ORG_HITRETURN
  1430. X    outstrn("Press RETURN to continue");
  1431. X    do {
  1432. X        c = vgetc();
  1433. X    } while (strchr("\r\n: ", c) == NULL);
  1434. X    if (c == ':')             /* this can vi too (but not always!) */
  1435. X        stuffReadbuff(mkstr(c));
  1436. X#else
  1437. X    outstrn("Press RETURN or enter command to continue");
  1438. X    c = vgetc();
  1439. X    if (strchr("\r\n ", c) == NULL)
  1440. X        stuffReadbuff(mkstr(c));
  1441. X#endif
  1442. X
  1443. X    if (State == SETWINSIZE)
  1444. X    {
  1445. X        State = oldstate;
  1446. X        set_winsize(0, 0, FALSE);
  1447. X    }
  1448. X    State = oldstate;
  1449. X    script_winsize_pp();
  1450. X
  1451. X    if (redraw)
  1452. X        updateScreen(CLEAR);
  1453. X}
  1454. END_OF_FILE
  1455. if test 2523 -ne `wc -c <'vim/src/message.c'`; then
  1456.     echo shar: \"'vim/src/message.c'\" unpacked with wrong size!
  1457. fi
  1458. # end of 'vim/src/message.c'
  1459. fi
  1460. if test -f 'vim/src/mkcmdtab.c' -a "${1}" != "-c" ; then 
  1461.   echo shar: Will not clobber existing file \"'vim/src/mkcmdtab.c'\"
  1462. else
  1463. echo shar: Extracting \"'vim/src/mkcmdtab.c'\" \(2066 characters\)
  1464. sed "s/^X//" >'vim/src/mkcmdtab.c' <<'END_OF_FILE'
  1465. X/* vi:ts=4:sw=4
  1466. X *
  1467. X * VIM - Vi IMitation
  1468. X *
  1469. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  1470. X *                            Tim Thompson            twitch!tjt
  1471. X *                            Tony Andrews            onecom!wldrdg!tony 
  1472. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  1473. X */
  1474. X
  1475. X/*
  1476. X * mkcmdtab.c: separate program that reads cmdtab.tab and produces cmdtab.h
  1477. X *
  1478. X *    call with: mkcmdtab cmdtab.tab cmdtab.h
  1479. X */
  1480. X
  1481. X#include <stdlib.h>
  1482. X#include <stdio.h>
  1483. X#include "vim.h"
  1484. X
  1485. X    void
  1486. Xmain(argc, argv)
  1487. X    int        argc;
  1488. X    char    **argv;
  1489. X{
  1490. X    register int    c;
  1491. X    char            buffer[100];
  1492. X    int                count;
  1493. X    int                i;
  1494. X    FILE            *ifp, *ofp;
  1495. X
  1496. X    if (argc != 3)
  1497. X    {
  1498. X        fprintf(stderr, "Usage: mkcmdtab cmdtab.tab cmdtab.h\n");
  1499. X        exit(10);
  1500. X    }
  1501. X    ifp = fopen(argv[1], "r");
  1502. X    if (ifp == NULL)
  1503. X    {
  1504. X        perror(argv[1]);
  1505. X        exit(10);
  1506. X    }
  1507. X    ofp = fopen(argv[2], "w");
  1508. X    if (ofp == NULL)
  1509. X    {
  1510. X        perror(argv[2]);
  1511. X        exit(10);
  1512. X    }
  1513. X
  1514. X    while ((c = getc(ifp)) != '|' && c != EOF)
  1515. X        putc(c, ofp);
  1516. X    fprintf(ofp, "THIS FILE IS AUTOMATICALLY PRODUCED - DO NOT EDIT");
  1517. X    while ((c = getc(ifp)) != '|' && c != EOF)
  1518. X        ;
  1519. X    while ((c = getc(ifp)) != '|' && c != EOF)
  1520. X        putc(c, ofp);
  1521. X
  1522. X    count = 0;
  1523. X    while ((c = getc(ifp)) != '|' && c != EOF)
  1524. X    {
  1525. X        putc(c, ofp);
  1526. X        while ((c = getc(ifp)) != '"' && c != EOF)
  1527. X            putc(c, ofp);
  1528. X        putc(c, ofp);
  1529. X
  1530. X        i = 0;
  1531. X        while ((c = getc(ifp)) != '"' && c != EOF)
  1532. X        {
  1533. X            putc(c, ofp);
  1534. X            buffer[i++] = c;
  1535. X        }
  1536. X        putc(c, ofp);
  1537. X        buffer[i] = 0;
  1538. X
  1539. X        while ((c = getc(ifp)) != '\n' && c != EOF)
  1540. X            putc(c, ofp);
  1541. X        putc(c, ofp);
  1542. X
  1543. X        switch (buffer[0])
  1544. X        {
  1545. X            case '@':    strcpy(buffer, "at");
  1546. X                        break;
  1547. X            case '!':    strcpy(buffer, "bang");
  1548. X                        break;
  1549. X            case '<':    strcpy(buffer, "lshift");
  1550. X                        break;
  1551. X            case '>':    strcpy(buffer, "rshift");
  1552. X                        break;
  1553. X            case '=':    strcpy(buffer, "equal");
  1554. X                        break;
  1555. X            case '&':    strcpy(buffer, "and");
  1556. X                        break;
  1557. X            case '~':    strcpy(buffer, "tilde");
  1558. X                        break;
  1559. X        }
  1560. X                    
  1561. X        fprintf(ofp, "#define CMD_%s %d\n", buffer, count++);
  1562. X    }
  1563. X
  1564. X    fprintf(ofp, "#define CMD_SIZE %d\n", count);
  1565. X
  1566. X    while ((c = getc(ifp)) != '|' && c != EOF)
  1567. X        putc(c, ofp);
  1568. X
  1569. X    if (c != '|')
  1570. X    {
  1571. X        fprintf(stderr, "not enough |'s\n");
  1572. X        exit(1);
  1573. X    }
  1574. X    exit(0);
  1575. X}
  1576. END_OF_FILE
  1577. if test 2066 -ne `wc -c <'vim/src/mkcmdtab.c'`; then
  1578.     echo shar: \"'vim/src/mkcmdtab.c'\" unpacked with wrong size!
  1579. fi
  1580. # end of 'vim/src/mkcmdtab.c'
  1581. fi
  1582. if test -f 'vim/src/msdos.h' -a "${1}" != "-c" ; then 
  1583.   echo shar: Will not clobber existing file \"'vim/src/msdos.h'\"
  1584. else
  1585. echo shar: Extracting \"'vim/src/msdos.h'\" \(2033 characters\)
  1586. sed "s/^X//" >'vim/src/msdos.h' <<'END_OF_FILE'
  1587. X/* vi:ts=8:sw=4
  1588. X *
  1589. X * VIM - Vi IMitation
  1590. X *
  1591. X * Code Contributions By:    Bram Moolenaar        mool@oce.nl
  1592. X *                Tim Thompson        twitch!tjt
  1593. X *                Tony Andrews        onecom!wldrdg!tony
  1594. X *                G. R. (Fred) Walter    watmath!watcgl!grwalter
  1595. X */
  1596. X
  1597. X/*
  1598. X * MSDOS Machine-dependent filenames.
  1599. X */
  1600. X#ifdef SYSEXRC_FILE
  1601. X# undef SYSEXRC_FILE
  1602. X# undef SYSVIMRC_FILE
  1603. X#endif /* SYSEXRC_FILE */
  1604. X#define SYSEXRC_FILE "$VIM\\_exrc"
  1605. X#define SYSVIMRC_FILE "$VIM\\_vimrc"
  1606. X
  1607. X#ifdef EXRC_FILE
  1608. X# undef EXRC_FILE
  1609. X# undef VIMRC_FILE
  1610. X#endif /* EXRC_FILE */
  1611. X#define EXRC_FILE "_exrc"
  1612. X#define VIMRC_FILE "_vimrc"
  1613. X
  1614. X#ifdef VIM_HLP
  1615. X# undef VIM_HLP
  1616. X#endif /* VIM_HLP */
  1617. X#define VIM_HLP "$VIM\\vim.hlp"
  1618. X
  1619. X#ifdef TMPNAME1
  1620. X# undef TMPNAME1
  1621. X# undef TMPNAME2
  1622. X# undef TMPNAMELEN
  1623. X#endif /* TMPNAME1 */
  1624. X#define TMPNAME1 "viXXXXXX"        /* put it in current dir */
  1625. X#define TMPNAME2 "voXXXXXX"        /*  is there a better place? */
  1626. X#define TMPNAMELEN    10
  1627. X
  1628. X/*
  1629. X * MSDOS Machine-dependent routines.
  1630. X */
  1631. X
  1632. X#undef remove                   /* MSDOS remove()s when not readonly */
  1633. X
  1634. X/* msdos.c */
  1635. Xvoid    vim_delay __ARGS((void));
  1636. Xint    remove __ARGS((char *));
  1637. Xvoid    flushbuf __ARGS((void));
  1638. Xvoid    outchar __ARGS((unsigned));
  1639. Xvoid    outstr __ARGS((char *));
  1640. Xint     GetChars __ARGS((char *, int, int));
  1641. Xvoid    textfile __ARGS((int));
  1642. Xvoid    mch_suspend __ARGS((void));
  1643. Xvoid    mch_windinit __ARGS((void));
  1644. Xvoid    check_win __ARGS((int, char **));
  1645. Xvoid    fname_case __ARGS((char *));
  1646. Xvoid    settitle __ARGS((char *));
  1647. Xvoid    resettitle __ARGS((void));
  1648. Xint    dirname __ARGS((char *, int));
  1649. Xint    FullName __ARGS((char *, char *, int));
  1650. Xlong    getperm __ARGS((char *));
  1651. Xint    setperm __ARGS((char *, int));
  1652. Xint    isdir __ARGS((char *));
  1653. Xvoid    mch_windexit __ARGS((int));
  1654. Xvoid    mch_settmode __ARGS((int));
  1655. Xint    mch_get_winsize __ARGS((void));
  1656. Xvoid    mch_set_winsize __ARGS((void));
  1657. Xint    call_shell __ARGS((char *, int));
  1658. Xvoid    breakcheck __ARGS((void));
  1659. Xchar    *modname __ARGS((char *, char *));
  1660. X#ifdef WILD_CARDS
  1661. Xint    has_wildcard __ARGS((char *));
  1662. Xint    ExpandWildCards __ARGS((int, char **, int *, char ***, int, int));
  1663. Xvoid    FreeWild __ARGS((int, char **));
  1664. X#endif
  1665. END_OF_FILE
  1666. if test 2033 -ne `wc -c <'vim/src/msdos.h'`; then
  1667.     echo shar: \"'vim/src/msdos.h'\" unpacked with wrong size!
  1668. fi
  1669. # end of 'vim/src/msdos.h'
  1670. fi
  1671. if test -f 'vim/src/ops.h' -a "${1}" != "-c" ; then 
  1672.   echo shar: Will not clobber existing file \"'vim/src/ops.h'\"
  1673. else
  1674. echo shar: Extracting \"'vim/src/ops.h'\" \(1963 characters\)
  1675. sed "s/^X//" >'vim/src/ops.h' <<'END_OF_FILE'
  1676. X/* vi:ts=4:sw=4
  1677. X *
  1678. X * VIM - Vi IMitation
  1679. X *
  1680. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  1681. X *                            Tim Thompson            twitch!tjt
  1682. X *                            Tony Andrews            onecom!wldrdg!tony 
  1683. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  1684. X */
  1685. X
  1686. X/*
  1687. X * ops.h: things shared between normal.c, cmdline.c and ops.c
  1688. X */
  1689. X
  1690. X/*
  1691. X * Operators
  1692. X */
  1693. X#define NOP     0                /* no pending operation */
  1694. X#define DELETE    1
  1695. X#define YANK    2
  1696. X#define CHANGE    3
  1697. X#define LSHIFT    4
  1698. X#define RSHIFT    5
  1699. X#define FILTER    6
  1700. X#define TILDE    7
  1701. X#define INDENT    8
  1702. X#define FORMAT    9
  1703. X#define COLON    10
  1704. X#define UPPER    11
  1705. X#define LOWER    12
  1706. X
  1707. X/*
  1708. X * operator characters; the order must correspond to the defines above
  1709. X */
  1710. XEXTERN char *opchars INIT(= "dyc<>!~=V:uU");
  1711. X
  1712. X/*
  1713. X * When a cursor motion command is made, it is marked as being a character or
  1714. X * line oriented motion. Then, if an operator is in effect, the operation
  1715. X * becomes character or line oriented accordingly.
  1716. X *
  1717. X * Character motions are marked as being inclusive or not. Most char. motions
  1718. X * are inclusive, but some (e.g. 'w') are not.
  1719. X *
  1720. X * Generally speaking, every command in normal() should either clear any pending
  1721. X * operator (with CLEAROP), or set the motion type variable.
  1722. X */
  1723. X
  1724. X/*
  1725. X * Motion types
  1726. X */
  1727. X#define MBAD    (-1)            /* 'bad' motion type marks unusable yank buf */
  1728. X#define MCHAR    0
  1729. X#define MLINE    1
  1730. X#define MBLOCK    2
  1731. X
  1732. XEXTERN int        operator INIT(= NOP);    /* current pending operator */
  1733. XEXTERN int        mtype;                    /* type of the current cursor motion */
  1734. XEXTERN int        mincl;                    /* true if char motion is inclusive */
  1735. XEXTERN int        oneless;                /* 1 if !mincl and startop != endop */
  1736. XEXTERN FPOS     startop;                /* cursor pos. at start of operator */
  1737. XEXTERN FPOS        endop;                    /* cursor pos. at end of operator */
  1738. XEXTERN colnr_t    startvcol;                /* start col for block mode operator */
  1739. XEXTERN colnr_t    endvcol;                /* end col for block mode operator */
  1740. XEXTERN long        nlines;                    /* lines between startop and endop + 1 */
  1741. XEXTERN int        yankbuffer INIT(= 0);    /* current yank buffer */
  1742. END_OF_FILE
  1743. if test 1963 -ne `wc -c <'vim/src/ops.h'`; then
  1744.     echo shar: \"'vim/src/ops.h'\" unpacked with wrong size!
  1745. fi
  1746. # end of 'vim/src/ops.h'
  1747. fi
  1748. if test -f 'vim/src/sun_stdlib.h' -a "${1}" != "-c" ; then 
  1749.   echo shar: Will not clobber existing file \"'vim/src/sun_stdlib.h'\"
  1750. else
  1751. echo shar: Extracting \"'vim/src/sun_stdlib.h'\" \(1868 characters\)
  1752. sed "s/^X//" >'vim/src/sun_stdlib.h' <<'END_OF_FILE'
  1753. X/*
  1754. X * sun_stdlib.h: declararions used on a sun
  1755. X */
  1756. X
  1757. X#ifndef __stdlib_h
  1758. Xextern void free(void *);
  1759. Xextern void *malloc(unsigned);
  1760. Xextern void *realloc(void *, unsigned);
  1761. Xextern void *calloc(unsigned, unsigned);
  1762. X#endif
  1763. X#ifdef __sys_types_h
  1764. Xextern off_t lseek(int, off_t, int);
  1765. X
  1766. X# ifdef _sys_time_h
  1767. Xextern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
  1768. X# endif _sys_time_h
  1769. X
  1770. X#else
  1771. Xextern long lseek(int, long, int);
  1772. X#endif
  1773. X
  1774. Xextern long tell(int);
  1775. Xextern void perror(char *);
  1776. X
  1777. X#ifndef __sys_fcntlcom_h
  1778. Xextern int open(char *, int, ...);
  1779. X#endif
  1780. Xextern int close(int);
  1781. Xextern int read(int, char *, unsigned);
  1782. Xextern int write(int, char *, unsigned);
  1783. Xextern int ioctl(int, int, ...);
  1784. Xextern int unlink(char *);
  1785. X
  1786. X#ifdef FILE
  1787. Xextern int _filbuf(FILE *);
  1788. Xextern int _flsbuf(unsigned char, FILE *);
  1789. Xextern int fclose(FILE *);
  1790. Xextern int fprintf(FILE *, char *, ...);
  1791. Xextern int fscanf(FILE *, char *, ...);
  1792. Xextern int fseek(FILE *, long, int);
  1793. Xextern int fflush(FILE *);
  1794. Xextern int fread(char *, int, int, FILE *);
  1795. X#else
  1796. Xextern char *sprintf(char *, char *, ...);
  1797. X#endif
  1798. X
  1799. Xextern int printf(char *, ...);
  1800. X
  1801. Xextern int scanf(char *, ...);
  1802. Xextern int sscanf(char *, char *, ...);
  1803. X
  1804. Xextern int system(char *);
  1805. Xextern char *getenv(char *);
  1806. X
  1807. Xextern char *getcwd(char *, int);
  1808. Xextern char *getwd(char *);
  1809. X
  1810. Xextern int chdir(char *);
  1811. Xextern int getuid(void);
  1812. Xextern int getgid(void);
  1813. X
  1814. Xextern int atoi (char *);
  1815. Xextern long atol(char *);
  1816. Xextern long strtol(char * , char **, int);
  1817. X
  1818. Xextern void bcopy(char *, char *, int);
  1819. Xextern int bcmp(char *, char *, int);
  1820. Xextern void bzero(char *, int);
  1821. X
  1822. Xextern char *memccpy(char *, char *, int, int);
  1823. Xextern char *memchr(char *, int, int);
  1824. Xextern char *memset(char *, int, int);
  1825. X
  1826. Xextern int strncmp(char *, char *, int);
  1827. Xextern int strcasecmp(char *, char *);
  1828. X
  1829. Xextern int toupper(int);
  1830. Xextern int tolower(int);
  1831. Xextern int isatty(int);
  1832. END_OF_FILE
  1833. if test 1868 -ne `wc -c <'vim/src/sun_stdlib.h'`; then
  1834.     echo shar: \"'vim/src/sun_stdlib.h'\" unpacked with wrong size!
  1835. fi
  1836. # end of 'vim/src/sun_stdlib.h'
  1837. fi
  1838. if test -f 'vim/src/tcconfig.tc.uue' -a "${1}" != "-c" ; then 
  1839.   echo shar: Will not clobber existing file \"'vim/src/tcconfig.tc.uue'\"
  1840. else
  1841. echo shar: Extracting \"'vim/src/tcconfig.tc.uue'\" \(2410 characters\)
  1842. sed "s/^X//" >'vim/src/tcconfig.tc.uue' <<'END_OF_FILE'
  1843. X
  1844. Xbegin 644 tcconfig.tc
  1845. XM5'5R8F\@0R!#;VYF:6=U<F%T:6]N($9I;&4@&@`!#1(7`1H``@$!``(````";
  1846. XM``(``0`#``(``@`$``$```4``0``!@`!```(``$`!`D``@````T``@`!``X`2
  1847. XM`@```!$``0`($@`"````$P`"`!D`%``"````%0`"``$`%@`"````%P`"``$`^
  1848. XM&``"``$`9``!``%E``$``68``0`!9P`!``%H``$``6D``0`!:@`!``%K``$`F
  1849. XM`6P``0`!;0`!``%N``$``6\``0`!<``!``%Q``$``7(``0`!<P`!``%T``$`"
  1850. XM`74``0`!=@`!``%W``$``7@``0`!>0`!``%Z``$``7L``0``?``!``%]``$`2
  1851. XM`7X``0``?P`!``&```$``8(``0``A``!``&%``$``<@``0``R0`!``#*``$`Q
  1852. XM`<L``0``S``!``#-``$``,X``0`!SP`!``#0``$`&=$``0!DT@`!`"#5``$`Q
  1853. XM`-<``0``V``!``#9``$``=H``0`!VP`!``#<``$``=T``0`!W@`!``#?``$``
  1854. XM`.```0``X0`!``#B``$``2P!1```````````````````````````````````8
  1855. XM`````````````````````````````````````````````````````````"T!N
  1856. XM@`!$.EQ40UQ)3D-,541%````````````````````````````````````````1
  1857. XM`````````````````````````````````````````````````````````````
  1858. XM`````````````````````````````````````````````````````"X!@`!$S
  1859. XM.EQ40UQ,24(`````````````````````````````````````````````````@
  1860. XM`````````````````````````````````````````````````````````````
  1861. XM`````````````````````````````````````````````````"\!4`!624TN:
  1862. XM4%)*````````````````````````````````````````````````````````L
  1863. XM`````````````````````````````````````````#`!!``S,@``,0$%`#(UX
  1864. XM````,@$%`#$P,```,P%_`$U31$]3.U=)3$1?0T%21%,`````````````````Y
  1865. XM`````````````````````````````````````````````````````````````
  1866. XM`````````````````````````````````````````````````````````````
  1867. XM```````````T`1X`*@``````````````````````````````````````-0$>1
  1868. XM`"H``````````````````````````````````````#8!'@`J````````````I
  1869. XM```````````````````````````W`1X`*@```````````````````````````
  1870. XM````````````.`$>`"H``````````````````````````````````````#D![
  1871. XM'@`J```````````````````````````````````````Z`1X`*@``````````+
  1872. XM````````````````````````````.P$>`"H`````````````````````````$
  1873. XM`````````````#P!'@`J```````````````````````````````````````]"
  1874. XM`8``````````````````````````````````````````````````````````!
  1875. XM`````````````````````````````````````````````````````````````
  1876. XM```````````````````````````````````````````````````````^`00`#
  1877. XM.````#\!4```````````````````````````````````````````````````(
  1878. XM`````````````````````````````````````````````````````````$`!!
  1879. XM1`!$.EQ40P``````````````````````````````````````````````````U
  1880. XM`````````````````````````````````$$!4```````````````````````2
  1881. XM`````````````````````````````````````````````````````````````
  1882. X9`````````````````````````/__`@`:````:
  1883. X``
  1884. Xend
  1885. Xsize 1690
  1886. END_OF_FILE
  1887. if test 2410 -ne `wc -c <'vim/src/tcconfig.tc.uue'`; then
  1888.     echo shar: \"'vim/src/tcconfig.tc.uue'\" unpacked with wrong size!
  1889. fi
  1890. # end of 'vim/src/tcconfig.tc.uue'
  1891. fi
  1892. if test -f 'vim/src/unix.h' -a "${1}" != "-c" ; then 
  1893.   echo shar: Will not clobber existing file \"'vim/src/unix.h'\"
  1894. else
  1895. echo shar: Extracting \"'vim/src/unix.h'\" \(1925 characters\)
  1896. sed "s/^X//" >'vim/src/unix.h' <<'END_OF_FILE'
  1897. X/* vi:ts=4:sw=4
  1898. X *
  1899. X * VIM - Vi IMitation
  1900. X *
  1901. X * Code Contributions By:    Bram Moolenaar            mool@oce.nl
  1902. X *                            Tim Thompson            twitch!tjt
  1903. X *                            Tony Andrews            onecom!wldrdg!tony 
  1904. X *                            G. R. (Fred) Walter        watmath!watcgl!grwalter 
  1905. X */
  1906. X
  1907. X/*
  1908. X * Unix system-dependent filenames
  1909. X */
  1910. X#define BACKUPDIR "~/"
  1911. X
  1912. X#ifdef TMPNAME1
  1913. X# undef TMPNAME1
  1914. X# undef TMPNAME2
  1915. X# undef TMPNAMELEN
  1916. X#endif /* TMPNAME1 */
  1917. X#define TMPNAME1 "/tmp/viXXXXXX"
  1918. X#define TMPNAME2 "/tmp/voXXXXXX"
  1919. X#define TMPNAMELEN    15
  1920. X
  1921. X#ifdef MAX_COLUMNS
  1922. X# undef MAX_COLUMNS
  1923. X#endif /* MAX_COLUMNS */
  1924. X#define MAX_COLUMNS 1024
  1925. X
  1926. X#define stricmp vim_stricmp
  1927. X
  1928. Xvoid    flushbuf __ARGS((void));
  1929. Xvoid    outchar __ARGS((unsigned));
  1930. Xvoid    outstr __ARGS((char *));
  1931. Xint     GetChars __ARGS((char *, int, int));
  1932. Xvoid    vim_delay __ARGS((void));
  1933. Xvoid    mch_suspend __ARGS((void));
  1934. Xvoid    mch_windinit __ARGS((void));
  1935. Xvoid    check_win __ARGS((int, char **));
  1936. Xvoid    fname_case __ARGS((char *));
  1937. Xvoid    settitle __ARGS((char *));
  1938. Xvoid    resettitle __ARGS((void));
  1939. Xvoid    mch_settmode __ARGS((int));
  1940. Xint     dirname __ARGS((char *, int));
  1941. Xint        FullName __ARGS((char *, char *, int));
  1942. Xlong    getperm __ARGS((char *));
  1943. Xint        setperm __ARGS((char *, int));
  1944. Xint        isdir __ARGS((char *));
  1945. Xvoid    mch_windexit __ARGS((int));
  1946. Xint        mch_get_winsize __ARGS((void));
  1947. Xvoid    mch_set_winsize __ARGS((void));
  1948. Xint        call_shell __ARGS((char *, int));
  1949. Xvoid    breakcheck __ARGS((void));
  1950. X#ifndef linux
  1951. Xint        remove __ARGS((char *));
  1952. X
  1953. X/* generic functions, not in unix.c */
  1954. Xvoid    sleep __ARGS((int));
  1955. Xint        rename __ARGS((char *, char *));
  1956. X#endif
  1957. X
  1958. Xint        stricmp __ARGS((char *, char *));
  1959. X
  1960. X#ifdef WILD_CARDS
  1961. Xint        has_wildcard __ARGS((char *));
  1962. Xint        ExpandWildCards __ARGS((int, char **, int *, char ***, int, int));
  1963. Xvoid    FreeWild __ARGS((int, char **));
  1964. X#endif
  1965. X
  1966. X/* memmove is not present on all systems, use bcopy or memcpy */
  1967. X#ifdef SYSV
  1968. X#define memmove(to, from, len) memcpy(to, from, len)
  1969. X#else
  1970. X#define memmove(to, from, len) bcopy(from, to, len);
  1971. X#endif
  1972. END_OF_FILE
  1973. if test 1925 -ne `wc -c <'vim/src/unix.h'`; then
  1974.     echo shar: \"'vim/src/unix.h'\" unpacked with wrong size!
  1975. fi
  1976. # end of 'vim/src/unix.h'
  1977. fi
  1978. if test -f 'vim/termcap' -a "${1}" != "-c" ; then 
  1979.   echo shar: Will not clobber existing file \"'vim/termcap'\"
  1980. else
  1981. echo shar: Extracting \"'vim/termcap'\" \(2694 characters\)
  1982. sed "s/^X//" >'vim/termcap' <<'END_OF_FILE'
  1983. X#
  1984. X#    Demonstration of a termcap file
  1985. X#
  1986. Xsx|ansi|any ansi terminal with pessimistic assumptions:\
  1987. X    :co#80:li#24:cl=50\E[;H\E[2J:bs:am:cm=\E[%i%d;%dH:\
  1988. X    :nd=\E[C:up=\E[A:ce=\E[K:ho=\E[H:pt:
  1989. XMu|sun|Sun Microsystems Workstation console:\
  1990. X    :am:bs:km:mi:ms:pt:li#34:co#80:cl=^L:cm=\E[%i%d;%dH:\
  1991. X    :ce=\E[K:cd=\E[J:\
  1992. X    :so=\E[7m:se=\E[m:us=\E[4m:ue=\E[m:rs=\E[s:\
  1993. X    :md=\E[1m:mr=\E[7m:me=\E[m:\
  1994. X    :al=\E[L:dl=\E[M:im=:ei=:ic=\E[@:dc=\E[P:\
  1995. X    :AL=\E[%dL:DL=\E[%dM:IC=\E[%d@:DC=\E[%dP:\
  1996. X    :up=\E[A:nd=\E[C:ku=\E[A:kd=\E[B:kr=\E[C:kl=\E[D:\
  1997. X    :k1=\E[224z:k2=\E[225z:k3=\E[226z:k4=\E[227z:k5=\E[228z:\
  1998. X    :k6=\E[229z:k7=\E[230z:k8=\E[231z:k9=\E[232z:
  1999. XM-|sun-e|sun-nic|sune|Sun Microsystems Workstation without insert character:\
  2000. X    :ic@:im@:ei@:tc=sun:
  2001. XMu|sun-s|Sun Microsystems Workstation window with status line:\
  2002. X    :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun:
  2003. XMu|sun-e-s|sun-s-e|Sun Microsystems Workstation with status hacked for emacs:\
  2004. X    :hs:ts=\E]l:fs=\E\\:ds=\E]l\E\\:tc=sun-e:
  2005. XM0|sun-48|Sun 48-line window:\
  2006. X    :li#48:co#80:tc=sun:
  2007. XM1|sun-34|Sun 34-line window:\
  2008. X    :li#34:co#80:tc=sun:
  2009. XM2|sun-24|Sun 24-line window:\
  2010. X    :li#24:co#80:tc=sun:
  2011. XM3|sun-17|Sun 17-line window:\
  2012. X    :li#17:co#80:tc=sun:
  2013. Xv9|925a|tvi925a|TeleVideo Model 925:\
  2014. X    :al=\EE:am:bs:bt=\EI:bw:cd=\EY:ce=\ET:cl=^Z:cm=\E=%+ %+ :co#80:dc=\EW:\
  2015. X    :dl=\ER:do=^V:ei=:ic=\EQ:if=/usr/share/lib/tabset/std:im=:kb=^H:kd=^V:\
  2016. X    :kh=^^:kl=^H:kn#12:kr=^L:ku=^K:li#24:nd=^L:pt:se=\EG0:sg#1:so=\EG4:\
  2017. X    :ue=\EG0:ug#1:ul:up=^K:us=\EG8:is=\El\
  2018. X    :vb=\Eb\200\200\200\200\200\200\200\200\200\200\200\200\200\200\Ed:\
  2019. X    :ve=\E.4:vs=\E.2:
  2020. Xd0|vt100|vt100-am|vt100am|dec vt100:\
  2021. X    :do=^J:co#80:li#24:cl=50\E[;H\E[2J:sf=5\ED:\
  2022. X    :le=^H:bs:am:cm=5\E[%i%d;%dH:nd=2\E[C:up=2\E[A:\
  2023. 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:\
  2024. X    :md=2\E[1m:mr=2\E[7m:mb=2\E[5m:me=2\E[m:is=\E[1;24r\E[24;1H:\
  2025. X    :rf=/usr/share/lib/tabset/vt100:\
  2026. X    :rs=\E>\E[?3l\E[?4l\E[?5l\E[?7h\E[?8h:ks=\E[?1h\E=:ke=\E[?1l\E>:\
  2027. X    :ku=\EOA:kd=\EOB:kr=\EOC:kl=\EOD:kb=^H:\
  2028. X    :ho=\E[H:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:pt:sr=5\EM:vt#3:xn:\
  2029. X    :sc=\E7:rc=\E8:cs=\E[%i%d;%dr:
  2030. X# Amiga termcap by Bram Moolenaar
  2031. XAA|amiga|Amiga ANSI:\
  2032. X    :co#80:li#25:am:do=\E[B:ce=\E[K:cd=\E[J:\
  2033. X    :cl=\014:ku=\233A:kd=\233B:kl=\233D:kr=\233C:kb=^H:\
  2034. X    :#4=\233 A:%i=\233 @:%1=\233?~:\
  2035. X    :k1=\2330~:k2=\2331~:k3=\2332~:k4=\2333~:k5=\2334~:\
  2036. X    :k6=\2335~:k7=\2336~:k8=\2337~:k9=\2338~:k;=\2339~:\
  2037. X    :F1=\23310~:F2=\23311~:F3=\23312~:F4=\23313~:F5=\23314~:\
  2038. X    :F6=\23315~:F7=\23316~:F8=\23317~:F9=\23318~:FA=\23319~:\
  2039. X    :al=\E[L:AL=\E[%dL:dl=\E[M:DL=\E[%dM:le=^H:cm=\E[%i%d;%dH:\
  2040. X    :nd=\E[C:RI=\E[%dC:up=\E[A:\
  2041. X    :ce=\E[K:ho=\E[H:dc=\E[P:ic=\E[@:vi=\E[0 p:ve=\E[1 p:\
  2042. X    :so=\E[2m:se=\E[m:us=\E[4m:ue=\E[m:mr=\E[7m:mb=\E[7;2m:me=\E[m:
  2043. X#
  2044. X# END OF TERMCAP
  2045. X#
  2046. END_OF_FILE
  2047. if test 2694 -ne `wc -c <'vim/termcap'`; then
  2048.     echo shar: \"'vim/termcap'\" unpacked with wrong size!
  2049. fi
  2050. # end of 'vim/termcap'
  2051. fi
  2052. echo shar: End of archive 2 \(of 23\).
  2053. cp /dev/null ark2isdone
  2054. MISSING=""
  2055. 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
  2056.     if test ! -f ark${I}isdone ; then
  2057.     MISSING="${MISSING} ${I}"
  2058.     fi
  2059. done
  2060. if test "${MISSING}" = "" ; then
  2061.     echo You have unpacked all 23 archives.
  2062.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2063. else
  2064.     echo You still need to unpack the following archives:
  2065.     echo "        " ${MISSING}
  2066. fi
  2067. ##  End of shell archive.
  2068. exit 0
  2069. -------------8<----------------8<----------------8<---------------8<--------
  2070. Bram Moolenaar                             | DISCLAIMER:  This  note  does  not
  2071. Oce Nederland B.V., Research & Development | necessarily represent the position
  2072. p.o. box 101, 5900 MA  Venlo               | of  Oce-Nederland  B.V.  Therefore
  2073. The Netherlands        phone +31 77 594077 | no liability or responsibility for
  2074. UUCP: mool@oce.nl        fax +31 77 595450 | whatever will be accepted.
  2075.  
  2076. exit 0 # Just in case...
  2077.