Applied MacVim r320 patch
[MacVim.git] / src / version.c
blobbe38a78fa0cdd710bcfb98c76111061468da98f5
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_FOLDING
221 "+folding",
222 #else
223 "-folding",
224 #endif
225 #ifdef FEAT_FOOTER
226 "+footer",
227 #else
228 "-footer",
229 #endif
230 /* only interesting on Unix systems */
231 #if !defined(USE_SYSTEM) && defined(UNIX)
232 "+fork()",
233 #endif
234 #ifdef FEAT_FULLSCREEN
235 "+fullscreen",
236 #else
237 "-fullscreen",
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_MENU
308 "+menu",
309 #else
310 "-menu",
311 #endif
312 #ifdef FEAT_SESSION
313 "+mksession",
314 #else
315 "-mksession",
316 #endif
317 #ifdef FEAT_MODIFY_FNAME
318 "+modify_fname",
319 #else
320 "-modify_fname",
321 #endif
322 #ifdef FEAT_MOUSE
323 "+mouse",
324 # ifdef FEAT_MOUSESHAPE
325 "+mouseshape",
326 # else
327 "-mouseshape",
328 # endif
329 # else
330 "-mouse",
331 #endif
332 #if defined(UNIX) || defined(VMS)
333 # ifdef FEAT_MOUSE_DEC
334 "+mouse_dec",
335 # else
336 "-mouse_dec",
337 # endif
338 # ifdef FEAT_MOUSE_GPM
339 "+mouse_gpm",
340 # else
341 "-mouse_gpm",
342 # endif
343 # ifdef FEAT_MOUSE_JSB
344 "+mouse_jsbterm",
345 # else
346 "-mouse_jsbterm",
347 # endif
348 # ifdef FEAT_MOUSE_NET
349 "+mouse_netterm",
350 # else
351 "-mouse_netterm",
352 # endif
353 # ifdef FEAT_MOUSE_XTERM
354 "+mouse_xterm",
355 # else
356 "-mouse_xterm",
357 # endif
358 #endif
359 #ifdef __QNX__
360 # ifdef FEAT_MOUSE_PTERM
361 "+mouse_pterm",
362 # else
363 "-mouse_pterm",
364 # endif
365 #endif
366 #ifdef FEAT_MBYTE_IME
367 # ifdef DYNAMIC_IME
368 "+multi_byte_ime/dyn",
369 # else
370 "+multi_byte_ime",
371 # endif
372 #else
373 # ifdef FEAT_MBYTE
374 "+multi_byte",
375 # else
376 "-multi_byte",
377 # endif
378 #endif
379 #ifdef FEAT_MULTI_LANG
380 "+multi_lang",
381 #else
382 "-multi_lang",
383 #endif
384 #ifdef FEAT_MZSCHEME
385 # ifdef DYNAMIC_MZSCHEME
386 "+mzscheme/dyn",
387 # else
388 "+mzscheme",
389 # endif
390 #else
391 "-mzscheme",
392 #endif
393 #ifdef FEAT_NETBEANS_INTG
394 "+netbeans_intg",
395 #else
396 "-netbeans_intg",
397 #endif
398 #ifdef FEAT_GUI_W32
399 # ifdef FEAT_OLE
400 "+ole",
401 # else
402 "-ole",
403 # endif
404 #endif
405 #ifdef FEAT_OSFILETYPE
406 "+osfiletype",
407 #else
408 "-osfiletype",
409 #endif
410 #ifdef FEAT_PATH_EXTRA
411 "+path_extra",
412 #else
413 "-path_extra",
414 #endif
415 #ifdef FEAT_PERL
416 # ifdef DYNAMIC_PERL
417 "+perl/dyn",
418 # else
419 "+perl",
420 # endif
421 #else
422 "-perl",
423 #endif
424 #ifdef FEAT_PRINTER
425 # ifdef FEAT_POSTSCRIPT
426 "+postscript",
427 # else
428 "-postscript",
429 # endif
430 "+printer",
431 #else
432 "-printer",
433 #endif
434 #ifdef FEAT_PROFILE
435 "+profile",
436 #else
437 "-profile",
438 #endif
439 #ifdef FEAT_PYTHON
440 # ifdef DYNAMIC_PYTHON
441 "+python/dyn",
442 # else
443 "+python",
444 # endif
445 #else
446 "-python",
447 #endif
448 #ifdef FEAT_QUICKFIX
449 "+quickfix",
450 #else
451 "-quickfix",
452 #endif
453 #ifdef FEAT_RELTIME
454 "+reltime",
455 #else
456 "-reltime",
457 #endif
458 #ifdef FEAT_RIGHTLEFT
459 "+rightleft",
460 #else
461 "-rightleft",
462 #endif
463 #ifdef FEAT_RUBY
464 # ifdef DYNAMIC_RUBY
465 "+ruby/dyn",
466 # else
467 "+ruby",
468 # endif
469 #else
470 "-ruby",
471 #endif
472 #ifdef FEAT_SCROLLBIND
473 "+scrollbind",
474 #else
475 "-scrollbind",
476 #endif
477 #ifdef FEAT_SIGNS
478 "+signs",
479 #else
480 "-signs",
481 #endif
482 #ifdef FEAT_SMARTINDENT
483 "+smartindent",
484 #else
485 "-smartindent",
486 #endif
487 #ifdef FEAT_SNIFF
488 "+sniff",
489 #else
490 "-sniff",
491 #endif
492 #ifdef FEAT_STL_OPT
493 "+statusline",
494 #else
495 "-statusline",
496 #endif
497 #ifdef FEAT_SUN_WORKSHOP
498 "+sun_workshop",
499 #else
500 "-sun_workshop",
501 #endif
502 #ifdef FEAT_SYN_HL
503 "+syntax",
504 #else
505 "-syntax",
506 #endif
507 /* only interesting on Unix systems */
508 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
509 "+system()",
510 #endif
511 #ifdef FEAT_TAG_BINS
512 "+tag_binary",
513 #else
514 "-tag_binary",
515 #endif
516 #ifdef FEAT_TAG_OLDSTATIC
517 "+tag_old_static",
518 #else
519 "-tag_old_static",
520 #endif
521 #ifdef FEAT_TAG_ANYWHITE
522 "+tag_any_white",
523 #else
524 "-tag_any_white",
525 #endif
526 #ifdef FEAT_TCL
527 # ifdef DYNAMIC_TCL
528 "+tcl/dyn",
529 # else
530 "+tcl",
531 # endif
532 #else
533 "-tcl",
534 #endif
535 #if defined(UNIX) || defined(__EMX__)
536 /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
537 # ifdef TERMINFO
538 "+terminfo",
539 # else
540 "-terminfo",
541 # endif
542 #else /* unix always includes termcap support */
543 # ifdef HAVE_TGETENT
544 "+tgetent",
545 # else
546 "-tgetent",
547 # endif
548 #endif
549 #ifdef FEAT_TERMRESPONSE
550 "+termresponse",
551 #else
552 "-termresponse",
553 #endif
554 #ifdef FEAT_TEXTOBJ
555 "+textobjects",
556 #else
557 "-textobjects",
558 #endif
559 #ifdef FEAT_TITLE
560 "+title",
561 #else
562 "-title",
563 #endif
564 #ifdef FEAT_TOOLBAR
565 "+toolbar",
566 #else
567 "-toolbar",
568 #endif
569 #ifdef FEAT_TRANSPARENCY
570 "+transparency",
571 #else
572 "-transparency",
573 #endif
574 #ifdef FEAT_USR_CMDS
575 "+user_commands",
576 #else
577 "-user_commands",
578 #endif
579 #ifdef FEAT_VERTSPLIT
580 "+vertsplit",
581 #else
582 "-vertsplit",
583 #endif
584 #ifdef FEAT_VIRTUALEDIT
585 "+virtualedit",
586 #else
587 "-virtualedit",
588 #endif
589 #ifdef FEAT_VISUAL
590 "+visual",
591 # ifdef FEAT_VISUALEXTRA
592 "+visualextra",
593 # else
594 "-visualextra",
595 # endif
596 #else
597 "-visual",
598 #endif
599 #ifdef FEAT_VIMINFO
600 "+viminfo",
601 #else
602 "-viminfo",
603 #endif
604 #ifdef FEAT_VREPLACE
605 "+vreplace",
606 #else
607 "-vreplace",
608 #endif
609 #ifdef FEAT_WILDIGN
610 "+wildignore",
611 #else
612 "-wildignore",
613 #endif
614 #ifdef FEAT_WILDMENU
615 "+wildmenu",
616 #else
617 "-wildmenu",
618 #endif
619 #ifdef FEAT_WINDOWS
620 "+windows",
621 #else
622 "-windows",
623 #endif
624 #ifdef FEAT_WRITEBACKUP
625 "+writebackup",
626 #else
627 "-writebackup",
628 #endif
629 #if defined(UNIX) || defined(VMS)
630 # ifdef FEAT_X11
631 "+X11",
632 # else
633 "-X11",
634 # endif
635 #endif
636 #ifdef FEAT_XFONTSET
637 "+xfontset",
638 #else
639 "-xfontset",
640 #endif
641 #ifdef FEAT_XIM
642 "+xim",
643 #else
644 "-xim",
645 #endif
646 #if defined(UNIX) || defined(VMS)
647 # ifdef USE_XSMP_INTERACT
648 "+xsmp_interact",
649 # else
650 # ifdef USE_XSMP
651 "+xsmp",
652 # else
653 "-xsmp",
654 # endif
655 # endif
656 # ifdef FEAT_XCLIPBOARD
657 "+xterm_clipboard",
658 # else
659 "-xterm_clipboard",
660 # endif
661 #endif
662 #ifdef FEAT_XTERM_SAVE
663 "+xterm_save",
664 #else
665 "-xterm_save",
666 #endif
667 #ifdef WIN3264
668 # ifdef FEAT_XPM_W32
669 "+xpm_w32",
670 # else
671 "-xpm_w32",
672 # endif
673 #endif
674 NULL
677 static int included_patches[] =
678 { /* Add new patch number below this line */
679 /**/
680 140,
681 /**/
682 139,
683 /**/
684 138,
685 /**/
686 137,
687 /**/
688 136,
689 /**/
690 135,
691 /**/
692 134,
693 /**/
694 133,
695 /**/
696 132,
697 /**/
698 131,
699 /**/
700 130,
701 /**/
702 129,
703 /**/
704 128,
705 /**/
706 127,
707 /**/
708 126,
709 /**/
710 125,
711 /**/
712 124,
713 /**/
714 123,
715 /**/
716 122,
717 /**/
718 121,
719 /**/
720 120,
721 /**/
722 119,
723 /**/
724 118,
725 /**/
726 117,
727 /**/
728 116,
729 /**/
730 115,
731 /**/
732 114,
733 /**/
734 113,
735 /**/
736 112,
737 /**/
738 111,
739 /**/
740 110,
741 /**/
742 109,
743 /**/
744 108,
745 /**/
746 107,
747 /**/
748 106,
749 /**/
750 105,
751 /**/
752 104,
753 /**/
754 103,
755 /**/
756 102,
757 /**/
758 101,
759 /**/
760 100,
761 /**/
763 /**/
765 /**/
767 /**/
769 /**/
771 /**/
773 /**/
775 /**/
777 /**/
779 /**/
781 /**/
783 /**/
785 /**/
787 /**/
789 /**/
791 /**/
793 /**/
795 /**/
797 /**/
799 /**/
801 /**/
803 /**/
805 /**/
807 /**/
809 /**/
811 /**/
813 /**/
815 /**/
817 /**/
819 /**/
821 /**/
823 /**/
825 /**/
827 /**/
829 /**/
831 /**/
833 /**/
835 /**/
837 /**/
839 /**/
841 /**/
843 /**/
845 /**/
847 /**/
849 /**/
851 /**/
853 /**/
855 /**/
857 /**/
859 /**/
861 /**/
863 /**/
865 /**/
867 /**/
869 /**/
871 /**/
873 /**/
875 /**/
877 /**/
879 /**/
881 /**/
883 /**/
885 /**/
887 /**/
889 /**/
891 /**/
893 /**/
895 /**/
897 /**/
899 /**/
901 /**/
903 /**/
905 /**/
907 /**/
909 /**/
911 /**/
913 /**/
915 /**/
917 /**/
919 /**/
921 /**/
923 /**/
925 /**/
927 /**/
929 /**/
931 /**/
933 /**/
935 /**/
937 /**/
939 /**/
941 /**/
943 /**/
945 /**/
947 /**/
949 /**/
951 /**/
953 /**/
955 /**/
957 /**/
959 /**/
964 highest_patch()
966 int i;
967 int h = 0;
969 for (i = 0; included_patches[i] != 0; ++i)
970 if (included_patches[i] > h)
971 h = included_patches[i];
972 return h;
975 #if defined(FEAT_EVAL) || defined(PROTO)
977 * Return TRUE if patch "n" has been included.
980 has_patch(n)
981 int n;
983 int i;
985 for (i = 0; included_patches[i] != 0; ++i)
986 if (included_patches[i] == n)
987 return TRUE;
988 return FALSE;
990 #endif
992 void
993 ex_version(eap)
994 exarg_T *eap;
997 * Ignore a ":version 9.99" command.
999 if (*eap->arg == NUL)
1001 msg_putchar('\n');
1002 list_version();
1006 void
1007 list_version()
1009 int i;
1010 int first;
1011 char *s = "";
1014 * When adding features here, don't forget to update the list of
1015 * internal variables in eval.c!
1017 MSG(longVersion);
1018 #ifdef WIN3264
1019 # ifdef FEAT_GUI_W32
1020 # if defined(_MSC_VER) && (_MSC_VER <= 1010)
1021 /* Only MS VC 4.1 and earlier can do Win32s */
1022 MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
1023 # else
1024 # ifdef _WIN64
1025 MSG_PUTS(_("\nMS-Windows 64 bit GUI version"));
1026 # else
1027 MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
1028 # endif
1029 # endif
1030 if (gui_is_win32s())
1031 MSG_PUTS(_(" in Win32s mode"));
1032 # ifdef FEAT_OLE
1033 MSG_PUTS(_(" with OLE support"));
1034 # endif
1035 # else
1036 MSG_PUTS(_("\nMS-Windows 32 bit console version"));
1037 # endif
1038 #endif
1039 #ifdef WIN16
1040 MSG_PUTS(_("\nMS-Windows 16 bit version"));
1041 #endif
1042 #ifdef MSDOS
1043 # ifdef DJGPP
1044 MSG_PUTS(_("\n32 bit MS-DOS version"));
1045 # else
1046 MSG_PUTS(_("\n16 bit MS-DOS version"));
1047 # endif
1048 #endif
1049 #ifdef MACOS
1050 # ifdef MACOS_X
1051 # ifdef MACOS_X_UNIX
1052 MSG_PUTS(_("\nMacOS X (unix) version"));
1053 # else
1054 MSG_PUTS(_("\nMacOS X version"));
1055 # endif
1056 #else
1057 MSG_PUTS(_("\nMacOS version"));
1058 # endif
1059 #endif
1061 #ifdef RISCOS
1062 MSG_PUTS(_("\nRISC OS version"));
1063 #endif
1064 #ifdef VMS
1065 MSG_PUTS("\nOpenVMS version");
1066 # ifdef HAVE_PATHDEF
1067 if (*compiled_arch != NUL)
1069 MSG_PUTS(" - ");
1070 MSG_PUTS(compiled_arch);
1072 # endif
1074 #endif
1076 /* Print the list of patch numbers if there is at least one. */
1077 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
1078 if (included_patches[0] != 0)
1080 MSG_PUTS(_("\nIncluded patches: "));
1081 first = -1;
1082 /* find last one */
1083 for (i = 0; included_patches[i] != 0; ++i)
1085 while (--i >= 0)
1087 if (first < 0)
1088 first = included_patches[i];
1089 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1091 MSG_PUTS(s);
1092 s = ", ";
1093 msg_outnum((long)first);
1094 if (first != included_patches[i])
1096 MSG_PUTS("-");
1097 msg_outnum((long)included_patches[i]);
1099 first = -1;
1104 #ifdef MODIFIED_BY
1105 MSG_PUTS("\n");
1106 MSG_PUTS(_("Modified by "));
1107 MSG_PUTS(MODIFIED_BY);
1108 #endif
1110 #ifdef HAVE_PATHDEF
1111 if (*compiled_user != NUL || *compiled_sys != NUL)
1113 MSG_PUTS(_("\nCompiled "));
1114 if (*compiled_user != NUL)
1116 MSG_PUTS(_("by "));
1117 MSG_PUTS(compiled_user);
1119 if (*compiled_sys != NUL)
1121 MSG_PUTS("@");
1122 MSG_PUTS(compiled_sys);
1125 #endif
1127 #ifdef FEAT_HUGE
1128 MSG_PUTS(_("\nHuge version "));
1129 #else
1130 # ifdef FEAT_BIG
1131 MSG_PUTS(_("\nBig version "));
1132 # else
1133 # ifdef FEAT_NORMAL
1134 MSG_PUTS(_("\nNormal version "));
1135 # else
1136 # ifdef FEAT_SMALL
1137 MSG_PUTS(_("\nSmall version "));
1138 # else
1139 MSG_PUTS(_("\nTiny version "));
1140 # endif
1141 # endif
1142 # endif
1143 #endif
1144 #ifndef FEAT_GUI
1145 MSG_PUTS(_("without GUI."));
1146 #else
1147 # ifdef FEAT_GUI_GTK
1148 # ifdef FEAT_GUI_GNOME
1149 # ifdef HAVE_GTK2
1150 MSG_PUTS(_("with GTK2-GNOME GUI."));
1151 # else
1152 MSG_PUTS(_("with GTK-GNOME GUI."));
1153 # endif
1154 # else
1155 # ifdef HAVE_GTK2
1156 MSG_PUTS(_("with GTK2 GUI."));
1157 # else
1158 MSG_PUTS(_("with GTK GUI."));
1159 # endif
1160 # endif
1161 # else
1162 # ifdef FEAT_GUI_MOTIF
1163 MSG_PUTS(_("with X11-Motif GUI."));
1164 # else
1165 # ifdef FEAT_GUI_ATHENA
1166 # ifdef FEAT_GUI_NEXTAW
1167 MSG_PUTS(_("with X11-neXtaw GUI."));
1168 # else
1169 MSG_PUTS(_("with X11-Athena GUI."));
1170 # endif
1171 # else
1172 # ifdef FEAT_GUI_PHOTON
1173 MSG_PUTS(_("with Photon GUI."));
1174 # else
1175 # if defined(MSWIN)
1176 MSG_PUTS(_("with GUI."));
1177 # else
1178 # if defined FEAT_GUI_MACVIM
1179 MSG_PUTS(_("with MacVim GUI."));
1180 # else
1181 # if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
1182 MSG_PUTS(_("with Carbon GUI."));
1183 # else
1184 # if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
1185 MSG_PUTS(_("with Cocoa GUI."));
1186 # else
1187 # if defined (MACOS)
1188 MSG_PUTS(_("with (classic) GUI."));
1189 # endif
1190 # endif
1191 # endif
1192 # endif
1193 # endif
1194 # endif
1195 # endif
1196 # endif
1197 # endif
1198 #endif
1199 version_msg(_(" Features included (+) or not (-):\n"));
1201 /* print all the features */
1202 for (i = 0; features[i] != NULL; ++i)
1204 version_msg(features[i]);
1205 if (msg_col > 0)
1206 version_msg(" ");
1209 version_msg("\n");
1210 #ifdef SYS_VIMRC_FILE
1211 version_msg(_(" system vimrc file: \""));
1212 version_msg(SYS_VIMRC_FILE);
1213 version_msg("\"\n");
1214 #endif
1215 #ifdef USR_VIMRC_FILE
1216 version_msg(_(" user vimrc file: \""));
1217 version_msg(USR_VIMRC_FILE);
1218 version_msg("\"\n");
1219 #endif
1220 #ifdef USR_VIMRC_FILE2
1221 version_msg(_(" 2nd user vimrc file: \""));
1222 version_msg(USR_VIMRC_FILE2);
1223 version_msg("\"\n");
1224 #endif
1225 #ifdef USR_VIMRC_FILE3
1226 version_msg(_(" 3rd user vimrc file: \""));
1227 version_msg(USR_VIMRC_FILE3);
1228 version_msg("\"\n");
1229 #endif
1230 #ifdef USR_EXRC_FILE
1231 version_msg(_(" user exrc file: \""));
1232 version_msg(USR_EXRC_FILE);
1233 version_msg("\"\n");
1234 #endif
1235 #ifdef USR_EXRC_FILE2
1236 version_msg(_(" 2nd user exrc file: \""));
1237 version_msg(USR_EXRC_FILE2);
1238 version_msg("\"\n");
1239 #endif
1240 #ifdef FEAT_GUI
1241 # ifdef SYS_GVIMRC_FILE
1242 version_msg(_(" system gvimrc file: \""));
1243 version_msg(SYS_GVIMRC_FILE);
1244 version_msg("\"\n");
1245 # endif
1246 version_msg(_(" user gvimrc file: \""));
1247 version_msg(USR_GVIMRC_FILE);
1248 version_msg("\"\n");
1249 # ifdef USR_GVIMRC_FILE2
1250 version_msg(_("2nd user gvimrc file: \""));
1251 version_msg(USR_GVIMRC_FILE2);
1252 version_msg("\"\n");
1253 # endif
1254 # ifdef USR_GVIMRC_FILE3
1255 version_msg(_("3rd user gvimrc file: \""));
1256 version_msg(USR_GVIMRC_FILE3);
1257 version_msg("\"\n");
1258 # endif
1259 #endif
1260 #ifdef FEAT_GUI
1261 # ifdef SYS_MENU_FILE
1262 version_msg(_(" system menu file: \""));
1263 version_msg(SYS_MENU_FILE);
1264 version_msg("\"\n");
1265 # endif
1266 #endif
1267 #ifdef HAVE_PATHDEF
1268 if (*default_vim_dir != NUL)
1270 version_msg(_(" fall-back for $VIM: \""));
1271 version_msg((char *)default_vim_dir);
1272 version_msg("\"\n");
1274 if (*default_vimruntime_dir != NUL)
1276 version_msg(_(" f-b for $VIMRUNTIME: \""));
1277 version_msg((char *)default_vimruntime_dir);
1278 version_msg("\"\n");
1280 version_msg(_("Compilation: "));
1281 version_msg((char *)all_cflags);
1282 version_msg("\n");
1283 #ifdef VMS
1284 if (*compiler_version != NUL)
1286 version_msg(_("Compiler: "));
1287 version_msg((char *)compiler_version);
1288 version_msg("\n");
1290 #endif
1291 version_msg(_("Linking: "));
1292 version_msg((char *)all_lflags);
1293 #endif
1294 #ifdef DEBUG
1295 version_msg("\n");
1296 version_msg(_(" DEBUG BUILD"));
1297 #endif
1301 * Output a string for the version message. If it's going to wrap, output a
1302 * newline, unless the message is too long to fit on the screen anyway.
1304 static void
1305 version_msg(s)
1306 char *s;
1308 int len = (int)STRLEN(s);
1310 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1311 && *s != '\n')
1312 msg_putchar('\n');
1313 if (!got_int)
1314 MSG_PUTS(s);
1317 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1320 * Give an introductory message about Vim.
1321 * Only used when starting Vim on an empty file, without a file name.
1322 * Or with the ":intro" command (for Sven :-).
1324 void
1325 intro_message(colon)
1326 int colon; /* TRUE for ":intro" */
1328 int i;
1329 int row;
1330 int blanklines;
1331 int sponsor;
1332 char *p;
1333 static char *(lines[]) =
1335 N_("VIM - Vi IMproved"),
1337 N_("version "),
1338 N_("by Bram Moolenaar et al."),
1339 #ifdef MODIFIED_BY
1340 " ",
1341 #endif
1342 N_("Vim is open source and freely distributable"),
1344 N_("Help poor children in Uganda!"),
1345 N_("type :help iccf<Enter> for information "),
1347 N_("type :q<Enter> to exit "),
1348 N_("type :help<Enter> or <F1> for on-line help"),
1349 #ifdef FEAT_GUI_MACVIM
1350 // TODO: Don't steal the show from version7 help?
1351 N_("type :help macvim<Enter> for MacVim help "),
1352 #else
1353 N_("type :help version7<Enter> for version info"),
1354 #endif
1355 NULL,
1357 N_("Running in Vi compatible mode"),
1358 N_("type :set nocp<Enter> for Vim defaults"),
1359 N_("type :help cp-default<Enter> for info on this"),
1361 #ifdef FEAT_GUI
1362 static char *(gui_lines[]) =
1364 NULL,
1365 NULL,
1366 NULL,
1367 NULL,
1368 #ifdef MODIFIED_BY
1369 NULL,
1370 #endif
1371 NULL,
1372 NULL,
1373 NULL,
1374 N_("menu Help->Orphans for information "),
1375 NULL,
1376 N_("Running modeless, typed text is inserted"),
1377 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1378 N_(" for two modes "),
1379 NULL,
1380 NULL,
1381 NULL,
1382 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1383 N_(" for Vim defaults "),
1385 #endif
1387 /* blanklines = screen height - # message lines */
1388 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1389 if (!p_cp)
1390 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1391 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1392 if (mch_windows95())
1393 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1394 #endif
1396 #ifdef FEAT_WINDOWS
1397 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1398 if (p_ls > 1)
1399 blanklines -= Rows - topframe->fr_height;
1400 #endif
1401 if (blanklines < 0)
1402 blanklines = 0;
1404 /* Show the sponsor and register message one out of four times, the Uganda
1405 * message two out of four times. */
1406 sponsor = (int)time(NULL);
1407 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1409 /* start displaying the message lines after half of the blank lines */
1410 row = blanklines / 2;
1411 if ((row >= 2 && Columns >= 50) || colon)
1413 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1415 p = lines[i];
1416 #ifdef FEAT_GUI
1417 if (p_im && gui.in_use && gui_lines[i] != NULL)
1418 p = gui_lines[i];
1419 #endif
1420 if (p == NULL)
1422 if (!p_cp)
1423 break;
1424 continue;
1426 if (sponsor != 0)
1428 if (strstr(p, "children") != NULL)
1429 p = sponsor < 0
1430 ? N_("Sponsor Vim development!")
1431 : N_("Become a registered Vim user!");
1432 else if (strstr(p, "iccf") != NULL)
1433 p = sponsor < 0
1434 ? N_("type :help sponsor<Enter> for information ")
1435 : N_("type :help register<Enter> for information ");
1436 else if (strstr(p, "Orphans") != NULL)
1437 p = N_("menu Help->Sponsor/Register for information ");
1439 if (*p != NUL)
1440 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1441 ++row;
1443 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1444 if (mch_windows95())
1446 do_intro_line(++row,
1447 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1448 FALSE, hl_attr(HLF_E));
1449 do_intro_line(++row,
1450 (char_u *)_("type :help windows95<Enter> for info on this"),
1451 FALSE, 0);
1453 #endif
1456 /* Make the wait-return message appear just below the text. */
1457 if (colon)
1458 msg_row = row;
1461 static void
1462 do_intro_line(row, mesg, add_version, attr)
1463 int row;
1464 char_u *mesg;
1465 int add_version;
1466 int attr;
1468 char_u vers[20];
1469 int col;
1470 char_u *p;
1471 int l;
1472 int clen;
1473 #ifdef MODIFIED_BY
1474 # define MODBY_LEN 150
1475 char_u modby[MODBY_LEN];
1477 if (*mesg == ' ')
1479 vim_strncpy(modby, _("Modified by "), MODBY_LEN - 1);
1480 l = STRLEN(modby);
1481 vim_strncpy(modby + l, MODIFIED_BY, MODBY_LEN - l - 1);
1482 mesg = modby;
1484 #endif
1486 /* Center the message horizontally. */
1487 col = vim_strsize(mesg);
1488 if (add_version)
1490 STRCPY(vers, mediumVersion);
1491 if (highest_patch())
1493 /* Check for 9.9x or 9.9xx, alpha/beta version */
1494 if (isalpha((int)mediumVersion[3]))
1496 if (isalpha((int)mediumVersion[4]))
1497 sprintf((char *)vers + 5, ".%d%s", highest_patch(),
1498 mediumVersion + 5);
1499 else
1500 sprintf((char *)vers + 4, ".%d%s", highest_patch(),
1501 mediumVersion + 4);
1503 else
1504 sprintf((char *)vers + 3, ".%d", highest_patch());
1506 col += (int)STRLEN(vers);
1508 col = (Columns - col) / 2;
1509 if (col < 0)
1510 col = 0;
1512 /* Split up in parts to highlight <> items differently. */
1513 for (p = mesg; *p != NUL; p += l)
1515 clen = 0;
1516 for (l = 0; p[l] != NUL
1517 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1519 #ifdef FEAT_MBYTE
1520 if (has_mbyte)
1522 clen += ptr2cells(p + l);
1523 l += (*mb_ptr2len)(p + l) - 1;
1525 else
1526 #endif
1527 clen += byte2cells(p[l]);
1529 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1530 col += clen;
1533 /* Add the version number to the version line. */
1534 if (add_version)
1535 screen_puts(vers, row, col, 0);
1539 * ":intro": clear screen, display intro screen and wait for return.
1541 /*ARGSUSED*/
1542 void
1543 ex_intro(eap)
1544 exarg_T *eap;
1546 screenclear();
1547 intro_message(TRUE);
1548 wait_return(TRUE);