Merge branch 'vim' into lua_interface
[vim_extended.git] / src / version.c
blob5aaf5d29db74bae1e5b780adbd9392a9faece0bb
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 /**/
690 /**/
692 /**/
694 /**/
696 /**/
698 /**/
700 /**/
702 /**/
704 /**/
706 /**/
708 /**/
710 /**/
712 /**/
714 /**/
716 /**/
718 /**/
720 /**/
722 /**/
724 /**/
726 /**/
728 /**/
730 /**/
732 /**/
734 /**/
736 /**/
738 /**/
740 /**/
742 /**/
744 /**/
746 /**/
748 /**/
750 /**/
752 /**/
754 /**/
756 /**/
758 /**/
760 /**/
762 /**/
764 /**/
766 /**/
768 /**/
770 /**/
772 /**/
774 /**/
776 /**/
778 /**/
780 /**/
782 /**/
784 /**/
786 /**/
788 /**/
790 /**/
792 /**/
794 /**/
796 /**/
798 /**/
800 /**/
802 /**/
804 /**/
806 /**/
808 /**/
810 /**/
812 /**/
814 /**/
816 /**/
818 /**/
823 * Place to put a short description when adding a feature with a patch.
824 * Keep it short, e.g.,: "relative numbers", "persistent undo".
825 * Also add a comment marker to separate the lines.
826 * See the official Vim patches for the diff format: It must use a context of
827 * one line only. Use "diff -C2".
829 static char *(extra_patches[]) =
830 { /* Add your patch description below this line */
831 /**/
832 NULL
836 highest_patch()
838 int i;
839 int h = 0;
841 for (i = 0; included_patches[i] != 0; ++i)
842 if (included_patches[i] > h)
843 h = included_patches[i];
844 return h;
847 #if defined(FEAT_EVAL) || defined(PROTO)
849 * Return TRUE if patch "n" has been included.
852 has_patch(n)
853 int n;
855 int i;
857 for (i = 0; included_patches[i] != 0; ++i)
858 if (included_patches[i] == n)
859 return TRUE;
860 return FALSE;
862 #endif
864 void
865 ex_version(eap)
866 exarg_T *eap;
869 * Ignore a ":version 9.99" command.
871 if (*eap->arg == NUL)
873 msg_putchar('\n');
874 list_version();
878 void
879 list_version()
881 int i;
882 int first;
883 char *s = "";
886 * When adding features here, don't forget to update the list of
887 * internal variables in eval.c!
889 MSG(longVersion);
890 #ifdef WIN3264
891 # ifdef FEAT_GUI_W32
892 # if defined(_MSC_VER) && (_MSC_VER <= 1010)
893 /* Only MS VC 4.1 and earlier can do Win32s */
894 MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
895 # else
896 # ifdef _WIN64
897 MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
898 # else
899 MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
900 # endif
901 # endif
902 if (gui_is_win32s())
903 MSG_PUTS(_(" in Win32s mode"));
904 # ifdef FEAT_OLE
905 MSG_PUTS(_(" with OLE support"));
906 # endif
907 # else
908 # ifdef _WIN64
909 MSG_PUTS(_("\nMS-Windows 64-bit console version"));
910 # else
911 MSG_PUTS(_("\nMS-Windows 32-bit console version"));
912 # endif
913 # endif
914 #endif
915 #ifdef WIN16
916 MSG_PUTS(_("\nMS-Windows 16-bit version"));
917 #endif
918 #ifdef MSDOS
919 # ifdef DJGPP
920 MSG_PUTS(_("\n32-bit MS-DOS version"));
921 # else
922 MSG_PUTS(_("\n16-bit MS-DOS version"));
923 # endif
924 #endif
925 #ifdef MACOS
926 # ifdef MACOS_X
927 # ifdef MACOS_X_UNIX
928 MSG_PUTS(_("\nMacOS X (unix) version"));
929 # else
930 MSG_PUTS(_("\nMacOS X version"));
931 # endif
932 #else
933 MSG_PUTS(_("\nMacOS version"));
934 # endif
935 #endif
937 #ifdef RISCOS
938 MSG_PUTS(_("\nRISC OS version"));
939 #endif
940 #ifdef VMS
941 MSG_PUTS(_("\nOpenVMS version"));
942 # ifdef HAVE_PATHDEF
943 if (*compiled_arch != NUL)
945 MSG_PUTS(" - ");
946 MSG_PUTS(compiled_arch);
948 # endif
950 #endif
952 /* Print the list of patch numbers if there is at least one. */
953 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
954 if (included_patches[0] != 0)
956 MSG_PUTS(_("\nIncluded patches: "));
957 first = -1;
958 /* find last one */
959 for (i = 0; included_patches[i] != 0; ++i)
961 while (--i >= 0)
963 if (first < 0)
964 first = included_patches[i];
965 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
967 MSG_PUTS(s);
968 s = ", ";
969 msg_outnum((long)first);
970 if (first != included_patches[i])
972 MSG_PUTS("-");
973 msg_outnum((long)included_patches[i]);
975 first = -1;
980 /* Print the list of extra patch descriptions if there is at least one. */
981 if (extra_patches[0] != NULL)
983 MSG_PUTS(_("\nExtra patches: "));
984 s = "";
985 for (i = 0; extra_patches[i] != NULL; ++i)
987 MSG_PUTS(s);
988 s = ", ";
989 MSG_PUTS(extra_patches[i]);
993 #ifdef MODIFIED_BY
994 MSG_PUTS("\n");
995 MSG_PUTS(_("Modified by "));
996 MSG_PUTS(MODIFIED_BY);
997 #endif
999 #ifdef HAVE_PATHDEF
1000 if (*compiled_user != NUL || *compiled_sys != NUL)
1002 MSG_PUTS(_("\nCompiled "));
1003 if (*compiled_user != NUL)
1005 MSG_PUTS(_("by "));
1006 MSG_PUTS(compiled_user);
1008 if (*compiled_sys != NUL)
1010 MSG_PUTS("@");
1011 MSG_PUTS(compiled_sys);
1014 #endif
1016 #ifdef FEAT_HUGE
1017 MSG_PUTS(_("\nHuge version "));
1018 #else
1019 # ifdef FEAT_BIG
1020 MSG_PUTS(_("\nBig version "));
1021 # else
1022 # ifdef FEAT_NORMAL
1023 MSG_PUTS(_("\nNormal version "));
1024 # else
1025 # ifdef FEAT_SMALL
1026 MSG_PUTS(_("\nSmall version "));
1027 # else
1028 MSG_PUTS(_("\nTiny version "));
1029 # endif
1030 # endif
1031 # endif
1032 #endif
1033 #ifndef FEAT_GUI
1034 MSG_PUTS(_("without GUI."));
1035 #else
1036 # ifdef FEAT_GUI_GTK
1037 # ifdef FEAT_GUI_GNOME
1038 # ifdef HAVE_GTK2
1039 MSG_PUTS(_("with GTK2-GNOME GUI."));
1040 # else
1041 MSG_PUTS(_("with GTK-GNOME GUI."));
1042 # endif
1043 # else
1044 # ifdef HAVE_GTK2
1045 MSG_PUTS(_("with GTK2 GUI."));
1046 # else
1047 MSG_PUTS(_("with GTK GUI."));
1048 # endif
1049 # endif
1050 # else
1051 # ifdef FEAT_GUI_MOTIF
1052 MSG_PUTS(_("with X11-Motif GUI."));
1053 # else
1054 # ifdef FEAT_GUI_ATHENA
1055 # ifdef FEAT_GUI_NEXTAW
1056 MSG_PUTS(_("with X11-neXtaw GUI."));
1057 # else
1058 MSG_PUTS(_("with X11-Athena GUI."));
1059 # endif
1060 # else
1061 # ifdef FEAT_GUI_PHOTON
1062 MSG_PUTS(_("with Photon GUI."));
1063 # else
1064 # if defined(MSWIN)
1065 MSG_PUTS(_("with GUI."));
1066 # else
1067 # if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
1068 MSG_PUTS(_("with Carbon GUI."));
1069 # else
1070 # if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
1071 MSG_PUTS(_("with Cocoa GUI."));
1072 # else
1073 # if defined (MACOS)
1074 MSG_PUTS(_("with (classic) GUI."));
1075 # endif
1076 # endif
1077 # endif
1078 # endif
1079 # endif
1080 # endif
1081 # endif
1082 # endif
1083 #endif
1084 version_msg(_(" Features included (+) or not (-):\n"));
1086 /* print all the features */
1087 for (i = 0; features[i] != NULL; ++i)
1089 version_msg(features[i]);
1090 if (msg_col > 0)
1091 version_msg(" ");
1094 version_msg("\n");
1095 #ifdef SYS_VIMRC_FILE
1096 version_msg(_(" system vimrc file: \""));
1097 version_msg(SYS_VIMRC_FILE);
1098 version_msg("\"\n");
1099 #endif
1100 #ifdef USR_VIMRC_FILE
1101 version_msg(_(" user vimrc file: \""));
1102 version_msg(USR_VIMRC_FILE);
1103 version_msg("\"\n");
1104 #endif
1105 #ifdef USR_VIMRC_FILE2
1106 version_msg(_(" 2nd user vimrc file: \""));
1107 version_msg(USR_VIMRC_FILE2);
1108 version_msg("\"\n");
1109 #endif
1110 #ifdef USR_VIMRC_FILE3
1111 version_msg(_(" 3rd user vimrc file: \""));
1112 version_msg(USR_VIMRC_FILE3);
1113 version_msg("\"\n");
1114 #endif
1115 #ifdef USR_EXRC_FILE
1116 version_msg(_(" user exrc file: \""));
1117 version_msg(USR_EXRC_FILE);
1118 version_msg("\"\n");
1119 #endif
1120 #ifdef USR_EXRC_FILE2
1121 version_msg(_(" 2nd user exrc file: \""));
1122 version_msg(USR_EXRC_FILE2);
1123 version_msg("\"\n");
1124 #endif
1125 #ifdef FEAT_GUI
1126 # ifdef SYS_GVIMRC_FILE
1127 version_msg(_(" system gvimrc file: \""));
1128 version_msg(SYS_GVIMRC_FILE);
1129 version_msg("\"\n");
1130 # endif
1131 version_msg(_(" user gvimrc file: \""));
1132 version_msg(USR_GVIMRC_FILE);
1133 version_msg("\"\n");
1134 # ifdef USR_GVIMRC_FILE2
1135 version_msg(_("2nd user gvimrc file: \""));
1136 version_msg(USR_GVIMRC_FILE2);
1137 version_msg("\"\n");
1138 # endif
1139 # ifdef USR_GVIMRC_FILE3
1140 version_msg(_("3rd user gvimrc file: \""));
1141 version_msg(USR_GVIMRC_FILE3);
1142 version_msg("\"\n");
1143 # endif
1144 #endif
1145 #ifdef FEAT_GUI
1146 # ifdef SYS_MENU_FILE
1147 version_msg(_(" system menu file: \""));
1148 version_msg(SYS_MENU_FILE);
1149 version_msg("\"\n");
1150 # endif
1151 #endif
1152 #ifdef HAVE_PATHDEF
1153 if (*default_vim_dir != NUL)
1155 version_msg(_(" fall-back for $VIM: \""));
1156 version_msg((char *)default_vim_dir);
1157 version_msg("\"\n");
1159 if (*default_vimruntime_dir != NUL)
1161 version_msg(_(" f-b for $VIMRUNTIME: \""));
1162 version_msg((char *)default_vimruntime_dir);
1163 version_msg("\"\n");
1165 version_msg(_("Compilation: "));
1166 version_msg((char *)all_cflags);
1167 version_msg("\n");
1168 #ifdef VMS
1169 if (*compiler_version != NUL)
1171 version_msg(_("Compiler: "));
1172 version_msg((char *)compiler_version);
1173 version_msg("\n");
1175 #endif
1176 version_msg(_("Linking: "));
1177 version_msg((char *)all_lflags);
1178 #endif
1179 #ifdef DEBUG
1180 version_msg("\n");
1181 version_msg(_(" DEBUG BUILD"));
1182 #endif
1186 * Output a string for the version message. If it's going to wrap, output a
1187 * newline, unless the message is too long to fit on the screen anyway.
1189 static void
1190 version_msg(s)
1191 char *s;
1193 int len = (int)STRLEN(s);
1195 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1196 && *s != '\n')
1197 msg_putchar('\n');
1198 if (!got_int)
1199 MSG_PUTS(s);
1202 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1205 * Give an introductory message about Vim.
1206 * Only used when starting Vim on an empty file, without a file name.
1207 * Or with the ":intro" command (for Sven :-).
1209 void
1210 intro_message(colon)
1211 int colon; /* TRUE for ":intro" */
1213 int i;
1214 int row;
1215 int blanklines;
1216 int sponsor;
1217 char *p;
1218 static char *(lines[]) =
1220 N_("VIM - Vi IMproved"),
1222 N_("version "),
1223 N_("by Bram Moolenaar et al."),
1224 #ifdef MODIFIED_BY
1225 " ",
1226 #endif
1227 N_("Vim is open source and freely distributable"),
1229 N_("Help poor children in Uganda!"),
1230 N_("type :help iccf<Enter> for information "),
1232 N_("type :q<Enter> to exit "),
1233 N_("type :help<Enter> or <F1> for on-line help"),
1234 N_("type :help version7<Enter> for version info"),
1235 NULL,
1237 N_("Running in Vi compatible mode"),
1238 N_("type :set nocp<Enter> for Vim defaults"),
1239 N_("type :help cp-default<Enter> for info on this"),
1241 #ifdef FEAT_GUI
1242 static char *(gui_lines[]) =
1244 NULL,
1245 NULL,
1246 NULL,
1247 NULL,
1248 #ifdef MODIFIED_BY
1249 NULL,
1250 #endif
1251 NULL,
1252 NULL,
1253 NULL,
1254 N_("menu Help->Orphans for information "),
1255 NULL,
1256 N_("Running modeless, typed text is inserted"),
1257 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1258 N_(" for two modes "),
1259 NULL,
1260 NULL,
1261 NULL,
1262 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1263 N_(" for Vim defaults "),
1265 #endif
1267 /* blanklines = screen height - # message lines */
1268 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1269 if (!p_cp)
1270 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1271 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1272 if (mch_windows95())
1273 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1274 #endif
1276 #ifdef FEAT_WINDOWS
1277 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1278 if (p_ls > 1)
1279 blanklines -= Rows - topframe->fr_height;
1280 #endif
1281 if (blanklines < 0)
1282 blanklines = 0;
1284 /* Show the sponsor and register message one out of four times, the Uganda
1285 * message two out of four times. */
1286 sponsor = (int)time(NULL);
1287 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1289 /* start displaying the message lines after half of the blank lines */
1290 row = blanklines / 2;
1291 if ((row >= 2 && Columns >= 50) || colon)
1293 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1295 p = lines[i];
1296 #ifdef FEAT_GUI
1297 if (p_im && gui.in_use && gui_lines[i] != NULL)
1298 p = gui_lines[i];
1299 #endif
1300 if (p == NULL)
1302 if (!p_cp)
1303 break;
1304 continue;
1306 if (sponsor != 0)
1308 if (strstr(p, "children") != NULL)
1309 p = sponsor < 0
1310 ? N_("Sponsor Vim development!")
1311 : N_("Become a registered Vim user!");
1312 else if (strstr(p, "iccf") != NULL)
1313 p = sponsor < 0
1314 ? N_("type :help sponsor<Enter> for information ")
1315 : N_("type :help register<Enter> for information ");
1316 else if (strstr(p, "Orphans") != NULL)
1317 p = N_("menu Help->Sponsor/Register for information ");
1319 if (*p != NUL)
1320 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1321 ++row;
1323 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1324 if (mch_windows95())
1326 do_intro_line(++row,
1327 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1328 FALSE, hl_attr(HLF_E));
1329 do_intro_line(++row,
1330 (char_u *)_("type :help windows95<Enter> for info on this"),
1331 FALSE, 0);
1333 #endif
1336 /* Make the wait-return message appear just below the text. */
1337 if (colon)
1338 msg_row = row;
1341 static void
1342 do_intro_line(row, mesg, add_version, attr)
1343 int row;
1344 char_u *mesg;
1345 int add_version;
1346 int attr;
1348 char_u vers[20];
1349 int col;
1350 char_u *p;
1351 int l;
1352 int clen;
1353 #ifdef MODIFIED_BY
1354 # define MODBY_LEN 150
1355 char_u modby[MODBY_LEN];
1357 if (*mesg == ' ')
1359 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
1360 l = STRLEN(modby);
1361 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
1362 mesg = modby;
1364 #endif
1366 /* Center the message horizontally. */
1367 col = vim_strsize(mesg);
1368 if (add_version)
1370 STRCPY(vers, mediumVersion);
1371 if (highest_patch())
1373 /* Check for 9.9x or 9.9xx, alpha/beta version */
1374 if (isalpha((int)mediumVersion[3]))
1376 if (isalpha((int)mediumVersion[4]))
1377 sprintf((char *)vers + 5, ".%d%s", highest_patch(),
1378 mediumVersion + 5);
1379 else
1380 sprintf((char *)vers + 4, ".%d%s", highest_patch(),
1381 mediumVersion + 4);
1383 else
1384 sprintf((char *)vers + 3, ".%d", highest_patch());
1386 col += (int)STRLEN(vers);
1388 col = (Columns - col) / 2;
1389 if (col < 0)
1390 col = 0;
1392 /* Split up in parts to highlight <> items differently. */
1393 for (p = mesg; *p != NUL; p += l)
1395 clen = 0;
1396 for (l = 0; p[l] != NUL
1397 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1399 #ifdef FEAT_MBYTE
1400 if (has_mbyte)
1402 clen += ptr2cells(p + l);
1403 l += (*mb_ptr2len)(p + l) - 1;
1405 else
1406 #endif
1407 clen += byte2cells(p[l]);
1409 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1410 col += clen;
1413 /* Add the version number to the version line. */
1414 if (add_version)
1415 screen_puts(vers, row, col, 0);
1419 * ":intro": clear screen, display intro screen and wait for return.
1421 /*ARGSUSED*/
1422 void
1423 ex_intro(eap)
1424 exarg_T *eap;
1426 screenclear();
1427 intro_message(TRUE);
1428 wait_return(TRUE);