Merge branch 'vim' into feat/lua
[vim_extended.git] / src / version.c
blob9251cb5f23311b355b11140a53ef9f62bf8d3527
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 STARTUPTIME
507 "+startuptime",
508 #else
509 "-startuptime",
510 #endif
511 #ifdef FEAT_STL_OPT
512 "+statusline",
513 #else
514 "-statusline",
515 #endif
516 #ifdef FEAT_SUN_WORKSHOP
517 "+sun_workshop",
518 #else
519 "-sun_workshop",
520 #endif
521 #ifdef FEAT_SYN_HL
522 "+syntax",
523 #else
524 "-syntax",
525 #endif
526 /* only interesting on Unix systems */
527 #if defined(USE_SYSTEM) && (defined(UNIX) || defined(__EMX__))
528 "+system()",
529 #endif
530 #ifdef FEAT_TAG_BINS
531 "+tag_binary",
532 #else
533 "-tag_binary",
534 #endif
535 #ifdef FEAT_TAG_OLDSTATIC
536 "+tag_old_static",
537 #else
538 "-tag_old_static",
539 #endif
540 #ifdef FEAT_TAG_ANYWHITE
541 "+tag_any_white",
542 #else
543 "-tag_any_white",
544 #endif
545 #ifdef FEAT_TCL
546 # ifdef DYNAMIC_TCL
547 "+tcl/dyn",
548 # else
549 "+tcl",
550 # endif
551 #else
552 "-tcl",
553 #endif
554 #if defined(UNIX) || defined(__EMX__)
555 /* only Unix (or OS/2 with EMX!) can have terminfo instead of termcap */
556 # ifdef TERMINFO
557 "+terminfo",
558 # else
559 "-terminfo",
560 # endif
561 #else /* unix always includes termcap support */
562 # ifdef HAVE_TGETENT
563 "+tgetent",
564 # else
565 "-tgetent",
566 # endif
567 #endif
568 #ifdef FEAT_TERMRESPONSE
569 "+termresponse",
570 #else
571 "-termresponse",
572 #endif
573 #ifdef FEAT_TEXTOBJ
574 "+textobjects",
575 #else
576 "-textobjects",
577 #endif
578 #ifdef FEAT_TITLE
579 "+title",
580 #else
581 "-title",
582 #endif
583 #ifdef FEAT_TOOLBAR
584 "+toolbar",
585 #else
586 "-toolbar",
587 #endif
588 #ifdef FEAT_USR_CMDS
589 "+user_commands",
590 #else
591 "-user_commands",
592 #endif
593 #ifdef FEAT_VERTSPLIT
594 "+vertsplit",
595 #else
596 "-vertsplit",
597 #endif
598 #ifdef FEAT_VIRTUALEDIT
599 "+virtualedit",
600 #else
601 "-virtualedit",
602 #endif
603 #ifdef FEAT_VISUAL
604 "+visual",
605 # ifdef FEAT_VISUALEXTRA
606 "+visualextra",
607 # else
608 "-visualextra",
609 # endif
610 #else
611 "-visual",
612 #endif
613 #ifdef FEAT_VIMINFO
614 "+viminfo",
615 #else
616 "-viminfo",
617 #endif
618 #ifdef FEAT_VREPLACE
619 "+vreplace",
620 #else
621 "-vreplace",
622 #endif
623 #ifdef FEAT_WILDIGN
624 "+wildignore",
625 #else
626 "-wildignore",
627 #endif
628 #ifdef FEAT_WILDMENU
629 "+wildmenu",
630 #else
631 "-wildmenu",
632 #endif
633 #ifdef FEAT_WINDOWS
634 "+windows",
635 #else
636 "-windows",
637 #endif
638 #ifdef FEAT_WRITEBACKUP
639 "+writebackup",
640 #else
641 "-writebackup",
642 #endif
643 #if defined(UNIX) || defined(VMS)
644 # ifdef FEAT_X11
645 "+X11",
646 # else
647 "-X11",
648 # endif
649 #endif
650 #ifdef FEAT_XFONTSET
651 "+xfontset",
652 #else
653 "-xfontset",
654 #endif
655 #ifdef FEAT_XIM
656 "+xim",
657 #else
658 "-xim",
659 #endif
660 #if defined(UNIX) || defined(VMS)
661 # ifdef USE_XSMP_INTERACT
662 "+xsmp_interact",
663 # else
664 # ifdef USE_XSMP
665 "+xsmp",
666 # else
667 "-xsmp",
668 # endif
669 # endif
670 # ifdef FEAT_XCLIPBOARD
671 "+xterm_clipboard",
672 # else
673 "-xterm_clipboard",
674 # endif
675 #endif
676 #ifdef FEAT_XTERM_SAVE
677 "+xterm_save",
678 #else
679 "-xterm_save",
680 #endif
681 #ifdef WIN3264
682 # ifdef FEAT_XPM_W32
683 "+xpm_w32",
684 # else
685 "-xpm_w32",
686 # endif
687 #endif
688 NULL
691 static int included_patches[] =
692 { /* Add new patch number below this line */
693 /**/
694 303,
695 /**/
696 302,
697 /**/
698 301,
699 /**/
700 300,
701 /**/
702 299,
703 /**/
704 298,
705 /**/
706 297,
707 /**/
708 296,
709 /**/
710 295,
711 /**/
712 294,
713 /**/
714 293,
715 /**/
716 292,
717 /**/
718 291,
719 /**/
720 290,
721 /**/
722 289,
723 /**/
724 288,
725 /**/
726 287,
727 /**/
728 286,
729 /**/
730 285,
731 /**/
732 284,
733 /**/
734 283,
735 /**/
736 282,
737 /**/
738 281,
739 /**/
740 280,
741 /**/
742 279,
743 /**/
744 278,
745 /**/
746 277,
747 /**/
748 276,
749 /**/
750 275,
751 /**/
752 274,
753 /**/
754 273,
755 /**/
756 272,
757 /**/
758 271,
759 /**/
760 270,
761 /**/
762 269,
763 /**/
764 268,
765 /**/
766 267,
767 /**/
768 266,
769 /**/
770 265,
771 /**/
772 264,
773 /**/
774 263,
775 /**/
776 262,
777 /**/
778 261,
779 /**/
780 260,
781 /**/
782 259,
783 /**/
784 258,
785 /**/
786 257,
787 /**/
788 256,
789 /**/
790 255,
791 /**/
792 254,
793 /**/
794 253,
795 /**/
796 252,
797 /**/
798 251,
799 /**/
800 250,
801 /**/
802 249,
803 /**/
804 248,
805 /**/
806 247,
807 /**/
808 246,
809 /**/
810 245,
811 /**/
812 244,
813 /**/
814 243,
815 /**/
816 242,
817 /**/
818 241,
819 /**/
820 240,
821 /**/
822 239,
823 /**/
824 238,
825 /**/
826 237,
827 /**/
828 236,
829 /**/
830 235,
831 /**/
832 234,
833 /**/
834 233,
835 /**/
836 232,
837 /**/
838 231,
839 /**/
840 230,
841 /**/
842 229,
843 /**/
844 228,
845 /**/
846 227,
847 /**/
848 226,
849 /**/
850 225,
851 /**/
852 224,
853 /**/
854 223,
855 /**/
856 222,
857 /**/
858 221,
859 /**/
860 220,
861 /**/
862 219,
863 /**/
864 218,
865 /**/
866 217,
867 /**/
868 216,
869 /**/
870 215,
871 /**/
872 214,
873 /**/
874 213,
875 /**/
876 212,
877 /**/
878 211,
879 /**/
880 210,
881 /**/
882 209,
883 /**/
884 208,
885 /**/
886 207,
887 /**/
888 206,
889 /**/
890 205,
891 /**/
892 204,
893 /**/
894 203,
895 /**/
896 202,
897 /**/
898 201,
899 /**/
900 200,
901 /**/
902 199,
903 /**/
904 198,
905 /**/
906 197,
907 /**/
908 196,
909 /**/
910 195,
911 /**/
912 194,
913 /**/
914 193,
915 /**/
916 192,
917 /**/
918 191,
919 /**/
920 190,
921 /**/
922 189,
923 /**/
924 188,
925 /**/
926 187,
927 /**/
928 186,
929 /**/
930 185,
931 /**/
932 184,
933 /**/
934 183,
935 /**/
936 182,
937 /**/
938 181,
939 /**/
940 180,
941 /**/
942 179,
943 /**/
944 178,
945 /**/
946 177,
947 /**/
948 176,
949 /**/
950 175,
951 /**/
952 174,
953 /**/
954 173,
955 /**/
956 172,
957 /**/
958 171,
959 /**/
960 170,
961 /**/
962 169,
963 /**/
964 168,
965 /**/
966 167,
967 /**/
968 166,
969 /**/
970 165,
971 /**/
972 164,
973 /**/
974 163,
975 /**/
976 162,
977 /**/
978 161,
979 /**/
980 160,
981 /**/
982 159,
983 /**/
984 158,
985 /**/
986 157,
987 /**/
988 156,
989 /**/
990 155,
991 /**/
992 154,
993 /**/
994 153,
995 /**/
996 152,
997 /**/
998 151,
999 /**/
1000 150,
1001 /**/
1002 149,
1003 /**/
1004 148,
1005 /**/
1006 147,
1007 /**/
1008 146,
1009 /**/
1010 145,
1011 /**/
1012 144,
1013 /**/
1014 143,
1015 /**/
1016 142,
1017 /**/
1018 141,
1019 /**/
1020 140,
1021 /**/
1022 139,
1023 /**/
1024 138,
1025 /**/
1026 137,
1027 /**/
1028 136,
1029 /**/
1030 135,
1031 /**/
1032 134,
1033 /**/
1034 133,
1035 /**/
1036 132,
1037 /**/
1038 131,
1039 /**/
1040 130,
1041 /**/
1042 129,
1043 /**/
1044 128,
1045 /**/
1046 127,
1047 /**/
1048 126,
1049 /**/
1050 125,
1051 /**/
1052 124,
1053 /**/
1054 123,
1055 /**/
1056 122,
1057 /**/
1058 121,
1059 /**/
1060 120,
1061 /**/
1062 119,
1063 /**/
1064 118,
1065 /**/
1066 117,
1067 /**/
1068 116,
1069 /**/
1070 115,
1071 /**/
1072 114,
1073 /**/
1074 113,
1075 /**/
1076 112,
1077 /**/
1078 111,
1079 /**/
1080 110,
1081 /**/
1082 109,
1083 /**/
1084 108,
1085 /**/
1086 107,
1087 /**/
1088 106,
1089 /**/
1090 105,
1091 /**/
1092 104,
1093 /**/
1094 103,
1095 /**/
1096 102,
1097 /**/
1098 101,
1099 /**/
1100 100,
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 /**/
1163 /**/
1165 /**/
1167 /**/
1169 /**/
1171 /**/
1173 /**/
1175 /**/
1177 /**/
1179 /**/
1181 /**/
1183 /**/
1185 /**/
1187 /**/
1189 /**/
1191 /**/
1193 /**/
1195 /**/
1197 /**/
1199 /**/
1201 /**/
1203 /**/
1205 /**/
1207 /**/
1209 /**/
1211 /**/
1213 /**/
1215 /**/
1217 /**/
1219 /**/
1221 /**/
1223 /**/
1225 /**/
1227 /**/
1229 /**/
1231 /**/
1233 /**/
1235 /**/
1237 /**/
1239 /**/
1241 /**/
1243 /**/
1245 /**/
1247 /**/
1249 /**/
1251 /**/
1253 /**/
1255 /**/
1257 /**/
1259 /**/
1261 /**/
1263 /**/
1265 /**/
1267 /**/
1269 /**/
1271 /**/
1273 /**/
1275 /**/
1277 /**/
1279 /**/
1281 /**/
1283 /**/
1285 /**/
1287 /**/
1289 /**/
1291 /**/
1293 /**/
1295 /**/
1297 /**/
1299 /**/
1304 * Place to put a short description when adding a feature with a patch.
1305 * Keep it short, e.g.,: "relative numbers", "persistent undo".
1306 * Also add a comment marker to separate the lines.
1307 * See the official Vim patches for the diff format: It must use a context of
1308 * one line only. Create it by hand or use "diff -C2" and edit the patch.
1310 static char *(extra_patches[]) =
1311 { /* Add your patch description below this line */
1312 /**/
1313 NULL
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 # ifdef _WIN64
1390 MSG_PUTS(_("\nMS-Windows 64-bit console version"));
1391 # else
1392 MSG_PUTS(_("\nMS-Windows 32-bit console version"));
1393 # endif
1394 # endif
1395 #endif
1396 #ifdef WIN16
1397 MSG_PUTS(_("\nMS-Windows 16-bit version"));
1398 #endif
1399 #ifdef MSDOS
1400 # ifdef DJGPP
1401 MSG_PUTS(_("\n32-bit MS-DOS version"));
1402 # else
1403 MSG_PUTS(_("\n16-bit MS-DOS version"));
1404 # endif
1405 #endif
1406 #ifdef MACOS
1407 # ifdef MACOS_X
1408 # ifdef MACOS_X_UNIX
1409 MSG_PUTS(_("\nMacOS X (unix) version"));
1410 # else
1411 MSG_PUTS(_("\nMacOS X version"));
1412 # endif
1413 #else
1414 MSG_PUTS(_("\nMacOS version"));
1415 # endif
1416 #endif
1418 #ifdef RISCOS
1419 MSG_PUTS(_("\nRISC OS version"));
1420 #endif
1421 #ifdef VMS
1422 MSG_PUTS(_("\nOpenVMS version"));
1423 # ifdef HAVE_PATHDEF
1424 if (*compiled_arch != NUL)
1426 MSG_PUTS(" - ");
1427 MSG_PUTS(compiled_arch);
1429 # endif
1431 #endif
1433 /* Print the list of patch numbers if there is at least one. */
1434 /* Print a range when patches are consecutive: "1-10, 12, 15-40, 42-45" */
1435 if (included_patches[0] != 0)
1437 MSG_PUTS(_("\nIncluded patches: "));
1438 first = -1;
1439 /* find last one */
1440 for (i = 0; included_patches[i] != 0; ++i)
1442 while (--i >= 0)
1444 if (first < 0)
1445 first = included_patches[i];
1446 if (i == 0 || included_patches[i - 1] != included_patches[i] + 1)
1448 MSG_PUTS(s);
1449 s = ", ";
1450 msg_outnum((long)first);
1451 if (first != included_patches[i])
1453 MSG_PUTS("-");
1454 msg_outnum((long)included_patches[i]);
1456 first = -1;
1461 /* Print the list of extra patch descriptions if there is at least one. */
1462 if (extra_patches[0] != NULL)
1464 MSG_PUTS(_("\nExtra patches: "));
1465 s = "";
1466 for (i = 0; extra_patches[i] != NULL; ++i)
1468 MSG_PUTS(s);
1469 s = ", ";
1470 MSG_PUTS(extra_patches[i]);
1474 #ifdef MODIFIED_BY
1475 MSG_PUTS("\n");
1476 MSG_PUTS(_("Modified by "));
1477 MSG_PUTS(MODIFIED_BY);
1478 #endif
1480 #ifdef HAVE_PATHDEF
1481 if (*compiled_user != NUL || *compiled_sys != NUL)
1483 MSG_PUTS(_("\nCompiled "));
1484 if (*compiled_user != NUL)
1486 MSG_PUTS(_("by "));
1487 MSG_PUTS(compiled_user);
1489 if (*compiled_sys != NUL)
1491 MSG_PUTS("@");
1492 MSG_PUTS(compiled_sys);
1495 #endif
1497 #ifdef FEAT_HUGE
1498 MSG_PUTS(_("\nHuge version "));
1499 #else
1500 # ifdef FEAT_BIG
1501 MSG_PUTS(_("\nBig version "));
1502 # else
1503 # ifdef FEAT_NORMAL
1504 MSG_PUTS(_("\nNormal version "));
1505 # else
1506 # ifdef FEAT_SMALL
1507 MSG_PUTS(_("\nSmall version "));
1508 # else
1509 MSG_PUTS(_("\nTiny version "));
1510 # endif
1511 # endif
1512 # endif
1513 #endif
1514 #ifndef FEAT_GUI
1515 MSG_PUTS(_("without GUI."));
1516 #else
1517 # ifdef FEAT_GUI_GTK
1518 # ifdef FEAT_GUI_GNOME
1519 # ifdef HAVE_GTK2
1520 MSG_PUTS(_("with GTK2-GNOME GUI."));
1521 # else
1522 MSG_PUTS(_("with GTK-GNOME GUI."));
1523 # endif
1524 # else
1525 # ifdef HAVE_GTK2
1526 MSG_PUTS(_("with GTK2 GUI."));
1527 # else
1528 MSG_PUTS(_("with GTK GUI."));
1529 # endif
1530 # endif
1531 # else
1532 # ifdef FEAT_GUI_MOTIF
1533 MSG_PUTS(_("with X11-Motif GUI."));
1534 # else
1535 # ifdef FEAT_GUI_ATHENA
1536 # ifdef FEAT_GUI_NEXTAW
1537 MSG_PUTS(_("with X11-neXtaw GUI."));
1538 # else
1539 MSG_PUTS(_("with X11-Athena GUI."));
1540 # endif
1541 # else
1542 # ifdef FEAT_GUI_PHOTON
1543 MSG_PUTS(_("with Photon GUI."));
1544 # else
1545 # if defined(MSWIN)
1546 MSG_PUTS(_("with GUI."));
1547 # else
1548 # if defined (TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON
1549 MSG_PUTS(_("with Carbon GUI."));
1550 # else
1551 # if defined (TARGET_API_MAC_OSX) && TARGET_API_MAC_OSX
1552 MSG_PUTS(_("with Cocoa GUI."));
1553 # else
1554 # if defined (MACOS)
1555 MSG_PUTS(_("with (classic) GUI."));
1556 # endif
1557 # endif
1558 # endif
1559 # endif
1560 # endif
1561 # endif
1562 # endif
1563 # endif
1564 #endif
1565 version_msg(_(" Features included (+) or not (-):\n"));
1567 /* print all the features */
1568 for (i = 0; features[i] != NULL; ++i)
1570 version_msg(features[i]);
1571 if (msg_col > 0)
1572 version_msg(" ");
1575 version_msg("\n");
1576 #ifdef SYS_VIMRC_FILE
1577 version_msg(_(" system vimrc file: \""));
1578 version_msg(SYS_VIMRC_FILE);
1579 version_msg("\"\n");
1580 #endif
1581 #ifdef USR_VIMRC_FILE
1582 version_msg(_(" user vimrc file: \""));
1583 version_msg(USR_VIMRC_FILE);
1584 version_msg("\"\n");
1585 #endif
1586 #ifdef USR_VIMRC_FILE2
1587 version_msg(_(" 2nd user vimrc file: \""));
1588 version_msg(USR_VIMRC_FILE2);
1589 version_msg("\"\n");
1590 #endif
1591 #ifdef USR_VIMRC_FILE3
1592 version_msg(_(" 3rd user vimrc file: \""));
1593 version_msg(USR_VIMRC_FILE3);
1594 version_msg("\"\n");
1595 #endif
1596 #ifdef USR_EXRC_FILE
1597 version_msg(_(" user exrc file: \""));
1598 version_msg(USR_EXRC_FILE);
1599 version_msg("\"\n");
1600 #endif
1601 #ifdef USR_EXRC_FILE2
1602 version_msg(_(" 2nd user exrc file: \""));
1603 version_msg(USR_EXRC_FILE2);
1604 version_msg("\"\n");
1605 #endif
1606 #ifdef FEAT_GUI
1607 # ifdef SYS_GVIMRC_FILE
1608 version_msg(_(" system gvimrc file: \""));
1609 version_msg(SYS_GVIMRC_FILE);
1610 version_msg("\"\n");
1611 # endif
1612 version_msg(_(" user gvimrc file: \""));
1613 version_msg(USR_GVIMRC_FILE);
1614 version_msg("\"\n");
1615 # ifdef USR_GVIMRC_FILE2
1616 version_msg(_("2nd user gvimrc file: \""));
1617 version_msg(USR_GVIMRC_FILE2);
1618 version_msg("\"\n");
1619 # endif
1620 # ifdef USR_GVIMRC_FILE3
1621 version_msg(_("3rd user gvimrc file: \""));
1622 version_msg(USR_GVIMRC_FILE3);
1623 version_msg("\"\n");
1624 # endif
1625 #endif
1626 #ifdef FEAT_GUI
1627 # ifdef SYS_MENU_FILE
1628 version_msg(_(" system menu file: \""));
1629 version_msg(SYS_MENU_FILE);
1630 version_msg("\"\n");
1631 # endif
1632 #endif
1633 #ifdef HAVE_PATHDEF
1634 if (*default_vim_dir != NUL)
1636 version_msg(_(" fall-back for $VIM: \""));
1637 version_msg((char *)default_vim_dir);
1638 version_msg("\"\n");
1640 if (*default_vimruntime_dir != NUL)
1642 version_msg(_(" f-b for $VIMRUNTIME: \""));
1643 version_msg((char *)default_vimruntime_dir);
1644 version_msg("\"\n");
1646 version_msg(_("Compilation: "));
1647 version_msg((char *)all_cflags);
1648 version_msg("\n");
1649 #ifdef VMS
1650 if (*compiler_version != NUL)
1652 version_msg(_("Compiler: "));
1653 version_msg((char *)compiler_version);
1654 version_msg("\n");
1656 #endif
1657 version_msg(_("Linking: "));
1658 version_msg((char *)all_lflags);
1659 #endif
1660 #ifdef DEBUG
1661 version_msg("\n");
1662 version_msg(_(" DEBUG BUILD"));
1663 #endif
1667 * Output a string for the version message. If it's going to wrap, output a
1668 * newline, unless the message is too long to fit on the screen anyway.
1670 static void
1671 version_msg(s)
1672 char *s;
1674 int len = (int)STRLEN(s);
1676 if (!got_int && len < (int)Columns && msg_col + len >= (int)Columns
1677 && *s != '\n')
1678 msg_putchar('\n');
1679 if (!got_int)
1680 MSG_PUTS(s);
1683 static void do_intro_line __ARGS((int row, char_u *mesg, int add_version, int attr));
1686 * Give an introductory message about Vim.
1687 * Only used when starting Vim on an empty file, without a file name.
1688 * Or with the ":intro" command (for Sven :-).
1690 void
1691 intro_message(colon)
1692 int colon; /* TRUE for ":intro" */
1694 int i;
1695 int row;
1696 int blanklines;
1697 int sponsor;
1698 char *p;
1699 static char *(lines[]) =
1701 N_("VIM - Vi IMproved"),
1703 N_("version "),
1704 N_("by Bram Moolenaar et al."),
1705 #ifdef MODIFIED_BY
1706 " ",
1707 #endif
1708 N_("Vim is open source and freely distributable"),
1710 N_("Help poor children in Uganda!"),
1711 N_("type :help iccf<Enter> for information "),
1713 N_("type :q<Enter> to exit "),
1714 N_("type :help<Enter> or <F1> for on-line help"),
1715 N_("type :help version7<Enter> for version info"),
1716 NULL,
1718 N_("Running in Vi compatible mode"),
1719 N_("type :set nocp<Enter> for Vim defaults"),
1720 N_("type :help cp-default<Enter> for info on this"),
1722 #ifdef FEAT_GUI
1723 static char *(gui_lines[]) =
1725 NULL,
1726 NULL,
1727 NULL,
1728 NULL,
1729 #ifdef MODIFIED_BY
1730 NULL,
1731 #endif
1732 NULL,
1733 NULL,
1734 NULL,
1735 N_("menu Help->Orphans for information "),
1736 NULL,
1737 N_("Running modeless, typed text is inserted"),
1738 N_("menu Edit->Global Settings->Toggle Insert Mode "),
1739 N_(" for two modes "),
1740 NULL,
1741 NULL,
1742 NULL,
1743 N_("menu Edit->Global Settings->Toggle Vi Compatible"),
1744 N_(" for Vim defaults "),
1746 #endif
1748 /* blanklines = screen height - # message lines */
1749 blanklines = (int)Rows - ((sizeof(lines) / sizeof(char *)) - 1);
1750 if (!p_cp)
1751 blanklines += 4; /* add 4 for not showing "Vi compatible" message */
1752 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1753 if (mch_windows95())
1754 blanklines -= 3; /* subtract 3 for showing "Windows 95" message */
1755 #endif
1757 #ifdef FEAT_WINDOWS
1758 /* Don't overwrite a statusline. Depends on 'cmdheight'. */
1759 if (p_ls > 1)
1760 blanklines -= Rows - topframe->fr_height;
1761 #endif
1762 if (blanklines < 0)
1763 blanklines = 0;
1765 /* Show the sponsor and register message one out of four times, the Uganda
1766 * message two out of four times. */
1767 sponsor = (int)time(NULL);
1768 sponsor = ((sponsor & 2) == 0) - ((sponsor & 4) == 0);
1770 /* start displaying the message lines after half of the blank lines */
1771 row = blanklines / 2;
1772 if ((row >= 2 && Columns >= 50) || colon)
1774 for (i = 0; i < (int)(sizeof(lines) / sizeof(char *)); ++i)
1776 p = lines[i];
1777 #ifdef FEAT_GUI
1778 if (p_im && gui.in_use && gui_lines[i] != NULL)
1779 p = gui_lines[i];
1780 #endif
1781 if (p == NULL)
1783 if (!p_cp)
1784 break;
1785 continue;
1787 if (sponsor != 0)
1789 if (strstr(p, "children") != NULL)
1790 p = sponsor < 0
1791 ? N_("Sponsor Vim development!")
1792 : N_("Become a registered Vim user!");
1793 else if (strstr(p, "iccf") != NULL)
1794 p = sponsor < 0
1795 ? N_("type :help sponsor<Enter> for information ")
1796 : N_("type :help register<Enter> for information ");
1797 else if (strstr(p, "Orphans") != NULL)
1798 p = N_("menu Help->Sponsor/Register for information ");
1800 if (*p != NUL)
1801 do_intro_line(row, (char_u *)_(p), i == 2, 0);
1802 ++row;
1804 #if defined(WIN3264) && !defined(FEAT_GUI_W32)
1805 if (mch_windows95())
1807 do_intro_line(++row,
1808 (char_u *)_("WARNING: Windows 95/98/ME detected"),
1809 FALSE, hl_attr(HLF_E));
1810 do_intro_line(++row,
1811 (char_u *)_("type :help windows95<Enter> for info on this"),
1812 FALSE, 0);
1814 #endif
1817 /* Make the wait-return message appear just below the text. */
1818 if (colon)
1819 msg_row = row;
1822 static void
1823 do_intro_line(row, mesg, add_version, attr)
1824 int row;
1825 char_u *mesg;
1826 int add_version;
1827 int attr;
1829 char_u vers[20];
1830 int col;
1831 char_u *p;
1832 int l;
1833 int clen;
1834 #ifdef MODIFIED_BY
1835 # define MODBY_LEN 150
1836 char_u modby[MODBY_LEN];
1838 if (*mesg == ' ')
1840 vim_strncpy(modby, (char_u *)_("Modified by "), MODBY_LEN - 1);
1841 l = STRLEN(modby);
1842 vim_strncpy(modby + l, (char_u *)MODIFIED_BY, MODBY_LEN - l - 1);
1843 mesg = modby;
1845 #endif
1847 /* Center the message horizontally. */
1848 col = vim_strsize(mesg);
1849 if (add_version)
1851 STRCPY(vers, mediumVersion);
1852 if (highest_patch())
1854 /* Check for 9.9x or 9.9xx, alpha/beta version */
1855 if (isalpha((int)mediumVersion[3]))
1857 if (isalpha((int)mediumVersion[4]))
1858 sprintf((char *)vers + 5, ".%d%s", highest_patch(),
1859 mediumVersion + 5);
1860 else
1861 sprintf((char *)vers + 4, ".%d%s", highest_patch(),
1862 mediumVersion + 4);
1864 else
1865 sprintf((char *)vers + 3, ".%d", highest_patch());
1867 col += (int)STRLEN(vers);
1869 col = (Columns - col) / 2;
1870 if (col < 0)
1871 col = 0;
1873 /* Split up in parts to highlight <> items differently. */
1874 for (p = mesg; *p != NUL; p += l)
1876 clen = 0;
1877 for (l = 0; p[l] != NUL
1878 && (l == 0 || (p[l] != '<' && p[l - 1] != '>')); ++l)
1880 #ifdef FEAT_MBYTE
1881 if (has_mbyte)
1883 clen += ptr2cells(p + l);
1884 l += (*mb_ptr2len)(p + l) - 1;
1886 else
1887 #endif
1888 clen += byte2cells(p[l]);
1890 screen_puts_len(p, l, row, col, *p == '<' ? hl_attr(HLF_8) : attr);
1891 col += clen;
1894 /* Add the version number to the version line. */
1895 if (add_version)
1896 screen_puts(vers, row, col, 0);
1900 * ":intro": clear screen, display intro screen and wait for return.
1902 void
1903 ex_intro(eap)
1904 exarg_T *eap UNUSED;
1906 screenclear();
1907 intro_message(TRUE);
1908 wait_return(TRUE);