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