comparison runtime/syntax/testdir/input/c.c @ 32591:92b93fe443e9 v9.0.1627

patch 9.0.1627: no generic mechanism to test syntax plugins Commit: https://github.com/vim/vim/commit/46acad7284cba7842b5e505fa3d07e99806d246f Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 11 19:04:18 2023 +0100 patch 9.0.1627: no generic mechanism to test syntax plugins Problem: No generic mechanism to test syntax plugins. Solution: Add a syntax plugin test mechanism, using screendumps. Add a simple test for "c".
author Bram Moolenaar <Bram@vim.org>
date Sun, 11 Jun 2023 20:15:06 +0200
parents
children 448aef880252
comparison
equal deleted inserted replaced
32590:635de73eeb4c 32591:92b93fe443e9
1 /* vi:set ts=8 sts=4 sw=4 noet:
2 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 *
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 */
9
10 #define EXTERN
11 #include "vim.h"
12
13 #ifdef __CYGWIN__
14 # include <cygwin/version.h>
15 # include <sys/cygwin.h> // for cygwin_conv_to_posix_path() and/or
16 // cygwin_conv_path()
17 # include <limits.h>
18 #endif
19
20 #if defined(MSWIN) && (!defined(FEAT_GUI_MSWIN) || defined(VIMDLL))
21 # include "iscygpty.h"
22 #endif
23
24 // Values for edit_type.
25 #define EDIT_NONE 0 // no edit type yet
26 #define EDIT_FILE 1 // file name argument[s] given, use argument list
27 #define EDIT_STDIN 2 // read file from stdin
28 #define EDIT_TAG 3 // tag name argument given, use tagname
29 #define EDIT_QF 4 // start in quickfix mode
30
31 #if (defined(UNIX) || defined(VMS)) && !defined(NO_VIM_MAIN)
32 static int file_owned(char *fname);
33 #endif
34 static void mainerr(int, char_u *);
35 static void early_arg_scan(mparm_T *parmp);
36 #ifndef NO_VIM_MAIN
37 static void usage(void);
38 static void parse_command_name(mparm_T *parmp);
39 static void command_line_scan(mparm_T *parmp);
40 static void check_tty(mparm_T *parmp);
41 static void read_stdin(void);
42 static void create_windows(mparm_T *parmp);
43 static void edit_buffers(mparm_T *parmp, char_u *cwd);
44 static void exe_pre_commands(mparm_T *parmp);
45 static void exe_commands(mparm_T *parmp);
46 static void source_startup_scripts(mparm_T *parmp);
47 static void main_start_gui(void);
48 static void check_swap_exists_action(void);
49 # ifdef FEAT_EVAL
50 static void set_progpath(char_u *argv0);
51 # endif
52 #endif
53
54
55 /*
56 * Different types of error messages.
57 */
58 static char *(main_errors[]) =
59 {
60 N_("Unknown option argument"),
61 #define ME_UNKNOWN_OPTION 0
62 N_("Too many edit arguments"),
63 #define ME_TOO_MANY_ARGS 1
64 N_("Argument missing after"),
65 #define ME_ARG_MISSING 2
66 N_("Garbage after option argument"),
67 #define ME_GARBAGE 3
68 N_("Too many \"+command\", \"-c command\" or \"--cmd command\" arguments"),
69 #define ME_EXTRA_CMD 4
70 N_("Invalid argument for"),
71 #define ME_INVALID_ARG 5
72 };
73
74 #ifndef PROTO // don't want a prototype for main()
75
76 // Various parameters passed between main() and other functions.
77 static mparm_T params;
78
79 #ifdef _IOLBF
80 static void *s_vbuf = NULL; // buffer for setvbuf()
81 #endif
82
83 #ifndef NO_VIM_MAIN // skip this for unittests
84
85 static char_u *start_dir = NULL; // current working dir on startup
86
87 static int has_dash_c_arg = FALSE;
88
89 # ifdef VIMDLL
90 __declspec(dllexport)
91 # endif
92 int
93 # ifdef MSWIN
94 VimMain
95 # else
96 main
97 # endif
98 (int argc, char **argv)
99 {
100 #if defined(STARTUPTIME) || defined(CLEAN_RUNTIMEPATH)
101 int i;
102 #endif
103
104 /*
105 * Do any system-specific initialisations. These can NOT use IObuff or
106 * NameBuff. Thus emsg2() cannot be called!
107 */
108 mch_early_init();
109
110 // Source startup scripts.
111 source_startup_scripts(&params);
112
113 #if 0
114 /*
115 * Newer version of MzScheme (Racket) require earlier (trampolined)
116 * initialisation via scheme_main_setup.
117 */
118 return mzscheme_main();
119 #else
120 return vim_main2();
121 #endif
122 }