Merge branch 'vim' into feat/lua
[vim_extended.git] / src / version.c
blob7fca213ff2d18d491d06cb0c645d950e5df213ff
1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
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 */
10 #include "vim.h"
12 #ifdef AMIGA
13 # include <time.h> /* for time() */
14 #endif
17 * Vim originated from Stevie version 3.6 (Fish disk 217) by GRWalter (Fred)
18 * It has been changed beyond recognition since then.
20 * Differences between version 6.x and 7.x can be found with ":help version7".
21 * Differences between version 5.x and 6.x can be found with ":help version6".
22 * Differences between version 4.x and 5.x can be found with ":help version5".
23 * Differences between version 3.0 and 4.x can be found with ":help version4".
24 * All the remarks about older versions have been removed, they are not very
25 * interesting.
28 #include "version.h"
30 char *Version = VIM_VERSION_SHORT;
31 static char *mediumVersion = VIM_VERSION_MEDIUM;
33 #if defined(HAVE_DATE_TIME) || defined(PROTO)
34 # if (defined(VMS) && defined(VAXC)) || defined(PROTO)
35 char longVersion[sizeof(VIM_VERSION_LONG_DATE) + sizeof(__DATE__)
36 + sizeof(__TIME__) + 3];
37 void
38 make_version()
41 * Construct the long version string. Necessary because
42 * VAX C can't catenate strings in the preprocessor.
44 strcpy(longVersion, VIM_VERSION_LONG_DATE);
45 strcat(longVersion, __DATE__);
46 strcat(longVersion, " ");
47 strcat(longVersion, __TIME__);
48 strcat(longVersion, ")");
50 # else
51 char *longVersion = VIM_VERSION_LONG_DATE __DATE__ " " __TIME__ ")";
52 # endif
53 #else
54 char *longVersion = VIM_VERSION_LONG;
55 #endif
57 static void version_msg __ARGS((char *s));
59 static char *(features[]) =
61 #ifdef AMIGA /* only for Amiga systems */
62 # ifdef FEAT_ARP
63 "+ARP",
64 # else
65 "-ARP",
66 # endif
67 #endif
68 #ifdef FEAT_ARABIC
69 "+arabic",
70 #else
71 "-arabic",
72 #endif
73 #ifdef FEAT_AUTOCMD
74 "+autocmd",
75 #else
76 "-autocmd",
77 #endif
78 #ifdef FEAT_BEVAL
79 "+balloon_eval",
80 #else
81 "-balloon_eval",
82 #endif
83 #ifdef FEAT_BROWSE
84 "+browse",
85 #else
86 "-browse",
87 #endif
88 #ifdef NO_BUILTIN_TCAPS
89 "-builtin_terms",
90 #endif
91 #ifdef SOME_BUILTIN_TCAPS
92 "+builtin_terms",
93 #endif
94 #ifdef ALL_BUILTIN_TCAPS
95 "++builtin_terms",
96 #endif
97 #ifdef FEAT_BYTEOFF
98 "+byte_offset",
99 #else
100 "-byte_offset",
101 #endif
102 #ifdef FEAT_CINDENT
103 "+cindent",
104 #else
105 "-cindent",
106 #endif
107 #ifdef FEAT_CLIENTSERVER
108 "+clientserver",
109 #else
110 "-clientserver",
111 #endif
112 #ifdef FEAT_CLIPBOARD
113 "+clipboard",
114 #else
115 "-clipboard",
116 #endif
117 #ifdef FEAT_CMDL_COMPL
118 "+cmdline_compl",
119 #else
120 "-cmdline_compl",
121 #endif
122 #ifdef FEAT_CMDHIST
123 "+cmdline_hist",
124 #else
125 "-cmdline_hist",
126 #endif
127 #ifdef FEAT_CMDL_INFO
128 "+cmdline_info",
129 #else
130 "-cmdline_info",
131 #endif
132 #ifdef FEAT_COMMENTS
133 "+comments",
134 #else
135 "-comments",
136 #endif
137 #ifdef FEAT_CRYPT
138 "+cryptv",
139 #else
140 "-cryptv",
141 #endif
142 #ifdef FEAT_CSCOPE
143 "+cscope",
144 #else
145 "-cscope",
146 #endif
147 #ifdef CURSOR_SHAPE
148 "+cursorshape",
149 #else
150 "-cursorshape",
151 #endif
152 #if defined(FEAT_CON_DIALOG) && defined(FEAT_GUI_DIALOG)
153 "+dialog_con_gui",
154 #else
155 # if defined(FEAT_CON_DIALOG)
156 "+dialog_con",
157 # else
158 # if defined(FEAT_GUI_DIALOG)
159 "+dialog_gui",
160 # else
161 "-dialog",
162 # endif
163 # endif
164 #endif
165 #ifdef FEAT_DIFF
166 "+diff",
167 #else
168 "-diff",
169 #endif
170 #ifdef FEAT_DIGRAPHS
171 "+digraphs",
172 #else
173 "-digraphs",
174 #endif
175 #ifdef FEAT_DND
176 "+dnd",
177 #else
178 "-dnd",
179 #endif
180 #ifdef EBCDIC
181 "+ebcdic",
182 #else
183 "-ebcdic",
184 #endif
185 #ifdef FEAT_EMACS_TAGS
186 "+emacs_tags",
187 #else
188 "-emacs_tags",
189 #endif
190 #ifdef FEAT_EVAL
191 "+eval",
192 #else
193 "-eval",
194 #endif
195 #ifdef FEAT_EX_EXTRA
196 "+ex_extra",
197 #else
198 "-ex_extra",
199 #endif
200 #ifdef FEAT_SEARCH_EXTRA
201 "+extra_search",
202 #else
203 "-extra_search",
204 #endif
205 #ifdef FEAT_FKMAP
206 "+farsi",
207 #else
208 "-farsi",
209 #endif
210 #ifdef FEAT_SEARCHPATH
211 "+file_in_path",
212 #else
213 "-file_in_path",
214 #endif
215 #ifdef FEAT_FIND_ID
216 "+find_in_path",
217 #else
218 "-find_in_path",
219 #endif
220 #ifdef FEAT_FLOAT
221 "+float",
222 #else
223 "-float",
224 #endif
225 #ifdef FEAT_FOLDING
226 "+folding",
227 #else
228 "-folding",
229 #endif
230 #ifdef FEAT_FOOTER
231 "+footer",
232 #else
233 "-footer",
234 #endif
235 /* only interesting on Unix systems */
236 #if !defined(USE_SYSTEM) && defined(UNIX)
237 "+fork()",
238 #endif
239 #ifdef FEAT_GETTEXT
240 # ifdef DYNAMIC_GETTEXT
241 "+gettext/dyn",
242 # else
243 "+gettext",
244 # endif
245 #else
246 "-gettext",
247 #endif
248 #ifdef FEAT_HANGULIN
249 "+hangul_input",
250 #else
251 "-hangul_input",
252 #endif
253 #if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
254 # ifdef DYNAMIC_ICONV
255 "+iconv/dyn",
256 # else
257 "+iconv",
258 # endif
259 #else
260 "-iconv",
261 #endif
262 #ifdef FEAT_INS_EXPAND
263 "+insert_expand",
264 #else
265 "-insert_expand",
266 #endif
267 #ifdef FEAT_JUMPLIST
268 "+jumplist",
269 #else
270 "-jumplist",
271 #endif
272 #ifdef FEAT_KEYMAP
273 "+keymap",
274 #else
275 "-keymap",
276 #endif
277 #ifdef FEAT_LANGMAP
278 "+langmap",
279 #else
280 "-langmap",
281 #endif
282 #ifdef FEAT_LIBCALL
283 "+libcall",
284 #else
285 "-libcall",
286 #endif
287 #ifdef FEAT_LINEBREAK
288 "+linebreak",
289 #else
290 "-linebreak",
291 #endif
292 #ifdef FEAT_LISP
293 "+lispindent",
294 #else
295 "-lispindent",
296 #endif
297 #ifdef FEAT_LISTCMDS
298 "+listcmds",
299 #else
300 "-listcmds",
301 #endif
302 #ifdef FEAT_LOCALMAP
303 "+localmap",
304 #else
305 "-localmap",
306 #endif
307 #ifdef FEAT_LUA
308 # ifdef DYNAMIC_LUA
309 "+lua/dyn",
310 # else
311 "+lua",
312 # endif
313 #else
314 "-lua",
315 #endif
316 #ifdef FEAT_MENU
317 "+menu",
318 #else
319 "-menu",
320 #endif
321 #ifdef FEAT_SESSION
322 "+mksession",
323 #else
324 "-mksession",
325 #endif
326 #ifdef FEAT_MODIFY_FNAME
327 "+modify_fname",
328 #else
329 "-modify_fname",
330 #endif
331 #ifdef FEAT_MOUSE
332 "+mouse",
333 # ifdef FEAT_MOUSESHAPE
334 "+mouseshape",
335 # else
336 "-mouseshape",
337 # endif
338 # else
339 "-mouse",
340 #endif
341 #if defined(UNIX) || defined(VMS)
342 # ifdef FEAT_MOUSE_DEC
343 "+mouse_dec",
344 # else
345 "-mouse_dec",
346 # endif
347 # ifdef FEAT_MOUSE_GPM
348 "+mouse_gpm",
349 # else
350 "-mouse_gpm",
351 # endif
352 # ifdef FEAT_MOUSE_JSB
353 "+mouse_jsbterm",
354 # else
355 "-mouse_jsbterm",
356 # endif
357 # ifdef FEAT_MOUSE_NET
358 "+mouse_netterm",
359 # else
360 "-mouse_netterm",
361 # endif
362 # ifdef FEAT_SYSMOUSE
363 "+mouse_sysmouse",
364 # else
365 "-mouse_sysmouse",
366 # endif
367 # ifdef FEAT_MOUSE_XTERM
368 "+mouse_xterm",
369 # else
370 "-mouse_xterm",
371 # endif
372 #endif
373 #ifdef __QNX__
374 # ifdef FEAT_MOUSE_PTERM
375 "+mouse_pterm",
376 # else
377 "-mouse_pterm",
378 # endif
379 #endif
380 #ifdef FEAT_MBYTE_IME
381 # ifdef DYNAMIC_IME
382 "+multi_byte_ime/dyn",
383 # else
384 "+multi_byte_ime",
385 # endif
386 #else
387 # ifdef FEAT_MBYTE
388 "+multi_byte",
389 # else
390 "-multi_byte",
391 # endif
392 #endif
393 #ifdef FEAT_MULTI_LANG
394 "+multi_lang",
395 #else
396 "-multi_lang",
397 #endif
398 #ifdef FEAT_MZSCHEME
399 # ifdef DYNAMIC_MZSCHEME
400 "+mzscheme/dyn",
401 # else
402 "+mzscheme",
403 # endif
404 #else
405 "-mzscheme",
406 #endif
407 #ifdef FEAT_NETBEANS_INTG
408 "+netbeans_intg",
409 #else
410 "-netbeans_intg",
411 #endif
412 #ifdef FEAT_GUI_W32
413 # ifdef FEAT_OLE
414 "+ole",
415 # else
416 "-ole",
417 # endif
418 #endif
419 #ifdef FEAT_OSFILETYPE
420 "+osfiletype",
421 #else
422 "-osfiletype",
423 #endif
424 #ifdef FEAT_PATH_EXTRA
425 "+path_extra",
426 #else
427 "-path_extra",
428 #endif
429 #ifdef FEAT_PERL
430 # ifdef DYNAMIC_PERL
431 "+perl/dyn",
432 # else
433 "+perl",
434 # endif
435 #else
436 "-perl",
437 #endif
438 #ifdef FEAT_PRINTER
439 # ifdef FEAT_POSTSCRIPT
440 "+postscript",
441 # else
442 "-postscript",
443 # endif
444 "+printer",
445 #else
446 "-printer",
447 #endif
448 #ifdef FEAT_PROFILE
449 "+profile",
450 #else
451 "-profile",
452 #endif
453 #ifdef FEAT_PYTHON
454 # ifdef DYNAMIC_PYTHON
455 "+python/dyn",
456 # else
457 "+python",
458 # endif
459 #else
460 "-python",
461 #endif
462 #ifdef FEAT_QUICKFIX
463 "+quickfix",
464 #else
465 "-quickfix",
466 #endif
467 #ifdef FEAT_RELTIME
468 "+reltime",
469 #else
470 "-reltime",
471 #endif
472 #ifdef FEAT_RIGHTLEFT
473 "+rightleft",
474 #else
475 "-rightleft",
476 #endif
477 #ifdef FEAT_RUBY
478 # ifdef DYNAMIC_RUBY
479 "+ruby/dyn",
480 # else
481 "+ruby",
482 # endif
483 #else
484 "-ruby",
485 #endif
486 #ifdef FEAT_SCROLLBIND
487 "+scrollbind",
488 #else
489 "-scrollbind",
490 #endif
491 #ifdef FEAT_SIGNS
492 "+signs",
493 #else
494 "-signs",
495 #endif
496 #ifdef FEAT_SMARTINDENT
497 "+smartindent",
498 #else
499 "-smartindent",
500 #endif
501 #ifdef FEAT_SNIFF
502 "+sniff",
503 #else
504 "-sniff",
505 #endif
506 #ifdef FEAT_STL_OPT
507 "+statusline",
508 #else
509 "-statusline",
510 #endif
511 #ifdef FEAT_SUN_WORKSHOP
512 "+sun_workshop",
513 #else
514 "-sun_workshop",
515 #endif
516 #ifdef FEAT_SYN_HL
517 "+syntax",
518 #else
519 "-syntax",
520 #endif
521 /* only interesting on Unix systems */
522 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
523 "+system()",
524 #endif
525 #ifdef FEAT_TAG_BINS
526 "+tag_binary",
527 #else
528 "-tag_binary",
529 #endif
530 #ifdef FEAT_TAG_OLDSTATIC
531 "+tag_old_static",
532 #else
533 "-tag_old_static",
534 #endif
535 #ifdef FEAT_TAG_ANYWHITE
536 "+tag_any_white",
537 #else
538 "-tag_any_white",
539 #endif
540 #ifdef FEAT_TCL
541 # ifdef DYNAMIC_TCL
542 "+tcl/dyn",
543 # else
544 "+tcl",
545 # endif
546 #else
547 "-tcl",
548 #endif
549 #if defined(UNIX) || defined(__EMX__)
550 /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
551 # ifdef TERMINFO
552 "+terminfo",
553 # else
554 "-terminfo",
555 # endif
556 #else /* unix always includes termcap support */
557 # ifdef HAVE_TGETENT
558 "+tgetent",
559 # else
560 "-tgetent",
561 # endif
562 #endif
563 #ifdef FEAT_TERMRESPONSE
564 "+termresponse",
565 #else
566 "-termresponse",
567 #endif
568 #ifdef FEAT_TEXTOBJ
569 "+textobjects",
570 #else
571 "-textobjects",
572 #endif
573 #ifdef FEAT_TITLE
574 "+title",
575 #else
576 "-title",
577 #endif
578 #ifdef FEAT_TOOLBAR
579 "+toolbar",
580 #else
581 "-toolbar",
582 #endif
583 #ifdef FEAT_USR_CMDS
584 "+user_commands",
585 #else
586 "-user_commands",
587 #endif
588 #ifdef FEAT_VERTSPLIT
589 "+vertsplit",
590 #else
591 "-vertsplit",
592 #endif
593 #ifdef FEAT_VIRTUALEDIT
594 "+virtualedit",
595 #else
596 "-virtualedit",
597 #endif
598 #ifdef FEAT_VISUAL
599 "+visual",
600 # ifdef FEAT_VISUALEXTRA
601 "+visualextra",
602 # else
603 "-visualextra",
604 # endif
605 #else
606 "-visual",
607 #endif
608 #ifdef FEAT_VIMINFO
609 "+viminfo",
610 #else
611 "-viminfo",
612 #endif
613 #ifdef FEAT_VREPLACE
614 "+vreplace",
615 #else
616 "-vreplace",
617 #endif
618 #ifdef FEAT_WILDIGN
619 "+wildignore",
620 #else
621 "-wildignore",
622 #endif
623 #ifdef FEAT_WILDMENU
624 "+wildmenu",
625 #else
626 "-wildmenu",
627 #endif
628 #ifdef FEAT_WINDOWS
629 "+windows",
630 #else
631 "-windows",
632 #endif
633 #ifdef FEAT_WRITEBACKUP
634 "+writebackup",
635 #else
636 "-writebackup",
637 #endif
638 #if defined(UNIX) || defined(VMS)
639 # ifdef FEAT_X11
640 "+X11",
641 # else
642 "-X11",
643 # endif
644 #endif
645 #ifdef FEAT_XFONTSET
646 "+xfontset",
647 #else
648 "-xfontset",
649 #endif
650 #ifdef FEAT_XIM
651 "+xim",
652 #else
653 "-xim",
654 #endif
655 #if defined(UNIX) || defined(VMS)
656 # ifdef USE_XSMP_INTERACT
657 "+xsmp_interact",
658 # else
659 # ifdef USE_XSMP
660 "+xsmp",
661 # else
662 "-xsmp",
663 # endif
664 # endif
665 # ifdef FEAT_XCLIPBOARD
666 "+xterm_clipboard",
667 # else
668 "-xterm_clipboard",
669 # endif
670 #endif
671 #ifdef FEAT_XTERM_SAVE
672 "+xterm_save",
673 #else
674 "-xterm_save",
675 #endif
676 #ifdef WIN3264
677 # ifdef FEAT_XPM_W32
678 "+xpm_w32",
679 # else
680 "-xpm_w32",
681 # endif
682 #endif
683 NULL
686 static int included_patches[] =
687 { /* Add new patch number below this line */
688 /**/
689 197,
690 /**/
691 196,
692 /**/
693 195,
694 /**/
695 194,
696 /**/
697 193,
698 /**/
699 192,
700 /**/
701 191,
702 /**/
703 190,
704 /**/
705 189,
706 /**/
707 188,
708 /**/
709 187,
710 /**/
711 186,
712 /**/
713 185,
714 /**/
715 184,
716 /**/
717 183,
718 /**/
719 182,
720 /**/
721 181,
722 /**/
723 180,
724 /**/
725 179,
726 /**/
727 178,
728 /**/
729 177,
730 /**/
731 176,
732 /**/
733 175,
734 /**/
735 174,
736 /**/
737 173,
738 /**/
739 172,
740 /**/
741 171,
742 /**/
743 170,
744 /**/
745 169,
746 /**/
747 168,
748 /**/
749 167,
750 /**/
751 166,
752 /**/
753 165,
754 /**/
755 164,
756 /**/
757 163,
758 /**/
759 162,
760 /**/
761 161,
762 /**/
763 160,
764 /**/
765 159,
766 /**/
767 158,
768 /**/
769 157,
770 /**/
771 156,
772 /**/
773 155,
774 /**/
775 154,
776 /**/
777 153,
778 /**/
779 152,
780 /**/
781 151,
782 /**/
783 150,
784 /**/
785 149,
786 /**/
787 148,
788 /**/
789 147,
790 /**/
791 146,
792 /**/
793 145,
794 /**/
795 144,
796 /**/
797 143,
798 /**/
799 142,
800 /**/
801 141,
802 /**/
803 140,
804 /**/
805 139,
806 /**/
807 138,
808 /**/
809 137,
810 /**/
811 136,
812 /**/
813 135,
814 /**/
815 134,
816 /**/
817 133,
818 /**/
819 132,
820 /**/
821 131,
822 /**/
823 130,
824 /**/
825 129,
826 /**/
827 128,
828 /**/
829 127,
830 /**/
831 126,
832 /**/
833 125,
834 /**/
835 124,
836 /**/
837 123,
838 /**/
839 122,
840 /**/
841 121,
842 /**/
843 120,
844 /**/
845 119,
846 /**/
847 118,
848 /**/
849 117,
850 /**/
851 116,
852 /**/
853 115,
854 /**/
855 114,
856 /**/
857 113,
858 /**/
859 112,
860 /**/
861 111,
862 /**/
863 110,
864 /**/
865 109,
866 /**/
867 108,
868 /**/
869 107,
870 /**/
871 106,
872 /**/
873 105,
874 /**/
875 104,
876 /**/
877 103,
878 /**/
879 102,
880 /**/
881 101,
882 /**/
883 100,
884 /**/
886 /**/
888 /**/
890 /**/
892 /**/
894 /**/
896 /**/
898 /**/
900 /**/
902 /**/
904 /**/
906 /**/
908 /**/
910 /**/
912 /**/
914 /**/
916 /**/
918 /**/
920 /**/
922 /**/
924 /**/
926 /**/
928 /**/
930 /**/
932 /**/
934 /**/
936 /**/
938 /**/
940 /**/
942 /**/
944 /**/
946 /**/
948 /**/
950 /**/
952 /**/
954 /**/
956 /**/
958 /**/
960 /**/
962 /**/
964 /**/
966 /**/
968 /**/
970 /**/
972 /**/
974 /**/
976 /**/
978 /**/
980 /**/
982 /**/
984 /**/
986 /**/
988 /**/
990 /**/
992 /**/
994 /**/
996 /**/
998 /**/
1000 /**/
1002 /**/
1004 /**/
1006 /**/
1008 /**/
1010 /**/
1012 /**/
1014 /**/
1016 /**/
1018 /**/
1020 /**/
1022 /**/
1024 /**/
1026 /**/
1028 /**/
1030 /**/
1032 /**/
1034 /**/
1036 /**/
1038 /**/
1040 /**/
1042 /**/
1044 /**/
1046 /**/
1048 /**/
1050 /**/
1052 /**/
1054 /**/
1056 /**/
1058 /**/
1060 /**/
1062 /**/
1064 /**/
1066 /**/
1068 /**/
1070 /**/
1072 /**/
1074 /**/
1076 /**/
1078 /**/
1080 /**/
1082 /**/
1087 * Place to put a short description when adding a feature with a patch.
1088 * Keep it short, e.g.,: "relative numbers", "persistent undo".
1089 * Also add a comment marker to separate the lines.
1090 * See the official Vim patches for the diff format: It must use a context of
1091 * one line only. Create it by hand or use "diff -C2" and edit the patch.
1093 static char *(extra_patches[]) =
1094 { /* Add your patch description below this line */
1095 /**/
1096 NULL
1100 highest_patch()
1102 int i;
1103 int h = 0;
1105 for (i = 0; included_patches[i] != 0; ++i)
1106 if (included_patches[i] > h)
1107 h = included_patches[i];
1108 return h;
1111 #if defined(FEAT_EVAL) || defined(PROTO)
1113 * Return TRUE if patch "n" has been included.
1116 has_patch(n)
1117 int n;
1119 int i;
1121 for (i = 0; included_patches[i] != 0; ++i)
1122 if (included_patches[i] == n)
1123 return TRUE;
1124 return FALSE;
1126 #endif
1128 void
1129 ex_version(eap)
1130 exarg_T *eap;
1133 * Ignore a ":version 9.99" command.
1135 if (*eap->arg == NUL)
1137 msg_putchar('\n');
1138 list_version();
1142 void
1143 list_version()
1145 int i;
1146 int first;
1147 char *s = "";
1150 * When adding features here, don't forget to update the list of
1151 * internal variables in eval.c!
1153 MSG(longVersion);
1154 #ifdef WIN3264
1155 # ifdef FEAT_GUI_W32
1156 # if defined(_MSC_VER) && (_MSC_VER <= 1010)
1157 /* Only MS VC 4.1 and earlier can do Win32s */
1158 MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
1159 # else
1160 # ifdef _WIN64
1161 MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
1162 # else
1163 MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
1164 # endif
1165 # endif
1166 if (gui_is_win32s())
1167 MSG_PUTS(_(" in Win32s mode"));
1168 # ifdef FEAT_OLE
1169 MSG_PUTS(_(" with OLE support"));
1170 # endif
1171 # else
1172 # ifdef _WIN64
1173 MSG_PUTS(_("\nMS-Windows 64-bit console version"));
1174 # else
1175 MSG_PUTS(_("\nMS-Windows 32-bit console version"));
1176 # endif
1177 # endif
1178 #endif
1179 #ifdef WIN16
1180 MSG_PUTS(_("\nMS-Windows 16-bit version"));
1181 #endif
1182 #ifdef MSDOS
1183 # ifdef DJGPP
1184 MSG_PUTS(_("\n32-bit MS-DOS version"));
1185 # else
1186 MSG_PUTS(_("\n16-bit MS-DOS version"));
1187 # endif
1188 #endif
1189 #ifdef MACOS
1190 # ifdef MACOS_X
1191 # ifdef MACOS_X_UNIX
1192 MSG_PUTS(_("\nMacOS X (unix) version"));
1193 # else
1194 MSG_PUTS(_("\nMacOS X version"));
1195 # endif
1196 #else
1197 MSG_PUTS(_("\nMacOS version"));
1198 # endif
1199 #endif
1201 #ifdef RISCOS
1202 MSG_PUTS(_("\nRISC OS version"));
1203 #endif
1204 #ifdef VMS
1205 MSG_PUTS(_("\nOpenVMS version"));
1206 # ifdef HAVE_PATHDEF
1207 if (*compiled_arch != NUL)
1209 MSG_PUTS(" - ");
1210 MSG_PUTS(compiled_arch);
1212 # endif
1214 #endif
1216 /* Print the list of patch numbers if there is at least one. */
1217 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
1218 if (included_patches[0] != 0)
1220 MSG_PUTS(_("\nIncluded patches: "));
1221 first = -1;
1222 /* find last one */
1223 for (i = 0; included_patches[i] != 0; ++i)
1225 while (--i >= 0)
1227 if (first < 0)
1228 first = included_patches[i];
1229 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1231 MSG_PUTS(s);
1232 s = ", ";
1233 msg_outnum((long)first);
1234 if (first != included_patches[i])
1236 MSG_PUTS("-");
1237 msg_outnum((long)included_patches[i]);
1239 first = -1;
1244 /* Print the list of extra patch descriptions if there is at least one. */
1245 if (extra_patches[0] != NULL)
1247 MSG_PUTS(_("\nExtra patches: "));
1248 s = "";
1249 for (i = 0; extra_patches[i] != NULL; ++i)
1251 MSG_PUTS(s);
1252 s = ", ";
1253 MSG_PUTS(extra_patches[i]);
1257 #ifdef MODIFIED_BY
1258 MSG_PUTS("\n");
1259 MSG_PUTS(_("Modified by "));
1260 MSG_PUTS(MODIFIED_BY);
1261 #endif
1263 #ifdef HAVE_PATHDEF
1264 if (*compiled_user != NUL || *compiled_sys != NUL)
1266 MSG_PUTS(_("\nCompiled "));
1267 if (*compiled_user != NUL)
1269 MSG_PUTS(_("by "));
1270 MSG_PUTS(compiled_user);
1272 if (*compiled_sys != NUL)
1274 MSG_PUTS("@");
1275 MSG_PUTS(compiled_sys);
1278 #endif
1280 #ifdef FEAT_HUGE
1281 MSG_PUTS(_("\nHuge version "));
1282 #else
1283 # ifdef FEAT_BIG
1284 MSG_PUTS(_("\nBig version "));
1285 # else
1286 # ifdef FEAT_NORMAL
1287 MSG_PUTS(_("\nNormal version "));
1288 # else
1289 # ifdef FEAT_SMALL
1290 MSG_PUTS(_("\nSmall version "));
1291 # else
1292 MSG_PUTS(_("\nTiny version "));
1293 # endif
1294 # endif
1295 # endif
1296 #endif
1297 #ifndef FEAT_GUI
1298 MSG_PUTS(_("without GUI."));
1299 #else
1300 # ifdef FEAT_GUI_GTK
1301 # ifdef FEAT_GUI_GNOME
1302 # ifdef HAVE_GTK2
1303 MSG_PUTS(_("with GTK2-GNOME GUI."));
1304 # else
1305 MSG_PUTS(_("with GTK-GNOME GUI."));
1306 # endif
1307 # else
1308 # ifdef HAVE_GTK2
1309 MSG_PUTS(_("with GTK2 GUI."));
1310 # else
1311 MSG_PUTS(_("with GTK GUI."));
1312 # endif
1313 # endif
1314 # else
1315 # ifdef FEAT_GUI_MOTIF
1316 MSG_PUTS(_("with X11-Motif GUI."));
1317 # else
1318 # ifdef FEAT_GUI_ATHENA
1319 # ifdef FEAT_GUI_NEXTAW
1320 MSG_PUTS(_("with X11-neXtaw GUI."));
1321 # else
1322 MSG_PUTS(_("with X11-Athena GUI."));
1323 # endif
1324 # else
1325 # ifdef FEAT_GUI_PHOTON
1326 MSG_PUTS(_("with Photon GUI."));
1327 # else
1328 # if defined(MSWIN)
1329 MSG_PUTS(_("with GUI."));
1330 # else
1331 # if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
1332 MSG_PUTS(_("with Carbon GUI."));
1333 # else
1334 # if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
1335 MSG_PUTS(_("with Cocoa GUI."));
1336 # else
1337 # if defined (MACOS)
1338 MSG_PUTS(_("with (classic) GUI."));
1339 # endif
1340 # endif
1341 # endif
1342 # endif
1343 # endif
1344 # endif
1345 # endif
1346 # endif
1347 #endif
1348 version_msg(_(" Features included (+) or not (-):\n"));
1350 /* print all the features */
1351 for (i = 0; features[i] != NULL; ++i)
1353 version_msg(features[i]);
1354 if (msg_col > 0)
1355 version_msg(" ");
1358 version_msg("\n");
1359 #ifdef SYS_VIMRC_FILE
1360 version_msg(_(" system vimrc file: \""));
1361 version_msg(SYS_VIMRC_FILE);
1362 version_msg("\"\n");
1363 #endif
1364 #ifdef USR_VIMRC_FILE
1365 version_msg(_(" user vimrc file: \""));
1366 version_msg(USR_VIMRC_FILE);
1367 version_msg("\"\n");
1368 #endif
1369 #ifdef USR_VIMRC_FILE2
1370 version_msg(_(" 2nd user vimrc file: \""));
1371 version_msg(USR_VIMRC_FILE2);
1372 version_msg("\"\n");
1373 #endif
1374 #ifdef USR_VIMRC_FILE3
1375 version_msg(_(" 3rd user vimrc file: \""));
1376 version_msg(USR_VIMRC_FILE3);
1377 version_msg("\"\n");
1378 #endif
1379 #ifdef USR_EXRC_FILE
1380 version_msg(_(" user exrc file: \""));
1381 version_msg(USR_EXRC_FILE);
1382 version_msg("\"\n");
1383 #endif
1384 #ifdef USR_EXRC_FILE2
1385 version_msg(_(" 2nd user exrc file: \""));
1386 version_msg(USR_EXRC_FILE2);
1387 version_msg("\"\n");
1388 #endif
1389 #ifdef FEAT_GUI
1390 # ifdef SYS_GVIMRC_FILE
1391 version_msg(_(" system gvimrc file: \""));
1392 version_msg(SYS_GVIMRC_FILE);
1393 version_msg("\"\n");
1394 # endif
1395 version_msg(_(" user gvimrc file: \""));
1396 version_msg(USR_GVIMRC_FILE);
1397 version_msg("\"\n");
1398 # ifdef USR_GVIMRC_FILE2
1399 version_msg(_("2nd user gvimrc file: \""));
1400 version_msg(USR_GVIMRC_FILE2);
1401 version_msg("\"\n");
1402 # endif
1403 # ifdef USR_GVIMRC_FILE3
1404 version_msg(_("3rd user gvimrc file: \""));
1405 version_msg(USR_GVIMRC_FILE3);
1406 version_msg("\"\n");
1407 # endif
1408 #endif
1409 #ifdef FEAT_GUI
1410 # ifdef SYS_MENU_FILE
1411 version_msg(_(" system menu file: \""));
1412 version_msg(SYS_MENU_FILE);
1413 version_msg("\"\n");
1414 # endif
1415 #endif
1416 #ifdef HAVE_PATHDEF
1417 if (*default_vim_dir != NUL)
1419 version_msg(_(" fall-back for $VIM: \""));
1420 version_msg((char *)default_vim_dir);
1421 version_msg("\"\n");
1423 if (*default_vimruntime_dir != NUL)
1425 version_msg(_(" f-b for $VIMRUNTIME: \""));
1426 version_msg((char *)default_vimruntime_dir);
1427 version_msg("\"\n");
1429 version_msg(_("Compilation: "));
1430 version_msg((char *)all_cflags);
1431 version_msg("\n");
1432 #ifdef VMS
1433 if (*compiler_version != NUL)
1435 version_msg(_("Compiler: "));
1436 version_msg((char *)compiler_version);
1437 version_msg("\n");
1439 #endif
1440 version_msg(_("Linking: "));
1441 version_msg((char *)all_lflags);
1442 #endif
1443 #ifdef DEBUG
1444 version_msg("\n");
1445 version_msg(_(" DEBUG BUILD"));
1446 #endif
1450 * Output a string for the version message. If it's going to wrap, output a
1451 * newline, unless the message is too long to fit on the screen anyway.
1453 static void
1454 version_msg(s)
1455 char *s;
1457 int len = (int)STRLEN(s);
1459 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1460 && *s != '\n')
1461 msg_putchar('\n');
1462 if (!got_int)
1463 MSG_PUTS(s);
1466 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1469 * Give an introductory message about Vim.
1470 * Only used when starting Vim on an empty file, without a file name.
1471 * Or with the ":intro" command (for Sven :-).
1473 void
1474 intro_message(colon)
1475 int colon; /* TRUE for ":intro" */
1477 int i;
1478 int row;
1479 int blanklines;
1480 int sponsor;
1481 char *p;
1482 static char *(lines[]) =
1484 N_("VIM - Vi IMproved"),
1486 N_("version "),
1487 N_("by Bram Moolenaar et al."),
1488 #ifdef MODIFIED_BY
1489 " ",
1490 #endif
1491 N_("Vim is open source and freely distributable"),
1493 N_("Help poor children in Uganda!"),
1494 N_("type :help iccf<Enter> for information "),
1496 N_("type :q<Enter> to exit "),
1497 N_("type :help<Enter> or <F1> for on-line help"),
1498 N_("type :help version7<Enter> for version info"),
1499 NULL,
1501 N_("Running in Vi compatible mode"),
1502 N_("type :set nocp<Enter> for Vim defaults"),
1503 N_("type :help cp-default<Enter> for info on this"),
1505 #ifdef FEAT_GUI
1506 static char *(gui_lines[]) =
1508 NULL,
1509 NULL,
1510 NULL,
1511 NULL,
1512 #ifdef MODIFIED_BY
1513 NULL,
1514 #endif
1515 NULL,
1516 NULL,
1517 NULL,
1518 N_("menu Help->Orphans for information "),
1519 NULL,
1520 N_("Running modeless, typed text is inserted"),
1521 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1522 N_(" for two modes "),
1523 NULL,
1524 NULL,
1525 NULL,
1526 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1527 N_(" for Vim defaults "),
1529 #endif
1531 /* blanklines = screen height - # message lines */
1532 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1533 if (!p_cp)
1534 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1535 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1536 if (mch_windows95())
1537 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1538 #endif
1540 #ifdef FEAT_WINDOWS
1541 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1542 if (p_ls > 1)
1543 blanklines -= Rows - topframe->fr_height;
1544 #endif
1545 if (blanklines < 0)
1546 blanklines = 0;
1548 /* Show the sponsor and register message one out of four times, the Uganda
1549 * message two out of four times. */
1550 sponsor = (int)time(NULL);
1551 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1553 /* start displaying the message lines after half of the blank lines */
1554 row = blanklines / 2;
1555 if ((row >= 2 && Columns >= 50) || colon)
1557 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1559 p = lines[i];
1560 #ifdef FEAT_GUI
1561 if (p_im && gui.in_use && gui_lines[i] != NULL)
1562 p = gui_lines[i];
1563 #endif
1564 if (p == NULL)
1566 if (!p_cp)
1567 break;
1568 continue;
1570 if (sponsor != 0)
1572 if (strstr(p, "children") != NULL)
1573 p = sponsor < 0
1574 ? N_("Sponsor Vim development!")
1575 : N_("Become a registered Vim user!");
1576 else if (strstr(p, "iccf") != NULL)
1577 p = sponsor < 0
1578 ? N_("type :help sponsor<Enter> for information ")
1579 : N_("type :help register<Enter> for information ");
1580 else if (strstr(p, "Orphans") != NULL)
1581 p = N_("menu Help->Sponsor/Register for information ");
1583 if (*p != NUL)
1584 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1585 ++row;
1587 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1588 if (mch_windows95())
1590 do_intro_line(++row,
1591 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1592 FALSE, hl_attr(HLF_E));
1593 do_intro_line(++row,
1594 (char_u *)_("type :help windows95<Enter> for info on this"),
1595 FALSE, 0);
1597 #endif
1600 /* Make the wait-return message appear just below the text. */
1601 if (colon)
1602 msg_row = row;
1605 static void
1606 do_intro_line(row, mesg, add_version, attr)
1607 int row;
1608 char_u *mesg;
1609 int add_version;
1610 int attr;
1612 char_u vers[20];
1613 int col;
1614 char_u *p;
1615 int l;
1616 int clen;
1617 #ifdef MODIFIED_BY
1618 # define MODBY_LEN 150
1619 char_u modby[MODBY_LEN];
1621 if (*mesg == ' ')
1623 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
1624 l = STRLEN(modby);
1625 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
1626 mesg = modby;
1628 #endif
1630 /* Center the message horizontally. */
1631 col = vim_strsize(mesg);
1632 if (add_version)
1634 STRCPY(vers, mediumVersion);
1635 if (highest_patch())
1637 /* Check for 9.9x or 9.9xx, alpha/beta version */
1638 if (isalpha((int)mediumVersion[3]))
1640 if (isalpha((int)mediumVersion[4]))
1641 sprintf((char *)vers + 5, ".%d%s", highest_patch(),
1642 mediumVersion + 5);
1643 else
1644 sprintf((char *)vers + 4, ".%d%s", highest_patch(),
1645 mediumVersion + 4);
1647 else
1648 sprintf((char *)vers + 3, ".%d", highest_patch());
1650 col += (int)STRLEN(vers);
1652 col = (Columns - col) / 2;
1653 if (col < 0)
1654 col = 0;
1656 /* Split up in parts to highlight <> items differently. */
1657 for (p = mesg; *p != NUL; p += l)
1659 clen = 0;
1660 for (l = 0; p[l] != NUL
1661 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1663 #ifdef FEAT_MBYTE
1664 if (has_mbyte)
1666 clen += ptr2cells(p + l);
1667 l += (*mb_ptr2len)(p + l) - 1;
1669 else
1670 #endif
1671 clen += byte2cells(p[l]);
1673 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1674 col += clen;
1677 /* Add the version number to the version line. */
1678 if (add_version)
1679 screen_puts(vers, row, col, 0);
1683 * ":intro": clear screen, display intro screen and wait for return.
1685 void
1686 ex_intro(eap)
1687 exarg_T *eap UNUSED;
1689 screenclear();
1690 intro_message(TRUE);
1691 wait_return(TRUE);