xref: /vim-8.2.3635/src/version.c (revision dc2f73a6)
1 /* vi:set ts=8 sts=4 sw=4 noet:
2  *
3  * VIM - Vi IMproved		by Bram Moolenaar
4  *
5  * Do ":help uganda"  in Vim to read copying and usage conditions.
6  * Do ":help credits" in Vim to see a list of people who contributed.
7  * See README.txt for an overview of the Vim source code.
8  */
9 
10 #include "vim.h"
11 
12 #ifdef AMIGA
13 # include <time.h>	/* for time() */
14 #endif
15 
16 /*
17  * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
18  * It has been changed beyond recognition since then.
19  *
20  * Differences between version 7.4 and 8.x can be found with ":help version8".
21  * Differences between version 6.4 and 7.x can be found with ":help version7".
22  * Differences between version 5.8 and 6.x can be found with ":help version6".
23  * Differences between version 4.x and 5.x can be found with ":help version5".
24  * Differences between version 3.0 and 4.x can be found with ":help version4".
25  * All the remarks about older versions have been removed, they are not very
26  * interesting.
27  */
28 
29 #include "version.h"
30 
31 char		*Version = VIM_VERSION_SHORT;
32 static char	*mediumVersion = VIM_VERSION_MEDIUM;
33 
34 #if defined(HAVE_DATE_TIME) || defined(PROTO)
35 # if (defined(VMS) && defined(VAXC)) || defined(PROTO)
36 char	longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
37 						      + sizeof(__TIME__) + 3];
38 
39     void
40 init_longVersion(void)
41 {
42     /*
43      * Construct the long version string.  Necessary because
44      * VAX C can't catenate strings in the preprocessor.
45      */
46     strcpy(longVersion, VIM_VERSION_LONG_DATE);
47     strcat(longVersion, __DATE__);
48     strcat(longVersion, " ");
49     strcat(longVersion, __TIME__);
50     strcat(longVersion, ")");
51 }
52 
53 # else
54     void
55 init_longVersion(void)
56 {
57     char *date_time = __DATE__ " " __TIME__;
58     char *msg = _("%s (%s, compiled %s)");
59     size_t len = strlen(msg)
60 		+ strlen(VIM_VERSION_LONG_ONLY)
61 		+ strlen(VIM_VERSION_DATE_ONLY)
62 		+ strlen(date_time);
63 
64     longVersion = (char *)alloc((unsigned)len);
65     if (longVersion == NULL)
66 	longVersion = VIM_VERSION_LONG;
67     else
68 	vim_snprintf(longVersion, len, msg,
69 		      VIM_VERSION_LONG_ONLY, VIM_VERSION_DATE_ONLY, date_time);
70 }
71 # endif
72 #else
73 char	*longVersion = VIM_VERSION_LONG;
74 
75     void
76 init_longVersion(void)
77 {
78     // nothing to do
79 }
80 #endif
81 
82 static char *(features[]) =
83 {
84 #ifdef HAVE_ACL
85 	"+acl",
86 #else
87 	"-acl",
88 #endif
89 #ifdef AMIGA		/* only for Amiga systems */
90 # ifdef FEAT_ARP
91 	"+ARP",
92 # else
93 	"-ARP",
94 # endif
95 #endif
96 #ifdef FEAT_ARABIC
97 	"+arabic",
98 #else
99 	"-arabic",
100 #endif
101 	"+autocmd",
102 #ifdef FEAT_AUTOCHDIR
103        "+autochdir",
104 #else
105        "-autochdir",
106 #endif
107 #ifdef FEAT_AUTOSERVERNAME
108 	"+autoservername",
109 #else
110 	"-autoservername",
111 #endif
112 #ifdef FEAT_BEVAL_GUI
113 	"+balloon_eval",
114 #else
115 	"-balloon_eval",
116 #endif
117 #ifdef FEAT_BEVAL_TERM
118 	"+balloon_eval_term",
119 #else
120 	"-balloon_eval_term",
121 #endif
122 #ifdef FEAT_BROWSE
123 	"+browse",
124 #else
125 	"-browse",
126 #endif
127 #ifdef NO_BUILTIN_TCAPS
128 	"-builtin_terms",
129 #endif
130 #ifdef SOME_BUILTIN_TCAPS
131 	"+builtin_terms",
132 #endif
133 #ifdef ALL_BUILTIN_TCAPS
134 	"++builtin_terms",
135 #endif
136 #ifdef FEAT_BYTEOFF
137 	"+byte_offset",
138 #else
139 	"-byte_offset",
140 #endif
141 #ifdef FEAT_JOB_CHANNEL
142 	"+channel",
143 #else
144 	"-channel",
145 #endif
146 #ifdef FEAT_CINDENT
147 	"+cindent",
148 #else
149 	"-cindent",
150 #endif
151 #ifdef FEAT_CLIENTSERVER
152 	"+clientserver",
153 #else
154 	"-clientserver",
155 #endif
156 #ifdef FEAT_CLIPBOARD
157 	"+clipboard",
158 #else
159 	"-clipboard",
160 #endif
161 #ifdef FEAT_CMDL_COMPL
162 	"+cmdline_compl",
163 #else
164 	"-cmdline_compl",
165 #endif
166 #ifdef FEAT_CMDHIST
167 	"+cmdline_hist",
168 #else
169 	"-cmdline_hist",
170 #endif
171 #ifdef FEAT_CMDL_INFO
172 	"+cmdline_info",
173 #else
174 	"-cmdline_info",
175 #endif
176 #ifdef FEAT_COMMENTS
177 	"+comments",
178 #else
179 	"-comments",
180 #endif
181 #ifdef FEAT_CONCEAL
182 	"+conceal",
183 #else
184 	"-conceal",
185 #endif
186 #ifdef FEAT_CRYPT
187 	"+cryptv",
188 #else
189 	"-cryptv",
190 #endif
191 #ifdef FEAT_CSCOPE
192 	"+cscope",
193 #else
194 	"-cscope",
195 #endif
196 	"+cursorbind",
197 #ifdef CURSOR_SHAPE
198 	"+cursorshape",
199 #else
200 	"-cursorshape",
201 #endif
202 #if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
203 	"+dialog_con_gui",
204 #else
205 # if defined(FEAT_CON_DIALOG)
206 	"+dialog_con",
207 # else
208 #  if defined(FEAT_GUI_DIALOG)
209 	"+dialog_gui",
210 #  else
211 	"-dialog",
212 #  endif
213 # endif
214 #endif
215 #ifdef FEAT_DIFF
216 	"+diff",
217 #else
218 	"-diff",
219 #endif
220 #ifdef FEAT_DIGRAPHS
221 	"+digraphs",
222 #else
223 	"-digraphs",
224 #endif
225 #ifdef FEAT_GUI_W32
226 # ifdef FEAT_DIRECTX
227 	"+directx",
228 # else
229 	"-directx",
230 # endif
231 #endif
232 #ifdef FEAT_DND
233 	"+dnd",
234 #else
235 	"-dnd",
236 #endif
237 #ifdef EBCDIC
238 	"+ebcdic",
239 #else
240 	"-ebcdic",
241 #endif
242 #ifdef FEAT_EMACS_TAGS
243 	"+emacs_tags",
244 #else
245 	"-emacs_tags",
246 #endif
247 #ifdef FEAT_EVAL
248 	"+eval",
249 #else
250 	"-eval",
251 #endif
252 	"+ex_extra",
253 #ifdef FEAT_SEARCH_EXTRA
254 	"+extra_search",
255 #else
256 	"-extra_search",
257 #endif
258 #ifdef FEAT_FKMAP
259 	"+farsi",
260 #else
261 	"-farsi",
262 #endif
263 #ifdef FEAT_SEARCHPATH
264 	"+file_in_path",
265 #else
266 	"-file_in_path",
267 #endif
268 #ifdef FEAT_FIND_ID
269 	"+find_in_path",
270 #else
271 	"-find_in_path",
272 #endif
273 #ifdef FEAT_FLOAT
274 	"+float",
275 #else
276 	"-float",
277 #endif
278 #ifdef FEAT_FOLDING
279 	"+folding",
280 #else
281 	"-folding",
282 #endif
283 #ifdef FEAT_FOOTER
284 	"+footer",
285 #else
286 	"-footer",
287 #endif
288 	    /* only interesting on Unix systems */
289 #if !defined(USE_SYSTEM) && defined(UNIX)
290 	"+fork()",
291 #endif
292 #ifdef FEAT_GETTEXT
293 # ifdef DYNAMIC_GETTEXT
294 	"+gettext/dyn",
295 # else
296 	"+gettext",
297 # endif
298 #else
299 	"-gettext",
300 #endif
301 #ifdef FEAT_HANGULIN
302 	"+hangul_input",
303 #else
304 	"-hangul_input",
305 #endif
306 #if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
307 # ifdef DYNAMIC_ICONV
308 	"+iconv/dyn",
309 # else
310 	"+iconv",
311 # endif
312 #else
313 	"-iconv",
314 #endif
315 #ifdef FEAT_INS_EXPAND
316 	"+insert_expand",
317 #else
318 	"-insert_expand",
319 #endif
320 #ifdef FEAT_JOB_CHANNEL
321 	"+job",
322 #else
323 	"-job",
324 #endif
325 #ifdef FEAT_JUMPLIST
326 	"+jumplist",
327 #else
328 	"-jumplist",
329 #endif
330 #ifdef FEAT_KEYMAP
331 	"+keymap",
332 #else
333 	"-keymap",
334 #endif
335 #ifdef FEAT_EVAL
336 	"+lambda",
337 #else
338 	"-lambda",
339 #endif
340 #ifdef FEAT_LANGMAP
341 	"+langmap",
342 #else
343 	"-langmap",
344 #endif
345 #ifdef FEAT_LIBCALL
346 	"+libcall",
347 #else
348 	"-libcall",
349 #endif
350 #ifdef FEAT_LINEBREAK
351 	"+linebreak",
352 #else
353 	"-linebreak",
354 #endif
355 #ifdef FEAT_LISP
356 	"+lispindent",
357 #else
358 	"-lispindent",
359 #endif
360 	"+listcmds",
361 #ifdef FEAT_LOCALMAP
362 	"+localmap",
363 #else
364 	"-localmap",
365 #endif
366 #ifdef FEAT_LUA
367 # ifdef DYNAMIC_LUA
368 	"+lua/dyn",
369 # else
370 	"+lua",
371 # endif
372 #else
373 	"-lua",
374 #endif
375 #ifdef FEAT_MENU
376 	"+menu",
377 #else
378 	"-menu",
379 #endif
380 #ifdef FEAT_SESSION
381 	"+mksession",
382 #else
383 	"-mksession",
384 #endif
385 #ifdef FEAT_MODIFY_FNAME
386 	"+modify_fname",
387 #else
388 	"-modify_fname",
389 #endif
390 #ifdef FEAT_MOUSE
391 	"+mouse",
392 #  ifdef FEAT_MOUSESHAPE
393 	"+mouseshape",
394 #  else
395 	"-mouseshape",
396 #  endif
397 # else
398 	"-mouse",
399 #endif
400 
401 #if defined(UNIX) || defined(VMS)
402 # ifdef FEAT_MOUSE_DEC
403 	"+mouse_dec",
404 # else
405 	"-mouse_dec",
406 # endif
407 # ifdef FEAT_MOUSE_GPM
408 	"+mouse_gpm",
409 # else
410 	"-mouse_gpm",
411 # endif
412 # ifdef FEAT_MOUSE_JSB
413 	"+mouse_jsbterm",
414 # else
415 	"-mouse_jsbterm",
416 # endif
417 # ifdef FEAT_MOUSE_NET
418 	"+mouse_netterm",
419 # else
420 	"-mouse_netterm",
421 # endif
422 #endif
423 
424 #ifdef __QNX__
425 # ifdef FEAT_MOUSE_PTERM
426 	"+mouse_pterm",
427 # else
428 	"-mouse_pterm",
429 # endif
430 #endif
431 
432 #if defined(UNIX) || defined(VMS)
433 # ifdef FEAT_MOUSE_SGR
434 	"+mouse_sgr",
435 # else
436 	"-mouse_sgr",
437 # endif
438 # ifdef FEAT_SYSMOUSE
439 	"+mouse_sysmouse",
440 # else
441 	"-mouse_sysmouse",
442 # endif
443 # ifdef FEAT_MOUSE_URXVT
444 	"+mouse_urxvt",
445 # else
446 	"-mouse_urxvt",
447 # endif
448 # ifdef FEAT_MOUSE_XTERM
449 	"+mouse_xterm",
450 # else
451 	"-mouse_xterm",
452 # endif
453 #endif
454 
455 #ifdef FEAT_MBYTE_IME
456 # ifdef DYNAMIC_IME
457 	"+multi_byte_ime/dyn",
458 # else
459 	"+multi_byte_ime",
460 # endif
461 #else
462 # ifdef FEAT_MBYTE
463 	"+multi_byte",
464 # else
465 	"-multi_byte",
466 # endif
467 #endif
468 #ifdef FEAT_MULTI_LANG
469 	"+multi_lang",
470 #else
471 	"-multi_lang",
472 #endif
473 #ifdef FEAT_MZSCHEME
474 # ifdef DYNAMIC_MZSCHEME
475 	"+mzscheme/dyn",
476 # else
477 	"+mzscheme",
478 # endif
479 #else
480 	"-mzscheme",
481 #endif
482 #ifdef FEAT_NETBEANS_INTG
483 	"+netbeans_intg",
484 #else
485 	"-netbeans_intg",
486 #endif
487 #ifdef FEAT_NUM64
488 	"+num64",
489 #else
490 	"-num64",
491 #endif
492 #ifdef FEAT_GUI_W32
493 # ifdef FEAT_OLE
494 	"+ole",
495 # else
496 	"-ole",
497 # endif
498 #endif
499 #ifdef FEAT_EVAL
500 	"+packages",
501 #else
502 	"-packages",
503 #endif
504 #ifdef FEAT_PATH_EXTRA
505 	"+path_extra",
506 #else
507 	"-path_extra",
508 #endif
509 #ifdef FEAT_PERL
510 # ifdef DYNAMIC_PERL
511 	"+perl/dyn",
512 # else
513 	"+perl",
514 # endif
515 #else
516 	"-perl",
517 #endif
518 #ifdef FEAT_PERSISTENT_UNDO
519 	"+persistent_undo",
520 #else
521 	"-persistent_undo",
522 #endif
523 #ifdef FEAT_PRINTER
524 # ifdef FEAT_POSTSCRIPT
525 	"+postscript",
526 # else
527 	"-postscript",
528 # endif
529 	"+printer",
530 #else
531 	"-printer",
532 #endif
533 #ifdef FEAT_PROFILE
534 	"+profile",
535 #else
536 	"-profile",
537 #endif
538 #ifdef FEAT_PYTHON
539 # ifdef DYNAMIC_PYTHON
540 	"+python/dyn",
541 # else
542 	"+python",
543 # endif
544 #else
545 	"-python",
546 #endif
547 #ifdef FEAT_PYTHON3
548 # ifdef DYNAMIC_PYTHON3
549 	"+python3/dyn",
550 # else
551 	"+python3",
552 # endif
553 #else
554 	"-python3",
555 #endif
556 #ifdef FEAT_QUICKFIX
557 	"+quickfix",
558 #else
559 	"-quickfix",
560 #endif
561 #ifdef FEAT_RELTIME
562 	"+reltime",
563 #else
564 	"-reltime",
565 #endif
566 #ifdef FEAT_RIGHTLEFT
567 	"+rightleft",
568 #else
569 	"-rightleft",
570 #endif
571 #ifdef FEAT_RUBY
572 # ifdef DYNAMIC_RUBY
573 	"+ruby/dyn",
574 # else
575 	"+ruby",
576 # endif
577 #else
578 	"-ruby",
579 #endif
580 	"+scrollbind",
581 #ifdef FEAT_SIGNS
582 	"+signs",
583 #else
584 	"-signs",
585 #endif
586 #ifdef FEAT_SMARTINDENT
587 	"+smartindent",
588 #else
589 	"-smartindent",
590 #endif
591 #ifdef STARTUPTIME
592 	"+startuptime",
593 #else
594 	"-startuptime",
595 #endif
596 #ifdef FEAT_STL_OPT
597 	"+statusline",
598 #else
599 	"-statusline",
600 #endif
601 #ifdef FEAT_SUN_WORKSHOP
602 	"+sun_workshop",
603 #else
604 	"-sun_workshop",
605 #endif
606 #ifdef FEAT_SYN_HL
607 	"+syntax",
608 #else
609 	"-syntax",
610 #endif
611 	    /* only interesting on Unix systems */
612 #if defined(USE_SYSTEM) && defined(UNIX)
613 	"+system()",
614 #endif
615 #ifdef FEAT_TAG_BINS
616 	"+tag_binary",
617 #else
618 	"-tag_binary",
619 #endif
620 #ifdef FEAT_TAG_OLDSTATIC
621 	"+tag_old_static",
622 #else
623 	"-tag_old_static",
624 #endif
625 #ifdef FEAT_TAG_ANYWHITE
626 	"+tag_any_white",
627 #else
628 	"-tag_any_white",
629 #endif
630 #ifdef FEAT_TCL
631 # ifdef DYNAMIC_TCL
632 	"+tcl/dyn",
633 # else
634 	"+tcl",
635 # endif
636 #else
637 	"-tcl",
638 #endif
639 #ifdef FEAT_TERMGUICOLORS
640 	"+termguicolors",
641 #else
642 	"-termguicolors",
643 #endif
644 #ifdef FEAT_TERMINAL
645 	"+terminal",
646 #else
647 	"-terminal",
648 #endif
649 #if defined(UNIX)
650 /* only Unix can have terminfo instead of termcap */
651 # ifdef TERMINFO
652 	"+terminfo",
653 # else
654 	"-terminfo",
655 # endif
656 #else		    /* unix always includes termcap support */
657 # ifdef HAVE_TGETENT
658 	"+tgetent",
659 # else
660 	"-tgetent",
661 # endif
662 #endif
663 #ifdef FEAT_TERMRESPONSE
664 	"+termresponse",
665 #else
666 	"-termresponse",
667 #endif
668 #ifdef FEAT_TEXTOBJ
669 	"+textobjects",
670 #else
671 	"-textobjects",
672 #endif
673 #ifdef FEAT_TIMERS
674 	"+timers",
675 #else
676 	"-timers",
677 #endif
678 #ifdef FEAT_TITLE
679 	"+title",
680 #else
681 	"-title",
682 #endif
683 #ifdef FEAT_TOOLBAR
684 	"+toolbar",
685 #else
686 	"-toolbar",
687 #endif
688 #ifdef FEAT_USR_CMDS
689 	"+user_commands",
690 #else
691 	"-user_commands",
692 #endif
693 #ifdef FEAT_VARTABS
694 	"+vartabs",
695 #else
696 	"-vartabs",
697 #endif
698 	"+vertsplit",
699 #ifdef FEAT_VIRTUALEDIT
700 	"+virtualedit",
701 #else
702 	"-virtualedit",
703 #endif
704 	"+visual",
705 #ifdef FEAT_VISUALEXTRA
706 	"+visualextra",
707 #else
708 	"-visualextra",
709 #endif
710 #ifdef FEAT_VIMINFO
711 	"+viminfo",
712 #else
713 	"-viminfo",
714 #endif
715 	"+vreplace",
716 #ifdef WIN3264
717 # ifdef FEAT_VTP
718 	"+vtp",
719 # else
720 	"-vtp",
721 # endif
722 #endif
723 #ifdef FEAT_WILDIGN
724 	"+wildignore",
725 #else
726 	"-wildignore",
727 #endif
728 #ifdef FEAT_WILDMENU
729 	"+wildmenu",
730 #else
731 	"-wildmenu",
732 #endif
733 	"+windows",
734 #ifdef FEAT_WRITEBACKUP
735 	"+writebackup",
736 #else
737 	"-writebackup",
738 #endif
739 #if defined(UNIX) || defined(VMS)
740 # ifdef FEAT_X11
741 	"+X11",
742 # else
743 	"-X11",
744 # endif
745 #endif
746 #ifdef FEAT_XFONTSET
747 	"+xfontset",
748 #else
749 	"-xfontset",
750 #endif
751 #ifdef FEAT_XIM
752 	"+xim",
753 #else
754 	"-xim",
755 #endif
756 #ifdef WIN3264
757 # ifdef FEAT_XPM_W32
758 	"+xpm_w32",
759 # else
760 	"-xpm_w32",
761 # endif
762 #else
763 # ifdef HAVE_XPM
764 	"+xpm",
765 # else
766 	"-xpm",
767 # endif
768 #endif
769 #if defined(UNIX) || defined(VMS)
770 # ifdef USE_XSMP_INTERACT
771 	"+xsmp_interact",
772 # else
773 #  ifdef USE_XSMP
774 	"+xsmp",
775 #  else
776 	"-xsmp",
777 #  endif
778 # endif
779 # ifdef FEAT_XCLIPBOARD
780 	"+xterm_clipboard",
781 # else
782 	"-xterm_clipboard",
783 # endif
784 #endif
785 #ifdef FEAT_XTERM_SAVE
786 	"+xterm_save",
787 #else
788 	"-xterm_save",
789 #endif
790 	NULL
791 };
792 
793 static int included_patches[] =
794 {   /* Add new patch number below this line */
795 /**/
796     545,
797 /**/
798     544,
799 /**/
800     543,
801 /**/
802     542,
803 /**/
804     541,
805 /**/
806     540,
807 /**/
808     539,
809 /**/
810     538,
811 /**/
812     537,
813 /**/
814     536,
815 /**/
816     535,
817 /**/
818     534,
819 /**/
820     533,
821 /**/
822     532,
823 /**/
824     531,
825 /**/
826     530,
827 /**/
828     529,
829 /**/
830     528,
831 /**/
832     527,
833 /**/
834     526,
835 /**/
836     525,
837 /**/
838     524,
839 /**/
840     523,
841 /**/
842     522,
843 /**/
844     521,
845 /**/
846     520,
847 /**/
848     519,
849 /**/
850     518,
851 /**/
852     517,
853 /**/
854     516,
855 /**/
856     515,
857 /**/
858     514,
859 /**/
860     513,
861 /**/
862     512,
863 /**/
864     511,
865 /**/
866     510,
867 /**/
868     509,
869 /**/
870     508,
871 /**/
872     507,
873 /**/
874     506,
875 /**/
876     505,
877 /**/
878     504,
879 /**/
880     503,
881 /**/
882     502,
883 /**/
884     501,
885 /**/
886     500,
887 /**/
888     499,
889 /**/
890     498,
891 /**/
892     497,
893 /**/
894     496,
895 /**/
896     495,
897 /**/
898     494,
899 /**/
900     493,
901 /**/
902     492,
903 /**/
904     491,
905 /**/
906     490,
907 /**/
908     489,
909 /**/
910     488,
911 /**/
912     487,
913 /**/
914     486,
915 /**/
916     485,
917 /**/
918     484,
919 /**/
920     483,
921 /**/
922     482,
923 /**/
924     481,
925 /**/
926     480,
927 /**/
928     479,
929 /**/
930     478,
931 /**/
932     477,
933 /**/
934     476,
935 /**/
936     475,
937 /**/
938     474,
939 /**/
940     473,
941 /**/
942     472,
943 /**/
944     471,
945 /**/
946     470,
947 /**/
948     469,
949 /**/
950     468,
951 /**/
952     467,
953 /**/
954     466,
955 /**/
956     465,
957 /**/
958     464,
959 /**/
960     463,
961 /**/
962     462,
963 /**/
964     461,
965 /**/
966     460,
967 /**/
968     459,
969 /**/
970     458,
971 /**/
972     457,
973 /**/
974     456,
975 /**/
976     455,
977 /**/
978     454,
979 /**/
980     453,
981 /**/
982     452,
983 /**/
984     451,
985 /**/
986     450,
987 /**/
988     449,
989 /**/
990     448,
991 /**/
992     447,
993 /**/
994     446,
995 /**/
996     445,
997 /**/
998     444,
999 /**/
1000     443,
1001 /**/
1002     442,
1003 /**/
1004     441,
1005 /**/
1006     440,
1007 /**/
1008     439,
1009 /**/
1010     438,
1011 /**/
1012     437,
1013 /**/
1014     436,
1015 /**/
1016     435,
1017 /**/
1018     434,
1019 /**/
1020     433,
1021 /**/
1022     432,
1023 /**/
1024     431,
1025 /**/
1026     430,
1027 /**/
1028     429,
1029 /**/
1030     428,
1031 /**/
1032     427,
1033 /**/
1034     426,
1035 /**/
1036     425,
1037 /**/
1038     424,
1039 /**/
1040     423,
1041 /**/
1042     422,
1043 /**/
1044     421,
1045 /**/
1046     420,
1047 /**/
1048     419,
1049 /**/
1050     418,
1051 /**/
1052     417,
1053 /**/
1054     416,
1055 /**/
1056     415,
1057 /**/
1058     414,
1059 /**/
1060     413,
1061 /**/
1062     412,
1063 /**/
1064     411,
1065 /**/
1066     410,
1067 /**/
1068     409,
1069 /**/
1070     408,
1071 /**/
1072     407,
1073 /**/
1074     406,
1075 /**/
1076     405,
1077 /**/
1078     404,
1079 /**/
1080     403,
1081 /**/
1082     402,
1083 /**/
1084     401,
1085 /**/
1086     400,
1087 /**/
1088     399,
1089 /**/
1090     398,
1091 /**/
1092     397,
1093 /**/
1094     396,
1095 /**/
1096     395,
1097 /**/
1098     394,
1099 /**/
1100     393,
1101 /**/
1102     392,
1103 /**/
1104     391,
1105 /**/
1106     390,
1107 /**/
1108     389,
1109 /**/
1110     388,
1111 /**/
1112     387,
1113 /**/
1114     386,
1115 /**/
1116     385,
1117 /**/
1118     384,
1119 /**/
1120     383,
1121 /**/
1122     382,
1123 /**/
1124     381,
1125 /**/
1126     380,
1127 /**/
1128     379,
1129 /**/
1130     378,
1131 /**/
1132     377,
1133 /**/
1134     376,
1135 /**/
1136     375,
1137 /**/
1138     374,
1139 /**/
1140     373,
1141 /**/
1142     372,
1143 /**/
1144     371,
1145 /**/
1146     370,
1147 /**/
1148     369,
1149 /**/
1150     368,
1151 /**/
1152     367,
1153 /**/
1154     366,
1155 /**/
1156     365,
1157 /**/
1158     364,
1159 /**/
1160     363,
1161 /**/
1162     362,
1163 /**/
1164     361,
1165 /**/
1166     360,
1167 /**/
1168     359,
1169 /**/
1170     358,
1171 /**/
1172     357,
1173 /**/
1174     356,
1175 /**/
1176     355,
1177 /**/
1178     354,
1179 /**/
1180     353,
1181 /**/
1182     352,
1183 /**/
1184     351,
1185 /**/
1186     350,
1187 /**/
1188     349,
1189 /**/
1190     348,
1191 /**/
1192     347,
1193 /**/
1194     346,
1195 /**/
1196     345,
1197 /**/
1198     344,
1199 /**/
1200     343,
1201 /**/
1202     342,
1203 /**/
1204     341,
1205 /**/
1206     340,
1207 /**/
1208     339,
1209 /**/
1210     338,
1211 /**/
1212     337,
1213 /**/
1214     336,
1215 /**/
1216     335,
1217 /**/
1218     334,
1219 /**/
1220     333,
1221 /**/
1222     332,
1223 /**/
1224     331,
1225 /**/
1226     330,
1227 /**/
1228     329,
1229 /**/
1230     328,
1231 /**/
1232     327,
1233 /**/
1234     326,
1235 /**/
1236     325,
1237 /**/
1238     324,
1239 /**/
1240     323,
1241 /**/
1242     322,
1243 /**/
1244     321,
1245 /**/
1246     320,
1247 /**/
1248     319,
1249 /**/
1250     318,
1251 /**/
1252     317,
1253 /**/
1254     316,
1255 /**/
1256     315,
1257 /**/
1258     314,
1259 /**/
1260     313,
1261 /**/
1262     312,
1263 /**/
1264     311,
1265 /**/
1266     310,
1267 /**/
1268     309,
1269 /**/
1270     308,
1271 /**/
1272     307,
1273 /**/
1274     306,
1275 /**/
1276     305,
1277 /**/
1278     304,
1279 /**/
1280     303,
1281 /**/
1282     302,
1283 /**/
1284     301,
1285 /**/
1286     300,
1287 /**/
1288     299,
1289 /**/
1290     298,
1291 /**/
1292     297,
1293 /**/
1294     296,
1295 /**/
1296     295,
1297 /**/
1298     294,
1299 /**/
1300     293,
1301 /**/
1302     292,
1303 /**/
1304     291,
1305 /**/
1306     290,
1307 /**/
1308     289,
1309 /**/
1310     288,
1311 /**/
1312     287,
1313 /**/
1314     286,
1315 /**/
1316     285,
1317 /**/
1318     284,
1319 /**/
1320     283,
1321 /**/
1322     282,
1323 /**/
1324     281,
1325 /**/
1326     280,
1327 /**/
1328     279,
1329 /**/
1330     278,
1331 /**/
1332     277,
1333 /**/
1334     276,
1335 /**/
1336     275,
1337 /**/
1338     274,
1339 /**/
1340     273,
1341 /**/
1342     272,
1343 /**/
1344     271,
1345 /**/
1346     270,
1347 /**/
1348     269,
1349 /**/
1350     268,
1351 /**/
1352     267,
1353 /**/
1354     266,
1355 /**/
1356     265,
1357 /**/
1358     264,
1359 /**/
1360     263,
1361 /**/
1362     262,
1363 /**/
1364     261,
1365 /**/
1366     260,
1367 /**/
1368     259,
1369 /**/
1370     258,
1371 /**/
1372     257,
1373 /**/
1374     256,
1375 /**/
1376     255,
1377 /**/
1378     254,
1379 /**/
1380     253,
1381 /**/
1382     252,
1383 /**/
1384     251,
1385 /**/
1386     250,
1387 /**/
1388     249,
1389 /**/
1390     248,
1391 /**/
1392     247,
1393 /**/
1394     246,
1395 /**/
1396     245,
1397 /**/
1398     244,
1399 /**/
1400     243,
1401 /**/
1402     242,
1403 /**/
1404     241,
1405 /**/
1406     240,
1407 /**/
1408     239,
1409 /**/
1410     238,
1411 /**/
1412     237,
1413 /**/
1414     236,
1415 /**/
1416     235,
1417 /**/
1418     234,
1419 /**/
1420     233,
1421 /**/
1422     232,
1423 /**/
1424     231,
1425 /**/
1426     230,
1427 /**/
1428     229,
1429 /**/
1430     228,
1431 /**/
1432     227,
1433 /**/
1434     226,
1435 /**/
1436     225,
1437 /**/
1438     224,
1439 /**/
1440     223,
1441 /**/
1442     222,
1443 /**/
1444     221,
1445 /**/
1446     220,
1447 /**/
1448     219,
1449 /**/
1450     218,
1451 /**/
1452     217,
1453 /**/
1454     216,
1455 /**/
1456     215,
1457 /**/
1458     214,
1459 /**/
1460     213,
1461 /**/
1462     212,
1463 /**/
1464     211,
1465 /**/
1466     210,
1467 /**/
1468     209,
1469 /**/
1470     208,
1471 /**/
1472     207,
1473 /**/
1474     206,
1475 /**/
1476     205,
1477 /**/
1478     204,
1479 /**/
1480     203,
1481 /**/
1482     202,
1483 /**/
1484     201,
1485 /**/
1486     200,
1487 /**/
1488     199,
1489 /**/
1490     198,
1491 /**/
1492     197,
1493 /**/
1494     196,
1495 /**/
1496     195,
1497 /**/
1498     194,
1499 /**/
1500     193,
1501 /**/
1502     192,
1503 /**/
1504     191,
1505 /**/
1506     190,
1507 /**/
1508     189,
1509 /**/
1510     188,
1511 /**/
1512     187,
1513 /**/
1514     186,
1515 /**/
1516     185,
1517 /**/
1518     184,
1519 /**/
1520     183,
1521 /**/
1522     182,
1523 /**/
1524     181,
1525 /**/
1526     180,
1527 /**/
1528     179,
1529 /**/
1530     178,
1531 /**/
1532     177,
1533 /**/
1534     176,
1535 /**/
1536     175,
1537 /**/
1538     174,
1539 /**/
1540     173,
1541 /**/
1542     172,
1543 /**/
1544     171,
1545 /**/
1546     170,
1547 /**/
1548     169,
1549 /**/
1550     168,
1551 /**/
1552     167,
1553 /**/
1554     166,
1555 /**/
1556     165,
1557 /**/
1558     164,
1559 /**/
1560     163,
1561 /**/
1562     162,
1563 /**/
1564     161,
1565 /**/
1566     160,
1567 /**/
1568     159,
1569 /**/
1570     158,
1571 /**/
1572     157,
1573 /**/
1574     156,
1575 /**/
1576     155,
1577 /**/
1578     154,
1579 /**/
1580     153,
1581 /**/
1582     152,
1583 /**/
1584     151,
1585 /**/
1586     150,
1587 /**/
1588     149,
1589 /**/
1590     148,
1591 /**/
1592     147,
1593 /**/
1594     146,
1595 /**/
1596     145,
1597 /**/
1598     144,
1599 /**/
1600     143,
1601 /**/
1602     142,
1603 /**/
1604     141,
1605 /**/
1606     140,
1607 /**/
1608     139,
1609 /**/
1610     138,
1611 /**/
1612     137,
1613 /**/
1614     136,
1615 /**/
1616     135,
1617 /**/
1618     134,
1619 /**/
1620     133,
1621 /**/
1622     132,
1623 /**/
1624     131,
1625 /**/
1626     130,
1627 /**/
1628     129,
1629 /**/
1630     128,
1631 /**/
1632     127,
1633 /**/
1634     126,
1635 /**/
1636     125,
1637 /**/
1638     124,
1639 /**/
1640     123,
1641 /**/
1642     122,
1643 /**/
1644     121,
1645 /**/
1646     120,
1647 /**/
1648     119,
1649 /**/
1650     118,
1651 /**/
1652     117,
1653 /**/
1654     116,
1655 /**/
1656     115,
1657 /**/
1658     114,
1659 /**/
1660     113,
1661 /**/
1662     112,
1663 /**/
1664     111,
1665 /**/
1666     110,
1667 /**/
1668     109,
1669 /**/
1670     108,
1671 /**/
1672     107,
1673 /**/
1674     106,
1675 /**/
1676     105,
1677 /**/
1678     104,
1679 /**/
1680     103,
1681 /**/
1682     102,
1683 /**/
1684     101,
1685 /**/
1686     100,
1687 /**/
1688     99,
1689 /**/
1690     98,
1691 /**/
1692     97,
1693 /**/
1694     96,
1695 /**/
1696     95,
1697 /**/
1698     94,
1699 /**/
1700     93,
1701 /**/
1702     92,
1703 /**/
1704     91,
1705 /**/
1706     90,
1707 /**/
1708     89,
1709 /**/
1710     88,
1711 /**/
1712     87,
1713 /**/
1714     86,
1715 /**/
1716     85,
1717 /**/
1718     84,
1719 /**/
1720     83,
1721 /**/
1722     82,
1723 /**/
1724     81,
1725 /**/
1726     80,
1727 /**/
1728     79,
1729 /**/
1730     78,
1731 /**/
1732     77,
1733 /**/
1734     76,
1735 /**/
1736     75,
1737 /**/
1738     74,
1739 /**/
1740     73,
1741 /**/
1742     72,
1743 /**/
1744     71,
1745 /**/
1746     70,
1747 /**/
1748     69,
1749 /**/
1750     68,
1751 /**/
1752     67,
1753 /**/
1754     66,
1755 /**/
1756     65,
1757 /**/
1758     64,
1759 /**/
1760     63,
1761 /**/
1762     62,
1763 /**/
1764     61,
1765 /**/
1766     60,
1767 /**/
1768     59,
1769 /**/
1770     58,
1771 /**/
1772     57,
1773 /**/
1774     56,
1775 /**/
1776     55,
1777 /**/
1778     54,
1779 /**/
1780     53,
1781 /**/
1782     52,
1783 /**/
1784     51,
1785 /**/
1786     50,
1787 /**/
1788     49,
1789 /**/
1790     48,
1791 /**/
1792     47,
1793 /**/
1794     46,
1795 /**/
1796     45,
1797 /**/
1798     44,
1799 /**/
1800     43,
1801 /**/
1802     42,
1803 /**/
1804     41,
1805 /**/
1806     40,
1807 /**/
1808     39,
1809 /**/
1810     38,
1811 /**/
1812     37,
1813 /**/
1814     36,
1815 /**/
1816     35,
1817 /**/
1818     34,
1819 /**/
1820     33,
1821 /**/
1822     32,
1823 /**/
1824     31,
1825 /**/
1826     30,
1827 /**/
1828     29,
1829 /**/
1830     28,
1831 /**/
1832     27,
1833 /**/
1834     26,
1835 /**/
1836     25,
1837 /**/
1838     24,
1839 /**/
1840     23,
1841 /**/
1842     22,
1843 /**/
1844     21,
1845 /**/
1846     20,
1847 /**/
1848     19,
1849 /**/
1850     18,
1851 /**/
1852     17,
1853 /**/
1854     16,
1855 /**/
1856     15,
1857 /**/
1858     14,
1859 /**/
1860     13,
1861 /**/
1862     12,
1863 /**/
1864     11,
1865 /**/
1866     10,
1867 /**/
1868     9,
1869 /**/
1870     8,
1871 /**/
1872     7,
1873 /**/
1874     6,
1875 /**/
1876     5,
1877 /**/
1878     4,
1879 /**/
1880     3,
1881 /**/
1882     2,
1883 /**/
1884     1,
1885 /**/
1886     0
1887 };
1888 
1889 /*
1890  * Place to put a short description when adding a feature with a patch.
1891  * Keep it short, e.g.,: "relative numbers", "persistent undo".
1892  * Also add a comment marker to separate the lines.
1893  * See the official Vim patches for the diff format: It must use a context of
1894  * one line only.  Create it by hand or use "diff -C2" and edit the patch.
1895  */
1896 static char *(extra_patches[]) =
1897 {   /* Add your patch description below this line */
1898 /**/
1899     NULL
1900 };
1901 
1902     int
1903 highest_patch(void)
1904 {
1905     int		i;
1906     int		h = 0;
1907 
1908     for (i = 0; included_patches[i] != 0; ++i)
1909 	if (included_patches[i] > h)
1910 	    h = included_patches[i];
1911     return h;
1912 }
1913 
1914 #if defined(FEAT_EVAL) || defined(PROTO)
1915 /*
1916  * Return TRUE if patch "n" has been included.
1917  */
1918     int
1919 has_patch(int n)
1920 {
1921     int		i;
1922 
1923     for (i = 0; included_patches[i] != 0; ++i)
1924 	if (included_patches[i] == n)
1925 	    return TRUE;
1926     return FALSE;
1927 }
1928 #endif
1929 
1930     void
1931 ex_version(exarg_T *eap)
1932 {
1933     /*
1934      * Ignore a ":version 9.99" command.
1935      */
1936     if (*eap->arg == NUL)
1937     {
1938 	msg_putchar('\n');
1939 	list_version();
1940     }
1941 }
1942 
1943 /*
1944  * Output a string for the version message.  If it's going to wrap, output a
1945  * newline, unless the message is too long to fit on the screen anyway.
1946  * When "wrap" is TRUE wrap the string in [].
1947  */
1948     static void
1949 version_msg_wrap(char_u *s, int wrap)
1950 {
1951     int		len = (int)vim_strsize(s) + (wrap ? 2 : 0);
1952 
1953     if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1954 								&& *s != '\n')
1955 	msg_putchar('\n');
1956     if (!got_int)
1957     {
1958 	if (wrap)
1959 	    MSG_PUTS("[");
1960 	MSG_PUTS(s);
1961 	if (wrap)
1962 	    MSG_PUTS("]");
1963     }
1964 }
1965 
1966     static void
1967 version_msg(char *s)
1968 {
1969     version_msg_wrap((char_u *)s, FALSE);
1970 }
1971 
1972 /*
1973  * List all features aligned in columns, dictionary style.
1974  */
1975     static void
1976 list_features(void)
1977 {
1978     list_in_columns((char_u **)features, -1, -1);
1979 }
1980 
1981 /*
1982  * List string items nicely aligned in columns.
1983  * When "size" is < 0 then the last entry is marked with NULL.
1984  * The entry with index "current" is inclosed in [].
1985  */
1986     void
1987 list_in_columns(char_u **items, int size, int current)
1988 {
1989     int		i;
1990     int		ncol;
1991     int		nrow;
1992     int		item_count = 0;
1993     int		width = 0;
1994 
1995     /* Find the length of the longest item, use that + 1 as the column
1996      * width. */
1997     for (i = 0; size < 0 ? items[i] != NULL : i < size; ++i)
1998     {
1999 	int l = (int)vim_strsize(items[i]) + (i == current ? 2 : 0);
2000 
2001 	if (l > width)
2002 	    width = l;
2003 	++item_count;
2004     }
2005     width += 1;
2006 
2007     if (Columns < width)
2008     {
2009 	/* Not enough screen columns - show one per line */
2010 	for (i = 0; i < item_count; ++i)
2011 	{
2012 	    version_msg_wrap(items[i], i == current);
2013 	    if (msg_col > 0)
2014 		msg_putchar('\n');
2015 	}
2016 	return;
2017     }
2018 
2019     /* The rightmost column doesn't need a separator.
2020      * Sacrifice it to fit in one more column if possible. */
2021     ncol = (int) (Columns + 1) / width;
2022     nrow = item_count / ncol + (item_count % ncol ? 1 : 0);
2023 
2024     /* i counts columns then rows.  idx counts rows then columns. */
2025     for (i = 0; !got_int && i < nrow * ncol; ++i)
2026     {
2027 	int idx = (i / ncol) + (i % ncol) * nrow;
2028 
2029 	if (idx < item_count)
2030 	{
2031 	    int last_col = (i + 1) % ncol == 0;
2032 
2033 	    if (idx == current)
2034 		msg_putchar('[');
2035 	    msg_puts(items[idx]);
2036 	    if (idx == current)
2037 		msg_putchar(']');
2038 	    if (last_col)
2039 	    {
2040 		if (msg_col > 0)
2041 		    msg_putchar('\n');
2042 	    }
2043 	    else
2044 	    {
2045 		while (msg_col % width)
2046 		    msg_putchar(' ');
2047 	    }
2048 	}
2049 	else
2050 	{
2051 	    if (msg_col > 0)
2052 		msg_putchar('\n');
2053 	}
2054     }
2055 }
2056 
2057     void
2058 list_version(void)
2059 {
2060     int		i;
2061     int		first;
2062     char	*s = "";
2063 
2064     /*
2065      * When adding features here, don't forget to update the list of
2066      * internal variables in eval.c!
2067      */
2068     init_longVersion();
2069     MSG(longVersion);
2070 #ifdef WIN3264
2071 # ifdef FEAT_GUI_W32
2072 #  ifdef _WIN64
2073     MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
2074 #  else
2075     MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
2076 #  endif
2077 # ifdef FEAT_OLE
2078     MSG_PUTS(_(" with OLE support"));
2079 # endif
2080 # else
2081 #  ifdef _WIN64
2082     MSG_PUTS(_("\nMS-Windows 64-bit console version"));
2083 #  else
2084     MSG_PUTS(_("\nMS-Windows 32-bit console version"));
2085 #  endif
2086 # endif
2087 #endif
2088 #if defined(MACOS_X)
2089 # if defined(MACOS_X_DARWIN)
2090     MSG_PUTS(_("\nmacOS version"));
2091 # else
2092     MSG_PUTS(_("\nmacOS version w/o darwin feat."));
2093 # endif
2094 #endif
2095 
2096 #ifdef VMS
2097     MSG_PUTS(_("\nOpenVMS version"));
2098 # ifdef HAVE_PATHDEF
2099     if (*compiled_arch != NUL)
2100     {
2101 	MSG_PUTS(" - ");
2102 	MSG_PUTS(compiled_arch);
2103     }
2104 # endif
2105 
2106 #endif
2107 
2108     /* Print the list of patch numbers if there is at least one. */
2109     /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
2110     if (included_patches[0] != 0)
2111     {
2112 	MSG_PUTS(_("\nIncluded patches: "));
2113 	first = -1;
2114 	/* find last one */
2115 	for (i = 0; included_patches[i] != 0; ++i)
2116 	    ;
2117 	while (--i >= 0)
2118 	{
2119 	    if (first < 0)
2120 		first = included_patches[i];
2121 	    if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
2122 	    {
2123 		MSG_PUTS(s);
2124 		s = ", ";
2125 		msg_outnum((long)first);
2126 		if (first != included_patches[i])
2127 		{
2128 		    MSG_PUTS("-");
2129 		    msg_outnum((long)included_patches[i]);
2130 		}
2131 		first = -1;
2132 	    }
2133 	}
2134     }
2135 
2136     /* Print the list of extra patch descriptions if there is at least one. */
2137     if (extra_patches[0] != NULL)
2138     {
2139 	MSG_PUTS(_("\nExtra patches: "));
2140 	s = "";
2141 	for (i = 0; extra_patches[i] != NULL; ++i)
2142 	{
2143 	    MSG_PUTS(s);
2144 	    s = ", ";
2145 	    MSG_PUTS(extra_patches[i]);
2146 	}
2147     }
2148 
2149 #ifdef MODIFIED_BY
2150     MSG_PUTS("\n");
2151     MSG_PUTS(_("Modified by "));
2152     MSG_PUTS(MODIFIED_BY);
2153 #endif
2154 
2155 #ifdef HAVE_PATHDEF
2156     if (*compiled_user != NUL || *compiled_sys != NUL)
2157     {
2158 	MSG_PUTS(_("\nCompiled "));
2159 	if (*compiled_user != NUL)
2160 	{
2161 	    MSG_PUTS(_("by "));
2162 	    MSG_PUTS(compiled_user);
2163 	}
2164 	if (*compiled_sys != NUL)
2165 	{
2166 	    MSG_PUTS("@");
2167 	    MSG_PUTS(compiled_sys);
2168 	}
2169     }
2170 #endif
2171 
2172 #ifdef FEAT_HUGE
2173     MSG_PUTS(_("\nHuge version "));
2174 #else
2175 # ifdef FEAT_BIG
2176     MSG_PUTS(_("\nBig version "));
2177 # else
2178 #  ifdef FEAT_NORMAL
2179     MSG_PUTS(_("\nNormal version "));
2180 #  else
2181 #   ifdef FEAT_SMALL
2182     MSG_PUTS(_("\nSmall version "));
2183 #   else
2184     MSG_PUTS(_("\nTiny version "));
2185 #   endif
2186 #  endif
2187 # endif
2188 #endif
2189 #ifndef FEAT_GUI
2190     MSG_PUTS(_("without GUI."));
2191 #else
2192 # ifdef FEAT_GUI_GTK
2193 #  ifdef USE_GTK3
2194     MSG_PUTS(_("with GTK3 GUI."));
2195 #  else
2196 #   ifdef FEAT_GUI_GNOME
2197      MSG_PUTS(_("with GTK2-GNOME GUI."));
2198 #   else
2199      MSG_PUTS(_("with GTK2 GUI."));
2200 #   endif
2201 # endif
2202 # else
2203 #  ifdef FEAT_GUI_MOTIF
2204     MSG_PUTS(_("with X11-Motif GUI."));
2205 #  else
2206 #   ifdef FEAT_GUI_ATHENA
2207 #    ifdef FEAT_GUI_NEXTAW
2208     MSG_PUTS(_("with X11-neXtaw GUI."));
2209 #    else
2210     MSG_PUTS(_("with X11-Athena GUI."));
2211 #    endif
2212 #   else
2213 #     ifdef FEAT_GUI_PHOTON
2214     MSG_PUTS(_("with Photon GUI."));
2215 #     else
2216 #      if defined(MSWIN)
2217     MSG_PUTS(_("with GUI."));
2218 #      else
2219 #	if defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
2220     MSG_PUTS(_("with Carbon GUI."));
2221 #	else
2222 #	 if defined(TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
2223     MSG_PUTS(_("with Cocoa GUI."));
2224 #	 else
2225 #	 endif
2226 #	endif
2227 #      endif
2228 #    endif
2229 #   endif
2230 #  endif
2231 # endif
2232 #endif
2233     version_msg(_("  Features included (+) or not (-):\n"));
2234 
2235     list_features();
2236 
2237 #ifdef SYS_VIMRC_FILE
2238     version_msg(_("   system vimrc file: \""));
2239     version_msg(SYS_VIMRC_FILE);
2240     version_msg("\"\n");
2241 #endif
2242 #ifdef USR_VIMRC_FILE
2243     version_msg(_("     user vimrc file: \""));
2244     version_msg(USR_VIMRC_FILE);
2245     version_msg("\"\n");
2246 #endif
2247 #ifdef USR_VIMRC_FILE2
2248     version_msg(_(" 2nd user vimrc file: \""));
2249     version_msg(USR_VIMRC_FILE2);
2250     version_msg("\"\n");
2251 #endif
2252 #ifdef USR_VIMRC_FILE3
2253     version_msg(_(" 3rd user vimrc file: \""));
2254     version_msg(USR_VIMRC_FILE3);
2255     version_msg("\"\n");
2256 #endif
2257 #ifdef USR_EXRC_FILE
2258     version_msg(_("      user exrc file: \""));
2259     version_msg(USR_EXRC_FILE);
2260     version_msg("\"\n");
2261 #endif
2262 #ifdef USR_EXRC_FILE2
2263     version_msg(_("  2nd user exrc file: \""));
2264     version_msg(USR_EXRC_FILE2);
2265     version_msg("\"\n");
2266 #endif
2267 #ifdef FEAT_GUI
2268 # ifdef SYS_GVIMRC_FILE
2269     version_msg(_("  system gvimrc file: \""));
2270     version_msg(SYS_GVIMRC_FILE);
2271     version_msg("\"\n");
2272 # endif
2273     version_msg(_("    user gvimrc file: \""));
2274     version_msg(USR_GVIMRC_FILE);
2275     version_msg("\"\n");
2276 # ifdef USR_GVIMRC_FILE2
2277     version_msg(_("2nd user gvimrc file: \""));
2278     version_msg(USR_GVIMRC_FILE2);
2279     version_msg("\"\n");
2280 # endif
2281 # ifdef USR_GVIMRC_FILE3
2282     version_msg(_("3rd user gvimrc file: \""));
2283     version_msg(USR_GVIMRC_FILE3);
2284     version_msg("\"\n");
2285 # endif
2286 #endif
2287     version_msg(_("       defaults file: \""));
2288     version_msg(VIM_DEFAULTS_FILE);
2289     version_msg("\"\n");
2290 #ifdef FEAT_GUI
2291 # ifdef SYS_MENU_FILE
2292     version_msg(_("    system menu file: \""));
2293     version_msg(SYS_MENU_FILE);
2294     version_msg("\"\n");
2295 # endif
2296 #endif
2297 #ifdef HAVE_PATHDEF
2298     if (*default_vim_dir != NUL)
2299     {
2300 	version_msg(_("  fall-back for $VIM: \""));
2301 	version_msg((char *)default_vim_dir);
2302 	version_msg("\"\n");
2303     }
2304     if (*default_vimruntime_dir != NUL)
2305     {
2306 	version_msg(_(" f-b for $VIMRUNTIME: \""));
2307 	version_msg((char *)default_vimruntime_dir);
2308 	version_msg("\"\n");
2309     }
2310     version_msg(_("Compilation: "));
2311     version_msg((char *)all_cflags);
2312     version_msg("\n");
2313 #ifdef VMS
2314     if (*compiler_version != NUL)
2315     {
2316 	version_msg(_("Compiler: "));
2317 	version_msg((char *)compiler_version);
2318 	version_msg("\n");
2319     }
2320 #endif
2321     version_msg(_("Linking: "));
2322     version_msg((char *)all_lflags);
2323 #endif
2324 #ifdef DEBUG
2325     version_msg("\n");
2326     version_msg(_("  DEBUG BUILD"));
2327 #endif
2328 }
2329 
2330 static void do_intro_line(int row, char_u *mesg, int add_version, int attr);
2331 
2332 /*
2333  * Show the intro message when not editing a file.
2334  */
2335     void
2336 maybe_intro_message(void)
2337 {
2338     if (BUFEMPTY()
2339 	    && curbuf->b_fname == NULL
2340 	    && firstwin->w_next == NULL
2341 	    && vim_strchr(p_shm, SHM_INTRO) == NULL)
2342 	intro_message(FALSE);
2343 }
2344 
2345 /*
2346  * Give an introductory message about Vim.
2347  * Only used when starting Vim on an empty file, without a file name.
2348  * Or with the ":intro" command (for Sven :-).
2349  */
2350     void
2351 intro_message(
2352     int		colon)		/* TRUE for ":intro" */
2353 {
2354     int		i;
2355     int		row;
2356     int		blanklines;
2357     int		sponsor;
2358     char	*p;
2359     static char	*(lines[]) =
2360     {
2361 	N_("VIM - Vi IMproved"),
2362 	"",
2363 	N_("version "),
2364 	N_("by Bram Moolenaar et al."),
2365 #ifdef MODIFIED_BY
2366 	" ",
2367 #endif
2368 	N_("Vim is open source and freely distributable"),
2369 	"",
2370 	N_("Help poor children in Uganda!"),
2371 	N_("type  :help iccf<Enter>       for information "),
2372 	"",
2373 	N_("type  :q<Enter>               to exit         "),
2374 	N_("type  :help<Enter>  or  <F1>  for on-line help"),
2375 	N_("type  :help version8<Enter>   for version info"),
2376 	NULL,
2377 	"",
2378 	N_("Running in Vi compatible mode"),
2379 	N_("type  :set nocp<Enter>        for Vim defaults"),
2380 	N_("type  :help cp-default<Enter> for info on this"),
2381     };
2382 #ifdef FEAT_GUI
2383     static char	*(gui_lines[]) =
2384     {
2385 	NULL,
2386 	NULL,
2387 	NULL,
2388 	NULL,
2389 #ifdef MODIFIED_BY
2390 	NULL,
2391 #endif
2392 	NULL,
2393 	NULL,
2394 	NULL,
2395 	N_("menu  Help->Orphans           for information    "),
2396 	NULL,
2397 	N_("Running modeless, typed text is inserted"),
2398 	N_("menu  Edit->Global Settings->Toggle Insert Mode  "),
2399 	N_("                              for two modes      "),
2400 	NULL,
2401 	NULL,
2402 	NULL,
2403 	N_("menu  Edit->Global Settings->Toggle Vi Compatible"),
2404 	N_("                              for Vim defaults   "),
2405     };
2406 #endif
2407 
2408     /* blanklines = screen height - # message lines */
2409     blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
2410     if (!p_cp)
2411 	blanklines += 4;  /* add 4 for not showing "Vi compatible" message */
2412 
2413     /* Don't overwrite a statusline.  Depends on 'cmdheight'. */
2414     if (p_ls > 1)
2415 	blanklines -= Rows - topframe->fr_height;
2416     if (blanklines < 0)
2417 	blanklines = 0;
2418 
2419     /* Show the sponsor and register message one out of four times, the Uganda
2420      * message two out of four times. */
2421     sponsor = (int)time(NULL);
2422     sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
2423 
2424     /* start displaying the message lines after half of the blank lines */
2425     row = blanklines / 2;
2426     if ((row >= 2 && Columns >= 50) || colon)
2427     {
2428 	for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
2429 	{
2430 	    p = lines[i];
2431 #ifdef FEAT_GUI
2432 	    if (p_im && gui.in_use && gui_lines[i] != NULL)
2433 		p = gui_lines[i];
2434 #endif
2435 	    if (p == NULL)
2436 	    {
2437 		if (!p_cp)
2438 		    break;
2439 		continue;
2440 	    }
2441 	    if (sponsor != 0)
2442 	    {
2443 		if (strstr(p, "children") != NULL)
2444 		    p = sponsor < 0
2445 			? N_("Sponsor Vim development!")
2446 			: N_("Become a registered Vim user!");
2447 		else if (strstr(p, "iccf") != NULL)
2448 		    p = sponsor < 0
2449 			? N_("type  :help sponsor<Enter>    for information ")
2450 			: N_("type  :help register<Enter>   for information ");
2451 		else if (strstr(p, "Orphans") != NULL)
2452 		    p = N_("menu  Help->Sponsor/Register  for information    ");
2453 	    }
2454 	    if (*p != NUL)
2455 		do_intro_line(row, (char_u *)_(p), i == 2, 0);
2456 	    ++row;
2457 	}
2458     }
2459 
2460     /* Make the wait-return message appear just below the text. */
2461     if (colon)
2462 	msg_row = row;
2463 }
2464 
2465     static void
2466 do_intro_line(
2467     int		row,
2468     char_u	*mesg,
2469     int		add_version,
2470     int		attr)
2471 {
2472     char_u	vers[20];
2473     int		col;
2474     char_u	*p;
2475     int		l;
2476     int		clen;
2477 #ifdef MODIFIED_BY
2478 # define MODBY_LEN 150
2479     char_u	modby[MODBY_LEN];
2480 
2481     if (*mesg == ' ')
2482     {
2483 	vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
2484 	l = (int)STRLEN(modby);
2485 	vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
2486 	mesg = modby;
2487     }
2488 #endif
2489 
2490     /* Center the message horizontally. */
2491     col = vim_strsize(mesg);
2492     if (add_version)
2493     {
2494 	STRCPY(vers, mediumVersion);
2495 	if (highest_patch())
2496 	{
2497 	    /* Check for 9.9x or 9.9xx, alpha/beta version */
2498 	    if (isalpha((int)vers[3]))
2499 	    {
2500 		int len = (isalpha((int)vers[4])) ? 5 : 4;
2501 		sprintf((char *)vers + len, ".%d%s", highest_patch(),
2502 							 mediumVersion + len);
2503 	    }
2504 	    else
2505 		sprintf((char *)vers + 3, ".%d", highest_patch());
2506 	}
2507 	col += (int)STRLEN(vers);
2508     }
2509     col = (Columns - col) / 2;
2510     if (col < 0)
2511 	col = 0;
2512 
2513     /* Split up in parts to highlight <> items differently. */
2514     for (p = mesg; *p != NUL; p += l)
2515     {
2516 	clen = 0;
2517 	for (l = 0; p[l] != NUL
2518 			 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
2519 	{
2520 #ifdef FEAT_MBYTE
2521 	    if (has_mbyte)
2522 	    {
2523 		clen += ptr2cells(p + l);
2524 		l += (*mb_ptr2len)(p + l) - 1;
2525 	    }
2526 	    else
2527 #endif
2528 		clen += byte2cells(p[l]);
2529 	}
2530 	screen_puts_len(p, l, row, col, *p == '<' ? HL_ATTR(HLF_8) : attr);
2531 	col += clen;
2532     }
2533 
2534     /* Add the version number to the version line. */
2535     if (add_version)
2536 	screen_puts(vers, row, col, 0);
2537 }
2538 
2539 /*
2540  * ":intro": clear screen, display intro screen and wait for return.
2541  */
2542     void
2543 ex_intro(exarg_T *eap UNUSED)
2544 {
2545     screenclear();
2546     intro_message(TRUE);
2547     wait_return(TRUE);
2548 }
2549