home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume44 / vim / part23 < prev    next >
Internet Message Format  |  1994-08-18  |  71KB

  1. From: mool@oce.nl (Bram Moolenaar)
  2. Newsgroups: comp.sources.misc
  3. Subject: v44i042:  vim - Vi IMproved editor, v3.0, Part23/26
  4. Date: 18 Aug 1994 14:03:45 -0500
  5. Organization: Sterling Software
  6. Sender: kent@sparky.sterling.com
  7. Approved: kent@sparky.sterling.com
  8. Message-ID: <330bah$e8n@sparky.sterling.com>
  9. X-Md4-Signature: 4e2dfed972896acc5c8dc3466ed1ccb5
  10.  
  11. Submitted-by: mool@oce.nl (Bram Moolenaar)
  12. Posting-number: Volume 44, Issue 42
  13. Archive-name: vim/part23
  14. Environment: UNIX, AMIGA, MS-DOS, Windows NT
  15. Supersedes: vim: Volume 41, Issue 50-75
  16.  
  17. #! /bin/sh
  18. # This is a shell archive.  Remove anything before this line, then feed it
  19. # into a shell via "sh file" or similar.  To overwrite existing files,
  20. # type "sh file -c".
  21. # Contents:  vim/src/makefile.dos vim/src/makefile.manx
  22. #   vim/src/makefile.sas vim/src/mark.c vim/src/message.c
  23. #   vim/src/proto/cmdline.pro vim/src/quickfix.c vim/src/vim.h
  24. # Wrapped by kent@sparky on Mon Aug 15 21:44:14 1994
  25. PATH=/bin:/usr/bin:/usr/ucb:/usr/local/bin:/usr/lbin:$PATH ; export PATH
  26. echo If this archive is complete, you will see the following message:
  27. echo '          "shar: End of archive 23 (of 26)."'
  28. if test -f 'vim/src/makefile.dos' -a "${1}" != "-c" ; then 
  29.   echo shar: Will not clobber existing file \"'vim/src/makefile.dos'\"
  30. else
  31.   echo shar: Extracting \"'vim/src/makefile.dos'\" \(5010 characters\)
  32.   sed "s/^X//" >'vim/src/makefile.dos' <<'END_OF_FILE'
  33. X#
  34. X# Makefile for VIM on MSDOS, using Turbo C
  35. X#
  36. X
  37. X#>>>>> choose options:
  38. X### -DDIGRAPHS        digraph support (at the cost of 1.6 Kbyte code)
  39. X### -DCOMPATIBLE    start in vi-compatible mode
  40. X### -DNOBACKUP        default is no backup file
  41. X### -DDEBUG        output a lot of debugging garbage
  42. X### -DTERMCAP        include termcap file support
  43. X### -DNO_BUILTIN_TCAPS    do not include builtin termcap entries
  44. X###                (use only with -DTERMCAP)
  45. X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
  46. X###                (use only without -DNO_BUILTIN_TCAPS)
  47. X### -DALL_BUILTIN_TCAPS    include all builtin termcap entries
  48. X###                (use only without -DNO_BUILTIN_TCAPS)
  49. X### -DVIMRC_FILE    name of the .vimrc file in current dir
  50. X### -DEXRC_FILE        name of the .exrc file in current dir
  51. X### -DSYSVIMRC_FILE    name of the global .vimrc file
  52. X### -DSYSEXRC_FILE    name of the global .exrc file
  53. X### -DDEFVIMRC_FILE    name of the system-wide .vimrc file
  54. X### -DVIM_HLP        name of the help file
  55. X### -DWEBB_COMPLETE    include Webb's code for command line completion
  56. X### -DWEBB_KEYWORD_COMPL include Webb's code for keyword completion
  57. X### -DNOTITLE        'title' option off by default
  58. XDEFINES = -DDIGRAPHS -DWEBB_COMPLETE -DWEBB_KEYWORD_COMPL
  59. X
  60. X#>>>>> name of the compiler and linker, name of lib directory
  61. XCC = tcc
  62. XLINK = tlink
  63. XLIB = c:\turboc\lib
  64. X
  65. X#>>>>> end of choices
  66. X###########################################################################
  67. X
  68. XINCL = vim.h globals.h param.h keymap.h macros.h ascii.h term.h msdos.h structs.h
  69. XCFLAGS = -c -ml -DMSDOS $(DEFINES)
  70. X
  71. XOBJ =    obj/alloc.obj obj/msdos.obj obj/buffer.obj obj/charset.obj obj/cmdcmds.obj obj/cmdline.obj \
  72. X    obj/csearch.obj obj/digraph.obj obj/edit.obj obj/fileio.obj obj/getchar.obj obj/help.obj \
  73. X    obj/linefunc.obj obj/main.obj obj/mark.obj obj/memfile.obj obj/memline.obj obj/message.obj obj/misccmds.obj \
  74. X    obj/normal.obj obj/ops.obj obj/param.obj obj/quickfix.obj obj/regexp.obj \
  75. X    obj/regsub.obj obj/screen.obj obj/search.obj \
  76. X    obj/tag.obj obj/term.obj obj/undo.obj obj/window.obj $(TERMLIB)
  77. X
  78. X..\vim: $(OBJ) version.c
  79. X    $(CC) $(CFLAGS) version.c
  80. X    $(LINK) /c /m $(LIB)\C0l @vimresp,..\vim,..\vim,$(LIB)\emu $(LIB)\Cl
  81. X
  82. Xctags:
  83. X    command /c ctags *.c *.h
  84. X
  85. Xclean:
  86. X    del $(OBJ) version.obj mkcmdtab.obj ..\vim mkcmdtab cmdtab.h
  87. X
  88. Xaddcr:    addcr.c
  89. X    $(CC) addcr.c
  90. X    command /c addcr.bat
  91. X
  92. X###########################################################################
  93. X
  94. Xobj/alloc.obj:    alloc.c  $(INCL)
  95. X    $(CC) $(CFLAGS) alloc.c -o obj/alloc.obj
  96. X
  97. Xobj/msdos.obj:    msdos.c  $(INCL) msdos.h
  98. X    $(CC) $(CFLAGS) msdos.c -o obj/msdos.obj
  99. X
  100. Xobj/buffer.obj:    buffer.c  $(INCL)
  101. X    $(CC) $(CFLAGS) buffer.c -o obj/buffer.obj
  102. X
  103. Xobj/charset.obj:    charset.c  $(INCL)
  104. X    $(CC) $(CFLAGS) charset.c -o obj/charset.obj
  105. X
  106. Xobj/cmdcmds.obj:    cmdcmds.c  $(INCL)
  107. X    $(CC) $(CFLAGS) cmdcmds.c -o obj/cmdcmds.obj
  108. X
  109. Xobj/cmdline.obj:    cmdline.c  $(INCL) cmdtab.h
  110. X    $(CC) $(CFLAGS) cmdline.c -o obj/cmdline.obj
  111. X
  112. Xobj/csearch.obj:    csearch.c  $(INCL)
  113. X    $(CC) $(CFLAGS) csearch.c -o obj/csearch.obj
  114. X
  115. Xobj/digraph.obj:    digraph.c  $(INCL)
  116. X    $(CC) $(CFLAGS) digraph.c -o obj/digraph.obj
  117. X
  118. Xobj/edit.obj:    edit.c  $(INCL)
  119. X    $(CC) $(CFLAGS) edit.c -o obj/edit.obj
  120. X
  121. Xobj/fileio.obj:    fileio.c  $(INCL)
  122. X    $(CC) $(CFLAGS) fileio.c -o obj/fileio.obj
  123. X
  124. Xobj/getchar.obj:    getchar.c  $(INCL)
  125. X    $(CC) $(CFLAGS) getchar.c -o obj/getchar.obj
  126. X
  127. Xobj/help.obj:    help.c  $(INCL)
  128. X    $(CC) $(CFLAGS) help.c -o obj/help.obj
  129. X
  130. Xobj/linefunc.obj:    linefunc.c  $(INCL)
  131. X    $(CC) $(CFLAGS) linefunc.c -o obj/linefunc.obj
  132. X
  133. Xobj/main.obj:    main.c  $(INCL)
  134. X    $(CC) $(CFLAGS) main.c -o obj/main.obj
  135. X
  136. Xobj/mark.obj:    mark.c  $(INCL)
  137. X    $(CC) $(CFLAGS) mark.c -o obj/mark.obj
  138. X
  139. Xobj/memfile.obj:    memfile.c  $(INCL)
  140. X    $(CC) $(CFLAGS) memfile.c -o obj/memfile.obj
  141. X
  142. Xobj/memline.obj:    memline.c  $(INCL)
  143. X    $(CC) $(CFLAGS) memline.c -o obj/memline.obj
  144. X
  145. Xobj/message.obj:    message.c  $(INCL)
  146. X    $(CC) $(CFLAGS) message.c -o obj/message.obj
  147. X
  148. Xobj/misccmds.obj:    misccmds.c  $(INCL)
  149. X    $(CC) $(CFLAGS) misccmds.c -o obj/misccmds.obj
  150. X
  151. Xobj/normal.obj:    normal.c  $(INCL) ops.h
  152. X    $(CC) $(CFLAGS) normal.c -o obj/normal.obj
  153. X
  154. Xobj/ops.obj:    ops.c  $(INCL) ops.h
  155. X    $(CC) $(CFLAGS) ops.c -o obj/ops.obj
  156. X
  157. Xobj/param.obj:    param.c  $(INCL)
  158. X    $(CC) $(CFLAGS) param.c -o obj/param.obj
  159. X
  160. Xobj/quickfix.obj:    quickfix.c  $(INCL)
  161. X    $(CC) $(CFLAGS) quickfix.c -o obj/quickfix.obj
  162. X
  163. Xobj/regexp.obj:    regexp.c  $(INCL)
  164. X    $(CC) $(CFLAGS) regexp.c -o obj/regexp.obj
  165. X
  166. Xobj/regsub.obj:    regsub.c  $(INCL)
  167. X    $(CC) $(CFLAGS) regsub.c -o obj/regsub.obj
  168. X
  169. Xobj/screen.obj:    screen.c  $(INCL)
  170. X    $(CC) $(CFLAGS) screen.c -o obj/screen.obj
  171. X
  172. Xobj/search.obj:    search.c  $(INCL)
  173. X    $(CC) $(CFLAGS) search.c -o obj/search.obj
  174. X
  175. Xobj/tag.obj:    tag.c  $(INCL)
  176. X    $(CC) $(CFLAGS) tag.c -o obj/tag.obj
  177. X
  178. Xobj/term.obj:    term.c  $(INCL)
  179. X    $(CC) $(CFLAGS) term.c -o obj/term.obj
  180. X
  181. Xobj/undo.obj:    undo.c  $(INCL)
  182. X    $(CC) $(CFLAGS) undo.c -o obj/undo.obj
  183. X
  184. Xobj/window.obj:    window.c  $(INCL)
  185. X    $(CC) $(CFLAGS) window.c -o obj/window.obj
  186. X
  187. Xcmdtab.h: cmdtab.tab mkcmdtab.exe
  188. X    mkcmdtab cmdtab.tab cmdtab.h
  189. X
  190. Xmkcmdtab.exe: obj/mkcmdtab.obj
  191. X    $(CC) -ml -o mkcmdtab obj/mkcmdtab.obj
  192. X
  193. Xobj/mkcmdtab.obj: mkcmdtab.c
  194. X    $(CC) $(CFLAGS) mkcmdtab.c -o obj/mkcmdtab.obj
  195. END_OF_FILE
  196.   if test 5010 -ne `wc -c <'vim/src/makefile.dos'`; then
  197.     echo shar: \"'vim/src/makefile.dos'\" unpacked with wrong size!
  198.   fi
  199.   # end of 'vim/src/makefile.dos'
  200. fi
  201. if test -f 'vim/src/makefile.manx' -a "${1}" != "-c" ; then 
  202.   echo shar: Will not clobber existing file \"'vim/src/makefile.manx'\"
  203. else
  204.   echo shar: Extracting \"'vim/src/makefile.manx'\" \(10141 characters\)
  205.   sed "s/^X//" >'vim/src/makefile.manx' <<'END_OF_FILE'
  206. X#
  207. X# Makefile for VIM on the Amiga, using Aztec/Manx C 5.0 or later
  208. X#
  209. X# Note: not all dependencies are included. This was done to avoid having
  210. X#       to compile everything when a global variable or function is added
  211. X#    
  212. X
  213. X#>>>>> choose options:
  214. X### -DDIGRAPHS        digraph support (at the cost of 1.6 Kbyte code)
  215. X### -DNO_ARP        do not use arp.library, DOS 2.0 required
  216. X### -DCOMPATIBLE    start in vi-compatible mode
  217. X### -DNOBACKUP        default is no backup file
  218. X### -DDEBUG        output a lot of debugging garbage
  219. X### -DTERMCAP        include termcap file support
  220. X### -DNO_BUILTIN_TCAPS    do not include builtin termcap entries
  221. X###                (use only with -DTERMCAP)
  222. X### -DSOME_BUILTIN_TCAPS include most useful builtin termcap entries
  223. X###                (use only without -DNO_BUILTIN_TCAPS)
  224. X### -DALL_BUILTIN_TCAPS    include all builtin termcap entries
  225. X###                (use only without -DNO_BUILTIN_TCAPS)
  226. X### -Dconst        for compilers that don't have type const
  227. X### -DVIMRC_FILE    name of the .vimrc file in current dir
  228. X### -DEXRC_FILE        name of the .exrc file in current dir
  229. X### -DSYSVIMRC_FILE    name of the global .vimrc file
  230. X### -DSYSEXRC_FILE    name of the global .exrc file
  231. X### -DDEFVIMRC_FILE    name of the system-wide .vimrc file
  232. X### -DVIM_HLP        name of the help file
  233. X### -DNOTITLE        'title' option off by default
  234. X### -DWEBB_COMPLETE    include Webb's code for command line completion
  235. X### -DWEBB_KEYWORD_COMPL include Webb's code for keyword completion
  236. X
  237. XDEFINES = -DDIGRAPHS -DSOME_BUILTIN_TCAPS -DVIM_ISSPACE \
  238. X        -DWEBB_COMPLETE -DWEBB_KEYWORD_COMPL
  239. X
  240. X#>>>>> if TERMCAP is defined obj/termlib.o has to be used
  241. X#TERMLIB = obj/termlib.o
  242. XTERMLIB = 
  243. X
  244. X#>>>>> choose between debugging (-bs) or optimizing (-so)
  245. XOPTIONS = -so
  246. X#OPTIONS = -bs
  247. X
  248. X#>>>>> end of choices
  249. X###########################################################################
  250. X
  251. XCFLAGS = $(OPTIONS) -wapruq -ps -qf $(DEFINES) -DAMIGA
  252. X
  253. XLIBS = -lc16
  254. XSYMS = vim.syms
  255. X
  256. XOBJ =    obj/alloc.o obj/amiga.o obj/buffer.o obj/charset.o obj/cmdcmds.o obj/cmdline.o \
  257. X    obj/csearch.o obj/digraph.o obj/edit.o obj/fileio.o obj/getchar.o obj/help.o \
  258. X    obj/linefunc.o obj/main.o obj/mark.o obj/memfile.o obj/memline.o obj/message.o obj/misccmds.o \
  259. X    obj/normal.o obj/ops.o obj/param.o obj/quickfix.o obj/regexp.o \
  260. X    obj/regsub.o obj/screen.o obj/search.o \
  261. X    obj/tag.o obj/term.o obj/undo.o obj/window.o $(TERMLIB)
  262. X
  263. XPRO =    proto/alloc.pro proto/buffer.pro proto/charset.pro proto/cmdcmds.pro proto/cmdline.pro \
  264. X    proto/csearch.pro proto/digraph.pro proto/edit.pro proto/fileio.pro \
  265. X    proto/getchar.pro proto/help.pro proto/linefunc.pro proto/main.pro proto/mark.pro \
  266. X    proto/memfile.pro proto/memline.pro proto/message.pro proto/misccmds.pro proto/normal.pro proto/ops.pro \
  267. X    proto/param.pro proto/quickfix.pro proto/regexp.pro proto/regsub.pro \
  268. X    proto/screen.pro proto/search.pro \
  269. X    proto/tag.pro proto/term.pro proto/termlib.pro \
  270. X    proto/undo.pro proto/window.pro proto/amiga.pro
  271. X
  272. X/Vim: $(OBJ) version.c
  273. X    cc $(CFLAGS) version.c -o obj/version.o
  274. X    ln +q -m -o /Vim $(OBJ) obj/version.o $(LIBS)
  275. X
  276. Xdebug: $(OBJ) version.c
  277. X    cc $(CFLAGS) version.c -o obj/version.o
  278. X    ln +q -m -g -o /Vim $(OBJ) obj/version.o $(LIBS)
  279. X
  280. Xproto: $(SYMS) $(PRO)
  281. X
  282. Xctags:
  283. X    csh -c ctags *.c *.h
  284. X
  285. X# can't use delete here, too many file names
  286. Xclean:
  287. X    csh -c rm -f $(OBJ) obj/version.o obj/mkcmdtab.o obj/termlib.o /Vim $(SYMS) mkcmdtab cmdtab.h
  288. X
  289. X$(SYMS)  : vim.h keymap.h macros.h ascii.h term.h structs.h amiga.h
  290. X    cc $(CFLAGS) -ho$(SYMS) vim.h
  291. X
  292. X###########################################################################
  293. X
  294. Xobj/alloc.o:    alloc.c  $(SYMS)
  295. X    cc $(CFLAGS) -hi$(SYMS) alloc.c -o obj/alloc.o
  296. X
  297. Xproto/alloc.pro:    alloc.c $(SYMS)
  298. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) alloc.c
  299. X    csh -c mv -f alloc.pro proto
  300. X
  301. Xobj/amiga.o:    amiga.c  $(SYMS)
  302. X    cc $(CFLAGS) -hi$(SYMS) amiga.c -o obj/amiga.o
  303. X
  304. Xproto/amiga.pro:    amiga.c $(SYMS)
  305. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) amiga.c
  306. X    csh -c mv -f amiga.pro proto
  307. X
  308. Xobj/buffer.o:    buffer.c  $(SYMS)
  309. X    cc $(CFLAGS) -hi$(SYMS) buffer.c -o obj/buffer.o
  310. X
  311. Xproto/buffer.pro:    buffer.c $(SYMS)
  312. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) buffer.c
  313. X    csh -c mv -f buffer.pro proto
  314. X
  315. Xobj/charset.o:    charset.c  $(SYMS)
  316. X    cc $(CFLAGS) -hi$(SYMS) charset.c -o obj/charset.o
  317. X
  318. Xproto/charset.pro:    charset.c $(SYMS)
  319. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) charset.c
  320. X    csh -c mv -f charset.pro proto
  321. X
  322. Xobj/cmdcmds.o:    cmdcmds.c  $(SYMS)
  323. X    cc $(CFLAGS) -hi$(SYMS) cmdcmds.c -o obj/cmdcmds.o
  324. X
  325. Xproto/cmdcmds.pro:    cmdcmds.c $(SYMS)
  326. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) cmdcmds.c
  327. X    csh -c mv -f cmdcmds.pro proto
  328. X
  329. Xobj/cmdline.o:    cmdline.c  $(SYMS) cmdtab.h
  330. X    cc $(CFLAGS) -hi$(SYMS) cmdline.c -o obj/cmdline.o
  331. X
  332. Xproto/cmdline.pro:    cmdline.c $(SYMS) cmdtab.h
  333. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) cmdline.c
  334. X    csh -c mv -f cmdline.pro proto
  335. X
  336. Xobj/csearch.o:    csearch.c  $(SYMS)
  337. X    cc $(CFLAGS) -hi$(SYMS) csearch.c -o obj/csearch.o
  338. X
  339. Xproto/csearch.pro:    csearch.c $(SYMS)
  340. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) csearch.c
  341. X    csh -c mv -f csearch.pro proto
  342. X
  343. Xobj/digraph.o:    digraph.c  $(SYMS)
  344. X    cc $(CFLAGS) -hi$(SYMS) digraph.c -o obj/digraph.o
  345. X
  346. Xproto/digraph.pro:    digraph.c $(SYMS)
  347. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) digraph.c
  348. X    csh -c mv -f digraph.pro proto
  349. X
  350. Xobj/edit.o:    edit.c  $(SYMS)
  351. X    cc $(CFLAGS) -hi$(SYMS) edit.c -o obj/edit.o
  352. X
  353. Xproto/edit.pro:    edit.c $(SYMS)
  354. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) edit.c
  355. X    csh -c mv -f edit.pro proto
  356. X
  357. Xobj/fileio.o:    fileio.c  $(SYMS)
  358. X    cc $(CFLAGS) -hi$(SYMS) fileio.c -o obj/fileio.o
  359. X
  360. Xproto/fileio.pro:    fileio.c $(SYMS)
  361. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) fileio.c
  362. X    csh -c mv -f fileio.pro proto
  363. X
  364. Xobj/getchar.o:    getchar.c  $(SYMS)
  365. X    cc $(CFLAGS) -hi$(SYMS) getchar.c -o obj/getchar.o
  366. X
  367. Xproto/getchar.pro:    getchar.c $(SYMS)
  368. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) getchar.c
  369. X    csh -c mv -f getchar.pro proto
  370. X
  371. Xobj/help.o:    help.c  $(SYMS)
  372. X    cc $(CFLAGS) -hi$(SYMS) help.c -o obj/help.o
  373. X
  374. Xproto/help.pro:    help.c $(SYMS)
  375. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) help.c
  376. X    csh -c mv -f help.pro proto
  377. X
  378. Xobj/linefunc.o:    linefunc.c  $(SYMS)
  379. X    cc $(CFLAGS) -hi$(SYMS) linefunc.c -o obj/linefunc.o
  380. X
  381. Xproto/linefunc.pro:    linefunc.c $(SYMS)
  382. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) linefunc.c
  383. X    csh -c mv -f linefunc.pro proto
  384. X
  385. Xobj/main.o:    main.c $(SYMS) param.h globals.h
  386. X    cc $(CFLAGS) -hi$(SYMS) main.c -o obj/main.o
  387. X
  388. Xproto/main.pro:    main.c $(SYMS)
  389. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) main.c
  390. X    csh -c mv -f main.pro proto
  391. X
  392. Xobj/mark.o:    mark.c  $(SYMS)
  393. X    cc $(CFLAGS) -hi$(SYMS) mark.c -o obj/mark.o
  394. X
  395. Xproto/mark.pro:    mark.c $(SYMS)
  396. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) mark.c
  397. X    csh -c mv -f mark.pro proto
  398. X
  399. Xobj/memfile.o:    memfile.c  $(SYMS)
  400. X    cc $(CFLAGS) -hi$(SYMS) memfile.c -o obj/memfile.o
  401. X
  402. Xproto/memfile.pro:    memfile.c $(SYMS)
  403. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) memfile.c
  404. X    csh -c mv -f memfile.pro proto
  405. X
  406. Xobj/memline.o:    memline.c  $(SYMS)
  407. X    cc $(CFLAGS) -hi$(SYMS) memline.c -o obj/memline.o
  408. X
  409. Xproto/memline.pro:    memline.c $(SYMS)
  410. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) memline.c
  411. X    csh -c mv -f memline.pro proto
  412. X
  413. Xobj/message.o:    message.c  $(SYMS)
  414. X    cc $(CFLAGS) -hi$(SYMS) message.c -o obj/message.o
  415. X
  416. Xproto/message.pro:    message.c $(SYMS)
  417. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) message.c
  418. X    csh -c mv -f message.pro proto
  419. X
  420. Xobj/misccmds.o:    misccmds.c  $(SYMS)
  421. X    cc $(CFLAGS) -hi$(SYMS) misccmds.c -o obj/misccmds.o
  422. X
  423. Xproto/misccmds.pro:    misccmds.c $(SYMS)
  424. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) misccmds.c
  425. X    csh -c mv -f misccmds.pro proto
  426. X
  427. Xobj/normal.o:    normal.c  $(SYMS) ops.h
  428. X    cc $(CFLAGS) -hi$(SYMS) normal.c -o obj/normal.o
  429. X
  430. Xproto/normal.pro:    normal.c $(SYMS)
  431. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) normal.c
  432. X    csh -c mv -f normal.pro proto
  433. X
  434. Xobj/ops.o:    ops.c  $(SYMS) ops.h
  435. X    cc $(CFLAGS) -hi$(SYMS) ops.c -o obj/ops.o
  436. X
  437. Xproto/ops.pro:    ops.c $(SYMS)
  438. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) ops.c
  439. X    csh -c mv -f ops.pro proto
  440. X
  441. Xobj/param.o:    param.c  $(SYMS)
  442. X    cc $(CFLAGS) -hi$(SYMS) param.c -o obj/param.o
  443. X
  444. Xproto/param.pro:    param.c $(SYMS)
  445. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) param.c
  446. X    csh -c mv -f param.pro proto
  447. X
  448. Xobj/quickfix.o:    quickfix.c  $(SYMS)
  449. X    cc $(CFLAGS) -hi$(SYMS) quickfix.c -o obj/quickfix.o
  450. X
  451. Xproto/quickfix.pro:    quickfix.c $(SYMS)
  452. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) quickfix.c
  453. X    csh -c mv -f quickfix.pro proto
  454. X
  455. Xobj/regexp.o:    regexp.c  $(SYMS)
  456. X    cc $(CFLAGS) -hi$(SYMS) regexp.c -o obj/regexp.o
  457. X
  458. Xproto/regexp.pro:    regexp.c $(SYMS)
  459. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) regexp.c
  460. X    csh -c mv -f regexp.pro proto
  461. X
  462. Xobj/regsub.o:    regsub.c  $(SYMS)
  463. X    cc $(CFLAGS) -hi$(SYMS) regsub.c -o obj/regsub.o
  464. X
  465. Xproto/regsub.pro:    regsub.c $(SYMS)
  466. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) regsub.c
  467. X    csh -c mv -f regsub.pro proto
  468. X
  469. Xobj/screen.o:    screen.c  $(SYMS)
  470. X    cc $(CFLAGS) -hi$(SYMS) screen.c -o obj/screen.o
  471. X
  472. Xproto/screen.pro:    screen.c $(SYMS)
  473. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) screen.c
  474. X    csh -c mv -f screen.pro proto
  475. X
  476. Xobj/search.o:    search.c  $(SYMS)
  477. X    cc $(CFLAGS) -hi$(SYMS) search.c -o obj/search.o
  478. X
  479. Xproto/search.pro:    search.c $(SYMS)
  480. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) search.c
  481. X    csh -c mv -f search.pro proto
  482. X
  483. Xobj/tag.o:    tag.c  $(SYMS)
  484. X    cc $(CFLAGS) -hi$(SYMS) tag.c -o obj/tag.o
  485. X
  486. Xproto/tag.pro:    tag.c $(SYMS)
  487. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) tag.c
  488. X    csh -c mv -f tag.pro proto
  489. X
  490. Xobj/term.o:    term.c  $(SYMS) term.h
  491. X    cc $(CFLAGS) -hi$(SYMS) term.c -o obj/term.o
  492. X
  493. Xproto/term.pro:    term.c $(SYMS)
  494. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) term.c
  495. X    csh -c mv -f term.pro proto
  496. X
  497. Xobj/termlib.o:    termlib.c  $(SYMS)
  498. X    cc $(CFLAGS) termlib.c -o obj/termlib.o
  499. X
  500. Xproto/termlib.pro:    termlib.c $(SYMS)
  501. X    cc -qa -qp $(CFLAGS) -DPROTO termlib.c
  502. X#the manx compiler generates a wrong prototype for tputs
  503. X    vim -s termlib.fix termlib.pro
  504. X    csh -c mv -f termlib.pro proto
  505. X
  506. Xobj/undo.o:    undo.c  $(SYMS)
  507. X    cc $(CFLAGS) -hi$(SYMS) undo.c -o obj/undo.o
  508. X
  509. Xproto/undo.pro:    undo.c $(SYMS)
  510. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) undo.c
  511. X    csh -c mv -f undo.pro proto
  512. X
  513. Xobj/window.o:    window.c  $(SYMS)
  514. X    cc $(CFLAGS) -hi$(SYMS) window.c -o obj/window.o
  515. X
  516. Xproto/window.pro:    window.c $(SYMS)
  517. X    cc -qa -qp $(CFLAGS) -DPROTO -hi$(SYMS) window.c
  518. X    csh -c mv -f window.pro proto
  519. X
  520. Xcmdtab.h: cmdtab.tab mkcmdtab
  521. X    mkcmdtab cmdtab.tab cmdtab.h
  522. X
  523. Xmkcmdtab: obj/mkcmdtab.o
  524. X    ln +q -o mkcmdtab obj/mkcmdtab.o -lc16
  525. X
  526. Xobj/mkcmdtab.o: mkcmdtab.c
  527. X    cc $(CFLAGS) mkcmdtab.c -o obj/mkcmdtab.o
  528. END_OF_FILE
  529.   if test 10141 -ne `wc -c <'vim/src/makefile.manx'`; then
  530.     echo shar: \"'vim/src/makefile.manx'\" unpacked with wrong size!
  531.   fi
  532.   # end of 'vim/src/makefile.manx'
  533. fi
  534. if test -f 'vim/src/makefile.sas' -a "${1}" != "-c" ; then 
  535.   echo shar: Will not clobber existing file \"'vim/src/makefile.sas'\"
  536. else
  537.   echo shar: Extracting \"'vim/src/makefile.sas'\" \(9401 characters\)
  538.   sed "s/^X//" >'vim/src/makefile.sas' <<'END_OF_FILE'
  539. X#
  540. X# Makefile for VIM on the Amiga, using SAS/Lattice C 6.0 to 6.3
  541. X#
  542. X# Do NOT use the peephole optimizer! It messes up all kinds of things.
  543. X# For 6.0 and 6.1, expand_env() will not work correctly.
  544. X# For 6.2 and 6.3 the call to free_line in u_freeentry is wrong.
  545. X# Don't know about 6.50, might work...
  546. X# You should use Manx Aztec C whenever possible.
  547. X#
  548. X# The prototypes from Manx and SAS are incompatible. If the prototypes
  549. X# were generated by Manx, first do "touch *.c; make proto" before "make".
  550. X#
  551. X# Note: not all dependencies are included. This was done to avoid having
  552. X#       to compile everything when a global variable or function is added
  553. X#    
  554. X
  555. X#>>>>> choose options:
  556. X### DEF=DIGRAPHS        digraph support (at the cost of 1.6 Kbyte code)
  557. X### DEF=NO_ARP            do not use arp.library, DOS 2.0 required
  558. X### DEF=COMPATIBLE        start in vi-compatible mode
  559. X### DEF=NOBACKUP        default is no backup file
  560. X### DEF=DEBUG            output a lot of debugging garbage
  561. X### DEF=TERMCAP            include termcap file support
  562. X### DEF=NO_BUILTIN_TCAPS    do not include builtin termcap entries
  563. X###                (use only with -DTERMCAP)
  564. X### DEF=SOME_BUILTIN_TCAPS     include most useful builtin termcap entries
  565. X###                (use only without -DNO_BUILTIN_TCAPS)
  566. X### DEF=ALL_BUILTIN_TCAPS    include all builtin termcap entries
  567. X###                (use only without -DNO_BUILTIN_TCAPS)
  568. X### DEF=WEBB_COMPLETE        include Webb's code for command line completion
  569. X### DEF=WEBB_KEYWORD_COMPL    include Webb's code for keyword completion
  570. X### DEF=NOTITLE            'title' option off by default
  571. XDEFINES = DEF=DIGRAPHS DEF=SOME_BUILTIN_TCAPS \
  572. X        DEF=WEBB_COMPLETE DEF=WEBB_KEYWORD_COMPL
  573. X
  574. X#>>>>> if TERMCAP is defined obj/termlib.o has to be used
  575. X#TERMLIB = obj/termlib.o
  576. XTERMLIB = 
  577. X
  578. X#>>>>> choose NODEBUG for normal compiling, the other for debugging and profiling
  579. X# don't switch on debugging when generating proto files, it crashes the compiler.
  580. XDBG = NODEBUG
  581. X#DBG = DBG=SF
  582. X
  583. X#>>>>> choose NOOPTPEEP for 6.0 to 6.3, NOOPT for debugging
  584. X# when all the optimizer bugs are finally solved you can use OPT
  585. X#OPTIMIZE=OPT
  586. XOPTIMIZE=NOOPTPEEP
  587. X#OPTIMIZE=NOOPT
  588. X
  589. X#>>>>> end of choices
  590. X###########################################################################
  591. X
  592. XCC = sc
  593. XGST = vim.gst
  594. XCOPTS = SINT SCODE SDATA
  595. X
  596. XCFLAGS = NOLINK $(OPTIMIZE) $(COPTS) DEF=AMIGA DEF=SASC $(DBG) $(DEFINES) GST=$(GST)
  597. X
  598. XPROPT = DEF=PROTO GPROTO GPPARM
  599. X
  600. XOBJ =    obj/alloc.o obj/amiga.o obj/buffer.o obj/charset.o obj/cmdcmds.o obj/cmdline.o \
  601. X    obj/csearch.o obj/digraph.o obj/edit.o obj/fileio.o obj/getchar.o obj/help.o \
  602. X    obj/linefunc.o obj/main.o obj/mark.o obj/memfile.o obj/memline.o obj/message.o obj/misccmds.o \
  603. X    obj/normal.o obj/ops.o obj/param.o obj/quickfix.o obj/regexp.o \
  604. X    obj/regsub.o obj/screen.o obj/search.o \
  605. X    obj/tag.o obj/term.o obj/undo.o obj/window.o $(TERMLIB)
  606. X
  607. XPRO =    proto/alloc.pro proto/buffer.pro proto/charset.pro proto/cmdcmds.pro proto/cmdline.pro \
  608. X    proto/csearch.pro proto/digraph.pro proto/edit.pro proto/fileio.pro \
  609. X    proto/getchar.pro proto/help.pro proto/linefunc.pro proto/main.pro proto/mark.pro \
  610. X    proto/memfile.pro proto/memline.pro proto/message.pro proto/misccmds.pro proto/normal.pro proto/ops.pro \
  611. X    proto/param.pro proto/quickfix.pro proto/regexp.pro proto/regsub.pro \
  612. X    proto/screen.pro proto/search.pro \
  613. X    proto/tag.pro proto/term.pro proto/termlib.pro \
  614. X    proto/undo.pro proto/window.pro proto/amiga.pro
  615. X
  616. X/Vim: $(OBJ) version.c
  617. X    $(CC) $(CFLAGS) version.c OBJNAME=obj/
  618. X    $(CC) LINK $(COPTS) $(OBJ) obj/version.o $(DBG) PNAME=/Vim
  619. X
  620. Xdebug: $(OBJ) version.c
  621. X    $(CC) $(CFLAGS) version.c OBJNAME=obj/
  622. X    $(CC) LINK $(COPTS) $(OBJ) obj/version.o $(DBG) PNAME=/Vim
  623. X
  624. Xproto: $(GST) $(PRO)
  625. X
  626. Xctags:
  627. X    csh -c ctags *.c *.h
  628. X
  629. X# can't use delete here, too many file names
  630. Xclean:
  631. X    csh -c rm -f $(OBJ) obj/version.o obj/mkcmdtab.o /Vim $(GST) mkcmdtab cmdtab.h
  632. X
  633. X$(GST)  : vim.h keymap.h macros.h ascii.h term.h structs.h
  634. X    $(CC) $(CFLAGS) MGST=$(GST) vim.h
  635. X
  636. X###########################################################################
  637. X
  638. Xobj/alloc.o:    alloc.c  $(GST)
  639. X    $(CC) $(CFLAGS) alloc.c OBJNAME=obj/
  640. X
  641. Xproto/alloc.pro:    alloc.c  $(GST)
  642. X    $(CC) $(CFLAGS) GPFILE=proto/alloc.pro $(PROPT) alloc.c
  643. X
  644. Xobj/amiga.o:    amiga.c  $(GST)
  645. X    $(CC) $(CFLAGS) amiga.c OBJNAME=obj/
  646. X
  647. Xproto/amiga.pro:    amiga.c $(GST)
  648. X    $(CC) $(CFLAGS) GPFILE=proto/amiga.pro $(PROPT) amiga.c
  649. X
  650. Xobj/buffer.o:    buffer.c  $(GST)
  651. X    $(CC) $(CFLAGS) buffer.c OBJNAME=obj/
  652. X
  653. Xproto/buffer.pro:    buffer.c $(GST)
  654. X    $(CC) $(CFLAGS) GPFILE=proto/buffer.pro $(PROPT) buffer.c
  655. X
  656. Xobj/charset.o:    charset.c  $(GST)
  657. X    $(CC) $(CFLAGS) charset.c OBJNAME=obj/
  658. X
  659. Xproto/charset.pro:    charset.c $(GST)
  660. X    $(CC) $(CFLAGS) GPFILE=proto/charset.pro $(PROPT) charset.c
  661. X
  662. Xobj/cmdcmds.o:    cmdcmds.c  $(GST)
  663. X    $(CC) $(CFLAGS) cmdcmds.c OBJNAME=obj/
  664. X
  665. Xproto/cmdcmds.pro:    cmdcmds.c $(GST)
  666. X    $(CC) $(CFLAGS) GPFILE=proto/cmdcmds.pro $(PROPT) cmdcmds.c
  667. X
  668. Xobj/cmdline.o:    cmdline.c  $(GST) cmdtab.h
  669. X    $(CC) $(CFLAGS) cmdline.c OBJNAME=obj/
  670. X
  671. Xproto/cmdline.pro:    cmdline.c $(GST) cmdtab.h
  672. X    $(CC) $(CFLAGS) GPFILE=proto/cmdline.pro $(PROPT) cmdline.c
  673. X
  674. Xobj/csearch.o:    csearch.c  $(GST)
  675. X    $(CC) $(CFLAGS) csearch.c OBJNAME=obj/
  676. X
  677. Xproto/csearch.pro:    csearch.c $(GST)
  678. X    $(CC) $(CFLAGS) GPFILE=proto/csearch.pro $(PROPT) csearch.c
  679. X
  680. Xobj/digraph.o:    digraph.c  $(GST)
  681. X    $(CC) $(CFLAGS) digraph.c OBJNAME=obj/
  682. X
  683. Xproto/digraph.pro:    digraph.c $(GST)
  684. X    $(CC) $(CFLAGS) GPFILE=proto/digraph.pro $(PROPT) digraph.c
  685. X
  686. Xobj/edit.o:    edit.c  $(GST)
  687. X    $(CC) $(CFLAGS) edit.c OBJNAME=obj/
  688. X
  689. Xproto/edit.pro:    edit.c $(GST)
  690. X    $(CC) $(CFLAGS) GPFILE=proto/edit.pro $(PROPT) edit.c
  691. X
  692. Xobj/fileio.o:    fileio.c  $(GST)
  693. X    $(CC) $(CFLAGS) fileio.c OBJNAME=obj/
  694. X
  695. Xproto/fileio.pro:    fileio.c $(GST)
  696. X    $(CC) $(CFLAGS) GPFILE=proto/fileio.pro $(PROPT) fileio.c
  697. X
  698. Xobj/getchar.o:    getchar.c  $(GST)
  699. X    $(CC) $(CFLAGS) getchar.c OBJNAME=obj/
  700. X
  701. Xproto/getchar.pro:    getchar.c $(GST)
  702. X    $(CC) $(CFLAGS) GPFILE=proto/getchar.pro $(PROPT) getchar.c
  703. X
  704. Xobj/help.o:    help.c  $(GST)
  705. X    $(CC) $(CFLAGS) help.c OBJNAME=obj/
  706. X
  707. Xproto/help.pro:    help.c $(GST)
  708. X    $(CC) $(CFLAGS) GPFILE=proto/help.pro $(PROPT) help.c
  709. X
  710. Xobj/linefunc.o:    linefunc.c  $(GST)
  711. X    $(CC) $(CFLAGS) linefunc.c OBJNAME=obj/
  712. X
  713. Xproto/linefunc.pro:    linefunc.c $(GST)
  714. X    $(CC) $(CFLAGS) GPFILE=proto/linefunc.pro $(PROPT) linefunc.c
  715. X
  716. Xobj/main.o:    main.c  $(GST)
  717. X    $(CC) $(CFLAGS) main.c OBJNAME=obj/
  718. X
  719. Xproto/main.pro:    main.c $(GST)
  720. X    $(CC) $(CFLAGS) GPFILE=proto/main.pro $(PROPT) main.c
  721. X
  722. Xobj/mark.o:    mark.c  $(GST)
  723. X    $(CC) $(CFLAGS) mark.c OBJNAME=obj/
  724. X
  725. Xproto/mark.pro:    mark.c $(GST)
  726. X    $(CC) $(CFLAGS) GPFILE=proto/mark.pro $(PROPT) mark.c
  727. X
  728. Xobj/memfile.o:    memfile.c  $(GST)
  729. X    $(CC) $(CFLAGS) memfile.c OBJNAME=obj/
  730. X
  731. Xproto/memfile.pro:    memfile.c $(GST)
  732. X    $(CC) $(CFLAGS) GPFILE=proto/memfile.pro $(PROPT) memfile.c
  733. X
  734. Xobj/memline.o:    memline.c  $(GST)
  735. X    $(CC) $(CFLAGS) memline.c OBJNAME=obj/
  736. X
  737. Xproto/memline.pro:    memline.c $(GST)
  738. X    $(CC) $(CFLAGS) GPFILE=proto/memline.pro $(PROPT) memline.c
  739. X
  740. Xobj/message.o:    message.c  $(GST)
  741. X    $(CC) $(CFLAGS) message.c OBJNAME=obj/
  742. X
  743. Xproto/message.pro:    message.c $(GST)
  744. X    $(CC) $(CFLAGS) GPFILE=proto/message.pro $(PROPT) message.c
  745. X
  746. Xobj/misccmds.o:    misccmds.c  $(GST)
  747. X    $(CC) $(CFLAGS) misccmds.c OBJNAME=obj/
  748. X
  749. Xproto/misccmds.pro:    misccmds.c $(GST)
  750. X    $(CC) $(CFLAGS) GPFILE=proto/misccmds.pro $(PROPT) misccmds.c
  751. X
  752. Xobj/normal.o:    normal.c  $(GST) ops.h
  753. X    $(CC) $(CFLAGS) normal.c OBJNAME=obj/
  754. X
  755. Xproto/normal.pro:    normal.c $(GST)
  756. X    $(CC) $(CFLAGS) GPFILE=proto/normal.pro $(PROPT) normal.c
  757. X
  758. Xobj/ops.o:    ops.c  $(GST) ops.h
  759. X    $(CC) $(CFLAGS) ops.c OBJNAME=obj/
  760. X
  761. Xproto/ops.pro:    ops.c $(GST)
  762. X    $(CC) $(CFLAGS) GPFILE=proto/ops.pro $(PROPT) ops.c
  763. X
  764. Xobj/param.o:    param.c  $(GST)
  765. X    $(CC) $(CFLAGS) param.c OBJNAME=obj/
  766. X
  767. Xproto/param.pro:    param.c $(GST)
  768. X    $(CC) $(CFLAGS) GPFILE=proto/param.pro $(PROPT) param.c
  769. X
  770. Xobj/quickfix.o:    quickfix.c  $(GST)
  771. X    $(CC) $(CFLAGS) quickfix.c OBJNAME=obj/
  772. X
  773. Xproto/quickfix.pro:    quickfix.c $(GST)
  774. X    $(CC) $(CFLAGS) GPFILE=proto/quickfix.pro $(PROPT) quickfix.c
  775. X
  776. Xobj/regexp.o:    regexp.c  $(GST)
  777. X    $(CC) $(CFLAGS) regexp.c OBJNAME=obj/
  778. X
  779. Xproto/regexp.pro:    regexp.c $(GST)
  780. X    $(CC) $(CFLAGS) GPFILE=proto/regexp.pro $(PROPT) regexp.c
  781. X
  782. Xobj/regsub.o:    regsub.c  $(GST)
  783. X    $(CC) $(CFLAGS) regsub.c OBJNAME=obj/
  784. X
  785. Xproto/regsub.pro:    regsub.c $(GST)
  786. X    $(CC) $(CFLAGS) GPFILE=proto/regsub.pro $(PROPT) regsub.c
  787. X
  788. Xobj/screen.o:    screen.c  $(GST)
  789. X    $(CC) $(CFLAGS) screen.c OBJNAME=obj/
  790. X
  791. Xproto/screen.pro:    screen.c $(GST)
  792. X    $(CC) $(CFLAGS) GPFILE=proto/screen.pro $(PROPT) screen.c
  793. X
  794. Xobj/search.o:    search.c  $(GST)
  795. X    $(CC) $(CFLAGS) search.c OBJNAME=obj/
  796. X
  797. Xproto/search.pro:    search.c $(GST)
  798. X    $(CC) $(CFLAGS) GPFILE=proto/search.pro $(PROPT) search.c
  799. X
  800. Xobj/tag.o:    tag.c  $(GST)
  801. X    $(CC) $(CFLAGS) tag.c OBJNAME=obj/
  802. X
  803. Xproto/tag.pro:    tag.c $(GST)
  804. X    $(CC) $(CFLAGS) GPFILE=proto/tag.pro $(PROPT) tag.c
  805. X
  806. Xobj/term.o:    term.c  $(GST)
  807. X    $(CC) $(CFLAGS) term.c OBJNAME=obj/
  808. X
  809. Xproto/term.pro:    term.c $(GST)
  810. X    $(CC) $(CFLAGS) GPFILE=proto/term.pro $(PROPT) term.c
  811. X
  812. Xobj/termlib.o:    termlib.c  $(GST)
  813. X    $(CC) $(CFLAGS) termlib.c OBJNAME=obj/
  814. X
  815. Xproto/termlib.pro:    termlib.c $(GST)
  816. X    $(CC) $(CFLAGS) GPFILE=proto/termlib.pro $(PROPT) termlib.c
  817. X
  818. Xobj/undo.o:    undo.c  $(GST)
  819. X    $(CC) $(CFLAGS) undo.c OBJNAME=obj/
  820. X
  821. Xproto/undo.pro:    undo.c $(GST)
  822. X    $(CC) $(CFLAGS) GPFILE=proto/undo.pro $(PROPT) undo.c
  823. X
  824. Xobj/window.o:    window.c  $(GST)
  825. X    $(CC) $(CFLAGS) window.c OBJNAME=obj/
  826. X
  827. Xproto/window.pro:    window.c $(GST)
  828. X    $(CC) $(CFLAGS) GPFILE=proto/window.pro $(PROPT) window.c
  829. X
  830. Xcmdtab.h: cmdtab.tab mkcmdtab
  831. X    mkcmdtab cmdtab.tab cmdtab.h
  832. X
  833. Xobj/mkcmdtab.o:    mkcmdtab.c
  834. X    $(CC) $(CFLAGS) mkcmdtab.c OBJNAME=obj/
  835. X
  836. Xmkcmdtab: obj/mkcmdtab.o
  837. X    $(CC) LINK $(COPTS) obj/mkcmdtab.o PNAME=mkcmdtab
  838. END_OF_FILE
  839.   if test 9401 -ne `wc -c <'vim/src/makefile.sas'`; then
  840.     echo shar: \"'vim/src/makefile.sas'\" unpacked with wrong size!
  841.   fi
  842.   # end of 'vim/src/makefile.sas'
  843. fi
  844. if test -f 'vim/src/mark.c' -a "${1}" != "-c" ; then 
  845.   echo shar: Will not clobber existing file \"'vim/src/mark.c'\"
  846. else
  847.   echo shar: Extracting \"'vim/src/mark.c'\" \(10133 characters\)
  848.   sed "s/^X//" >'vim/src/mark.c' <<'END_OF_FILE'
  849. X/* vi:ts=4:sw=4
  850. X *
  851. X * VIM - Vi IMproved        by Bram Moolenaar
  852. X *
  853. X * Read the file "credits.txt" for a list of people who contributed.
  854. X * Read the file "uganda.txt" for copying and usage conditions.
  855. X */
  856. X
  857. X/*
  858. X * mark.c: functions for setting marks and jumping to them
  859. X */
  860. X
  861. X#include "vim.h"
  862. X#include "globals.h"
  863. X#include "proto.h"
  864. X
  865. X/*
  866. X * This file contains routines to maintain and manipulate marks.
  867. X */
  868. X
  869. Xstatic struct filemark namedfm[NMARKS];        /* new marks with file nr */
  870. X
  871. X/*
  872. X * setmark(c) - set named mark 'c' at current cursor position
  873. X *
  874. X * Returns OK on success, FAIL if no room for mark or bad name given.
  875. X */
  876. X    int
  877. Xsetmark(c)
  878. X    int            c;
  879. X{
  880. X    int         i;
  881. X
  882. X    if (islower(c))
  883. X    {
  884. X        i = c - 'a';
  885. X        curbuf->b_namedm[i] = curwin->w_cursor;
  886. X        return OK;
  887. X    }
  888. X    if (isupper(c))
  889. X    {
  890. X        i = c - 'A';
  891. X        namedfm[i].mark = curwin->w_cursor;
  892. X        namedfm[i].fnum = curbuf->b_fnum;
  893. X        return OK;
  894. X    }
  895. X    return FAIL;
  896. X}
  897. X
  898. X/*
  899. X * setpcmark() - set the previous context mark to the current position
  900. X *                 and insert it into the jump list
  901. X */
  902. X    void
  903. Xsetpcmark()
  904. X{
  905. X    int i;
  906. X#ifdef ROTATE
  907. X    struct filemark tempmark;
  908. X#endif
  909. X
  910. X    curwin->w_prev_pcmark = curwin->w_pcmark;
  911. X    curwin->w_pcmark = curwin->w_cursor;
  912. X
  913. X#ifndef ROTATE
  914. X    /*
  915. X     * simply add the new entry at the end of the list
  916. X     */
  917. X    curwin->w_jumplistidx = curwin->w_jumplistlen;
  918. X#else
  919. X    /*
  920. X     * If last used entry is not at the top, put it at the top by rotating
  921. X     * the stack until it is (the newer entries will be at the bottom).
  922. X     * Keep one entry (the last used one) at the top.
  923. X     */
  924. X    if (curwin->w_jumplistidx < curwin->w_jumplistlen)
  925. X        ++curwin->w_jumplistidx;
  926. X    while (curwin->w_jumplistidx < curwin->w_jumplistlen)
  927. X    {
  928. X        tempmark = curwin->w_jumplist[curwin->w_jumplistlen - 1];
  929. X        for (i = curwin->w_jumplistlen - 1; i > 0; --i)
  930. X            curwin->w_jumplist[i] = curwin->w_jumplist[i - 1];
  931. X        curwin->w_jumplist[0] = tempmark;
  932. X        ++curwin->w_jumplistidx;
  933. X    }
  934. X#endif
  935. X
  936. X        /* only add new entry if it differs from the last one */
  937. X    if (curwin->w_jumplistlen == 0 ||
  938. X                curwin->w_jumplist[curwin->w_jumplistidx - 1].mark.lnum !=
  939. X                                                        curwin->w_pcmark.lnum ||
  940. X                curwin->w_jumplist[curwin->w_jumplistidx - 1].fnum !=
  941. X                                                        curbuf->b_fnum)
  942. X    {
  943. X            /* if jumplist is full: remove oldest entry */
  944. X        if (++curwin->w_jumplistlen > JUMPLISTSIZE)
  945. X        {
  946. X            curwin->w_jumplistlen = JUMPLISTSIZE;
  947. X            for (i = 1; i < curwin->w_jumplistlen; ++i)
  948. X                curwin->w_jumplist[i - 1] = curwin->w_jumplist[i];
  949. X            --curwin->w_jumplistidx;
  950. X        }
  951. X
  952. X#ifdef ARCHIE
  953. X        /* Workaround for a bug in gcc 2.4.5 R2 on the Archimedes
  954. X         * Should be fixed in 2.5.x.
  955. X         */
  956. X        curwin->w_jumplist[curwin->w_jumplistidx].mark.ptr = curwin->w_pcmark.ptr;
  957. X        curwin->w_jumplist[curwin->w_jumplistidx].mark.col = curwin->w_pcmark.col;
  958. X#else
  959. X        curwin->w_jumplist[curwin->w_jumplistidx].mark = curwin->w_pcmark;
  960. X#endif
  961. X        curwin->w_jumplist[curwin->w_jumplistidx].fnum = curbuf->b_fnum;
  962. X        ++curwin->w_jumplistidx;
  963. X    }
  964. X}
  965. X
  966. X/*
  967. X * checkpcmark() - To change context, call setpcmark(), then move the current
  968. X *                   position to where ever, then call checkpcmark().  This
  969. X *                   ensures that the previous context will only be changed if
  970. X *                   the cursor moved to a different line. -- webb.
  971. X *                   If pcmark was deleted (with "dG") the previous mark is restored.
  972. X */
  973. X    void
  974. Xcheckpcmark()
  975. X{
  976. X    if (curwin->w_prev_pcmark.lnum != 0 &&
  977. X            (curwin->w_pcmark.lnum == curwin->w_cursor.lnum ||
  978. X            curwin->w_pcmark.lnum == 0))
  979. X    {
  980. X        curwin->w_pcmark = curwin->w_prev_pcmark;
  981. X        curwin->w_prev_pcmark.lnum = 0;            /* Show it has been checked */
  982. X    }
  983. X}
  984. X
  985. X/*
  986. X * move "count" positions in the jump list (count may be negative)
  987. X */
  988. X    FPOS *
  989. Xmovemark(count)
  990. X    int count;
  991. X{
  992. X    FPOS        *pos;
  993. X
  994. X    if (curwin->w_jumplistlen == 0)            /* nothing to jump to */
  995. X        return (FPOS *)NULL;
  996. X
  997. X    if (curwin->w_jumplistidx + count < 0 ||
  998. X                        curwin->w_jumplistidx + count >= curwin->w_jumplistlen)
  999. X        return (FPOS *)NULL;
  1000. X
  1001. X    /*
  1002. X     * if first CTRL-O or CTRL-I command after a jump, add cursor position to list
  1003. X     */
  1004. X    if (curwin->w_jumplistidx == curwin->w_jumplistlen)
  1005. X    {
  1006. X        setpcmark();
  1007. X        --curwin->w_jumplistidx;        /* skip the new entry */
  1008. X    }
  1009. X
  1010. X    curwin->w_jumplistidx += count;
  1011. X                                                /* jump to other file */
  1012. X    if (curwin->w_jumplist[curwin->w_jumplistidx].fnum != curbuf->b_fnum)
  1013. X    {
  1014. X        if (buflist_getfile(curwin->w_jumplist[curwin->w_jumplistidx].fnum,
  1015. X                    curwin->w_jumplist[curwin->w_jumplistidx].mark.lnum, FALSE) == FAIL)
  1016. X            return (FPOS *)NULL;
  1017. X        curwin->w_cursor.col = curwin->w_jumplist[curwin->w_jumplistidx].mark.col;
  1018. X        pos = (FPOS *)-1;
  1019. X    }
  1020. X    else
  1021. X        pos = &(curwin->w_jumplist[curwin->w_jumplistidx].mark);
  1022. X    return pos;
  1023. X}
  1024. X
  1025. X/*
  1026. X * getmark(c) - find mark for char 'c'
  1027. X *
  1028. X * Return pointer to FPOS if found
  1029. X *        NULL if no such mark.
  1030. X *        -1 if mark is in other file (only if changefile is TRUE)
  1031. X */
  1032. X    FPOS *
  1033. Xgetmark(c, changefile)
  1034. X    int            c;
  1035. X    int            changefile;
  1036. X{
  1037. X    FPOS    *posp;
  1038. X    static    FPOS    pos_copy;
  1039. X
  1040. X    posp = NULL;
  1041. X    if (c == '\'' || c == '`')            /* previous context mark */
  1042. X    {
  1043. X        pos_copy = curwin->w_pcmark;    /* need to make a copy because b_pcmark */
  1044. X        posp = &pos_copy;                /*   may be changed soon */
  1045. X    }
  1046. X    else if (c == '[')                    /* to start of previous operator */
  1047. X    {
  1048. X        if (curbuf->b_startop.lnum > 0 &&
  1049. X                        curbuf->b_startop.lnum <= curbuf->b_ml.ml_line_count)
  1050. X            posp = &(curbuf->b_startop);
  1051. X    }
  1052. X    else if (c == ']')                    /* to end of previous operator */
  1053. X    {
  1054. X        if (curbuf->b_endop.lnum > 0 &&
  1055. X                        curbuf->b_endop.lnum <= curbuf->b_ml.ml_line_count)
  1056. X            posp = &(curbuf->b_endop);
  1057. X    }
  1058. X    else if (islower(c))                /* normal named mark */
  1059. X        posp = &(curbuf->b_namedm[c - 'a']);
  1060. X    else if (isupper(c))                /* named file mark */
  1061. X    {
  1062. X        c -= 'A';
  1063. X        posp = &(namedfm[c].mark);
  1064. X        if (namedfm[c].fnum != curbuf->b_fnum &&
  1065. X                                    namedfm[c].mark.lnum != 0 && changefile)
  1066. X        {
  1067. X            if (buflist_getfile(namedfm[c].fnum, namedfm[c].mark.lnum, TRUE) == OK)
  1068. X            {
  1069. X                curwin->w_cursor.col = namedfm[c].mark.col;
  1070. X                posp = (FPOS *)-1;
  1071. X            }
  1072. X        }
  1073. X    }
  1074. X    return posp;
  1075. X}
  1076. X
  1077. X/*
  1078. X * clrallmarks() - clear all marks in the buffer 'buf'
  1079. X *
  1080. X * Used mainly when trashing the entire buffer during ":e" type commands
  1081. X */
  1082. X    void
  1083. Xclrallmarks(buf)
  1084. X    BUF        *buf;
  1085. X{
  1086. X    static int             i = -1;
  1087. X
  1088. X    if (i == -1)        /* first call ever: initialize */
  1089. X        for (i = 0; i < NMARKS; i++)
  1090. X            namedfm[i].mark.lnum = 0;
  1091. X
  1092. X    for (i = 0; i < NMARKS; i++)
  1093. X        buf->b_namedm[i].lnum = 0;
  1094. X    buf->b_startop.lnum = 0;        /* start/end op mark cleared */
  1095. X    buf->b_endop.lnum = 0;
  1096. X}
  1097. X
  1098. X/*
  1099. X * get name of file from a filemark
  1100. X */
  1101. X    char_u *
  1102. Xfm_getname(fmark)
  1103. X    struct filemark *fmark;
  1104. X{
  1105. X    char_u        *name;
  1106. X
  1107. X    if (fmark->fnum != curbuf->b_fnum)                /* not current file */
  1108. X    {
  1109. X        name = buflist_nr2name(fmark->fnum);
  1110. X        if (name == NULL)
  1111. X            return (char_u *)"-unknown-";
  1112. X        return name;
  1113. X    }
  1114. X    return (char_u *)"-current-";
  1115. X}
  1116. X
  1117. X/*
  1118. X * print the marks (use the occasion to update the line numbers)
  1119. X */
  1120. X    void
  1121. Xdomarks()
  1122. X{
  1123. X    int            i;
  1124. X    char_u        *name;
  1125. X
  1126. X    gotocmdline(TRUE, NUL);
  1127. X    msg_outstr((char_u *)"\nmark line  file\n");
  1128. X    for (i = 0; i < NMARKS; ++i)
  1129. X    {
  1130. X        if (curbuf->b_namedm[i].lnum != 0)
  1131. X        {
  1132. X            sprintf((char *)IObuff, " %c %5ld\n", i + 'a',
  1133. X                                                curbuf->b_namedm[i].lnum);
  1134. X            msg_outstr(IObuff);
  1135. X        }
  1136. X        flushbuf();
  1137. X    }
  1138. X    for (i = 0; i < NMARKS; ++i)
  1139. X    {
  1140. X        if (namedfm[i].mark.lnum != 0)
  1141. X        {
  1142. X            name = fm_getname(&namedfm[i]);
  1143. X            if (name == NULL)        /* file name not available */
  1144. X                continue;
  1145. X
  1146. X            sprintf((char *)IObuff, " %c %5ld  %s\n",
  1147. X                i + 'A',
  1148. X                namedfm[i].mark.lnum,
  1149. X                name);
  1150. X            msg_outstr(IObuff);
  1151. X        }
  1152. X        flushbuf();                /* show one line at a time */
  1153. X    }
  1154. X    msg_end();
  1155. X}
  1156. X
  1157. X/*
  1158. X * print the jumplist
  1159. X */
  1160. X    void
  1161. Xdojumps()
  1162. X{
  1163. X    int            i;
  1164. X    char_u        *name;
  1165. X
  1166. X    gotocmdline(TRUE, NUL);
  1167. X    msg_outstr((char_u *)"\n jump line  file\n");
  1168. X    for (i = 0; i < curwin->w_jumplistlen; ++i)
  1169. X    {
  1170. X        if (curwin->w_jumplist[i].mark.lnum != 0)
  1171. X        {
  1172. X            name = fm_getname(&curwin->w_jumplist[i]);
  1173. X            if (name == NULL)        /* file name not available */
  1174. X                continue;
  1175. X
  1176. X            sprintf((char *)IObuff, "%c %2d %5ld  %s\n",
  1177. X                i == curwin->w_jumplistidx ? '>' : ' ',
  1178. X                i + 1,
  1179. X                curwin->w_jumplist[i].mark.lnum,
  1180. X                name);
  1181. X            msg_outstr(IObuff);
  1182. X        }
  1183. X        flushbuf();
  1184. X    }
  1185. X    if (curwin->w_jumplistidx == curwin->w_jumplistlen)
  1186. X        msg_outstr((char_u *)">\n");
  1187. X    msg_end();
  1188. X}
  1189. X
  1190. X/*
  1191. X * adjust marks between line1 and line2 (inclusive) to move 'inc' lines
  1192. X * If 'inc' is MAXLNUM the mark is made invalid.
  1193. X */
  1194. X    void
  1195. Xmark_adjust(line1, line2, inc)
  1196. X    linenr_t    line1;
  1197. X    linenr_t    line2;
  1198. X    long        inc;
  1199. X{
  1200. X    int            i;
  1201. X    int            fnum = curbuf->b_fnum;
  1202. X    linenr_t    *lp;
  1203. X    WIN            *win;
  1204. X
  1205. X/* named marks, lower case and upper case */
  1206. X    for (i = 0; i < NMARKS; i++)
  1207. X    {
  1208. X        lp = &(curbuf->b_namedm[i].lnum);
  1209. X        if (*lp >= line1 && *lp <= line2)
  1210. X        {
  1211. X            if (inc == MAXLNUM)
  1212. X                *lp = 0;
  1213. X            else
  1214. X                *lp += inc;
  1215. X        }
  1216. X        if (namedfm[i].fnum == fnum)
  1217. X        {
  1218. X            lp = &(namedfm[i].mark.lnum);
  1219. X            if (*lp >= line1 && *lp <= line2)
  1220. X            {
  1221. X                if (inc == MAXLNUM)
  1222. X                    *lp = 0;
  1223. X                else
  1224. X                    *lp += inc;
  1225. X            }
  1226. X        }
  1227. X    }
  1228. X
  1229. X/* previous context mark */
  1230. X    lp = &(curwin->w_pcmark.lnum);
  1231. X    if (*lp >= line1 && *lp <= line2)
  1232. X    {
  1233. X        if (inc == MAXLNUM)
  1234. X            *lp = 0;
  1235. X        else
  1236. X            *lp += inc;
  1237. X    }
  1238. X
  1239. X/* previous pcmark */
  1240. X    lp = &(curwin->w_prev_pcmark.lnum);
  1241. X    if (*lp >= line1 && *lp <= line2)
  1242. X    {
  1243. X        if (inc == MAXLNUM)
  1244. X            *lp = 0;
  1245. X        else
  1246. X            *lp += inc;
  1247. X    }
  1248. X
  1249. X/* quickfix marks */
  1250. X    qf_mark_adjust(line1, line2, inc);
  1251. X
  1252. X/* jumplist marks */
  1253. X    for (win = firstwin; win != NULL; win = win->w_next)
  1254. X    {
  1255. X        for (i = 0; i < win->w_jumplistlen; ++i)
  1256. X            if (win->w_jumplist[i].fnum == fnum)
  1257. X            {
  1258. X                lp = &(win->w_jumplist[i].mark.lnum);
  1259. X                if (*lp >= line1 && *lp <= line2)
  1260. X                {
  1261. X                    if (inc == MAXLNUM)
  1262. X                        *lp = 0;
  1263. X                    else
  1264. X                        *lp += inc;
  1265. X                }
  1266. X            }
  1267. X        /*
  1268. X         * also adjust the line at the top of the window and the cursor position
  1269. X         * for windows with the same buffer.
  1270. X         */
  1271. X        if (win != curwin && win->w_buffer == curbuf)
  1272. X        {
  1273. X            if (win->w_topline >= line1 && win->w_topline <= line2)
  1274. X            {
  1275. X                if (inc == MAXLNUM)        /* topline is deleted */
  1276. X                    win->w_topline = line1;
  1277. X                else                    /* keep topline on the same line */
  1278. X                    win->w_topline += inc;
  1279. X            }
  1280. X            if (win->w_cursor.lnum >= line1 && win->w_cursor.lnum <= line2)
  1281. X            {
  1282. X                if (inc == MAXLNUM)        /* line with cursor is deleted */
  1283. X                {
  1284. X                    win->w_cursor.lnum = line1;
  1285. X                    win->w_cursor.col = 0;
  1286. X                }
  1287. X                else                    /* keep cursor on the same line */
  1288. X                    win->w_cursor.lnum += inc;
  1289. X            }
  1290. X        }
  1291. X    }
  1292. X}
  1293. END_OF_FILE
  1294.   if test 10133 -ne `wc -c <'vim/src/mark.c'`; then
  1295.     echo shar: \"'vim/src/mark.c'\" unpacked with wrong size!
  1296.   fi
  1297.   # end of 'vim/src/mark.c'
  1298. fi
  1299. if test -f 'vim/src/message.c' -a "${1}" != "-c" ; then 
  1300.   echo shar: Will not clobber existing file \"'vim/src/message.c'\"
  1301. else
  1302.   echo shar: Extracting \"'vim/src/message.c'\" \(9490 characters\)
  1303.   sed "s/^X//" >'vim/src/message.c' <<'END_OF_FILE'
  1304. X/* vi:ts=4:sw=4
  1305. X *
  1306. X * VIM - Vi IMproved        by Bram Moolenaar
  1307. X *
  1308. X * Read the file "credits.txt" for a list of people who contributed.
  1309. X * Read the file "uganda.txt" for copying and usage conditions.
  1310. X */
  1311. X
  1312. X/*
  1313. X * message.c: functions for displaying messages on the command line
  1314. X */
  1315. X
  1316. X#include "vim.h"
  1317. X#include "globals.h"
  1318. X#define MESSAGE            /* don't include prototype for smsg() */
  1319. X#include "proto.h"
  1320. X#include "param.h"
  1321. X
  1322. Xstatic int msg_check_screen __ARGS((void));
  1323. X
  1324. Xstatic int lines_left = -1;            /* lines left for listing */
  1325. X
  1326. X/*
  1327. X * msg(s) - displays the string 's' on the status line
  1328. X * return TRUE if wait_return not called
  1329. X */
  1330. X    int
  1331. Xmsg(s)
  1332. X    char_u           *s;
  1333. X{
  1334. X    if (!screen_valid())            /* terminal not initialized */
  1335. X    {
  1336. X        fprintf(stderr, (char *)s);
  1337. X        fflush(stderr);
  1338. X        return TRUE;
  1339. X    }
  1340. X
  1341. X    msg_start();
  1342. X    if (msg_highlight)            /* actually it is highlighting instead of invert */
  1343. X        start_highlight();
  1344. X    msg_outtrans(s, -1);
  1345. X    if (msg_highlight)
  1346. X    {
  1347. X        stop_highlight();
  1348. X        msg_highlight = FALSE;        /* clear for next call */
  1349. X    }
  1350. X    msg_ceol();
  1351. X    return msg_end();
  1352. X}
  1353. X
  1354. X#ifndef PROTO        /* automatic prototype generation does not understand this */
  1355. X/* VARARGS */
  1356. X    void
  1357. Xsmsg(s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
  1358. X    char_u        *s;
  1359. X    long        a1, a2, a3, a4, a5, a6, a7, a8, a9, a10;
  1360. X{
  1361. X    sprintf((char *)IObuff, (char *)s, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
  1362. X    msg(IObuff);
  1363. X}
  1364. X#endif
  1365. X
  1366. X/*
  1367. X * emsg() - display an error message
  1368. X *
  1369. X * Rings the bell, if appropriate, and calls message() to do the real work
  1370. X *
  1371. X * return TRUE if wait_return not called
  1372. X */
  1373. X    int
  1374. Xemsg(s)
  1375. X    char_u           *s;
  1376. X{
  1377. X    if (p_eb)
  1378. X        beep();                    /* also includes flush_buffers() */
  1379. X    else
  1380. X        flush_buffers(FALSE);    /* flush internal buffers */
  1381. X    (void)set_highlight('e');    /* set highlight mode for error messages */
  1382. X    msg_highlight = TRUE;
  1383. X/*
  1384. X * Msg returns TRUE if wait_return() was not called.
  1385. X * In that case may call sleep() to give the user a chance to read the message.
  1386. X * Don't call sleep() if dont_sleep is set.
  1387. X */
  1388. X    if (msg(s))
  1389. X    {
  1390. X        if (dont_sleep)
  1391. X        {
  1392. X            msg_outchar('\n');    /* one message per line, don't overwrite */
  1393. X            cmdline_row = msg_row;
  1394. X            need_wait_return = TRUE;
  1395. X        }
  1396. X        else
  1397. X            sleep(1);            /* give the user a chance to read the message */
  1398. X        return TRUE;
  1399. X    }
  1400. X    return FALSE;
  1401. X}
  1402. X
  1403. X    int
  1404. Xemsg2(s, a1)
  1405. X    char_u *s, *a1;
  1406. X{
  1407. X    sprintf((char *)IObuff, (char *)s, (char *)a1);
  1408. X    return emsg(IObuff);
  1409. X}
  1410. X
  1411. X/*
  1412. X * wait for the user to hit a key (normally a return)
  1413. X * if 'redraw' is TRUE, clear and redraw the screen
  1414. X * if 'redraw' is FALSE, just redraw the screen
  1415. X * if 'redraw' is -1, don't redraw at all
  1416. X */
  1417. X    void
  1418. Xwait_return(redraw)
  1419. X    int        redraw;
  1420. X{
  1421. X    int                c;
  1422. X    int                oldState;
  1423. X    int                tmpState;
  1424. X
  1425. X/*
  1426. X * With the global command (and some others) we only need one return at the
  1427. X * end. Adjust cmdline_row to avoid the next message overwriting the last one.
  1428. X */
  1429. X    if (no_wait_return)
  1430. X    {
  1431. X        need_wait_return = TRUE;
  1432. X        cmdline_row = msg_row;
  1433. X        if (!termcap_active)
  1434. X            starttermcap();
  1435. X        return;
  1436. X    }
  1437. X    need_wait_return = FALSE;
  1438. X    lines_left = -1;
  1439. X    oldState = State;
  1440. X    State = HITRETURN;
  1441. X    if (got_int)
  1442. X        msg_outstr((char_u *)"Interrupt: ");
  1443. X
  1444. X    (void)set_highlight('r');
  1445. X    start_highlight();
  1446. X#ifdef ORG_HITRETURN
  1447. X    msg_outstr("Press RETURN to continue");
  1448. X    stop_highlight();
  1449. X    do {
  1450. X        c = vgetc();
  1451. X    } while (strchr("\r\n: ", c) == NULL);
  1452. X    if (c == ':')                     /* this can vi too (but not always!) */
  1453. X        stuffcharReadbuff(c);
  1454. X#else
  1455. X    msg_outstr((char_u *)"Press RETURN or enter command to continue");
  1456. X    stop_highlight();
  1457. X    do
  1458. X    {
  1459. X        c = vgetc();
  1460. X        got_int = FALSE;
  1461. X    } while (c == Ctrl('C'));
  1462. X    breakcheck();
  1463. X    if (strchr("\r\n ", c) == NULL)
  1464. X        stuffcharReadbuff(c);
  1465. X#endif
  1466. X
  1467. X    /*
  1468. X     * If the user hits ':' we get a command line from the next line.
  1469. X     */
  1470. X    if (c == ':')
  1471. X        cmdline_row = msg_row;
  1472. X
  1473. X    if (!termcap_active)            /* start termcap before redrawing */
  1474. X        starttermcap();
  1475. X
  1476. X/*
  1477. X * If the window size changed set_winsize() will redraw the screen.
  1478. X * Otherwise the screen is only redrawn if 'redraw' is set and no ':' typed.
  1479. X */
  1480. X    tmpState = State;
  1481. X    State = oldState;                /* restore State before set_winsize */
  1482. X    msg_check();
  1483. X    if (tmpState == SETWSIZE)        /* got resize event while in vgetc() */
  1484. X        set_winsize(0, 0, FALSE);
  1485. X    else if (redraw == TRUE)
  1486. X    {
  1487. X        if (c == ':')
  1488. X            must_redraw = CLEAR;
  1489. X        else
  1490. X            updateScreen(CLEAR);
  1491. X    }
  1492. X    else if (msg_scrolled && c != ':' && redraw != -1)
  1493. X        updateScreen(VALID);
  1494. X
  1495. X    if (c == ':')
  1496. X        skip_redraw = TRUE;            /* skip redraw once */
  1497. X}
  1498. X
  1499. X/*
  1500. X * Prepare for outputting characters in the command line.
  1501. X */
  1502. X    void
  1503. Xmsg_start()
  1504. X{
  1505. X    did_msg = TRUE;                    /* for doglob() */
  1506. X    keep_msg = NULL;                /* don't display old message now */
  1507. X    msg_pos(cmdline_row, 0);
  1508. X    cursor_off();
  1509. X    lines_left = cmdline_row;
  1510. X}
  1511. X
  1512. X/*
  1513. X * Move message position. This should always be used after moving the cursor.
  1514. X * Use negative value if row or col does not have to be changed.
  1515. X */
  1516. X    void
  1517. Xmsg_pos(row, col)
  1518. X    int        row, col;
  1519. X{
  1520. X    if (row >= 0)
  1521. X        msg_row = row;
  1522. X    if (col >= 0)
  1523. X        msg_col = col;
  1524. X    screen_start();
  1525. X}
  1526. X
  1527. X    void
  1528. Xmsg_outchar(c)
  1529. X    int        c;
  1530. X{
  1531. X    char_u        buf[2];
  1532. X
  1533. X    buf[0] = c;
  1534. X    buf[1] = NUL;
  1535. X    msg_outstr(buf);
  1536. X}
  1537. X
  1538. X    void
  1539. Xmsg_outnum(n)
  1540. X    long        n;
  1541. X{
  1542. X    char_u        buf[20];
  1543. X
  1544. X    sprintf((char *)buf, "%ld", n);
  1545. X    msg_outstr(buf);
  1546. X}
  1547. X
  1548. X/*
  1549. X * output 'len' characters in 'str' (including NULs) with translation
  1550. X * if 'len' is -1, output upto a NUL character
  1551. X * return the number of characters it takes on the screen
  1552. X */
  1553. X    int
  1554. Xmsg_outtrans(str, len)
  1555. X    register char_u *str;
  1556. X    register int   len;
  1557. X{
  1558. X    int retval = 0;
  1559. X
  1560. X    if (len == -1)
  1561. X        len = STRLEN(str);
  1562. X    while (--len >= 0)
  1563. X    {
  1564. X        msg_outstr(transchar(*str));
  1565. X        retval += charsize(*str);
  1566. X        ++str;
  1567. X    }
  1568. X    return retval;
  1569. X}
  1570. X
  1571. X/*
  1572. X * print line for :p command
  1573. X */
  1574. X    void
  1575. Xmsg_prt_line(s)
  1576. X    char_u           *s;
  1577. X{
  1578. X    register int    si = 0;
  1579. X    register int    c;
  1580. X    register int    col = 0;
  1581. X
  1582. X    int             n_extra = 0;
  1583. X    int             n_spaces = 0;
  1584. X    char_u            *p = NULL;            /* init to make SASC shut up */
  1585. X    int             n;
  1586. X
  1587. X    for (;;)
  1588. X    {
  1589. X        if (n_extra)
  1590. X        {
  1591. X            --n_extra;
  1592. X            c = *p++;
  1593. X        }
  1594. X        else if (n_spaces)
  1595. X        {
  1596. X            --n_spaces;
  1597. X            c = ' ';
  1598. X        }
  1599. X        else
  1600. X        {
  1601. X            c = s[si++];
  1602. X            if (c == TAB && !curwin->w_p_list)
  1603. X            {
  1604. X                /* tab amount depends on current column */
  1605. X                n_spaces = curbuf->b_p_ts - col % curbuf->b_p_ts - 1;
  1606. X                c = ' ';
  1607. X            }
  1608. X            else if (c == NUL && curwin->w_p_list)
  1609. X            {
  1610. X                p = (char_u *)"";
  1611. X                n_extra = 1;
  1612. X                c = '$';
  1613. X            }
  1614. X            else if (c != NUL && (n = charsize(c)) > 1)
  1615. X            {
  1616. X                n_extra = n - 1;
  1617. X                p = transchar(c);
  1618. X                c = *p++;
  1619. X            }
  1620. X        }
  1621. X
  1622. X        if (c == NUL)
  1623. X            break;
  1624. X
  1625. X        msg_outchar(c);
  1626. X        col++;
  1627. X    }
  1628. X}
  1629. X
  1630. X/*
  1631. X * output a string to the screen at position msg_row, msg_col
  1632. X * Update msg_row and msg_col for the next message.
  1633. X */
  1634. X    void
  1635. Xmsg_outstr(s)
  1636. X    char_u        *s;
  1637. X{
  1638. X    int        c;
  1639. X
  1640. X    /*
  1641. X     * if there is no valid screen, use fprintf so we can see error messages
  1642. X     */
  1643. X    if (!msg_check_screen())
  1644. X    {
  1645. X        fprintf(stderr, (char *)s);
  1646. X        return;
  1647. X    }
  1648. X
  1649. X    while (*s)
  1650. X    {
  1651. X        /*
  1652. X         * the screen is scrolled up when:
  1653. X         * - When outputting a newline in the last row
  1654. X         * - when outputting a character in the last column of the last row
  1655. X         *   (some terminals scroll automatically, some don't. To avoid problems
  1656. X         *   we scroll ourselves)
  1657. X         */
  1658. X        if (msg_row >= Rows - 1 && (*s == '\n' || msg_col >= Columns - 1))
  1659. X        {
  1660. X            screen_del_lines(0, 0, 1, (int)Rows);        /* always works */
  1661. X            msg_row = Rows - 2;
  1662. X            if (msg_col >= Columns)        /* can happen after screen resize */
  1663. X                msg_col = Columns - 1;
  1664. X            ++msg_scrolled;
  1665. X            if (cmdline_row > 0)
  1666. X                --cmdline_row;
  1667. X            /*
  1668. X             * if screen is completely filled wait for a character
  1669. X             */
  1670. X            if (p_more && --lines_left == 0)
  1671. X            {
  1672. X                windgoto((int)Rows - 1, 0);
  1673. X                outstr((char_u *)"-- more --");
  1674. X                c = vgetc();
  1675. X                if (c == CR || c == NL)
  1676. X                    lines_left = 1;
  1677. X                else if (c == 'q' || c == Ctrl('C'))
  1678. X                    got_int = TRUE;
  1679. X                else
  1680. X                    lines_left = Rows - 1;
  1681. X                outstr((char_u *)"\r          ");
  1682. X            }
  1683. X            screen_start();
  1684. X        }
  1685. X        if (*s == '\n')
  1686. X        {
  1687. X            msg_col = 0;
  1688. X            ++msg_row;
  1689. X        }
  1690. X        else
  1691. X        {
  1692. X            screen_outchar(*s, msg_row, msg_col);
  1693. X            if (++msg_col >= Columns)
  1694. X            {
  1695. X                msg_col = 0;
  1696. X                ++msg_row;
  1697. X            }
  1698. X        }
  1699. X        ++s;
  1700. X    }
  1701. X}
  1702. X
  1703. X/*
  1704. X * msg_check_screen - check if the screen is initialized.
  1705. X * Also check msg_row and msg_col, if they are too big it may cause a crash.
  1706. X */
  1707. X    static int
  1708. Xmsg_check_screen()
  1709. X{
  1710. X    if (!screen_valid())
  1711. X        return FALSE;
  1712. X    
  1713. X    if (msg_row >= Rows)
  1714. X        msg_row = Rows - 1;
  1715. X    if (msg_col >= Columns)
  1716. X        msg_col = Columns - 1;
  1717. X    return TRUE;
  1718. X}
  1719. X
  1720. X/*
  1721. X * clear from current message position to end of screen
  1722. X * Note: msg_col is not updated, so we remember the end of the message
  1723. X * for msg_check().
  1724. X */
  1725. X    void
  1726. Xmsg_ceol()
  1727. X{
  1728. X    if (!msg_check_screen())
  1729. X        return;
  1730. X    screen_fill(msg_row, msg_row + 1, msg_col, (int)Columns, ' ', ' ');
  1731. X    screen_fill(msg_row + 1, (int)Rows, 0, (int)Columns, ' ', ' ');
  1732. X}
  1733. X
  1734. X/*
  1735. X * end putting a message on the screen
  1736. X * call wait_return if the message does not fit in the available space
  1737. X * return TRUE if wait_return not called.
  1738. X */
  1739. X    int
  1740. Xmsg_end()
  1741. X{
  1742. X    lines_left = -1;
  1743. X    /*
  1744. X     * if the string is larger than the window,
  1745. X     * or the ruler option is set and we run into it,
  1746. X     * we have to redraw the window.
  1747. X     * Do not do this if we are abandoning the file or editing the command line.
  1748. X     */
  1749. X    if (!exiting && msg_check() && State != CMDLINE)
  1750. X    {
  1751. X        msg_outchar('\n');
  1752. X        wait_return(FALSE);
  1753. X        return FALSE;
  1754. X    }
  1755. X    flushbuf();
  1756. X    return TRUE;
  1757. X}
  1758. X
  1759. X/*
  1760. X * If the written message has caused the screen to scroll up, or if we
  1761. X * run into the shown command or ruler, we have to redraw the window later.
  1762. X */
  1763. X    int
  1764. Xmsg_check()
  1765. X{
  1766. X    lines_left = -1;
  1767. X    if (msg_scrolled || (msg_row == Rows - 1 && msg_col >= sc_col))
  1768. X    {
  1769. X        if (must_redraw < NOT_VALID)
  1770. X            must_redraw = NOT_VALID;
  1771. X        redraw_cmdline = TRUE;
  1772. X        return TRUE;
  1773. X    }
  1774. X    return FALSE;
  1775. X}
  1776. END_OF_FILE
  1777.   if test 9490 -ne `wc -c <'vim/src/message.c'`; then
  1778.     echo shar: \"'vim/src/message.c'\" unpacked with wrong size!
  1779.   fi
  1780.   # end of 'vim/src/message.c'
  1781. fi
  1782. if test -f 'vim/src/proto/cmdline.pro' -a "${1}" != "-c" ; then 
  1783.   echo shar: Will not clobber existing file \"'vim/src/proto/cmdline.pro'\"
  1784. else
  1785.   echo shar: Extracting \"'vim/src/proto/cmdline.pro'\" \(761 characters\)
  1786.   sed "s/^X//" >'vim/src/proto/cmdline.pro' <<'END_OF_FILE'
  1787. X/* cmdline.c */
  1788. Xint getcmdline __PARMS((int firstc, unsigned char *buff));
  1789. Xvoid redrawcmdline __PARMS((void));
  1790. Xvoid compute_cmdrow __PARMS((void));
  1791. Xvoid redrawcmd __PARMS((void));
  1792. Xint docmdline __PARMS((unsigned char *cmdline));
  1793. Xint autowrite __PARMS((struct buffer *buf));
  1794. Xvoid autowrite_all __PARMS((void));
  1795. Xint doecmd __PARMS((unsigned char *fname, unsigned char *sfname, unsigned char *command, int hide, long newlnum));
  1796. Xvoid gotocmdline __PARMS((int clr, int firstc));
  1797. Xvoid gotocmdend __PARMS((void));
  1798. Xint check_fname __PARMS((void));
  1799. Xint getfile __PARMS((unsigned char *fname, unsigned char *sfname, int setpm, long lnum));
  1800. Xunsigned char *ExpandOne __PARMS((unsigned char *str, int list_notfound, int mode));
  1801. Xint dosource __PARMS((unsigned char *fname));
  1802. END_OF_FILE
  1803.   if test 761 -ne `wc -c <'vim/src/proto/cmdline.pro'`; then
  1804.     echo shar: \"'vim/src/proto/cmdline.pro'\" unpacked with wrong size!
  1805.   fi
  1806.   # end of 'vim/src/proto/cmdline.pro'
  1807. fi
  1808. if test -f 'vim/src/quickfix.c' -a "${1}" != "-c" ; then 
  1809.   echo shar: Will not clobber existing file \"'vim/src/quickfix.c'\"
  1810. else
  1811.   echo shar: Extracting \"'vim/src/quickfix.c'\" \(9335 characters\)
  1812.   sed "s/^X//" >'vim/src/quickfix.c' <<'END_OF_FILE'
  1813. X/* vi:ts=4:sw=4
  1814. X *
  1815. X * VIM - Vi IMproved        by Bram Moolenaar
  1816. X *
  1817. X * Read the file "credits.txt" for a list of people who contributed.
  1818. X * Read the file "uganda.txt" for copying and usage conditions.
  1819. X */
  1820. X
  1821. X/*
  1822. X * quickfix.c: functions for quickfix mode, using a file with error messages
  1823. X */
  1824. X
  1825. X#include "vim.h"
  1826. X#include "globals.h"
  1827. X#include "proto.h"
  1828. X#include "param.h"
  1829. X
  1830. Xstatic void qf_free __ARGS((void));
  1831. Xstatic char_u *qf_types __ARGS((int, int));
  1832. X
  1833. X/*
  1834. X * for each error the next struct is allocated and linked in a list
  1835. X */
  1836. Xstruct qf_line
  1837. X{
  1838. X    struct qf_line    *qf_next;    /* pointer to next error in the list */
  1839. X    struct qf_line    *qf_prev;    /* pointer to previous error in the list */
  1840. X    linenr_t         qf_lnum;    /* line number where the error occurred */
  1841. X    int                 qf_fnum;    /* file number for the line */
  1842. X    int                 qf_col;    /* column where the error occurred */
  1843. X    int                 qf_nr;        /* error number */
  1844. X    char_u            *qf_text;    /* description of the error */
  1845. X    char_u             qf_cleared;/* set to TRUE if line has been deleted */
  1846. X    char_u             qf_type;    /* type of the error (mostly 'E') */
  1847. X    char_u             qf_valid;    /* valid error message detected */
  1848. X};
  1849. X
  1850. Xstatic struct qf_line *qf_start;        /* pointer to the first error */
  1851. Xstatic struct qf_line *qf_ptr;            /* pointer to the current error */
  1852. X
  1853. Xstatic int    qf_count = 0;        /* number of errors (0 means no error list) */
  1854. Xstatic int    qf_index;            /* current index in the error list */
  1855. Xstatic int    qf_nonevalid;        /* set to TRUE if not a single valid entry found */
  1856. X
  1857. X/*
  1858. X * Read the errorfile into memory, line by line, building the error list.
  1859. X * Return FAIL for error, OK for success.
  1860. X */
  1861. X    int
  1862. Xqf_init()
  1863. X{
  1864. X    char_u             namebuf[CMDBUFFSIZE + 1];
  1865. X    char_u            errmsg[CMDBUFFSIZE + 1];
  1866. X    int                col;
  1867. X    int                type;
  1868. X    int                valid;
  1869. X    long            lnum;
  1870. X    int                enr;
  1871. X    FILE            *fd;
  1872. X    struct qf_line    *qfp = NULL;
  1873. X    struct qf_line    *qfprev = NULL;        /* init to make SASC shut up */
  1874. X    char_u            *pfmt, *fmtstr;
  1875. X#ifdef UTS2
  1876. X    char_u            *(adr[7]);
  1877. X#else
  1878. X    void            *(adr[7]);
  1879. X#endif
  1880. X    int                adr_cnt = 0;
  1881. X    int                maxlen;
  1882. X    int                i;
  1883. X
  1884. X    if (p_ef == NULL || *p_ef == NUL)
  1885. X    {
  1886. X        emsg(e_errorf);
  1887. X        return FAIL;
  1888. X    }
  1889. X    if ((fd = fopen((char *)p_ef, "r")) == NULL)
  1890. X    {
  1891. X        emsg2(e_openerrf, p_ef);
  1892. X        return FAIL;
  1893. X    }
  1894. X    qf_free();
  1895. X    qf_index = 0;
  1896. X    for (i = 0; i < 7; ++i)
  1897. X        adr[i] = NULL;
  1898. X
  1899. X/*
  1900. X * The format string is copied and modified from p_efm to fmtstr.
  1901. X * Only a few % characters are allowed.
  1902. X */
  1903. X        /* get some space to modify the format string into */
  1904. X        /* must be able to do the largest expansion 7 times (7 x 3) */
  1905. X    maxlen = STRLEN(p_efm) + 25;
  1906. X    fmtstr = alloc(maxlen);
  1907. X    if (fmtstr == NULL)
  1908. X        goto error2;
  1909. X    for (pfmt = p_efm, i = 0; *pfmt; ++pfmt, ++i)
  1910. X    {
  1911. X        if (pfmt[0] != '%')                /* copy normal character */
  1912. X            fmtstr[i] = pfmt[0];
  1913. X        else
  1914. X        {
  1915. X            fmtstr[i++] = '%';
  1916. X            switch (pfmt[1])
  1917. X            {
  1918. X            case 'f':        /* filename */
  1919. X                    adr[adr_cnt++] = namebuf;
  1920. X
  1921. X            case 'm':        /* message */
  1922. X                    if (pfmt[1] == 'm')
  1923. X                        adr[adr_cnt++] = errmsg;
  1924. X                    fmtstr[i++] = '[';
  1925. X                    fmtstr[i++] = '^';
  1926. X                    if (pfmt[2])
  1927. X                        fmtstr[i++] = pfmt[2];
  1928. X                    else
  1929. X#ifdef MSDOS
  1930. X                        fmtstr[i++] = '\r';
  1931. X#else
  1932. X                        fmtstr[i++] = '\n';
  1933. X#endif
  1934. X                    fmtstr[i] = ']';
  1935. X                    break;
  1936. X            case 'c':        /* column */
  1937. X                    adr[adr_cnt++] = &col;
  1938. X                    fmtstr[i] = 'd';
  1939. X                    break;
  1940. X            case 'l':        /* line */
  1941. X                    adr[adr_cnt++] = &lnum;
  1942. X                    fmtstr[i++] = 'l';
  1943. X                    fmtstr[i] = 'd';
  1944. X                    break;
  1945. X            case 'n':        /* error number */
  1946. X                    adr[adr_cnt++] = &enr;
  1947. X                    fmtstr[i] = 'd';
  1948. X                    break;
  1949. X            case 't':        /* error type */
  1950. X                    adr[adr_cnt++] = &type;
  1951. X                    fmtstr[i] = 'c';
  1952. X                    break;
  1953. X            case '%':        /* %% */
  1954. X            case '*':        /* %*: no assignment */
  1955. X                    fmtstr[i] = pfmt[1];
  1956. X                    break;
  1957. X            default:
  1958. X                    EMSG("invalid % in format string");
  1959. X                    goto error2;
  1960. X            }
  1961. X            if (adr_cnt == 7)
  1962. X            {
  1963. X                EMSG("too many % in format string");
  1964. X                goto error2;
  1965. X            }
  1966. X            ++pfmt;
  1967. X        }
  1968. X        if (i >= maxlen - 6)
  1969. X        {
  1970. X            EMSG("invalid format string");
  1971. X            goto error2;
  1972. X        }
  1973. X    }
  1974. X    fmtstr[i] = NUL;
  1975. X
  1976. X    while (fgets((char *)IObuff, CMDBUFFSIZE, fd) != NULL && !got_int)
  1977. X    {
  1978. X        if ((qfp = (struct qf_line *)alloc((unsigned)sizeof(struct qf_line))) == NULL)
  1979. X            goto error2;
  1980. X
  1981. X        IObuff[CMDBUFFSIZE] = NUL;    /* for very long lines */
  1982. X        namebuf[0] = NUL;
  1983. X        errmsg[0] = NUL;
  1984. X        lnum = 0;
  1985. X        col = 0;
  1986. X        enr = -1;
  1987. X        type = 0;
  1988. X        valid = TRUE;
  1989. X
  1990. X        if (sscanf((char *)IObuff, (char *)fmtstr, adr[0], adr[1], adr[2], adr[3],
  1991. X                                                adr[4], adr[5]) != adr_cnt)
  1992. X        {
  1993. X            namebuf[0] = NUL;            /* something failed, remove file name */
  1994. X            valid = FALSE;
  1995. X            STRCPY(errmsg, IObuff);        /* copy whole line to error message */
  1996. X            if ((pfmt = STRRCHR(errmsg, '\n')) != NULL)
  1997. X                *pfmt = NUL;
  1998. X#ifdef MSDOS
  1999. X            if ((pfmt = STRRCHR(errmsg, '\r')) != NULL)
  2000. X                *pfmt = NUL;
  2001. X#endif
  2002. X        }
  2003. X
  2004. X        if (namebuf[0] == NUL)            /* no file name */
  2005. X            qfp->qf_fnum = 0;
  2006. X        else
  2007. X            qfp->qf_fnum = buflist_add(namebuf);
  2008. X        if ((qfp->qf_text = strsave(errmsg)) == NULL)
  2009. X            goto error1;
  2010. X        qfp->qf_lnum = lnum;
  2011. X        qfp->qf_col = col;
  2012. X        qfp->qf_nr = enr;
  2013. X        qfp->qf_type = type;
  2014. X        qfp->qf_valid = valid;
  2015. X
  2016. X        if (qf_count == 0)        /* first element in the list */
  2017. X        {
  2018. X            qf_start = qfp;
  2019. X            qfp->qf_prev = qfp;    /* first element points to itself */
  2020. X        }
  2021. X        else
  2022. X        {
  2023. X            qfp->qf_prev = qfprev;
  2024. X            qfprev->qf_next = qfp;
  2025. X        }
  2026. X        qfp->qf_next = qfp;        /* last element points to itself */
  2027. X        qfp->qf_cleared = FALSE;
  2028. X        qfprev = qfp;
  2029. X        ++qf_count;
  2030. X        if (qf_index == 0 && qfp->qf_valid)        /* first valid entry */
  2031. X        {
  2032. X            qf_index = qf_count;
  2033. X            qf_ptr = qfp;
  2034. X        }
  2035. X        breakcheck();
  2036. X    }
  2037. X    free(fmtstr);
  2038. X    if (!ferror(fd))
  2039. X    {
  2040. X        if (qf_index == 0)        /* no valid entry found */
  2041. X        {
  2042. X            qf_ptr = qf_start;
  2043. X            qf_index = 1;
  2044. X            qf_nonevalid = TRUE;
  2045. X        }
  2046. X        else
  2047. X            qf_nonevalid = FALSE;
  2048. X        fclose(fd);
  2049. X        qf_jump(0, 0);            /* display first error */
  2050. X        return OK;
  2051. X    }
  2052. X    emsg(e_readerrf);
  2053. Xerror1:
  2054. X    free(qfp);
  2055. Xerror2:
  2056. X    fclose(fd);
  2057. X    qf_free();
  2058. X    return FAIL;
  2059. X}
  2060. X
  2061. X/*
  2062. X * jump to a quickfix line
  2063. X * if dir == FORWARD go "errornr" valid entries forward
  2064. X * if dir == BACKWARD go "errornr" valid entries backward
  2065. X * else if "errornr" is zero, redisplay the same line
  2066. X * else go to entry "errornr"
  2067. X */
  2068. X    void
  2069. Xqf_jump(dir, errornr)
  2070. X    int        dir;
  2071. X    int        errornr;
  2072. X{
  2073. X    linenr_t        i;
  2074. X
  2075. X    if (qf_count == 0)
  2076. X    {
  2077. X        emsg(e_quickfix);
  2078. X        return;
  2079. X    }
  2080. X
  2081. X    if (dir == FORWARD)        /* next valid entry */
  2082. X    {
  2083. X        while (errornr--)
  2084. X        {
  2085. X            do
  2086. X            {
  2087. X                if (qf_index == qf_count || qf_ptr->qf_next == NULL)
  2088. X                    break;
  2089. X                ++qf_index;
  2090. X                qf_ptr = qf_ptr->qf_next;
  2091. X            } while (!qf_nonevalid && !qf_ptr->qf_valid);
  2092. X        }
  2093. X    }
  2094. X    else if (dir == BACKWARD)        /* previous valid entry */
  2095. X    {
  2096. X        while (errornr--)
  2097. X        {
  2098. X            do
  2099. X            {
  2100. X                if (qf_index == 1 || qf_ptr->qf_prev == NULL)
  2101. X                    break;
  2102. X                --qf_index;
  2103. X                qf_ptr = qf_ptr->qf_prev;
  2104. X            } while (!qf_nonevalid && !qf_ptr->qf_valid);
  2105. X        }
  2106. X    }
  2107. X    else if (errornr != 0)        /* go to specified number */
  2108. X    {
  2109. X        while (errornr < qf_index && qf_index > 1 && qf_ptr->qf_prev != NULL)
  2110. X        {
  2111. X            --qf_index;
  2112. X            qf_ptr = qf_ptr->qf_prev;
  2113. X        }
  2114. X        while (errornr > qf_index && qf_index < qf_count && qf_ptr->qf_next != NULL)
  2115. X        {
  2116. X            ++qf_index;
  2117. X            qf_ptr = qf_ptr->qf_next;
  2118. X        }
  2119. X    }
  2120. X
  2121. X    /*
  2122. X     * If there is a file name, 
  2123. X     * read the wanted file if needed, and check autowrite etc.
  2124. X     */
  2125. X    if (qf_ptr->qf_fnum == 0 || buflist_getfile(qf_ptr->qf_fnum, (linenr_t)1, TRUE) == OK)
  2126. X    {
  2127. X        /*
  2128. X         * Go to line with error, unless qf_lnum is 0.
  2129. X         */
  2130. X        i = qf_ptr->qf_lnum;
  2131. X        if (i > 0)
  2132. X        {
  2133. X            if (i > curbuf->b_ml.ml_line_count)
  2134. X                i = curbuf->b_ml.ml_line_count;
  2135. X            curwin->w_cursor.lnum = i;
  2136. X        }
  2137. X        curwin->w_cursor.col = qf_ptr->qf_col;
  2138. X        adjust_cursor();
  2139. X        cursupdate();
  2140. X        smsg((char_u *)"(%d of %d) %s%s: %s", qf_index, qf_count, 
  2141. X                    qf_ptr->qf_cleared ? (char_u *)"(line deleted) " : (char_u *)"",
  2142. X                    qf_types(qf_ptr->qf_type, qf_ptr->qf_nr), qf_ptr->qf_text);
  2143. X    }
  2144. X}
  2145. X
  2146. X/*
  2147. X * list all errors
  2148. X */
  2149. X    void
  2150. Xqf_list()
  2151. X{
  2152. X    struct qf_line *qfp;
  2153. X    int i;
  2154. X
  2155. X    if (qf_count == 0)
  2156. X    {
  2157. X        emsg(e_quickfix);
  2158. X        return;
  2159. X    }
  2160. X    qfp = qf_start;
  2161. X    gotocmdline(TRUE, NUL);
  2162. X    for (i = 1; !got_int && i <= qf_count; ++i)
  2163. X    {
  2164. X        sprintf((char *)IObuff, "%2d line %3ld col %2d %s: %s",
  2165. X            i,
  2166. X            (long)qfp->qf_lnum,
  2167. X            qfp->qf_col,
  2168. X            qf_types(qfp->qf_type, qfp->qf_nr),
  2169. X            qfp->qf_text);
  2170. X        msg_outstr(IObuff);
  2171. X        msg_outchar('\n');
  2172. X        qfp = qfp->qf_next;
  2173. X        flushbuf();                    /* show one line at a time */
  2174. X        breakcheck();
  2175. X    }
  2176. X    wait_return(FALSE);
  2177. X}
  2178. X
  2179. X/*
  2180. X * free the error list
  2181. X */
  2182. X    static void
  2183. Xqf_free()
  2184. X{
  2185. X    struct qf_line *qfp;
  2186. X
  2187. X    while (qf_count)
  2188. X    {
  2189. X        qfp = qf_start->qf_next;
  2190. X        free(qf_start->qf_text);
  2191. X        free(qf_start);
  2192. X        qf_start = qfp;
  2193. X        --qf_count;
  2194. X    }
  2195. X}
  2196. X
  2197. X/*
  2198. X * qf_mark_adjust: adjust marks
  2199. X */
  2200. X   void
  2201. Xqf_mark_adjust(line1, line2, inc)
  2202. X    linenr_t    line1;
  2203. X    linenr_t    line2;
  2204. X    long        inc;
  2205. X{
  2206. X    register int i;
  2207. X    struct qf_line *qfp;
  2208. X
  2209. X    if (qf_count)
  2210. X        for (i = 0, qfp = qf_start; i < qf_count; ++i, qfp = qfp->qf_next)
  2211. X            if (qfp->qf_fnum == curbuf->b_fnum &&
  2212. X                            qfp->qf_lnum >= line1 && qfp->qf_lnum <= line2)
  2213. X            {
  2214. X                if (inc == MAXLNUM)
  2215. X                    qfp->qf_cleared = TRUE;
  2216. X                else
  2217. X                    qfp->qf_lnum += inc;
  2218. X            }
  2219. X}
  2220. X
  2221. X/*
  2222. X * Make a nice message out of the error character and the error number:
  2223. X *    char    number        message
  2224. X *  e or E    0            "  Error"
  2225. X *  w or W    0            "Warning"
  2226. X *  other     0             ""
  2227. X *  w or W    n            "Warning n"
  2228. X *  other     n            "  Error n"
  2229. X */
  2230. X    static char_u *
  2231. Xqf_types(c, nr)
  2232. X    int c, nr;
  2233. X{
  2234. X    static char_u    buf[20];
  2235. X    char_u        *p1;
  2236. X
  2237. X    p1 = (char_u *)"  Error";
  2238. X    if (c == 'W' || c == 'w')
  2239. X        p1 =  (char_u *)"Warning";
  2240. X    else if (nr <= 0 && c != 'E' && c != 'e')
  2241. X        p1 = (char_u *)"";
  2242. X
  2243. X    if (nr <= 0)
  2244. X        return p1;
  2245. X
  2246. X    sprintf((char *)buf, "%s %3d", p1, nr);
  2247. X    return buf;
  2248. X}
  2249. END_OF_FILE
  2250.   if test 9335 -ne `wc -c <'vim/src/quickfix.c'`; then
  2251.     echo shar: \"'vim/src/quickfix.c'\" unpacked with wrong size!
  2252.   fi
  2253.   # end of 'vim/src/quickfix.c'
  2254. fi
  2255. if test -f 'vim/src/vim.h' -a "${1}" != "-c" ; then 
  2256.   echo shar: Will not clobber existing file \"'vim/src/vim.h'\"
  2257. else
  2258.   echo shar: Extracting \"'vim/src/vim.h'\" \(8836 characters\)
  2259.   sed "s/^X//" >'vim/src/vim.h' <<'END_OF_FILE'
  2260. X/* vi:ts=4:sw=4
  2261. X *
  2262. X * VIM - Vi IMproved        by Bram Moolenaar
  2263. X *
  2264. X * Read the file "credits.txt" for a list of people who contributed.
  2265. X * Read the file "uganda.txt" for copying and usage conditions.
  2266. X */
  2267. X
  2268. X#if defined(SYSV_UNIX) || defined(BSD_UNIX)
  2269. X# ifndef UNIX
  2270. X#  define UNIX
  2271. X# endif
  2272. X#endif
  2273. X
  2274. X/*
  2275. X * Shorhand for unsinged variables. Many systems, but not all, have u_char
  2276. X * already defined, so we use char_u to avoid trouble.
  2277. X */
  2278. Xtypedef unsigned char    char_u;
  2279. Xtypedef unsigned short    short_u;
  2280. Xtypedef unsigned int    int_u;
  2281. Xtypedef unsigned long    long_u;
  2282. X
  2283. X#include <stdio.h>
  2284. X#include <ctype.h>
  2285. X
  2286. X#if !defined(DOMAIN) && !defined(NOLIMITS)
  2287. X# include <limits.h>        /* For INT_MAX, remove this if it does not exist */
  2288. X#endif
  2289. X
  2290. X#ifdef BSD_UNIX
  2291. X# ifndef apollo
  2292. X#  include <strings.h>
  2293. X# endif
  2294. X# ifdef __STDC__
  2295. X#  include <string.h>
  2296. X# endif
  2297. X#else
  2298. X# include <string.h>
  2299. X#endif
  2300. X
  2301. X#include "ascii.h"
  2302. X#include "keymap.h"
  2303. X#include "term.h"
  2304. X#include "macros.h"
  2305. X
  2306. X#ifdef LATTICE
  2307. X# include <sys/types.h>
  2308. X# include <sys/stat.h>
  2309. X#else
  2310. X# ifdef _DCC
  2311. X#  include <sys/stat.h>
  2312. X# else
  2313. X#  ifdef MSDOS 
  2314. X#   include <sys\stat.h>
  2315. X#  else
  2316. X#   ifdef UNIX
  2317. X#     ifndef linux
  2318. X#      define volatile        /* needed for gcc */
  2319. X#      define signed            /* needed for gcc */
  2320. X#    endif
  2321. X#    include <sys/types.h>
  2322. X#    include <sys/stat.h>
  2323. X#   else
  2324. X#     include <stat.h>
  2325. X#   endif
  2326. X#  endif
  2327. X# endif
  2328. X#endif
  2329. X
  2330. X#if !defined(DOMAIN) && !defined(NOSTDLIB)
  2331. X# include <stdlib.h>
  2332. X#endif
  2333. X
  2334. X#ifdef AMIGA
  2335. X/*
  2336. X * arpbase.h must be included before functions.h
  2337. X */
  2338. X# include <libraries/arpbase.h>
  2339. X
  2340. X/*
  2341. X * This won't be needed if you have a version of Lattice 4.01 without broken
  2342. X * break signal handling.
  2343. X */
  2344. X# include <signal.h>
  2345. X#endif
  2346. X
  2347. X#ifndef AMIGA
  2348. X/*
  2349. X * For the Amiga we use a version of getenv that does local variables under 2.0
  2350. X */
  2351. X# define vimgetenv(x) (char_u *)getenv((char *)x)
  2352. X#endif
  2353. X
  2354. X#ifdef AZTEC_C
  2355. X# include <functions.h>
  2356. X# define __ARGS(x)    x
  2357. X# define __PARMS(x)    x
  2358. X#endif
  2359. X
  2360. X#ifdef SASC
  2361. X# include <clib/exec_protos.h>
  2362. X# define __ARGS(x)    x
  2363. X# define __PARMS(x)    x
  2364. X#endif
  2365. X
  2366. X#ifdef _DCC
  2367. X# include <functions.h>
  2368. X# define __ARGS(x)    x
  2369. X# define __PARMS(x)    x
  2370. X#endif
  2371. X
  2372. X#ifdef __TURBOC__
  2373. X# define __ARGS(x) x
  2374. X#endif
  2375. X
  2376. X#if defined(MSDOS) && !defined(NT)
  2377. X# include <dos.h>
  2378. X# include <dir.h>
  2379. X#endif
  2380. X
  2381. X#ifdef SOLARIS
  2382. X# include <stdlib.h>
  2383. X#endif
  2384. X
  2385. X#ifdef UNIX
  2386. X# include <unistd.h>        /* any unix that doesn't have it? */
  2387. X# ifdef SCO
  2388. X#  undef M_XENIX
  2389. X#  include <sys/ndir.h>        /* for MAXNAMLEN */
  2390. X# else
  2391. X#  if defined(SOLARIS) || defined(AIX) || defined(ARCHIE)
  2392. X#   include <dirent.h>        /* for MAXNAMLEN */
  2393. X#  else
  2394. X#   include <sys/dir.h>        /* for MAXNAMLEN */
  2395. X#  endif
  2396. X# endif
  2397. X# ifdef USL
  2398. X#  define MAXNAMLEN DIRSIZ
  2399. X# endif
  2400. X# if defined(UFS_MAXNAMLEN) && !defined(MAXNAMLEN)
  2401. X#  define MAXNAMLEN UFS_MAXNAMLEN        /* for dynix/ptx */
  2402. X# endif
  2403. X# if defined(NAME_MAX) && !defined(MAXNAMLEN)
  2404. X#  define MAXNAMLEN NAME_MAX            /* for Linux before .99p3 */
  2405. X# endif
  2406. X# if !defined(MAXNAMLEN)
  2407. X#  define MAXNAMLEN 512                 /* for all other Unix */
  2408. X# endif
  2409. X#endif
  2410. X
  2411. X#ifdef UNICOS        /* would make sense for other systems too */
  2412. X# include <errno.h>
  2413. X#endif
  2414. X
  2415. X#if defined(__STDC__) || defined(__GNUC__)
  2416. X# ifndef __ARGS
  2417. X#  define __ARGS(x) x
  2418. X# endif /* __ARGS */
  2419. X# if defined(_SEQUENT_)
  2420. X#  include "ptx_stdlib.h"
  2421. X# endif
  2422. X# if defined(sun) && !defined(SOLARIS)
  2423. X#  include "sun_stdlib.h"
  2424. X# endif
  2425. X#else /*__STDC__*/
  2426. X# if defined(_SEQUENT_) && !defined(_STDLIB_H_)
  2427. X  extern char *getenv();
  2428. X  extern void *malloc();
  2429. X# endif
  2430. X#endif /* __STDC__ */
  2431. X
  2432. X#ifndef __ARGS
  2433. X#define __ARGS(x)    ()
  2434. X#endif
  2435. X#ifndef __PARMS
  2436. X#define __PARMS(x)    ()
  2437. X#endif
  2438. X
  2439. X/*
  2440. X * for systems that do not allow free(NULL)
  2441. X */
  2442. X#ifdef NO_FREE_NULL
  2443. X# define free(x)    nofreeNULL(x)
  2444. X  extern void nofreeNULL __ARGS((void *));
  2445. X#endif
  2446. X
  2447. X/*
  2448. X * fnamecmp() is used to compare filenames.
  2449. X * On some systems case in a filename does not matter, on others it does.
  2450. X * (this does not account for maximum name lengths, thus it is not 100% accurate!)
  2451. X */
  2452. X#if defined(AMIGA) || defined(MSDOS)
  2453. X# define fnamecmp(x, y) stricmp((char *)(x), (char *)(y))
  2454. X#else
  2455. X# define fnamecmp(x, y) strcmp((char *)(x), (char *)(y))
  2456. X#endif
  2457. X
  2458. X/*
  2459. X * flags for updateScreen()
  2460. X * The higher the value, the higher the priority
  2461. X */
  2462. X#define VALID                    10    /* buffer not changed */
  2463. X#define INVERTED                20    /* redisplay inverted part */
  2464. X#define VALID_TO_CURSCHAR        30    /* buffer at/below cursor changed */
  2465. X#define NOT_VALID                40    /* buffer changed */
  2466. X#define CURSUPD                    50    /* buffer changed, update cursor first */
  2467. X#define CLEAR                    60    /* screen messed up, clear it */
  2468. X
  2469. X/* values for State */
  2470. X/*
  2471. X * The lowest three bits are used to distinguish normal/cmdline/insert+replace
  2472. X * mode. This is used for mapping.
  2473. X */
  2474. X#define NORMAL                    0x01
  2475. X#define NORMAL_BUSY                0x11    /* busy interpreting a command */
  2476. X#define CMDLINE                 0x02
  2477. X#define INSERT                    0x04
  2478. X#define REPLACE                 0x24    /* replace mode */
  2479. X#define HELP                    0x30    /* displaying help */
  2480. X#define NOMAPPING                 0x40    /* no :mapping mode for vgetc() */
  2481. X#define ONLYKEY                 0x70    /* like NOMAPPING, but keys allowed */
  2482. X#define HITRETURN                0x51    /* waiting for a return */
  2483. X#define SETWSIZE                0x60    /* window size has changed */
  2484. X#define ABBREV                    0x80    /* abbreviation instead of mapping */
  2485. X
  2486. X/* directions */
  2487. X#define FORWARD                  1
  2488. X#define BACKWARD                 -1
  2489. X
  2490. X/* return values for functions */
  2491. X#define OK                        1
  2492. X#define FAIL                    0
  2493. X
  2494. X/* for GetChars */
  2495. X#define T_PEEK                    1    /* do not wait at all */
  2496. X#define T_WAIT                    2    /* wait for a short time */
  2497. X#define T_BLOCK                    3    /* wait forever */
  2498. X
  2499. X#define VISUALLINE            MAXCOL    /* Visual is linewise */
  2500. X
  2501. X#ifdef WEBB_COMPLETE
  2502. X/*
  2503. X * values for command line completion
  2504. X */
  2505. X#define CONTEXT_UNKNOWN            -2
  2506. X#define EXPAND_UNSUCCESSFUL        -1
  2507. X#define EXPAND_NOTHING            0
  2508. X#define EXPAND_COMMANDS            1
  2509. X#define EXPAND_FILES            2
  2510. X#define EXPAND_DIRECTORIES        3
  2511. X#define EXPAND_SETTINGS            4
  2512. X#define EXPAND_BOOL_SETTINGS    5
  2513. X#define EXPAND_TAGS                6
  2514. X#endif /* WEBB_COMPLETE */
  2515. X/*
  2516. X * Boolean constants
  2517. X */
  2518. X#ifndef TRUE
  2519. X#define FALSE    (0)            /* note: this is an int, not a long! */
  2520. X#define TRUE    (1)
  2521. X#endif
  2522. X
  2523. X/*
  2524. X * Maximum and minimum screen size (height is unlimited)
  2525. X */
  2526. X#ifdef UNIX
  2527. X# define MAX_COLUMNS     1024L
  2528. X#else
  2529. X# define MAX_COLUMNS     255L
  2530. X#endif
  2531. X#define MIN_COLUMNS        5
  2532. X#define MIN_ROWS        1
  2533. X#define STATUS_HEIGHT    1        /* height of a status line under a window */
  2534. X
  2535. X/*
  2536. X * Buffer sizes
  2537. X */
  2538. X#ifdef UNIX        /* Unix has plenty of memory */
  2539. X# define CMDBUFFSIZE    1024    /* size of the command processing buffer */
  2540. X#else
  2541. X# define CMDBUFFSIZE    256        /* size of the command processing buffer */
  2542. X#endif
  2543. X
  2544. X#define LSIZE        512            /* max. size of a line in the tags file */
  2545. X
  2546. X#define IOSIZE       (1024+1)     /* file i/o and sprintf buffer size */
  2547. X
  2548. X#define    TERMBUFSIZE    1024
  2549. X
  2550. X#ifdef linux
  2551. X# define TBUFSZ 2048            /* buffer size for termcap entry */
  2552. X#else
  2553. X# define TBUFSZ 1024            /* buffer size for termcap entry */
  2554. X#endif
  2555. X
  2556. X/*
  2557. X * maximum length of a file name path
  2558. X */
  2559. X#ifdef UNIX
  2560. X# define MAXPATHL    1024        /* Unix has long paths and plenty of memory */
  2561. X#else
  2562. X# define MAXPATHL    128            /* not too long to put name on stack */
  2563. X#endif
  2564. X
  2565. X#ifdef MSDOS
  2566. X# define WRITEBIN    "wb"        /* no CR-LF translation */
  2567. X# define READBIN    "rb"
  2568. X# define APPENDBIN    "ab"
  2569. X#else
  2570. X# define WRITEBIN    "w"
  2571. X# define READBIN    "r"
  2572. X# define APPENDBIN    "a"
  2573. X#endif
  2574. X
  2575. X#define CHANGED           set_Changed()
  2576. X#define UNCHANGED(buf)    unset_Changed(buf)
  2577. X
  2578. X/*
  2579. X * defines to avoid typecasts from (char_u *) to (char *) and back
  2580. X */
  2581. X#define STRCHR(s, c)        (char_u *)strchr((char *)(s), c)
  2582. X#define STRRCHR(s, c)        (char_u *)strrchr((char *)(s), c)
  2583. X#define STRLEN(s)            strlen((char *)(s))
  2584. X#define STRCPY(d, s)        strcpy((char *)(d), (char *)(s))
  2585. X#define STRNCPY(d, s, n)    strncpy((char *)(d), (char *)(s), n)
  2586. X#define STRCMP(d, s)        strcmp((char *)(d), (char *)(s))
  2587. X#define STRNCMP(d, s, n)    strncmp((char *)(d), (char *)(s), n)
  2588. X#define STRCAT(d, s)        strcat((char *)(d), (char *)(s))
  2589. X
  2590. X#define MSG(s)                msg((char_u *)(s))
  2591. X#define EMSG(s)                emsg((char_u *)(s))
  2592. X#define EMSG2(s, p)            emsg2((char_u *)(s), (char_u *)(p))
  2593. X#define OUTSTR(s)            outstr((char_u *)(s))
  2594. X#define OUTSTRN(s)            outstrn((char_u *)(s))
  2595. X
  2596. Xtypedef long            linenr_t;    /* line number type */
  2597. Xtypedef unsigned        colnr_t;    /* column number type */
  2598. X
  2599. X#define MAXLNUM (0x7fffffff)        /* maximum (invalid) line number */
  2600. X#ifdef INT_MAX
  2601. X# define MAXCOL    INT_MAX                /* maximum column number */
  2602. X#else
  2603. X# define MAXCOL    32767                /* maximum column number, 15 bits */
  2604. X#endif
  2605. X
  2606. X/*
  2607. X * Some versions of isspace() handle Meta characters like a space!
  2608. X * This define fixes that.
  2609. X */
  2610. X#ifdef VIM_ISSPACE
  2611. X# ifdef isspace
  2612. X#  undef isspace
  2613. X# endif /* isspace */
  2614. X# define isspace(x)  (((x) >= 9 && (x) <= 13) || ((x) == 32))
  2615. X#endif /* VIM_ISSPACE */
  2616. X
  2617. X/*
  2618. X * iswhite() is used for "^" and the like
  2619. X */
  2620. X#define iswhite(x)    ((x) == ' ' || (x) == '\t')
  2621. X
  2622. X#include "structs.h"        /* file that defines many structures */
  2623. X
  2624. X#ifdef AMIGA
  2625. X# include "amiga.h"
  2626. X#endif
  2627. X
  2628. X#ifdef ARCHIE
  2629. X# include "archie.h"
  2630. X#endif
  2631. X
  2632. X#ifdef MSDOS
  2633. X# include "msdos.h"
  2634. X#endif
  2635. X
  2636. X#ifdef UNIX
  2637. X# include "unix.h"
  2638. X#endif
  2639. END_OF_FILE
  2640.   if test 8836 -ne `wc -c <'vim/src/vim.h'`; then
  2641.     echo shar: \"'vim/src/vim.h'\" unpacked with wrong size!
  2642.   fi
  2643.   # end of 'vim/src/vim.h'
  2644. fi
  2645. echo shar: End of archive 23 \(of 26\).
  2646. cp /dev/null ark23isdone
  2647. MISSING=""
  2648. 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 24 25 26 ; do
  2649.     if test ! -f ark${I}isdone ; then
  2650.     MISSING="${MISSING} ${I}"
  2651.     fi
  2652. done
  2653. if test "${MISSING}" = "" ; then
  2654.     echo You have unpacked all 26 archives.
  2655.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  2656. else
  2657.     echo You still must unpack the following archives:
  2658.     echo "        " ${MISSING}
  2659. fi
  2660. exit 0
  2661. exit 0 # Just in case...
  2662.