Merge branch 'master' of git://repo.or.cz/MacVim into KaoriYa
[MacVim/KaoriYa.git] / src / version.c
blob61e0038024081e85bcad37f9be375b297bcc98c4
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_FULLSCREEN
240 "+fullscreen",
241 #else
242 "-fullscreen",
243 #endif
244 #ifdef FEAT_GETTEXT
245 # ifdef DYNAMIC_GETTEXT
246 "+gettext/dyn",
247 # else
248 "+gettext",
249 # endif
250 #else
251 "-gettext",
252 #endif
253 "+guess_encode",
254 #ifdef FEAT_HANGULIN
255 "+hangul_input",
256 #else
257 "-hangul_input",
258 #endif
259 #if (defined(HAVE_ICONV_H) && defined(USE_ICONV)) || defined(DYNAMIC_ICONV)
260 # ifdef DYNAMIC_ICONV
261 "+iconv/dyn",
262 # else
263 "+iconv",
264 # endif
265 #else
266 "-iconv",
267 #endif
268 #ifdef FEAT_INS_EXPAND
269 "+insert_expand",
270 #else
271 "-insert_expand",
272 #endif
273 #ifdef FEAT_JUMPLIST
274 "+jumplist",
275 #else
276 "-jumplist",
277 #endif
278 #ifdef FEAT_KEYMAP
279 "+keymap",
280 #else
281 "-keymap",
282 #endif
283 "+kaoriya",
284 #ifdef FEAT_LANGMAP
285 "+langmap",
286 #else
287 "-langmap",
288 #endif
289 #ifdef FEAT_LIBCALL
290 "+libcall",
291 #else
292 "-libcall",
293 #endif
294 #ifdef FEAT_LINEBREAK
295 "+linebreak",
296 #else
297 "-linebreak",
298 #endif
299 #ifdef FEAT_LISP
300 "+lispindent",
301 #else
302 "-lispindent",
303 #endif
304 #ifdef FEAT_LISTCMDS
305 "+listcmds",
306 #else
307 "-listcmds",
308 #endif
309 #ifdef FEAT_LOCALMAP
310 "+localmap",
311 #else
312 "-localmap",
313 #endif
314 #ifdef FEAT_MENU
315 "+menu",
316 #else
317 "-menu",
318 #endif
319 #ifdef USE_MIGEMO
320 # ifdef DYNAMIC_MIGEMO
321 "+migemo/dyn",
322 # else
323 "+migemo",
324 # endif
325 #else
326 "-migemo",
327 #endif
328 #ifdef FEAT_SESSION
329 "+mksession",
330 #else
331 "-mksession",
332 #endif
333 #ifdef FEAT_MODIFY_FNAME
334 "+modify_fname",
335 #else
336 "-modify_fname",
337 #endif
338 #ifdef FEAT_MOUSE
339 "+mouse",
340 # ifdef FEAT_MOUSESHAPE
341 "+mouseshape",
342 # else
343 "-mouseshape",
344 # endif
345 # else
346 "-mouse",
347 #endif
348 #if defined(UNIX) || defined(VMS)
349 # ifdef FEAT_MOUSE_DEC
350 "+mouse_dec",
351 # else
352 "-mouse_dec",
353 # endif
354 # ifdef FEAT_MOUSE_GPM
355 "+mouse_gpm",
356 # else
357 "-mouse_gpm",
358 # endif
359 # ifdef FEAT_MOUSE_JSB
360 "+mouse_jsbterm",
361 # else
362 "-mouse_jsbterm",
363 # endif
364 # ifdef FEAT_MOUSE_NET
365 "+mouse_netterm",
366 # else
367 "-mouse_netterm",
368 # endif
369 # ifdef FEAT_SYSMOUSE
370 "+mouse_sysmouse",
371 # else
372 "-mouse_sysmouse",
373 # endif
374 # ifdef FEAT_MOUSE_XTERM
375 "+mouse_xterm",
376 # else
377 "-mouse_xterm",
378 # endif
379 #endif
380 #ifdef __QNX__
381 # ifdef FEAT_MOUSE_PTERM
382 "+mouse_pterm",
383 # else
384 "-mouse_pterm",
385 # endif
386 #endif
387 #ifdef FEAT_MBYTE_IME
388 # ifdef DYNAMIC_IME
389 "+multi_byte_ime/dyn",
390 # else
391 "+multi_byte_ime",
392 # endif
393 #else
394 # ifdef FEAT_MBYTE
395 "+multi_byte",
396 # else
397 "-multi_byte",
398 # endif
399 #endif
400 #ifdef FEAT_MULTI_LANG
401 "+multi_lang",
402 #else
403 "-multi_lang",
404 #endif
405 #ifdef FEAT_MZSCHEME
406 # ifdef DYNAMIC_MZSCHEME
407 "+mzscheme/dyn",
408 # else
409 "+mzscheme",
410 # endif
411 #else
412 "-mzscheme",
413 #endif
414 #ifdef FEAT_NETBEANS_INTG
415 "+netbeans_intg",
416 #else
417 "-netbeans_intg",
418 #endif
419 #ifdef FEAT_ODB_EDITOR
420 "+odbeditor",
421 #else
422 "-odbeditor",
423 #endif
424 #ifdef FEAT_GUI_W32
425 # ifdef FEAT_OLE
426 "+ole",
427 # else
428 "-ole",
429 # endif
430 #endif
431 #ifdef FEAT_OSFILETYPE
432 "+osfiletype",
433 #else
434 "-osfiletype",
435 #endif
436 #ifdef FEAT_PATH_EXTRA
437 "+path_extra",
438 #else
439 "-path_extra",
440 #endif
441 #ifdef FEAT_PERL
442 # ifdef DYNAMIC_PERL
443 "+perl/dyn",
444 # else
445 "+perl",
446 # endif
447 #else
448 "-perl",
449 #endif
450 #ifdef FEAT_PRINTER
451 # ifdef FEAT_POSTSCRIPT
452 "+postscript",
453 # else
454 "-postscript",
455 # endif
456 "+printer",
457 #else
458 "-printer",
459 #endif
460 #ifdef FEAT_PROFILE
461 "+profile",
462 #else
463 "-profile",
464 #endif
465 #ifdef FEAT_PYTHON
466 # ifdef DYNAMIC_PYTHON
467 "+python/dyn",
468 # else
469 "+python",
470 # endif
471 #else
472 "-python",
473 #endif
474 #ifdef FEAT_QUICKFIX
475 "+quickfix",
476 #else
477 "-quickfix",
478 #endif
479 #ifdef FEAT_RELTIME
480 "+reltime",
481 #else
482 "-reltime",
483 #endif
484 #ifdef FEAT_RIGHTLEFT
485 "+rightleft",
486 #else
487 "-rightleft",
488 #endif
489 #ifdef FEAT_RUBY
490 # ifdef DYNAMIC_RUBY
491 "+ruby/dyn",
492 # else
493 "+ruby",
494 # endif
495 #else
496 "-ruby",
497 #endif
498 #ifdef FEAT_SCROLLBIND
499 "+scrollbind",
500 #else
501 "-scrollbind",
502 #endif
503 #ifdef FEAT_SIGNS
504 "+signs",
505 #else
506 "-signs",
507 #endif
508 #ifdef FEAT_SMARTINDENT
509 "+smartindent",
510 #else
511 "-smartindent",
512 #endif
513 #ifdef FEAT_SNIFF
514 "+sniff",
515 #else
516 "-sniff",
517 #endif
518 #ifdef FEAT_STL_OPT
519 "+statusline",
520 #else
521 "-statusline",
522 #endif
523 #ifdef FEAT_SUN_WORKSHOP
524 "+sun_workshop",
525 #else
526 "-sun_workshop",
527 #endif
528 #ifdef FEAT_SYN_HL
529 "+syntax",
530 #else
531 "-syntax",
532 #endif
533 /* only interesting on Unix systems */
534 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
535 "+system()",
536 #endif
537 #ifdef FEAT_TAG_BINS
538 "+tag_binary",
539 #else
540 "-tag_binary",
541 #endif
542 #ifdef FEAT_TAG_OLDSTATIC
543 "+tag_old_static",
544 #else
545 "-tag_old_static",
546 #endif
547 #ifdef FEAT_TAG_ANYWHITE
548 "+tag_any_white",
549 #else
550 "-tag_any_white",
551 #endif
552 #ifdef FEAT_TCL
553 # ifdef DYNAMIC_TCL
554 "+tcl/dyn",
555 # else
556 "+tcl",
557 # endif
558 #else
559 "-tcl",
560 #endif
561 #if defined(UNIX) || defined(__EMX__)
562 /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
563 # ifdef TERMINFO
564 "+terminfo",
565 # else
566 "-terminfo",
567 # endif
568 #else /* unix always includes termcap support */
569 # ifdef HAVE_TGETENT
570 "+tgetent",
571 # else
572 "-tgetent",
573 # endif
574 #endif
575 #ifdef FEAT_TERMRESPONSE
576 "+termresponse",
577 #else
578 "-termresponse",
579 #endif
580 #ifdef FEAT_TEXTOBJ
581 "+textobjects",
582 #else
583 "-textobjects",
584 #endif
585 #ifdef FEAT_TITLE
586 "+title",
587 #else
588 "-title",
589 #endif
590 #ifdef FEAT_TOOLBAR
591 "+toolbar",
592 #else
593 "-toolbar",
594 #endif
595 #ifdef FEAT_TRANSPARENCY
596 "+transparency",
597 #else
598 "-transparency",
599 #endif
600 #ifdef FEAT_USR_CMDS
601 "+user_commands",
602 #else
603 "-user_commands",
604 #endif
605 #ifdef FEAT_VERTSPLIT
606 "+vertsplit",
607 #else
608 "-vertsplit",
609 #endif
610 #ifdef FEAT_VIRTUALEDIT
611 "+virtualedit",
612 #else
613 "-virtualedit",
614 #endif
615 #ifdef FEAT_VISUAL
616 "+visual",
617 # ifdef FEAT_VISUALEXTRA
618 "+visualextra",
619 # else
620 "-visualextra",
621 # endif
622 #else
623 "-visual",
624 #endif
625 #ifdef FEAT_VIMINFO
626 "+viminfo",
627 #else
628 "-viminfo",
629 #endif
630 #ifdef FEAT_VREPLACE
631 "+vreplace",
632 #else
633 "-vreplace",
634 #endif
635 #ifdef FEAT_WILDIGN
636 "+wildignore",
637 #else
638 "-wildignore",
639 #endif
640 #ifdef FEAT_WILDMENU
641 "+wildmenu",
642 #else
643 "-wildmenu",
644 #endif
645 #ifdef FEAT_WINDOWS
646 "+windows",
647 #else
648 "-windows",
649 #endif
650 #ifdef FEAT_WRITEBACKUP
651 "+writebackup",
652 #else
653 "-writebackup",
654 #endif
655 #if defined(UNIX) || defined(VMS)
656 # ifdef FEAT_X11
657 "+X11",
658 # else
659 "-X11",
660 # endif
661 #endif
662 #ifdef FEAT_XFONTSET
663 "+xfontset",
664 #else
665 "-xfontset",
666 #endif
667 #ifdef FEAT_XIM
668 "+xim",
669 #else
670 "-xim",
671 #endif
672 #if defined(UNIX) || defined(VMS)
673 # ifdef USE_XSMP_INTERACT
674 "+xsmp_interact",
675 # else
676 # ifdef USE_XSMP
677 "+xsmp",
678 # else
679 "-xsmp",
680 # endif
681 # endif
682 # ifdef FEAT_XCLIPBOARD
683 "+xterm_clipboard",
684 # else
685 "-xterm_clipboard",
686 # endif
687 #endif
688 #ifdef FEAT_XTERM_SAVE
689 "+xterm_save",
690 #else
691 "-xterm_save",
692 #endif
693 #ifdef WIN3264
694 # ifdef FEAT_XPM_W32
695 "+xpm_w32",
696 # else
697 "-xpm_w32",
698 # endif
699 #endif
700 NULL
703 static int included_patches[] =
704 { /* Add new patch number below this line */
705 /**/
706 228,
707 /**/
708 227,
709 /**/
710 226,
711 /**/
712 225,
713 /**/
714 224,
715 /**/
716 223,
717 /**/
718 222,
719 /**/
720 221,
721 /**/
722 220,
723 /**/
724 219,
725 /**/
726 218,
727 /**/
728 217,
729 /**/
730 216,
731 /**/
732 215,
733 /**/
734 214,
735 /**/
736 213,
737 /**/
738 212,
739 /**/
740 211,
741 /**/
742 210,
743 /**/
744 209,
745 /**/
746 208,
747 /**/
748 207,
749 /**/
750 206,
751 /**/
752 205,
753 /**/
754 204,
755 /**/
756 203,
757 /**/
758 202,
759 /**/
760 201,
761 /**/
762 200,
763 /**/
764 199,
765 /**/
766 198,
767 /**/
768 197,
769 /**/
770 196,
771 /**/
772 195,
773 /**/
774 194,
775 /**/
776 193,
777 /**/
778 192,
779 /**/
780 191,
781 /**/
782 190,
783 /**/
784 189,
785 /**/
786 188,
787 /**/
788 187,
789 /**/
790 186,
791 /**/
792 185,
793 /**/
794 184,
795 /**/
796 183,
797 /**/
798 182,
799 /**/
800 181,
801 /**/
802 180,
803 /**/
804 179,
805 /**/
806 178,
807 /**/
808 177,
809 /**/
810 176,
811 /**/
812 175,
813 /**/
814 174,
815 /**/
816 173,
817 /**/
818 172,
819 /**/
820 171,
821 /**/
822 170,
823 /**/
824 169,
825 /**/
826 168,
827 /**/
828 167,
829 /**/
830 166,
831 /**/
832 165,
833 /**/
834 164,
835 /**/
836 163,
837 /**/
838 162,
839 /**/
840 161,
841 /**/
842 160,
843 /**/
844 159,
845 /**/
846 158,
847 /**/
848 157,
849 /**/
850 156,
851 /**/
852 155,
853 /**/
854 154,
855 /**/
856 153,
857 /**/
858 152,
859 /**/
860 151,
861 /**/
862 150,
863 /**/
864 149,
865 /**/
866 148,
867 /**/
868 147,
869 /**/
870 146,
871 /**/
872 145,
873 /**/
874 144,
875 /**/
876 143,
877 /**/
878 142,
879 /**/
880 141,
881 /**/
882 140,
883 /**/
884 139,
885 /**/
886 138,
887 /**/
888 137,
889 /**/
890 136,
891 /**/
892 135,
893 /**/
894 134,
895 /**/
896 133,
897 /**/
898 132,
899 /**/
900 131,
901 /**/
902 130,
903 /**/
904 129,
905 /**/
906 128,
907 /**/
908 127,
909 /**/
910 126,
911 /**/
912 125,
913 /**/
914 124,
915 /**/
916 123,
917 /**/
918 122,
919 /**/
920 121,
921 /**/
922 120,
923 /**/
924 119,
925 /**/
926 118,
927 /**/
928 117,
929 /**/
930 116,
931 /**/
932 115,
933 /**/
934 114,
935 /**/
936 113,
937 /**/
938 112,
939 /**/
940 111,
941 /**/
942 110,
943 /**/
944 109,
945 /**/
946 108,
947 /**/
948 107,
949 /**/
950 106,
951 /**/
952 105,
953 /**/
954 104,
955 /**/
956 103,
957 /**/
958 102,
959 /**/
960 101,
961 /**/
962 100,
963 /**/
965 /**/
967 /**/
969 /**/
971 /**/
973 /**/
975 /**/
977 /**/
979 /**/
981 /**/
983 /**/
985 /**/
987 /**/
989 /**/
991 /**/
993 /**/
995 /**/
997 /**/
999 /**/
1001 /**/
1003 /**/
1005 /**/
1007 /**/
1009 /**/
1011 /**/
1013 /**/
1015 /**/
1017 /**/
1019 /**/
1021 /**/
1023 /**/
1025 /**/
1027 /**/
1029 /**/
1031 /**/
1033 /**/
1035 /**/
1037 /**/
1039 /**/
1041 /**/
1043 /**/
1045 /**/
1047 /**/
1049 /**/
1051 /**/
1053 /**/
1055 /**/
1057 /**/
1059 /**/
1061 /**/
1063 /**/
1065 /**/
1067 /**/
1069 /**/
1071 /**/
1073 /**/
1075 /**/
1077 /**/
1079 /**/
1081 /**/
1083 /**/
1085 /**/
1087 /**/
1089 /**/
1091 /**/
1093 /**/
1095 /**/
1097 /**/
1099 /**/
1101 /**/
1103 /**/
1105 /**/
1107 /**/
1109 /**/
1111 /**/
1113 /**/
1115 /**/
1117 /**/
1119 /**/
1121 /**/
1123 /**/
1125 /**/
1127 /**/
1129 /**/
1131 /**/
1133 /**/
1135 /**/
1137 /**/
1139 /**/
1141 /**/
1143 /**/
1145 /**/
1147 /**/
1149 /**/
1151 /**/
1153 /**/
1155 /**/
1157 /**/
1159 /**/
1161 /**/
1166 * Place to put a short description when adding a feature with a patch.
1167 * Keep it short, e.g.,: "relative numbers", "persistent undo".
1168 * Also add a comment marker to separate the lines.
1169 * See the official Vim patches for the diff format: It must use a context of
1170 * one line only. Create it by hand or use "diff -C2" and edit the patch.
1172 static char *(extra_patches[]) =
1173 { /* Add your patch description below this line */
1174 /**/
1175 NULL
1179 highest_patch()
1181 int i;
1182 int h = 0;
1184 for (i = 0; included_patches[i] != 0; ++i)
1185 if (included_patches[i] > h)
1186 h = included_patches[i];
1187 return h;
1190 #if defined(FEAT_EVAL) || defined(PROTO)
1192 * Return TRUE if patch "n" has been included.
1195 has_patch(n)
1196 int n;
1198 int i;
1200 for (i = 0; included_patches[i] != 0; ++i)
1201 if (included_patches[i] == n)
1202 return TRUE;
1203 return FALSE;
1205 #endif
1207 void
1208 ex_version(eap)
1209 exarg_T *eap;
1212 * Ignore a ":version 9.99" command.
1214 if (*eap->arg == NUL)
1216 msg_putchar('\n');
1217 list_version();
1221 void
1222 list_version()
1224 int i;
1225 int first;
1226 char *s = "";
1229 * When adding features here, don't forget to update the list of
1230 * internal variables in eval.c!
1232 MSG(longVersion);
1233 #ifdef WIN3264
1234 # ifdef FEAT_GUI_W32
1235 # if defined(_MSC_VER) && (_MSC_VER <= 1010)
1236 /* Only MS VC 4.1 and earlier can do Win32s */
1237 MSG_PUTS(_("\nMS-Windows 16/32-bit GUI version"));
1238 # else
1239 # ifdef _WIN64
1240 MSG_PUTS(_("\nMS-Windows 64-bit GUI version"));
1241 # else
1242 MSG_PUTS(_("\nMS-Windows 32-bit GUI version"));
1243 # endif
1244 # endif
1245 if (gui_is_win32s())
1246 MSG_PUTS(_(" in Win32s mode"));
1247 # ifdef FEAT_OLE
1248 MSG_PUTS(_(" with OLE support"));
1249 # endif
1250 # else
1251 # ifdef _WIN64
1252 MSG_PUTS(_("\nMS-Windows 64-bit console version"));
1253 # else
1254 MSG_PUTS(_("\nMS-Windows 32-bit console version"));
1255 # endif
1256 # endif
1257 #endif
1258 #ifdef WIN16
1259 MSG_PUTS(_("\nMS-Windows 16-bit version"));
1260 #endif
1261 #ifdef MSDOS
1262 # ifdef DJGPP
1263 MSG_PUTS(_("\n32-bit MS-DOS version"));
1264 # else
1265 MSG_PUTS(_("\n16-bit MS-DOS version"));
1266 # endif
1267 #endif
1268 #ifdef MACOS
1269 # ifdef MACOS_X
1270 # ifdef MACOS_X_UNIX
1271 MSG_PUTS(_("\nMacOS X (unix) version"));
1272 # else
1273 MSG_PUTS(_("\nMacOS X version"));
1274 # endif
1275 #else
1276 MSG_PUTS(_("\nMacOS version"));
1277 # endif
1278 #endif
1280 #ifdef RISCOS
1281 MSG_PUTS(_("\nRISC OS version"));
1282 #endif
1283 #ifdef VMS
1284 MSG_PUTS(_("\nOpenVMS version"));
1285 # ifdef HAVE_PATHDEF
1286 if (*compiled_arch != NUL)
1288 MSG_PUTS(" - ");
1289 MSG_PUTS(compiled_arch);
1291 # endif
1293 #endif
1295 /* Print the list of patch numbers if there is at least one. */
1296 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
1297 if (included_patches[0] != 0)
1299 MSG_PUTS(_("\nIncluded patches: "));
1300 first = -1;
1301 /* find last one */
1302 for (i = 0; included_patches[i] != 0; ++i)
1304 while (--i >= 0)
1306 if (first < 0)
1307 first = included_patches[i];
1308 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1310 MSG_PUTS(s);
1311 s = ", ";
1312 msg_outnum((long)first);
1313 if (first != included_patches[i])
1315 MSG_PUTS("-");
1316 msg_outnum((long)included_patches[i]);
1318 first = -1;
1323 /* Print the list of extra patch descriptions if there is at least one. */
1324 if (extra_patches[0] != NULL)
1326 MSG_PUTS(_("\nExtra patches: "));
1327 s = "";
1328 for (i = 0; extra_patches[i] != NULL; ++i)
1330 MSG_PUTS(s);
1331 s = ", ";
1332 MSG_PUTS(extra_patches[i]);
1336 #ifdef MODIFIED_BY
1337 MSG_PUTS("\n");
1338 MSG_PUTS(_("Modified by "));
1339 MSG_PUTS(MODIFIED_BY);
1340 #endif
1342 #ifdef HAVE_PATHDEF
1343 if (*compiled_user != NUL || *compiled_sys != NUL)
1345 MSG_PUTS(_("\nCompiled "));
1346 if (*compiled_user != NUL)
1348 MSG_PUTS(_("by "));
1349 MSG_PUTS(compiled_user);
1351 if (*compiled_sys != NUL)
1353 MSG_PUTS("@");
1354 MSG_PUTS(compiled_sys);
1357 #endif
1359 #ifdef FEAT_HUGE
1360 MSG_PUTS(_("\nHuge version "));
1361 #else
1362 # ifdef FEAT_BIG
1363 MSG_PUTS(_("\nBig version "));
1364 # else
1365 # ifdef FEAT_NORMAL
1366 MSG_PUTS(_("\nNormal version "));
1367 # else
1368 # ifdef FEAT_SMALL
1369 MSG_PUTS(_("\nSmall version "));
1370 # else
1371 MSG_PUTS(_("\nTiny version "));
1372 # endif
1373 # endif
1374 # endif
1375 #endif
1376 #ifndef FEAT_GUI
1377 MSG_PUTS(_("without GUI."));
1378 #else
1379 # ifdef FEAT_GUI_GTK
1380 # ifdef FEAT_GUI_GNOME
1381 # ifdef HAVE_GTK2
1382 MSG_PUTS(_("with GTK2-GNOME GUI."));
1383 # else
1384 MSG_PUTS(_("with GTK-GNOME GUI."));
1385 # endif
1386 # else
1387 # ifdef HAVE_GTK2
1388 MSG_PUTS(_("with GTK2 GUI."));
1389 # else
1390 MSG_PUTS(_("with GTK GUI."));
1391 # endif
1392 # endif
1393 # else
1394 # ifdef FEAT_GUI_MOTIF
1395 MSG_PUTS(_("with X11-Motif GUI."));
1396 # else
1397 # ifdef FEAT_GUI_ATHENA
1398 # ifdef FEAT_GUI_NEXTAW
1399 MSG_PUTS(_("with X11-neXtaw GUI."));
1400 # else
1401 MSG_PUTS(_("with X11-Athena GUI."));
1402 # endif
1403 # else
1404 # ifdef FEAT_GUI_PHOTON
1405 MSG_PUTS(_("with Photon GUI."));
1406 # else
1407 # if defined(MSWIN)
1408 MSG_PUTS(_("with GUI."));
1409 # else
1410 # if defined FEAT_GUI_MACVIM
1411 MSG_PUTS(_("with MacVim GUI."));
1412 # else
1413 # if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
1414 MSG_PUTS(_("with Carbon GUI."));
1415 # else
1416 # if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
1417 MSG_PUTS(_("with Cocoa GUI."));
1418 # else
1419 # if defined (MACOS)
1420 MSG_PUTS(_("with (classic) GUI."));
1421 # endif
1422 # endif
1423 # endif
1424 # endif
1425 # endif
1426 # endif
1427 # endif
1428 # endif
1429 # endif
1430 #endif
1431 version_msg(_(" Features included (+) or not (-):\n"));
1433 /* print all the features */
1434 for (i = 0; features[i] != NULL; ++i)
1436 version_msg(features[i]);
1437 if (msg_col > 0)
1438 version_msg(" ");
1441 version_msg("\n");
1442 #ifdef SYS_VIMRC_FILE
1443 version_msg(_(" system vimrc file: \""));
1444 version_msg(SYS_VIMRC_FILE);
1445 version_msg("\"\n");
1446 #endif
1447 #ifdef USR_VIMRC_FILE
1448 version_msg(_(" user vimrc file: \""));
1449 version_msg(USR_VIMRC_FILE);
1450 version_msg("\"\n");
1451 #endif
1452 #ifdef USR_VIMRC_FILE2
1453 version_msg(_(" 2nd user vimrc file: \""));
1454 version_msg(USR_VIMRC_FILE2);
1455 version_msg("\"\n");
1456 #endif
1457 #ifdef USR_VIMRC_FILE3
1458 version_msg(_(" 3rd user vimrc file: \""));
1459 version_msg(USR_VIMRC_FILE3);
1460 version_msg("\"\n");
1461 #endif
1462 #ifdef USR_EXRC_FILE
1463 version_msg(_(" user exrc file: \""));
1464 version_msg(USR_EXRC_FILE);
1465 version_msg("\"\n");
1466 #endif
1467 #ifdef USR_EXRC_FILE2
1468 version_msg(_(" 2nd user exrc file: \""));
1469 version_msg(USR_EXRC_FILE2);
1470 version_msg("\"\n");
1471 #endif
1472 #ifdef FEAT_GUI
1473 # ifdef SYS_GVIMRC_FILE
1474 version_msg(_(" system gvimrc file: \""));
1475 version_msg(SYS_GVIMRC_FILE);
1476 version_msg("\"\n");
1477 # endif
1478 version_msg(_(" user gvimrc file: \""));
1479 version_msg(USR_GVIMRC_FILE);
1480 version_msg("\"\n");
1481 # ifdef USR_GVIMRC_FILE2
1482 version_msg(_("2nd user gvimrc file: \""));
1483 version_msg(USR_GVIMRC_FILE2);
1484 version_msg("\"\n");
1485 # endif
1486 # ifdef USR_GVIMRC_FILE3
1487 version_msg(_("3rd user gvimrc file: \""));
1488 version_msg(USR_GVIMRC_FILE3);
1489 version_msg("\"\n");
1490 # endif
1491 #endif
1492 #ifdef FEAT_GUI
1493 # ifdef SYS_MENU_FILE
1494 version_msg(_(" system menu file: \""));
1495 version_msg(SYS_MENU_FILE);
1496 version_msg("\"\n");
1497 # endif
1498 #endif
1499 #ifdef HAVE_PATHDEF
1500 if (*default_vim_dir != NUL)
1502 version_msg(_(" fall-back for $VIM: \""));
1503 version_msg((char *)default_vim_dir);
1504 version_msg("\"\n");
1506 if (*default_vimruntime_dir != NUL)
1508 version_msg(_(" f-b for $VIMRUNTIME: \""));
1509 version_msg((char *)default_vimruntime_dir);
1510 version_msg("\"\n");
1512 version_msg(_("Compilation: "));
1513 version_msg((char *)all_cflags);
1514 version_msg("\n");
1515 #ifdef VMS
1516 if (*compiler_version != NUL)
1518 version_msg(_("Compiler: "));
1519 version_msg((char *)compiler_version);
1520 version_msg("\n");
1522 #endif
1523 version_msg(_("Linking: "));
1524 version_msg((char *)all_lflags);
1525 #endif
1526 #ifdef DEBUG
1527 version_msg("\n");
1528 version_msg(_(" DEBUG BUILD"));
1529 #endif
1533 * Output a string for the version message. If it's going to wrap, output a
1534 * newline, unless the message is too long to fit on the screen anyway.
1536 static void
1537 version_msg(s)
1538 char *s;
1540 int len = (int)STRLEN(s);
1542 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1543 && *s != '\n')
1544 msg_putchar('\n');
1545 if (!got_int)
1546 MSG_PUTS(s);
1549 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1552 * Give an introductory message about Vim.
1553 * Only used when starting Vim on an empty file, without a file name.
1554 * Or with the ":intro" command (for Sven :-).
1556 void
1557 intro_message(colon)
1558 int colon; /* TRUE for ":intro" */
1560 int i;
1561 int row;
1562 int blanklines;
1563 int sponsor;
1564 char *p;
1565 static char *(lines[]) =
1567 N_("VIM - Vi IMproved"),
1569 N_("version "),
1570 N_("by Bram Moolenaar et al."),
1571 #ifdef MODIFIED_BY
1572 " ",
1573 #endif
1574 N_("Vim is open source and freely distributable"),
1576 N_("Help poor children in Uganda!"),
1577 N_("type :help iccf<Enter> for information "),
1579 N_("type :q<Enter> to exit "),
1580 N_("type :help<Enter> or <F1> for on-line help"),
1581 #ifdef FEAT_GUI_MACVIM
1582 // TODO: Don't steal the show from version7 help?
1583 N_("type :help macvim<Enter> for MacVim help "),
1584 #else
1585 N_("type :help version7<Enter> for version info"),
1586 #endif
1587 NULL,
1589 N_("Running in Vi compatible mode"),
1590 N_("type :set nocp<Enter> for Vim defaults"),
1591 N_("type :help cp-default<Enter> for info on this"),
1593 #ifdef FEAT_GUI
1594 static char *(gui_lines[]) =
1596 NULL,
1597 NULL,
1598 NULL,
1599 NULL,
1600 #ifdef MODIFIED_BY
1601 NULL,
1602 #endif
1603 NULL,
1604 NULL,
1605 NULL,
1606 N_("menu Help->Orphans for information "),
1607 NULL,
1608 N_("Running modeless, typed text is inserted"),
1609 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1610 N_(" for two modes "),
1611 NULL,
1612 NULL,
1613 NULL,
1614 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1615 N_(" for Vim defaults "),
1617 #endif
1619 /* blanklines = screen height - # message lines */
1620 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1621 if (!p_cp)
1622 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1623 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1624 if (mch_windows95())
1625 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1626 #endif
1628 #ifdef FEAT_WINDOWS
1629 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1630 if (p_ls > 1)
1631 blanklines -= Rows - topframe->fr_height;
1632 #endif
1633 if (blanklines < 0)
1634 blanklines = 0;
1636 /* Show the sponsor and register message one out of four times, the Uganda
1637 * message two out of four times. */
1638 sponsor = (int)time(NULL);
1639 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1641 /* start displaying the message lines after half of the blank lines */
1642 row = blanklines / 2;
1643 if ((row >= 2 && Columns >= 50) || colon)
1645 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1647 p = lines[i];
1648 #ifdef FEAT_GUI
1649 if (p_im && gui.in_use && gui_lines[i] != NULL)
1650 p = gui_lines[i];
1651 #endif
1652 if (p == NULL)
1654 if (!p_cp)
1655 break;
1656 continue;
1658 if (sponsor != 0)
1660 if (strstr(p, "children") != NULL)
1661 p = sponsor < 0
1662 ? N_("Sponsor Vim development!")
1663 : N_("Become a registered Vim user!");
1664 else if (strstr(p, "iccf") != NULL)
1665 p = sponsor < 0
1666 ? N_("type :help sponsor<Enter> for information ")
1667 : N_("type :help register<Enter> for information ");
1668 else if (strstr(p, "Orphans") != NULL)
1669 p = N_("menu Help->Sponsor/Register for information ");
1671 if (*p != NUL)
1672 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1673 ++row;
1675 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1676 if (mch_windows95())
1678 do_intro_line(++row,
1679 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1680 FALSE, hl_attr(HLF_E));
1681 do_intro_line(++row,
1682 (char_u *)_("type :help windows95<Enter> for info on this"),
1683 FALSE, 0);
1685 #endif
1688 /* Make the wait-return message appear just below the text. */
1689 if (colon)
1690 msg_row = row;
1693 static void
1694 do_intro_line(row, mesg, add_version, attr)
1695 int row;
1696 char_u *mesg;
1697 int add_version;
1698 int attr;
1700 char_u vers[20];
1701 int col;
1702 char_u *p;
1703 int l;
1704 int clen;
1705 #ifdef MODIFIED_BY
1706 # define MODBY_LEN 150
1707 char_u modby[MODBY_LEN];
1709 if (*mesg == ' ')
1711 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
1712 l = STRLEN(modby);
1713 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
1714 mesg = modby;
1716 #endif
1718 /* Center the message horizontally. */
1719 col = vim_strsize(mesg);
1720 if (add_version)
1722 STRCPY(vers, mediumVersion);
1723 if (highest_patch())
1725 /* Check for 9.9x or 9.9xx, alpha/beta version */
1726 if (isalpha((int)mediumVersion[3]))
1728 if (isalpha((int)mediumVersion[4]))
1729 sprintf((char *)vers + 5, ".%d%s", highest_patch(),
1730 mediumVersion + 5);
1731 else
1732 sprintf((char *)vers + 4, ".%d%s", highest_patch(),
1733 mediumVersion + 4);
1735 else
1736 sprintf((char *)vers + 3, ".%d", highest_patch());
1738 col += (int)STRLEN(vers);
1740 col = (Columns - col) / 2;
1741 if (col < 0)
1742 col = 0;
1744 /* Split up in parts to highlight <> items differently. */
1745 for (p = mesg; *p != NUL; p += l)
1747 clen = 0;
1748 for (l = 0; p[l] != NUL
1749 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1751 #ifdef FEAT_MBYTE
1752 if (has_mbyte)
1754 clen += ptr2cells(p + l);
1755 l += (*mb_ptr2len)(p + l) - 1;
1757 else
1758 #endif
1759 clen += byte2cells(p[l]);
1761 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1762 col += clen;
1765 /* Add the version number to the version line. */
1766 if (add_version)
1767 screen_puts(vers, row, col, 0);
1771 * ":intro": clear screen, display intro screen and wait for return.
1773 void
1774 ex_intro(eap)
1775 exarg_T *eap UNUSED;
1777 screenclear();
1778 intro_message(TRUE);
1779 wait_return(TRUE);