Merge branch 'vim'
[MacVim.git] / src / version.c
blob509c02078c6572bda3ad1ad46cd66ad30cbeba67
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_ODB_EDITOR
399 "+odbeditor",
400 #else
401 "-odbeditor",
402 #endif
403 #ifdef FEAT_GUI_W32
404 # ifdef FEAT_OLE
405 "+ole",
406 # else
407 "-ole",
408 # endif
409 #endif
410 #ifdef FEAT_OSFILETYPE
411 "+osfiletype",
412 #else
413 "-osfiletype",
414 #endif
415 #ifdef FEAT_PATH_EXTRA
416 "+path_extra",
417 #else
418 "-path_extra",
419 #endif
420 #ifdef FEAT_PERL
421 # ifdef DYNAMIC_PERL
422 "+perl/dyn",
423 # else
424 "+perl",
425 # endif
426 #else
427 "-perl",
428 #endif
429 #ifdef FEAT_PRINTER
430 # ifdef FEAT_POSTSCRIPT
431 "+postscript",
432 # else
433 "-postscript",
434 # endif
435 "+printer",
436 #else
437 "-printer",
438 #endif
439 #ifdef FEAT_PROFILE
440 "+profile",
441 #else
442 "-profile",
443 #endif
444 #ifdef FEAT_PYTHON
445 # ifdef DYNAMIC_PYTHON
446 "+python/dyn",
447 # else
448 "+python",
449 # endif
450 #else
451 "-python",
452 #endif
453 #ifdef FEAT_QUICKFIX
454 "+quickfix",
455 #else
456 "-quickfix",
457 #endif
458 #ifdef FEAT_RELTIME
459 "+reltime",
460 #else
461 "-reltime",
462 #endif
463 #ifdef FEAT_RIGHTLEFT
464 "+rightleft",
465 #else
466 "-rightleft",
467 #endif
468 #ifdef FEAT_RUBY
469 # ifdef DYNAMIC_RUBY
470 "+ruby/dyn",
471 # else
472 "+ruby",
473 # endif
474 #else
475 "-ruby",
476 #endif
477 #ifdef FEAT_SCROLLBIND
478 "+scrollbind",
479 #else
480 "-scrollbind",
481 #endif
482 #ifdef FEAT_SIGNS
483 "+signs",
484 #else
485 "-signs",
486 #endif
487 #ifdef FEAT_SMARTINDENT
488 "+smartindent",
489 #else
490 "-smartindent",
491 #endif
492 #ifdef FEAT_SNIFF
493 "+sniff",
494 #else
495 "-sniff",
496 #endif
497 #ifdef FEAT_STL_OPT
498 "+statusline",
499 #else
500 "-statusline",
501 #endif
502 #ifdef FEAT_SUN_WORKSHOP
503 "+sun_workshop",
504 #else
505 "-sun_workshop",
506 #endif
507 #ifdef FEAT_SYN_HL
508 "+syntax",
509 #else
510 "-syntax",
511 #endif
512 /* only interesting on Unix systems */
513 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
514 "+system()",
515 #endif
516 #ifdef FEAT_TAG_BINS
517 "+tag_binary",
518 #else
519 "-tag_binary",
520 #endif
521 #ifdef FEAT_TAG_OLDSTATIC
522 "+tag_old_static",
523 #else
524 "-tag_old_static",
525 #endif
526 #ifdef FEAT_TAG_ANYWHITE
527 "+tag_any_white",
528 #else
529 "-tag_any_white",
530 #endif
531 #ifdef FEAT_TCL
532 # ifdef DYNAMIC_TCL
533 "+tcl/dyn",
534 # else
535 "+tcl",
536 # endif
537 #else
538 "-tcl",
539 #endif
540 #if defined(UNIX) || defined(__EMX__)
541 /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
542 # ifdef TERMINFO
543 "+terminfo",
544 # else
545 "-terminfo",
546 # endif
547 #else /* unix always includes termcap support */
548 # ifdef HAVE_TGETENT
549 "+tgetent",
550 # else
551 "-tgetent",
552 # endif
553 #endif
554 #ifdef FEAT_TERMRESPONSE
555 "+termresponse",
556 #else
557 "-termresponse",
558 #endif
559 #ifdef FEAT_TEXTOBJ
560 "+textobjects",
561 #else
562 "-textobjects",
563 #endif
564 #ifdef FEAT_TITLE
565 "+title",
566 #else
567 "-title",
568 #endif
569 #ifdef FEAT_TOOLBAR
570 "+toolbar",
571 #else
572 "-toolbar",
573 #endif
574 #ifdef FEAT_TRANSPARENCY
575 "+transparency",
576 #else
577 "-transparency",
578 #endif
579 #ifdef FEAT_USR_CMDS
580 "+user_commands",
581 #else
582 "-user_commands",
583 #endif
584 #ifdef FEAT_VERTSPLIT
585 "+vertsplit",
586 #else
587 "-vertsplit",
588 #endif
589 #ifdef FEAT_VIRTUALEDIT
590 "+virtualedit",
591 #else
592 "-virtualedit",
593 #endif
594 #ifdef FEAT_VISUAL
595 "+visual",
596 # ifdef FEAT_VISUALEXTRA
597 "+visualextra",
598 # else
599 "-visualextra",
600 # endif
601 #else
602 "-visual",
603 #endif
604 #ifdef FEAT_VIMINFO
605 "+viminfo",
606 #else
607 "-viminfo",
608 #endif
609 #ifdef FEAT_VREPLACE
610 "+vreplace",
611 #else
612 "-vreplace",
613 #endif
614 #ifdef FEAT_WILDIGN
615 "+wildignore",
616 #else
617 "-wildignore",
618 #endif
619 #ifdef FEAT_WILDMENU
620 "+wildmenu",
621 #else
622 "-wildmenu",
623 #endif
624 #ifdef FEAT_WINDOWS
625 "+windows",
626 #else
627 "-windows",
628 #endif
629 #ifdef FEAT_WRITEBACKUP
630 "+writebackup",
631 #else
632 "-writebackup",
633 #endif
634 #if defined(UNIX) || defined(VMS)
635 # ifdef FEAT_X11
636 "+X11",
637 # else
638 "-X11",
639 # endif
640 #endif
641 #ifdef FEAT_XFONTSET
642 "+xfontset",
643 #else
644 "-xfontset",
645 #endif
646 #ifdef FEAT_XIM
647 "+xim",
648 #else
649 "-xim",
650 #endif
651 #if defined(UNIX) || defined(VMS)
652 # ifdef USE_XSMP_INTERACT
653 "+xsmp_interact",
654 # else
655 # ifdef USE_XSMP
656 "+xsmp",
657 # else
658 "-xsmp",
659 # endif
660 # endif
661 # ifdef FEAT_XCLIPBOARD
662 "+xterm_clipboard",
663 # else
664 "-xterm_clipboard",
665 # endif
666 #endif
667 #ifdef FEAT_XTERM_SAVE
668 "+xterm_save",
669 #else
670 "-xterm_save",
671 #endif
672 #ifdef WIN3264
673 # ifdef FEAT_XPM_W32
674 "+xpm_w32",
675 # else
676 "-xpm_w32",
677 # endif
678 #endif
679 NULL
682 static int included_patches[] =
683 { /* Add new patch number below this line */
684 /**/
685 314,
686 /**/
687 313,
688 /**/
689 312,
690 /**/
691 311,
692 /**/
693 310,
694 /**/
695 309,
696 /**/
697 308,
698 /**/
699 307,
700 /**/
701 306,
702 /**/
703 305,
704 /**/
705 304,
706 /**/
707 303,
708 /**/
709 302,
710 /**/
711 301,
712 /**/
713 300,
714 /**/
715 299,
716 /**/
717 298,
718 /**/
719 297,
720 /**/
721 296,
722 /**/
723 295,
724 /**/
725 294,
726 /**/
727 293,
728 /**/
729 292,
730 /**/
731 291,
732 /**/
733 290,
734 /**/
735 289,
736 /**/
737 288,
738 /**/
739 287,
740 /**/
741 286,
742 /**/
743 285,
744 /**/
745 284,
746 /**/
747 283,
748 /**/
749 282,
750 /**/
751 281,
752 /**/
753 280,
754 /**/
755 279,
756 /**/
757 278,
758 /**/
759 277,
760 /**/
761 276,
762 /**/
763 275,
764 /**/
765 274,
766 /**/
767 273,
768 /**/
769 272,
770 /**/
771 271,
772 /**/
773 270,
774 /**/
775 269,
776 /**/
777 268,
778 /**/
779 267,
780 /**/
781 266,
782 /**/
783 265,
784 /**/
785 264,
786 /**/
787 263,
788 /**/
789 262,
790 /**/
791 261,
792 /**/
793 260,
794 /**/
795 259,
796 /**/
797 258,
798 /**/
799 257,
800 /**/
801 256,
802 /**/
803 255,
804 /**/
805 254,
806 /**/
807 253,
808 /**/
809 252,
810 /**/
811 251,
812 /**/
813 250,
814 /**/
815 249,
816 /**/
817 248,
818 /**/
819 247,
820 /**/
821 246,
822 /**/
823 245,
824 /**/
825 244,
826 /**/
827 243,
828 /**/
829 242,
830 /**/
831 241,
832 /**/
833 240,
834 /**/
835 239,
836 /**/
837 238,
838 /**/
839 237,
840 /**/
841 236,
842 /**/
843 235,
844 /**/
845 234,
846 /**/
847 233,
848 /**/
849 232,
850 /**/
851 231,
852 /**/
853 230,
854 /**/
855 229,
856 /**/
857 228,
858 /**/
859 227,
860 /**/
861 226,
862 /**/
863 225,
864 /**/
865 224,
866 /**/
867 223,
868 /**/
869 222,
870 /**/
871 221,
872 /**/
873 220,
874 /**/
875 219,
876 /**/
877 218,
878 /**/
879 217,
880 /**/
881 216,
882 /**/
883 215,
884 /**/
885 214,
886 /**/
887 213,
888 /**/
889 212,
890 /**/
891 211,
892 /**/
893 210,
894 /**/
895 209,
896 /**/
897 208,
898 /**/
899 207,
900 /**/
901 206,
902 /**/
903 205,
904 /**/
905 204,
906 /**/
907 203,
908 /**/
909 202,
910 /**/
911 201,
912 /**/
913 200,
914 /**/
915 199,
916 /**/
917 198,
918 /**/
919 197,
920 /**/
921 196,
922 /**/
923 195,
924 /**/
925 194,
926 /**/
927 193,
928 /**/
929 192,
930 /**/
931 191,
932 /**/
933 190,
934 /**/
935 189,
936 /**/
937 188,
938 /**/
939 187,
940 /**/
941 186,
942 /**/
943 185,
944 /**/
945 184,
946 /**/
947 183,
948 /**/
949 182,
950 /**/
951 181,
952 /**/
953 180,
954 /**/
955 179,
956 /**/
957 178,
958 /**/
959 177,
960 /**/
961 176,
962 /**/
963 175,
964 /**/
965 174,
966 /**/
967 173,
968 /**/
969 172,
970 /**/
971 171,
972 /**/
973 170,
974 /**/
975 169,
976 /**/
977 168,
978 /**/
979 167,
980 /**/
981 166,
982 /**/
983 165,
984 /**/
985 164,
986 /**/
987 163,
988 /**/
989 162,
990 /**/
991 161,
992 /**/
993 160,
994 /**/
995 159,
996 /**/
997 158,
998 /**/
999 157,
1000 /**/
1001 156,
1002 /**/
1003 155,
1004 /**/
1005 154,
1006 /**/
1007 153,
1008 /**/
1009 152,
1010 /**/
1011 151,
1012 /**/
1013 150,
1014 /**/
1015 149,
1016 /**/
1017 148,
1018 /**/
1019 147,
1020 /**/
1021 146,
1022 /**/
1023 145,
1024 /**/
1025 144,
1026 /**/
1027 143,
1028 /**/
1029 142,
1030 /**/
1031 141,
1032 /**/
1033 140,
1034 /**/
1035 139,
1036 /**/
1037 138,
1038 /**/
1039 137,
1040 /**/
1041 136,
1042 /**/
1043 135,
1044 /**/
1045 134,
1046 /**/
1047 133,
1048 /**/
1049 132,
1050 /**/
1051 131,
1052 /**/
1053 130,
1054 /**/
1055 129,
1056 /**/
1057 128,
1058 /**/
1059 127,
1060 /**/
1061 126,
1062 /**/
1063 125,
1064 /**/
1065 124,
1066 /**/
1067 123,
1068 /**/
1069 122,
1070 /**/
1071 121,
1072 /**/
1073 120,
1074 /**/
1075 119,
1076 /**/
1077 118,
1078 /**/
1079 117,
1080 /**/
1081 116,
1082 /**/
1083 115,
1084 /**/
1085 114,
1086 /**/
1087 113,
1088 /**/
1089 112,
1090 /**/
1091 111,
1092 /**/
1093 110,
1094 /**/
1095 109,
1096 /**/
1097 108,
1098 /**/
1099 107,
1100 /**/
1101 106,
1102 /**/
1103 105,
1104 /**/
1105 104,
1106 /**/
1107 103,
1108 /**/
1109 102,
1110 /**/
1111 101,
1112 /**/
1113 100,
1114 /**/
1116 /**/
1118 /**/
1120 /**/
1122 /**/
1124 /**/
1126 /**/
1128 /**/
1130 /**/
1132 /**/
1134 /**/
1136 /**/
1138 /**/
1140 /**/
1142 /**/
1144 /**/
1146 /**/
1148 /**/
1150 /**/
1152 /**/
1154 /**/
1156 /**/
1158 /**/
1160 /**/
1162 /**/
1164 /**/
1166 /**/
1168 /**/
1170 /**/
1172 /**/
1174 /**/
1176 /**/
1178 /**/
1180 /**/
1182 /**/
1184 /**/
1186 /**/
1188 /**/
1190 /**/
1192 /**/
1194 /**/
1196 /**/
1198 /**/
1200 /**/
1202 /**/
1204 /**/
1206 /**/
1208 /**/
1210 /**/
1212 /**/
1214 /**/
1216 /**/
1218 /**/
1220 /**/
1222 /**/
1224 /**/
1226 /**/
1228 /**/
1230 /**/
1232 /**/
1234 /**/
1236 /**/
1238 /**/
1240 /**/
1242 /**/
1244 /**/
1246 /**/
1248 /**/
1250 /**/
1252 /**/
1254 /**/
1256 /**/
1258 /**/
1260 /**/
1262 /**/
1264 /**/
1266 /**/
1268 /**/
1270 /**/
1272 /**/
1274 /**/
1276 /**/
1278 /**/
1280 /**/
1282 /**/
1284 /**/
1286 /**/
1288 /**/
1290 /**/
1292 /**/
1294 /**/
1296 /**/
1298 /**/
1300 /**/
1302 /**/
1304 /**/
1306 /**/
1308 /**/
1310 /**/
1312 /**/
1317 highest_patch()
1319 int i;
1320 int h = 0;
1322 for (i = 0; included_patches[i] != 0; ++i)
1323 if (included_patches[i] > h)
1324 h = included_patches[i];
1325 return h;
1328 #if defined(FEAT_EVAL) || defined(PROTO)
1330 * Return TRUE if patch "n" has been included.
1333 has_patch(n)
1334 int n;
1336 int i;
1338 for (i = 0; included_patches[i] != 0; ++i)
1339 if (included_patches[i] == n)
1340 return TRUE;
1341 return FALSE;
1343 #endif
1345 void
1346 ex_version(eap)
1347 exarg_T *eap;
1350 * Ignore a ":version 9.99" command.
1352 if (*eap->arg == NUL)
1354 msg_putchar('\n');
1355 list_version();
1359 void
1360 list_version()
1362 int i;
1363 int first;
1364 char *s = "";
1367 * When adding features here, don't forget to update the list of
1368 * internal variables in eval.c!
1370 MSG(longVersion);
1371 #ifdef WIN3264
1372 # ifdef FEAT_GUI_W32
1373 # if defined(_MSC_VER) && (_MSC_VER <= 1010)
1374 /* Only MS VC 4.1 and earlier can do Win32s */
1375 MSG_PUTS(_("\nMS-Windows 16/32 bit GUI version"));
1376 # else
1377 # ifdef _WIN64
1378 MSG_PUTS(_("\nMS-Windows 64 bit GUI version"));
1379 # else
1380 MSG_PUTS(_("\nMS-Windows 32 bit GUI version"));
1381 # endif
1382 # endif
1383 if (gui_is_win32s())
1384 MSG_PUTS(_(" in Win32s mode"));
1385 # ifdef FEAT_OLE
1386 MSG_PUTS(_(" with OLE support"));
1387 # endif
1388 # else
1389 MSG_PUTS(_("\nMS-Windows 32 bit console version"));
1390 # endif
1391 #endif
1392 #ifdef WIN16
1393 MSG_PUTS(_("\nMS-Windows 16 bit version"));
1394 #endif
1395 #ifdef MSDOS
1396 # ifdef DJGPP
1397 MSG_PUTS(_("\n32 bit MS-DOS version"));
1398 # else
1399 MSG_PUTS(_("\n16 bit MS-DOS version"));
1400 # endif
1401 #endif
1402 #ifdef MACOS
1403 # ifdef MACOS_X
1404 # ifdef MACOS_X_UNIX
1405 MSG_PUTS(_("\nMacOS X (unix) version"));
1406 # else
1407 MSG_PUTS(_("\nMacOS X version"));
1408 # endif
1409 #else
1410 MSG_PUTS(_("\nMacOS version"));
1411 # endif
1412 #endif
1414 #ifdef RISCOS
1415 MSG_PUTS(_("\nRISC OS version"));
1416 #endif
1417 #ifdef VMS
1418 MSG_PUTS("\nOpenVMS version");
1419 # ifdef HAVE_PATHDEF
1420 if (*compiled_arch != NUL)
1422 MSG_PUTS(" - ");
1423 MSG_PUTS(compiled_arch);
1425 # endif
1427 #endif
1429 /* Print the list of patch numbers if there is at least one. */
1430 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
1431 if (included_patches[0] != 0)
1433 MSG_PUTS(_("\nIncluded patches: "));
1434 first = -1;
1435 /* find last one */
1436 for (i = 0; included_patches[i] != 0; ++i)
1438 while (--i >= 0)
1440 if (first < 0)
1441 first = included_patches[i];
1442 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1444 MSG_PUTS(s);
1445 s = ", ";
1446 msg_outnum((long)first);
1447 if (first != included_patches[i])
1449 MSG_PUTS("-");
1450 msg_outnum((long)included_patches[i]);
1452 first = -1;
1457 #ifdef MODIFIED_BY
1458 MSG_PUTS("\n");
1459 MSG_PUTS(_("Modified by "));
1460 MSG_PUTS(MODIFIED_BY);
1461 #endif
1463 #ifdef HAVE_PATHDEF
1464 if (*compiled_user != NUL || *compiled_sys != NUL)
1466 MSG_PUTS(_("\nCompiled "));
1467 if (*compiled_user != NUL)
1469 MSG_PUTS(_("by "));
1470 MSG_PUTS(compiled_user);
1472 if (*compiled_sys != NUL)
1474 MSG_PUTS("@");
1475 MSG_PUTS(compiled_sys);
1478 #endif
1480 #ifdef FEAT_HUGE
1481 MSG_PUTS(_("\nHuge version "));
1482 #else
1483 # ifdef FEAT_BIG
1484 MSG_PUTS(_("\nBig version "));
1485 # else
1486 # ifdef FEAT_NORMAL
1487 MSG_PUTS(_("\nNormal version "));
1488 # else
1489 # ifdef FEAT_SMALL
1490 MSG_PUTS(_("\nSmall version "));
1491 # else
1492 MSG_PUTS(_("\nTiny version "));
1493 # endif
1494 # endif
1495 # endif
1496 #endif
1497 #ifndef FEAT_GUI
1498 MSG_PUTS(_("without GUI."));
1499 #else
1500 # ifdef FEAT_GUI_GTK
1501 # ifdef FEAT_GUI_GNOME
1502 # ifdef HAVE_GTK2
1503 MSG_PUTS(_("with GTK2-GNOME GUI."));
1504 # else
1505 MSG_PUTS(_("with GTK-GNOME GUI."));
1506 # endif
1507 # else
1508 # ifdef HAVE_GTK2
1509 MSG_PUTS(_("with GTK2 GUI."));
1510 # else
1511 MSG_PUTS(_("with GTK GUI."));
1512 # endif
1513 # endif
1514 # else
1515 # ifdef FEAT_GUI_MOTIF
1516 MSG_PUTS(_("with X11-Motif GUI."));
1517 # else
1518 # ifdef FEAT_GUI_ATHENA
1519 # ifdef FEAT_GUI_NEXTAW
1520 MSG_PUTS(_("with X11-neXtaw GUI."));
1521 # else
1522 MSG_PUTS(_("with X11-Athena GUI."));
1523 # endif
1524 # else
1525 # ifdef FEAT_GUI_PHOTON
1526 MSG_PUTS(_("with Photon GUI."));
1527 # else
1528 # if defined(MSWIN)
1529 MSG_PUTS(_("with GUI."));
1530 # else
1531 # if defined FEAT_GUI_MACVIM
1532 MSG_PUTS(_("with MacVim GUI."));
1533 # else
1534 # if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
1535 MSG_PUTS(_("with Carbon GUI."));
1536 # else
1537 # if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
1538 MSG_PUTS(_("with Cocoa GUI."));
1539 # else
1540 # if defined (MACOS)
1541 MSG_PUTS(_("with (classic) GUI."));
1542 # endif
1543 # endif
1544 # endif
1545 # endif
1546 # endif
1547 # endif
1548 # endif
1549 # endif
1550 # endif
1551 #endif
1552 version_msg(_(" Features included (+) or not (-):\n"));
1554 /* print all the features */
1555 for (i = 0; features[i] != NULL; ++i)
1557 version_msg(features[i]);
1558 if (msg_col > 0)
1559 version_msg(" ");
1562 version_msg("\n");
1563 #ifdef SYS_VIMRC_FILE
1564 version_msg(_(" system vimrc file: \""));
1565 version_msg(SYS_VIMRC_FILE);
1566 version_msg("\"\n");
1567 #endif
1568 #ifdef USR_VIMRC_FILE
1569 version_msg(_(" user vimrc file: \""));
1570 version_msg(USR_VIMRC_FILE);
1571 version_msg("\"\n");
1572 #endif
1573 #ifdef USR_VIMRC_FILE2
1574 version_msg(_(" 2nd user vimrc file: \""));
1575 version_msg(USR_VIMRC_FILE2);
1576 version_msg("\"\n");
1577 #endif
1578 #ifdef USR_VIMRC_FILE3
1579 version_msg(_(" 3rd user vimrc file: \""));
1580 version_msg(USR_VIMRC_FILE3);
1581 version_msg("\"\n");
1582 #endif
1583 #ifdef USR_EXRC_FILE
1584 version_msg(_(" user exrc file: \""));
1585 version_msg(USR_EXRC_FILE);
1586 version_msg("\"\n");
1587 #endif
1588 #ifdef USR_EXRC_FILE2
1589 version_msg(_(" 2nd user exrc file: \""));
1590 version_msg(USR_EXRC_FILE2);
1591 version_msg("\"\n");
1592 #endif
1593 #ifdef FEAT_GUI
1594 # ifdef SYS_GVIMRC_FILE
1595 version_msg(_(" system gvimrc file: \""));
1596 version_msg(SYS_GVIMRC_FILE);
1597 version_msg("\"\n");
1598 # endif
1599 version_msg(_(" user gvimrc file: \""));
1600 version_msg(USR_GVIMRC_FILE);
1601 version_msg("\"\n");
1602 # ifdef USR_GVIMRC_FILE2
1603 version_msg(_("2nd user gvimrc file: \""));
1604 version_msg(USR_GVIMRC_FILE2);
1605 version_msg("\"\n");
1606 # endif
1607 # ifdef USR_GVIMRC_FILE3
1608 version_msg(_("3rd user gvimrc file: \""));
1609 version_msg(USR_GVIMRC_FILE3);
1610 version_msg("\"\n");
1611 # endif
1612 #endif
1613 #ifdef FEAT_GUI
1614 # ifdef SYS_MENU_FILE
1615 version_msg(_(" system menu file: \""));
1616 version_msg(SYS_MENU_FILE);
1617 version_msg("\"\n");
1618 # endif
1619 #endif
1620 #ifdef HAVE_PATHDEF
1621 if (*default_vim_dir != NUL)
1623 version_msg(_(" fall-back for $VIM: \""));
1624 version_msg((char *)default_vim_dir);
1625 version_msg("\"\n");
1627 if (*default_vimruntime_dir != NUL)
1629 version_msg(_(" f-b for $VIMRUNTIME: \""));
1630 version_msg((char *)default_vimruntime_dir);
1631 version_msg("\"\n");
1633 version_msg(_("Compilation: "));
1634 version_msg((char *)all_cflags);
1635 version_msg("\n");
1636 #ifdef VMS
1637 if (*compiler_version != NUL)
1639 version_msg(_("Compiler: "));
1640 version_msg((char *)compiler_version);
1641 version_msg("\n");
1643 #endif
1644 version_msg(_("Linking: "));
1645 version_msg((char *)all_lflags);
1646 #endif
1647 #ifdef DEBUG
1648 version_msg("\n");
1649 version_msg(_(" DEBUG BUILD"));
1650 #endif
1654 * Output a string for the version message. If it's going to wrap, output a
1655 * newline, unless the message is too long to fit on the screen anyway.
1657 static void
1658 version_msg(s)
1659 char *s;
1661 int len = (int)STRLEN(s);
1663 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1664 && *s != '\n')
1665 msg_putchar('\n');
1666 if (!got_int)
1667 MSG_PUTS(s);
1670 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1673 * Give an introductory message about Vim.
1674 * Only used when starting Vim on an empty file, without a file name.
1675 * Or with the ":intro" command (for Sven :-).
1677 void
1678 intro_message(colon)
1679 int colon; /* TRUE for ":intro" */
1681 int i;
1682 int row;
1683 int blanklines;
1684 int sponsor;
1685 char *p;
1686 static char *(lines[]) =
1688 N_("VIM - Vi IMproved"),
1690 N_("version "),
1691 N_("by Bram Moolenaar et al."),
1692 #ifdef MODIFIED_BY
1693 " ",
1694 #endif
1695 N_("Vim is open source and freely distributable"),
1697 N_("Help poor children in Uganda!"),
1698 N_("type :help iccf<Enter> for information "),
1700 N_("type :q<Enter> to exit "),
1701 N_("type :help<Enter> or <F1> for on-line help"),
1702 #ifdef FEAT_GUI_MACVIM
1703 // TODO: Don't steal the show from version7 help?
1704 N_("type :help macvim<Enter> for MacVim help "),
1705 #else
1706 N_("type :help version7<Enter> for version info"),
1707 #endif
1708 NULL,
1710 N_("Running in Vi compatible mode"),
1711 N_("type :set nocp<Enter> for Vim defaults"),
1712 N_("type :help cp-default<Enter> for info on this"),
1714 #ifdef FEAT_GUI
1715 static char *(gui_lines[]) =
1717 NULL,
1718 NULL,
1719 NULL,
1720 NULL,
1721 #ifdef MODIFIED_BY
1722 NULL,
1723 #endif
1724 NULL,
1725 NULL,
1726 NULL,
1727 N_("menu Help->Orphans for information "),
1728 NULL,
1729 N_("Running modeless, typed text is inserted"),
1730 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1731 N_(" for two modes "),
1732 NULL,
1733 NULL,
1734 NULL,
1735 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1736 N_(" for Vim defaults "),
1738 #endif
1740 /* blanklines = screen height - # message lines */
1741 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1742 if (!p_cp)
1743 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1744 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1745 if (mch_windows95())
1746 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1747 #endif
1749 #ifdef FEAT_WINDOWS
1750 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1751 if (p_ls > 1)
1752 blanklines -= Rows - topframe->fr_height;
1753 #endif
1754 if (blanklines < 0)
1755 blanklines = 0;
1757 /* Show the sponsor and register message one out of four times, the Uganda
1758 * message two out of four times. */
1759 sponsor = (int)time(NULL);
1760 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1762 /* start displaying the message lines after half of the blank lines */
1763 row = blanklines / 2;
1764 if ((row >= 2 && Columns >= 50) || colon)
1766 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1768 p = lines[i];
1769 #ifdef FEAT_GUI
1770 if (p_im && gui.in_use && gui_lines[i] != NULL)
1771 p = gui_lines[i];
1772 #endif
1773 if (p == NULL)
1775 if (!p_cp)
1776 break;
1777 continue;
1779 if (sponsor != 0)
1781 if (strstr(p, "children") != NULL)
1782 p = sponsor < 0
1783 ? N_("Sponsor Vim development!")
1784 : N_("Become a registered Vim user!");
1785 else if (strstr(p, "iccf") != NULL)
1786 p = sponsor < 0
1787 ? N_("type :help sponsor<Enter> for information ")
1788 : N_("type :help register<Enter> for information ");
1789 else if (strstr(p, "Orphans") != NULL)
1790 p = N_("menu Help->Sponsor/Register for information ");
1792 if (*p != NUL)
1793 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1794 ++row;
1796 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1797 if (mch_windows95())
1799 do_intro_line(++row,
1800 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1801 FALSE, hl_attr(HLF_E));
1802 do_intro_line(++row,
1803 (char_u *)_("type :help windows95<Enter> for info on this"),
1804 FALSE, 0);
1806 #endif
1809 /* Make the wait-return message appear just below the text. */
1810 if (colon)
1811 msg_row = row;
1814 static void
1815 do_intro_line(row, mesg, add_version, attr)
1816 int row;
1817 char_u *mesg;
1818 int add_version;
1819 int attr;
1821 char_u vers[20];
1822 int col;
1823 char_u *p;
1824 int l;
1825 int clen;
1826 #ifdef MODIFIED_BY
1827 # define MODBY_LEN 150
1828 char_u modby[MODBY_LEN];
1830 if (*mesg == ' ')
1832 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
1833 l = STRLEN(modby);
1834 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
1835 mesg = modby;
1837 #endif
1839 /* Center the message horizontally. */
1840 col = vim_strsize(mesg);
1841 if (add_version)
1843 STRCPY(vers, mediumVersion);
1844 if (highest_patch())
1846 /* Check for 9.9x or 9.9xx, alpha/beta version */
1847 if (isalpha((int)mediumVersion[3]))
1849 if (isalpha((int)mediumVersion[4]))
1850 sprintf((char *)vers + 5, ".%d%s", highest_patch(),
1851 mediumVersion + 5);
1852 else
1853 sprintf((char *)vers + 4, ".%d%s", highest_patch(),
1854 mediumVersion + 4);
1856 else
1857 sprintf((char *)vers + 3, ".%d", highest_patch());
1859 col += (int)STRLEN(vers);
1861 col = (Columns - col) / 2;
1862 if (col < 0)
1863 col = 0;
1865 /* Split up in parts to highlight <> items differently. */
1866 for (p = mesg; *p != NUL; p += l)
1868 clen = 0;
1869 for (l = 0; p[l] != NUL
1870 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1872 #ifdef FEAT_MBYTE
1873 if (has_mbyte)
1875 clen += ptr2cells(p + l);
1876 l += (*mb_ptr2len)(p + l) - 1;
1878 else
1879 #endif
1880 clen += byte2cells(p[l]);
1882 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1883 col += clen;
1886 /* Add the version number to the version line. */
1887 if (add_version)
1888 screen_puts(vers, row, col, 0);
1892 * ":intro": clear screen, display intro screen and wait for return.
1894 /*ARGSUSED*/
1895 void
1896 ex_intro(eap)
1897 exarg_T *eap;
1899 screenclear();
1900 intro_message(TRUE);
1901 wait_return(TRUE);