summaryrefslogtreecommitdiff
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c841
1 files changed, 322 insertions, 519 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 47f6b5b5d..7dfd990a1 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -586,8 +586,7 @@ static void save_dbg_stuff(struct dbg_stuff *dsp);
static void restore_dbg_stuff(struct dbg_stuff *dsp);
static void
-save_dbg_stuff(dsp)
- struct dbg_stuff *dsp;
+save_dbg_stuff(struct dbg_stuff *dsp)
{
dsp->trylevel = trylevel; trylevel = 0;
dsp->force_abort = force_abort; force_abort = FALSE;
@@ -605,8 +604,7 @@ save_dbg_stuff(dsp)
}
static void
-restore_dbg_stuff(dsp)
- struct dbg_stuff *dsp;
+restore_dbg_stuff(struct dbg_stuff *dsp)
{
suppress_errthrow = FALSE;
trylevel = dsp->trylevel;
@@ -629,8 +627,8 @@ restore_dbg_stuff(dsp)
* command is given.
*/
void
-do_exmode(improved)
- int improved; /* TRUE for "improved Ex" mode */
+do_exmode(
+ int improved) /* TRUE for "improved Ex" mode */
{
int save_msg_scroll;
int prev_msg_row;
@@ -732,8 +730,7 @@ do_exmode(improved)
* Execute a simple command line. Used for translated commands like "*".
*/
int
-do_cmdline_cmd(cmd)
- char_u *cmd;
+do_cmdline_cmd(char_u *cmd)
{
return do_cmdline(cmd, NULL, NULL,
DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
@@ -759,11 +756,11 @@ do_cmdline_cmd(cmd)
* return FAIL if cmdline could not be executed, OK otherwise
*/
int
-do_cmdline(cmdline, fgetline, cookie, flags)
- char_u *cmdline;
- char_u *(*fgetline)(int, void *, int);
- void *cookie; /* argument for fgetline() */
- int flags;
+do_cmdline(
+ char_u *cmdline,
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie, /* argument for fgetline() */
+ int flags)
{
char_u *next_cmdline; /* next cmd to execute */
char_u *cmdline_copy = NULL; /* copy of cmd line */
@@ -1558,10 +1555,7 @@ do_cmdline(cmdline, fgetline, cookie, flags)
* Obtain a line when inside a ":while" or ":for" loop.
*/
static char_u *
-get_loop_line(c, cookie, indent)
- int c;
- void *cookie;
- int indent;
+get_loop_line(int c, void *cookie, int indent)
{
struct loop_cookie *cp = (struct loop_cookie *)cookie;
wcmd_T *wp;
@@ -1594,9 +1588,7 @@ get_loop_line(c, cookie, indent)
* Store a line in "gap" so that a ":while" loop can execute it again.
*/
static int
-store_loop_line(gap, line)
- garray_T *gap;
- char_u *line;
+store_loop_line(garray_T *gap, char_u *line)
{
if (ga_grow(gap, 1) == FAIL)
return FAIL;
@@ -1610,8 +1602,7 @@ store_loop_line(gap, line)
* Free the lines stored for a ":while" or ":for" loop.
*/
static void
-free_cmdlines(gap)
- garray_T *gap;
+free_cmdlines(garray_T *gap)
{
while (gap->ga_len > 0)
{
@@ -1626,10 +1617,10 @@ free_cmdlines(gap)
* "func". * Otherwise return TRUE when "fgetline" equals "func".
*/
int
-getline_equal(fgetline, cookie, func)
- char_u *(*fgetline)(int, void *, int);
- void *cookie UNUSED; /* argument for fgetline() */
- char_u *(*func)(int, void *, int);
+getline_equal(
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie UNUSED, /* argument for fgetline() */
+ char_u *(*func)(int, void *, int))
{
#ifdef FEAT_EVAL
char_u *(*gp)(int, void *, int);
@@ -1657,9 +1648,9 @@ getline_equal(fgetline, cookie, func)
* getline function. Otherwise return "cookie".
*/
void *
-getline_cookie(fgetline, cookie)
- char_u *(*fgetline)(int, void *, int) UNUSED;
- void *cookie; /* argument for fgetline() */
+getline_cookie(
+ char_u *(*fgetline)(int, void *, int) UNUSED,
+ void *cookie) /* argument for fgetline() */
{
# ifdef FEAT_EVAL
char_u *(*gp)(int, void *, int);
@@ -1689,10 +1680,7 @@ getline_cookie(fgetline, cookie)
* Returns the buffer number.
*/
static int
-compute_buffer_local_count(addr_type, lnum, offset)
- int addr_type;
- int lnum;
- int offset;
+compute_buffer_local_count(int addr_type, int lnum, int offset)
{
buf_T *buf;
buf_T *nextbuf;
@@ -1735,8 +1723,7 @@ static int current_win_nr(win_T *win);
static int current_tab_nr(tabpage_T *tab);
static int
-current_win_nr(win)
- win_T *win;
+current_win_nr(win_T *win)
{
win_T *wp;
int nr = 0;
@@ -1751,8 +1738,7 @@ current_win_nr(win)
}
static int
-current_tab_nr(tab)
- tabpage_T *tab;
+current_tab_nr(tabpage_T *tab)
{
tabpage_T *tp;
int nr = 0;
@@ -1802,18 +1788,14 @@ current_tab_nr(tab)
#pragma optimize( "g", off )
#endif
static char_u *
-do_one_cmd(cmdlinep, sourcing,
-#ifdef FEAT_EVAL
- cstack,
-#endif
- fgetline, cookie)
- char_u **cmdlinep;
- int sourcing;
+do_one_cmd(
+ char_u **cmdlinep,
+ int sourcing,
#ifdef FEAT_EVAL
- struct condstack *cstack;
+ struct condstack *cstack,
#endif
- char_u *(*fgetline)(int, void *, int);
- void *cookie; /* argument for fgetline() */
+ char_u *(*fgetline)(int, void *, int),
+ void *cookie) /* argument for fgetline() */
{
char_u *p;
linenr_T lnum;
@@ -3064,10 +3046,10 @@ doend:
* If there is a match advance "pp" to the argument and return TRUE.
*/
int
-checkforcmd(pp, cmd, len)
- char_u **pp; /* start of command */
- char *cmd; /* name of command */
- int len; /* required length */
+checkforcmd(
+ char_u **pp, /* start of command */
+ char *cmd, /* name of command */
+ int len) /* required length */
{
int i;
@@ -3088,8 +3070,7 @@ checkforcmd(pp, cmd, len)
* invisible otherwise.
*/
static void
-append_command(cmd)
- char_u *cmd;
+append_command(char_u *cmd)
{
char_u *s = cmd;
char_u *d;
@@ -3126,9 +3107,7 @@ append_command(cmd)
* Returns NULL for an ambiguous user command.
*/
static char_u *
-find_command(eap, full)
- exarg_T *eap;
- int *full UNUSED;
+find_command(exarg_T *eap, int *full UNUSED)
{
int len;
char_u *p;
@@ -3235,12 +3214,12 @@ find_command(eap, full)
* Return NULL if there is no matching command.
*/
static char_u *
-find_ucmd(eap, p, full, xp, compl)
- exarg_T *eap;
- char_u *p; /* end of the command (possibly including count) */
- int *full; /* set to TRUE for a full match */
- expand_T *xp; /* used for completion, NULL otherwise */
- int *compl; /* completion flags or NULL */
+find_ucmd(
+ exarg_T *eap,
+ char_u *p, /* end of the command (possibly including count) */
+ int *full, /* set to TRUE for a full match */
+ expand_T *xp, /* used for completion, NULL otherwise */
+ int *compl) /* completion flags or NULL */
{
int len = (int)(p - eap->cmd);
int j, k, matchlen = 0;
@@ -3380,8 +3359,7 @@ static struct cmdmod
* Return zero when it's not a modifier.
*/
int
-modifier_len(cmd)
- char_u *cmd;
+modifier_len(char_u *cmd)
{
int i, j;
char_u *p = cmd;
@@ -3406,8 +3384,7 @@ modifier_len(cmd)
* Return 3 if there is an ambiguous match.
*/
int
-cmd_exists(name)
- char_u *name;
+cmd_exists(char_u *name)
{
exarg_T ea;
int full = FALSE;
@@ -3448,9 +3425,9 @@ cmd_exists(name)
* probably won't change that much -- webb.
*/
char_u *
-set_one_cmd_context(xp, buff)
- expand_T *xp;
- char_u *buff; /* buffer for command string */
+set_one_cmd_context(
+ expand_T *xp,
+ char_u *buff) /* buffer for command string */
{
char_u *p;
char_u *cmd, *arg;
@@ -4308,9 +4285,9 @@ set_one_cmd_context(xp, buff)
* Returns the "cmd" pointer advanced to beyond the range.
*/
char_u *
-skip_range(cmd, ctx)
- char_u *cmd;
- int *ctx; /* pointer to xp_context or NULL */
+skip_range(
+ char_u *cmd,
+ int *ctx) /* pointer to xp_context or NULL */
{
unsigned delim;
@@ -4350,12 +4327,12 @@ skip_range(cmd, ctx)
* Return MAXLNUM when no Ex address was found.
*/
static linenr_T
-get_address(eap, ptr, addr_type, skip, to_other_file)
- exarg_T *eap UNUSED;
- char_u **ptr;
- int addr_type; /* flag: one of ADDR_LINES, ... */
- int skip; /* only skip the address, don't use it */
- int to_other_file; /* flag: may jump to other file */
+get_address(
+ exarg_T *eap UNUSED,
+ char_u **ptr,
+ int addr_type, /* flag: one of ADDR_LINES, ... */
+ int skip, /* only skip the address, don't use it */
+ int to_other_file) /* flag: may jump to other file */
{
int c;
int i;
@@ -4647,8 +4624,7 @@ error:
* Get flags from an Ex command argument.
*/
static void
-get_flags(eap)
- exarg_T *eap;
+get_flags(exarg_T *eap)
{
while (vim_strchr((char_u *)"lp#", *eap->arg) != NULL)
{
@@ -4666,8 +4642,7 @@ get_flags(eap)
* Function called for command which is Not Implemented. NI!
*/
void
-ex_ni(eap)
- exarg_T *eap;
+ex_ni(exarg_T *eap)
{
if (!eap->skip)
eap->errmsg = (char_u *)N_("E319: Sorry, the command is not available in this version");
@@ -4679,8 +4654,7 @@ ex_ni(eap)
* Skips over ":perl <<EOF" constructs.
*/
static void
-ex_script_ni(eap)
- exarg_T *eap;
+ex_script_ni(exarg_T *eap)
{
if (!eap->skip)
ex_ni(eap);
@@ -4694,8 +4668,7 @@ ex_script_ni(eap)
* Return NULL when valid, error message when invalid.
*/
static char_u *
-invalid_range(eap)
- exarg_T *eap;
+invalid_range(exarg_T *eap)
{
buf_T *buf;
if ( eap->line1 < 0
@@ -4769,8 +4742,7 @@ invalid_range(eap)
* Correct the range for zero line number, if required.
*/
static void
-correct_range(eap)
- exarg_T *eap;
+correct_range(exarg_T *eap)
{
if (!(eap->argt & ZEROR)) /* zero in range not allowed */
{
@@ -4789,8 +4761,7 @@ static char_u *skip_grep_pat(exarg_T *eap);
* pattern. Otherwise return eap->arg.
*/
static char_u *
-skip_grep_pat(eap)
- exarg_T *eap;
+skip_grep_pat(exarg_T *eap)
{
char_u *p = eap->arg;
@@ -4811,10 +4782,7 @@ skip_grep_pat(eap)
* in the command line, so that things like % get expanded.
*/
static char_u *
-replace_makeprg(eap, p, cmdlinep)
- exarg_T *eap;
- char_u *p;
- char_u **cmdlinep;
+replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep)
{
char_u *new_cmdline;
char_u *program;
@@ -4896,10 +4864,10 @@ replace_makeprg(eap, p, cmdlinep)
* Return FAIL for failure, OK otherwise.
*/
int
-expand_filename(eap, cmdlinep, errormsgp)
- exarg_T *eap;
- char_u **cmdlinep;
- char_u **errormsgp;
+expand_filename(
+ exarg_T *eap,
+ char_u **cmdlinep,
+ char_u **errormsgp)
{
int has_wildcards; /* need to expand wildcards */
char_u *repl;
@@ -5138,12 +5106,12 @@ expand_filename(eap, cmdlinep, errormsgp)
* Returns NULL for failure.
*/
static char_u *
-repl_cmdline(eap, src, srclen, repl, cmdlinep)
- exarg_T *eap;
- char_u *src;
- int srclen;
- char_u *repl;
- char_u **cmdlinep;
+repl_cmdline(
+ exarg_T *eap,
+ char_u *src,
+ int srclen,
+ char_u *repl,
+ char_u **cmdlinep)
{
int len;
int i;
@@ -5195,8 +5163,7 @@ repl_cmdline(eap, src, srclen, repl, cmdlinep)
* Check for '|' to separate commands and '"' to start comments.
*/
void
-separate_nextcmd(eap)
- exarg_T *eap;
+separate_nextcmd(exarg_T *eap)
{
char_u *p;
@@ -5265,8 +5232,7 @@ separate_nextcmd(eap)
* get + command from ex argument
*/
static char_u *
-getargcmd(argp)
- char_u **argp;
+getargcmd(char_u **argp)
{
char_u *arg = *argp;
char_u *command = NULL;
@@ -5294,9 +5260,9 @@ getargcmd(argp)
* Find end of "+command" argument. Skip over "\ " and "\\".
*/
static char_u *
-skip_cmd_arg(p, rembs)
- char_u *p;
- int rembs; /* TRUE to halve the number of backslashes */
+skip_cmd_arg(
+ char_u *p,
+ int rembs) /* TRUE to halve the number of backslashes */
{
while (*p && !vim_isspace(*p))
{
@@ -5317,8 +5283,7 @@ skip_cmd_arg(p, rembs)
* Return FAIL or OK.
*/
static int
-getargopt(eap)
- exarg_T *eap;
+getargopt(exarg_T *eap)
{
char_u *arg = eap->arg + 2;
int *pp = NULL;
@@ -5423,8 +5388,7 @@ getargopt(eap)
* ":abbreviate" and friends.
*/
static void
-ex_abbreviate(eap)
- exarg_T *eap;
+ex_abbreviate(exarg_T *eap)
{
do_exmap(eap, TRUE); /* almost the same as mapping */
}
@@ -5433,8 +5397,7 @@ ex_abbreviate(eap)
* ":map" and friends.
*/
static void
-ex_map(eap)
- exarg_T *eap;
+ex_map(exarg_T *eap)
{
/*
* If we are sourcing .exrc or .vimrc in current directory we
@@ -5453,8 +5416,7 @@ ex_map(eap)
* ":unmap" and friends.
*/
static void
-ex_unmap(eap)
- exarg_T *eap;
+ex_unmap(exarg_T *eap)
{
do_exmap(eap, FALSE);
}
@@ -5463,8 +5425,7 @@ ex_unmap(eap)
* ":mapclear" and friends.
*/
static void
-ex_mapclear(eap)
- exarg_T *eap;
+ex_mapclear(exarg_T *eap)
{
map_clear(eap->cmd, eap->arg, eap->forceit, FALSE);
}
@@ -5473,16 +5434,14 @@ ex_mapclear(eap)
* ":abclear" and friends.
*/
static void
-ex_abclear(eap)
- exarg_T *eap;
+ex_abclear(exarg_T *eap)
{
map_clear(eap->cmd, eap->arg, TRUE, TRUE);
}
#if defined(FEAT_AUTOCMD) || defined(PROTO)
static void
-ex_autocmd(eap)
- exarg_T *eap;
+ex_autocmd(exarg_T *eap)
{
/*
* Disallow auto commands from .exrc and .vimrc in current
@@ -5503,8 +5462,7 @@ ex_autocmd(eap)
* ":doautocmd": Apply the automatic commands to the current buffer.
*/
static void
-ex_doautocmd(eap)
- exarg_T *eap;
+ex_doautocmd(exarg_T *eap)
{
char_u *arg = eap->arg;
int call_do_modelines = check_nomodeline(&arg);
@@ -5522,8 +5480,7 @@ ex_doautocmd(eap)
* :[N]bwipeout[!] [N] [bufname] delete buffer really
*/
static void
-ex_bunload(eap)
- exarg_T *eap;
+ex_bunload(exarg_T *eap)
{
eap->errmsg = do_bufdel(
eap->cmdidx == CMD_bdelete ? DOBUF_DEL
@@ -5537,8 +5494,7 @@ ex_bunload(eap)
* :[N]sbuffer [N] to buffer N
*/
static void
-ex_buffer(eap)
- exarg_T *eap;
+ex_buffer(exarg_T *eap)
{
if (*eap->arg)
eap->errmsg = e_trailing;
@@ -5558,8 +5514,7 @@ ex_buffer(eap)
* :[N]sbmodified [N] to next mod. buffer
*/
static void
-ex_bmodified(eap)
- exarg_T *eap;
+ex_bmodified(exarg_T *eap)
{
goto_buffer(eap, DOBUF_MOD, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
@@ -5571,8 +5526,7 @@ ex_bmodified(eap)
* :[N]sbnext [N] split and to next buffer
*/
static void
-ex_bnext(eap)
- exarg_T *eap;
+ex_bnext(exarg_T *eap)
{
goto_buffer(eap, DOBUF_CURRENT, FORWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
@@ -5586,8 +5540,7 @@ ex_bnext(eap)
* :[N]sbprevious [N] split and to previous buffer
*/
static void
-ex_bprevious(eap)
- exarg_T *eap;
+ex_bprevious(exarg_T *eap)
{
goto_buffer(eap, DOBUF_CURRENT, BACKWARD, (int)eap->line2);
if (eap->do_ecmd_cmd != NULL)
@@ -5601,8 +5554,7 @@ ex_bprevious(eap)
* :sbfirst split and to first buffer
*/
static void
-ex_brewind(eap)
- exarg_T *eap;
+ex_brewind(exarg_T *eap)
{
goto_buffer(eap, DOBUF_FIRST, FORWARD, 0);
if (eap->do_ecmd_cmd != NULL)
@@ -5614,8 +5566,7 @@ ex_brewind(eap)
* :sblast split and to last buffer
*/
static void
-ex_blast(eap)
- exarg_T *eap;
+ex_blast(exarg_T *eap)
{
goto_buffer(eap, DOBUF_LAST, BACKWARD, 0);
if (eap->do_ecmd_cmd != NULL)
@@ -5624,8 +5575,7 @@ ex_blast(eap)
#endif
int
-ends_excmd(c)
- int c;
+ends_excmd(int c)
{
return (c == NUL || c == '|' || c == '"' || c == '\n');
}
@@ -5637,8 +5587,7 @@ ends_excmd(c)
* Return NULL if not found.
*/
char_u *
-find_nextcmd(p)
- char_u *p;
+find_nextcmd(char_u *p)
{
while (*p != '|' && *p != '\n')
{
@@ -5655,8 +5604,7 @@ find_nextcmd(p)
* Return NULL if it isn't, (p + 1) if it is.
*/
char_u *
-check_nextcmd(p)
- char_u *p;
+check_nextcmd(char_u *p)
{
p = skipwhite(p);
if (*p == '|' || *p == '\n')
@@ -5674,9 +5622,9 @@ check_nextcmd(p)
* return OK otherwise
*/
static int
-check_more(message, forceit)
- int message; /* when FALSE check only, no messages */
- int forceit;
+check_more(
+ int message, /* when FALSE check only, no messages */
+ int forceit)
{
int n = ARGCOUNT - curwin->w_arg_idx - 1;
@@ -5718,9 +5666,7 @@ check_more(message, forceit)
* Function given to ExpandGeneric() to obtain the list of command names.
*/
char_u *
-get_command_name(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_command_name(expand_T *xp UNUSED, int idx)
{
if (idx >= (int)CMD_SIZE)
# ifdef FEAT_USR_CMDS
@@ -5740,17 +5686,17 @@ static char_u *uc_split_args(char_u *arg, size_t *lenp);
static size_t uc_check_code(char_u *code, size_t len, char_u *buf, ucmd_T *cmd, exarg_T *eap, char_u **split_buf, size_t *split_len);
static int
-uc_add_command(name, name_len, rep, argt, def, flags, compl, compl_arg, addr_type, force)
- char_u *name;
- size_t name_len;
- char_u *rep;
- long argt;
- long def;
- int flags;
- int compl;
- char_u *compl_arg;
- int addr_type;
- int force;
+uc_add_command(
+ char_u *name,
+ size_t name_len,
+ char_u *rep,
+ long argt,
+ long def,
+ int flags,
+ int compl,
+ char_u *compl_arg,
+ int addr_type,
+ int force)
{
ucmd_T *cmd = NULL;
char_u *p;
@@ -5937,9 +5883,7 @@ static struct
#if defined(FEAT_USR_CMDS) || defined(PROTO)
static void
-uc_list(name, name_len)
- char_u *name;
- size_t name_len;
+uc_list(char_u *name, size_t name_len)
{
int i, j;
int found = FALSE;
@@ -6073,7 +6017,7 @@ uc_list(name, name_len)
}
static char_u *
-uc_fun_cmd()
+uc_fun_cmd(void)
{
static char_u fcmd[] = {0x84, 0xaf, 0x60, 0xb9, 0xaf, 0xb5, 0x60, 0xa4,
0xa5, 0xad, 0xa1, 0xae, 0xa4, 0x60, 0xa1, 0x60,
@@ -6088,15 +6032,15 @@ uc_fun_cmd()
}
static int
-uc_scan_attr(attr, len, argt, def, flags, compl, compl_arg, addr_type_arg)
- char_u *attr;
- size_t len;
- long *argt;
- long *def;
- int *flags;
- int *compl;
- char_u **compl_arg;
- int *addr_type_arg;
+uc_scan_attr(
+ char_u *attr,
+ size_t len,
+ long *argt,
+ long *def,
+ int *flags,
+ int *compl,
+ char_u **compl_arg,
+ int *addr_type_arg)
{
char_u *p;
@@ -6246,8 +6190,7 @@ invalid_count:
* ":command ..."
*/
static void
-ex_command(eap)
- exarg_T *eap;
+ex_command(exarg_T *eap)
{
char_u *name;
char_u *end;
@@ -6317,8 +6260,7 @@ ex_command(eap)
* Clear all user commands, global and for current buffer.
*/
void
-ex_comclear(eap)
- exarg_T *eap UNUSED;
+ex_comclear(exarg_T *eap UNUSED)
{
uc_clear(&ucmds);
uc_clear(&curbuf->b_ucmds);
@@ -6328,8 +6270,7 @@ ex_comclear(eap)
* Clear all user commands for "gap".
*/
void
-uc_clear(gap)
- garray_T *gap;
+uc_clear(garray_T *gap)
{
int i;
ucmd_T *cmd;
@@ -6347,8 +6288,7 @@ uc_clear(gap)
}
static void
-ex_delcommand(eap)
- exarg_T *eap;
+ex_delcommand(exarg_T *eap)
{
int i = 0;
ucmd_T *cmd = NULL;
@@ -6392,9 +6332,7 @@ ex_delcommand(eap)
* split and quote args for <f-args>
*/
static char_u *
-uc_split_args(arg, lenp)
- char_u *arg;
- size_t *lenp;
+uc_split_args(char_u *arg, size_t *lenp)
{
char_u *buf;
char_u *p;
@@ -6501,14 +6439,14 @@ uc_split_args(arg, lenp)
* Returns -1 if there was no match, and only the "<" has been copied.
*/
static size_t
-uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
- char_u *code;
- size_t len;
- char_u *buf;
- ucmd_T *cmd; /* the user command we're expanding */
- exarg_T *eap; /* ex arguments */
- char_u **split_buf;
- size_t *split_len;
+uc_check_code(
+ char_u *code,
+ size_t len,
+ char_u *buf,
+ ucmd_T *cmd, /* the user command we're expanding */
+ exarg_T *eap, /* ex arguments */
+ char_u **split_buf,
+ size_t *split_len)
{
size_t result = 0;
char_u *p = code + 1;
@@ -6697,8 +6635,7 @@ uc_check_code(code, len, buf, cmd, eap, split_buf, split_len)
}
static void
-do_ucmd(eap)
- exarg_T *eap;
+do_ucmd(exarg_T *eap)
{
char_u *buf;
char_u *p;
@@ -6827,8 +6764,7 @@ do_ucmd(eap)
# if defined(FEAT_CMDL_COMPL) || defined(PROTO)
static char_u *
-get_user_command_name(idx)
- int idx;
+get_user_command_name(int idx)
{
return get_user_commands(NULL, idx - (int)CMD_SIZE);
}
@@ -6837,9 +6773,7 @@ get_user_command_name(idx)
* Function given to ExpandGeneric() to obtain the list of user command names.
*/
char_u *
-get_user_commands(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_commands(expand_T *xp UNUSED, int idx)
{
if (idx < curbuf->b_ucmds.ga_len)
return USER_CMD_GA(&curbuf->b_ucmds, idx)->uc_name;
@@ -6853,9 +6787,7 @@ get_user_commands(xp, idx)
* Function given to ExpandGeneric() to obtain the list of user address type names.
*/
char_u *
-get_user_cmd_addr_type(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_addr_type(expand_T *xp UNUSED, int idx)
{
return (char_u *)addr_type_complete[idx].name;
}
@@ -6865,9 +6797,7 @@ get_user_cmd_addr_type(xp, idx)
* attributes.
*/
char_u *
-get_user_cmd_flags(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_flags(expand_T *xp UNUSED, int idx)
{
static char *user_cmd_flags[] =
{"addr", "bang", "bar", "buffer", "complete",
@@ -6882,9 +6812,7 @@ get_user_cmd_flags(xp, idx)
* Function given to ExpandGeneric() to obtain the list of values for -nargs.
*/
char_u *
-get_user_cmd_nargs(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_nargs(expand_T *xp UNUSED, int idx)
{
static char *user_cmd_nargs[] = {"0", "1", "*", "?", "+"};
@@ -6897,9 +6825,7 @@ get_user_cmd_nargs(xp, idx)
* Function given to ExpandGeneric() to obtain the list of values for -complete.
*/
char_u *
-get_user_cmd_complete(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_user_cmd_complete(expand_T *xp UNUSED, int idx)
{
return (char_u *)command_complete[idx].name;
}
@@ -6909,11 +6835,11 @@ get_user_cmd_complete(xp, idx)
* Parse address type argument
*/
int
-parse_addr_type_arg(value, vallen, argt, addr_type_arg)
- char_u *value;
- int vallen;
- long *argt;
- int *addr_type_arg;
+parse_addr_type_arg(
+ char_u *value,
+ int vallen,
+ long *argt,
+ int *addr_type_arg)
{
int i, a, b;
@@ -6956,12 +6882,12 @@ parse_addr_type_arg(value, vallen, argt, addr_type_arg)
* Returns FAIL if something is wrong.
*/
int
-parse_compl_arg(value, vallen, complp, argt, compl_arg)
- char_u *value;
- int vallen;
- int *complp;
- long *argt;
- char_u **compl_arg UNUSED;
+parse_compl_arg(
+ char_u *value,
+ int vallen,
+ int *complp,
+ long *argt,
+ char_u **compl_arg UNUSED)
{
char_u *arg = NULL;
# if defined(FEAT_EVAL) && defined(FEAT_CMDL_COMPL)
@@ -7032,8 +6958,7 @@ parse_compl_arg(value, vallen, complp, argt, compl_arg)
#endif
static void
-ex_colorscheme(eap)
- exarg_T *eap;
+ex_colorscheme(exarg_T *eap)
{
if (*eap->arg == NUL)
{
@@ -7064,8 +6989,7 @@ ex_colorscheme(eap)
}
static void
-ex_highlight(eap)
- exarg_T *eap;
+ex_highlight(exarg_T *eap)
{
if (*eap->arg == NUL && eap->cmd[2] == '!')
MSG(_("Greetings, Vim user!"));
@@ -7078,7 +7002,7 @@ ex_highlight(eap)
* (because of an error). May need to restore the terminal mode.
*/
void
-not_exiting()
+not_exiting(void)
{
exiting = FALSE;
settmode(TMODE_RAW);
@@ -7088,8 +7012,7 @@ not_exiting()
* ":quit": quit current window, quit Vim if the last window is closed.
*/
static void
-ex_quit(eap)
- exarg_T *eap;
+ex_quit(exarg_T *eap)
{
#if defined(FEAT_WINDOWS) || defined(FEAT_AUTOCMD)
win_T *wp;
@@ -7177,8 +7100,7 @@ ex_quit(eap)
* ":cquit".
*/
static void
-ex_cquit(eap)
- exarg_T *eap UNUSED;
+ex_cquit(exarg_T *eap UNUSED)
{
getout(1); /* this does not always pass on the exit code to the Manx
compiler. why? */
@@ -7188,8 +7110,7 @@ ex_cquit(eap)
* ":qall": try to quit all windows
*/
static void
-ex_quit_all(eap)
- exarg_T *eap;
+ex_quit_all(exarg_T *eap)
{
# ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -7227,8 +7148,7 @@ ex_quit_all(eap)
* ":close": close current window, unless it is the last one
*/
static void
-ex_close(eap)
- exarg_T *eap;
+ex_close(exarg_T *eap)
{
win_T *win;
int winnr = 0;
@@ -7264,8 +7184,7 @@ ex_close(eap)
* ":pclose": Close any preview window.
*/
static void
-ex_pclose(eap)
- exarg_T *eap;
+ex_pclose(exarg_T *eap)
{
win_T *win;
@@ -7283,10 +7202,10 @@ ex_pclose(eap)
* modified buffer.
*/
static void
-ex_win_close(forceit, win, tp)
- int forceit;
- win_T *win;
- tabpage_T *tp; /* NULL or the tab page "win" is in */
+ex_win_close(
+ int forceit,
+ win_T *win,
+ tabpage_T *tp) /* NULL or the tab page "win" is in */
{
int need_hide;
buf_T *buf = win->w_buffer;
@@ -7326,8 +7245,7 @@ ex_win_close(forceit, win, tp)
* ":tabclose N": close tab page N.
*/
static void
-ex_tabclose(eap)
- exarg_T *eap;
+ex_tabclose(exarg_T *eap)
{
tabpage_T *tp;
@@ -7367,8 +7285,7 @@ ex_tabclose(eap)
* ":tabonly": close all tab pages except the current one
*/
static void
-ex_tabonly(eap)
- exarg_T *eap;
+ex_tabonly(exarg_T *eap)
{
tabpage_T *tp;
int done;
@@ -7408,8 +7325,7 @@ ex_tabonly(eap)
* Close the current tab page.
*/
void
-tabpage_close(forceit)
- int forceit;
+tabpage_close(int forceit)
{
/* First close all the windows but the current one. If that worked then
* close the last window in this tab, that will close it. */
@@ -7429,9 +7345,7 @@ tabpage_close(forceit)
* last-but-one tab page.
*/
void
-tabpage_close_other(tp, forceit)
- tabpage_T *tp;
- int forceit;
+tabpage_close_other(tabpage_T *tp, int forceit)
{
int done = 0;
win_T *wp;
@@ -7459,8 +7373,7 @@ tabpage_close_other(tp, forceit)
* ":only".
*/
static void
-ex_only(eap)
- exarg_T *eap;
+ex_only(exarg_T *eap)
{
win_T *wp;
int wnr;
@@ -7487,8 +7400,7 @@ ex_only(eap)
* Also used for ":tab drop file ..." after setting the argument list.
*/
void
-ex_all(eap)
- exarg_T *eap;
+ex_all(exarg_T *eap)
{
if (eap->addr_count == 0)
eap->line2 = 9999;
@@ -7497,8 +7409,7 @@ ex_all(eap)
#endif /* FEAT_WINDOWS */
static void
-ex_hide(eap)
- exarg_T *eap;
+ex_hide(exarg_T *eap)
{
if (*eap->arg != NUL && check_nextcmd(eap->arg) == NULL)
eap->errmsg = e_invarg;
@@ -7538,8 +7449,7 @@ ex_hide(eap)
* ":stop" and ":suspend": Suspend Vim.
*/
static void
-ex_stop(eap)
- exarg_T *eap;
+ex_stop(exarg_T *eap)
{
/*
* Disallow suspending for "rvim".
@@ -7579,8 +7489,7 @@ ex_stop(eap)
* ":exit", ":xit" and ":wq": Write file and exit Vim.
*/
static void
-ex_exit(eap)
- exarg_T *eap;
+ex_exit(exarg_T *eap)
{
#ifdef FEAT_CMDWIN
if (cmdwin_type != 0)
@@ -7636,8 +7545,7 @@ ex_exit(eap)
* ":print", ":list", ":number".
*/
static void
-ex_print(eap)
- exarg_T *eap;
+ex_print(exarg_T *eap)
{
if (curbuf->b_ml.ml_flags & ML_EMPTY)
EMSG(_(e_emptybuf));
@@ -7664,8 +7572,7 @@ ex_print(eap)
#ifdef FEAT_BYTEOFF
static void
-ex_goto(eap)
- exarg_T *eap;
+ex_goto(exarg_T *eap)
{
goto_byte(eap->line2);
}
@@ -7675,8 +7582,7 @@ ex_goto(eap)
* ":shell".
*/
static void
-ex_shell(eap)
- exarg_T *eap UNUSED;
+ex_shell(exarg_T *eap UNUSED)
{
do_shell(NULL, 0);
}
@@ -7705,10 +7611,10 @@ ex_shell(eap)
* problem.
*/
void
-handle_drop(filec, filev, split)
- int filec; /* the number of files dropped */
- char_u **filev; /* the list of files dropped */
- int split; /* force splitting the window */
+handle_drop(
+ int filec, /* the number of files dropped */
+ char_u **filev, /* the list of files dropped */
+ int split) /* force splitting the window */
{
exarg_T ea;
int save_msg_scroll = msg_scroll;
@@ -7780,8 +7686,7 @@ handle_drop(filec, filev, split)
* Clear an argument list: free all file names and reset it to zero entries.
*/
void
-alist_clear(al)
- alist_T *al;
+alist_clear(alist_T *al)
{
while (--al->al_ga.ga_len >= 0)
vim_free(AARGLIST(al)[al->al_ga.ga_len].ae_fname);
@@ -7792,8 +7697,7 @@ alist_clear(al)
* Init an argument list.
*/
void
-alist_init(al)
- alist_T *al;
+alist_init(alist_T *al)
{
ga_init2(&al->al_ga, (int)sizeof(aentry_T), 5);
}
@@ -7806,8 +7710,7 @@ alist_init(al)
* If the argument list is no longer used by any window, free it.
*/
void
-alist_unlink(al)
- alist_T *al;
+alist_unlink(alist_T *al)
{
if (al != &global_alist && --al->al_refcount <= 0)
{
@@ -7821,7 +7724,7 @@ alist_unlink(al)
* Create a new argument list and use it for the current window.
*/
void
-alist_new()
+alist_new(void)
{
curwin->w_alist = (alist_T *)alloc((unsigned)sizeof(alist_T));
if (curwin->w_alist == NULL)
@@ -7846,9 +7749,7 @@ alist_new()
* numbers to be re-used.
*/
void
-alist_expand(fnum_list, fnum_len)
- int *fnum_list;
- int fnum_len;
+alist_expand(int *fnum_list, int fnum_len)
{
char_u **old_arg_files;
int old_arg_count;
@@ -7886,13 +7787,13 @@ alist_expand(fnum_list, fnum_len)
* Takes over the allocated files[] and the allocated fnames in it.
*/
void
-alist_set(al, count, files, use_curbuf, fnum_list, fnum_len)
- alist_T *al;
- int count;
- char_u **files;
- int use_curbuf;
- int *fnum_list;
- int fnum_len;
+alist_set(
+ alist_T *al,
+ int count,
+ char_u **files,
+ int use_curbuf,
+ int *fnum_list,
+ int fnum_len)
{
int i;
@@ -7933,10 +7834,10 @@ alist_set(al, count, files, use_curbuf, fnum_list, fnum_len)
* "fname" must have been allocated and "al" must have been checked for room.
*/
void
-alist_add(al, fname, set_fnum)
- alist_T *al;
- char_u *fname;
- int set_fnum; /* 1: set buffer number; 2: re-use curbuf */
+alist_add(
+ alist_T *al,
+ char_u *fname,
+ int set_fnum) /* 1: set buffer number; 2: re-use curbuf */
{
if (fname == NULL) /* don't add NULL file names */
return;
@@ -7955,7 +7856,7 @@ alist_add(al, fname, set_fnum)
* Adjust slashes in file names. Called after 'shellslash' was set.
*/
void
-alist_slash_adjust()
+alist_slash_adjust(void)
{
int i;
# ifdef FEAT_WINDOWS
@@ -7980,8 +7881,7 @@ alist_slash_adjust()
* ":preserve".
*/
static void
-ex_preserve(eap)
- exarg_T *eap UNUSED;
+ex_preserve(exarg_T *eap UNUSED)
{
curbuf->b_flags |= BF_PRESERVED;
ml_preserve(curbuf, TRUE);
@@ -7991,8 +7891,7 @@ ex_preserve(eap)
* ":recover".
*/
static void
-ex_recover(eap)
- exarg_T *eap;
+ex_recover(exarg_T *eap)
{
/* Set recoverymode right away to avoid the ATTENTION prompt. */
recoverymode = TRUE;
@@ -8011,8 +7910,7 @@ ex_recover(eap)
* Command modifier used in a wrong way.
*/
static void
-ex_wrongmodifier(eap)
- exarg_T *eap;
+ex_wrongmodifier(exarg_T *eap)
{
eap->errmsg = e_invcmd;
}
@@ -8032,8 +7930,7 @@ ex_wrongmodifier(eap)
* :tabfind [+command] file open new Tab page and find "file"
*/
void
-ex_splitview(eap)
- exarg_T *eap;
+ex_splitview(exarg_T *eap)
{
win_T *old_curwin = curwin;
# if defined(FEAT_SEARCHPATH) || defined(FEAT_BROWSE)
@@ -8169,7 +8066,7 @@ theend:
* Open a new tab page.
*/
void
-tabpage_new()
+tabpage_new(void)
{
exarg_T ea;
@@ -8184,8 +8081,7 @@ tabpage_new()
* :tabnext command
*/
static void
-ex_tabnext(eap)
- exarg_T *eap;
+ex_tabnext(exarg_T *eap)
{
switch (eap->cmdidx)
{
@@ -8210,8 +8106,7 @@ ex_tabnext(eap)
* :tabmove command
*/
static void
-ex_tabmove(eap)
- exarg_T *eap;
+ex_tabmove(exarg_T *eap)
{
int tab_number;
@@ -8274,8 +8169,7 @@ ex_tabmove(eap)
* :tabs command: List tabs and their contents.
*/
static void
-ex_tabs(eap)
- exarg_T *eap UNUSED;
+ex_tabs(exarg_T *eap UNUSED)
{
tabpage_T *tp;
win_T *wp;
@@ -8321,8 +8215,7 @@ ex_tabs(eap)
* If no argument given, just get the screen size and redraw.
*/
static void
-ex_mode(eap)
- exarg_T *eap;
+ex_mode(exarg_T *eap)
{
if (*eap->arg == NUL)
shell_resized();
@@ -8336,8 +8229,7 @@ ex_mode(eap)
* set, increment or decrement current window height
*/
static void
-ex_resize(eap)
- exarg_T *eap;
+ex_resize(exarg_T *eap)
{
int n;
win_T *wp = curwin;
@@ -8378,8 +8270,7 @@ ex_resize(eap)
* ":find [+command] <file>" command.
*/
static void
-ex_find(eap)
- exarg_T *eap;
+ex_find(exarg_T *eap)
{
#ifdef FEAT_SEARCHPATH
char_u *fname;
@@ -8415,8 +8306,7 @@ ex_find(eap)
* ":open" simulation: for now just work like ":visual".
*/
static void
-ex_open(eap)
- exarg_T *eap;
+ex_open(exarg_T *eap)
{
regmatch_T regmatch;
char_u *p;
@@ -8453,8 +8343,7 @@ ex_open(eap)
* ":edit", ":badd", ":visual".
*/
static void
-ex_edit(eap)
- exarg_T *eap;
+ex_edit(exarg_T *eap)
{
do_exedit(eap, NULL);
}
@@ -8463,9 +8352,9 @@ ex_edit(eap)
* ":edit <file>" command and alikes.
*/
void
-do_exedit(eap, old_curwin)
- exarg_T *eap;
- win_T *old_curwin; /* curwin before doing a split or NULL */
+do_exedit(
+ exarg_T *eap,
+ win_T *old_curwin) /* curwin before doing a split or NULL */
{
int n;
#ifdef FEAT_WINDOWS
@@ -8650,8 +8539,7 @@ do_exedit(eap, old_curwin)
* ":gui" and ":gvim" when there is no GUI.
*/
static void
-ex_nogui(eap)
- exarg_T *eap;
+ex_nogui(exarg_T *eap)
{
eap->errmsg = e_nogvim;
}
@@ -8659,8 +8547,7 @@ ex_nogui(eap)
#if defined(FEAT_GUI_W32) && defined(FEAT_MENU) && defined(FEAT_TEAROFF)
static void
-ex_tearoff(eap)
- exarg_T *eap;
+ex_tearoff(exarg_T *eap)
{
gui_make_tearoff(eap->arg);
}
@@ -8668,16 +8555,14 @@ ex_tearoff(eap)
#if (defined(FEAT_GUI_MSWIN) || defined(FEAT_GUI_GTK)) && defined(FEAT_MENU)
static void
-ex_popup(eap)
- exarg_T *eap;
+ex_popup(exarg_T *eap)
{
gui_make_popup(eap->arg, eap->forceit);
}
#endif
static void
-ex_swapname(eap)
- exarg_T *eap UNUSED;
+ex_swapname(exarg_T *eap UNUSED)
{
if (curbuf->b_ml.ml_mfp == NULL || curbuf->b_ml.ml_mfp->mf_fname == NULL)
MSG(_("No swap file"));
@@ -8691,8 +8576,7 @@ ex_swapname(eap)
* (1998-11-02 16:21:01 R. Edward Ralston <eralston@computer.org>)
*/
static void
-ex_syncbind(eap)
- exarg_T *eap UNUSED;
+ex_syncbind(exarg_T *eap UNUSED)
{
#ifdef FEAT_SCROLLBIND
win_T *wp;
@@ -8769,8 +8653,7 @@ ex_syncbind(eap)
static void
-ex_read(eap)
- exarg_T *eap;
+ex_read(exarg_T *eap)
{
int i;
int empty = (curbuf->b_ml.ml_flags & ML_EMPTY);
@@ -8851,7 +8734,7 @@ static char_u *prev_dir = NULL;
#if defined(EXITFREE) || defined(PROTO)
void
-free_cd_dir()
+free_cd_dir(void)
{
vim_free(prev_dir);
prev_dir = NULL;
@@ -8866,8 +8749,7 @@ free_cd_dir()
* When "local" is TRUE then this was after an ":lcd" command.
*/
void
-post_chdir(local)
- int local;
+post_chdir(int local)
{
vim_free(curwin->w_localdir);
curwin->w_localdir = NULL;
@@ -8897,8 +8779,7 @@ post_chdir(local)
* ":cd", ":lcd", ":chdir" and ":lchdir".
*/
void
-ex_cd(eap)
- exarg_T *eap;
+ex_cd(exarg_T *eap)
{
char_u *new_dir;
char_u *tofree;
@@ -8977,8 +8858,7 @@ ex_cd(eap)
* ":pwd".
*/
static void
-ex_pwd(eap)
- exarg_T *eap UNUSED;
+ex_pwd(exarg_T *eap UNUSED)
{
if (mch_dirname(NameBuff, MAXPATHL) == OK)
{
@@ -8995,16 +8875,14 @@ ex_pwd(eap)
* ":=".
*/
static void
-ex_equal(eap)
- exarg_T *eap;
+ex_equal(exarg_T *eap)
{
smsg((char_u *)"%ld", (long)eap->line2);
ex_may_print(eap);
}
static void
-ex_sleep(eap)
- exarg_T *eap;
+ex_sleep(exarg_T *eap)
{
int n;
long len;
@@ -9030,8 +8908,7 @@ ex_sleep(eap)
* Sleep for "msec" milliseconds, but keep checking for a CTRL-C every second.
*/
void
-do_sleep(msec)
- long msec;
+do_sleep(long msec)
{
long done;
@@ -9051,9 +8928,7 @@ do_sleep(msec)
}
static void
-do_exmap(eap, isabbrev)
- exarg_T *eap;
- int isabbrev;
+do_exmap(exarg_T *eap, int isabbrev)
{
int mode;
char_u *cmdp;
@@ -9075,8 +8950,7 @@ do_exmap(eap, isabbrev)
* ":winsize" command (obsolete).
*/
static void
-ex_winsize(eap)
- exarg_T *eap;
+ex_winsize(exarg_T *eap)
{
int w, h;
char_u *arg = eap->arg;
@@ -9094,8 +8968,7 @@ ex_winsize(eap)
#ifdef FEAT_WINDOWS
static void
-ex_wincmd(eap)
- exarg_T *eap;
+ex_wincmd(exarg_T *eap)
{
int xchar = NUL;
char_u *p;
@@ -9135,8 +9008,7 @@ ex_wincmd(eap)
* ":winpos".
*/
static void
-ex_winpos(eap)
- exarg_T *eap;
+ex_winpos(exarg_T *eap)
{
int x, y;
char_u *arg = eap->arg;
@@ -9198,8 +9070,7 @@ ex_winpos(eap)
* Handle command that work like operators: ":delete", ":yank", ":>" and ":<".
*/
static void
-ex_operators(eap)
- exarg_T *eap;
+ex_operators(exarg_T *eap)
{
oparg_T oa;
@@ -9258,8 +9129,7 @@ ex_operators(eap)
* ":put".
*/
static void
-ex_put(eap)
- exarg_T *eap;
+ex_put(exarg_T *eap)
{
/* ":0put" works like ":1put!". */
if (eap->line2 == 0)
@@ -9276,8 +9146,7 @@ ex_put(eap)
* Handle ":copy" and ":move".
*/
static void
-ex_copymove(eap)
- exarg_T *eap;
+ex_copymove(exarg_T *eap)
{
long n;
@@ -9314,8 +9183,7 @@ ex_copymove(eap)
* Print the current line if flags were given to the Ex command.
*/
void
-ex_may_print(eap)
- exarg_T *eap;
+ex_may_print(exarg_T *eap)
{
if (eap->flags != 0)
{
@@ -9329,8 +9197,7 @@ ex_may_print(eap)
* ":smagic" and ":snomagic".
*/
static void
-ex_submagic(eap)
- exarg_T *eap;
+ex_submagic(exarg_T *eap)
{
int magic_save = p_magic;
@@ -9343,8 +9210,7 @@ ex_submagic(eap)
* ":join".
*/
static void
-ex_join(eap)
- exarg_T *eap;
+ex_join(exarg_T *eap)
{
curwin->w_cursor.lnum = eap->line1;
if (eap->line1 == eap->line2)
@@ -9367,8 +9233,7 @@ ex_join(eap)
* ":[addr]@r" or ":[addr]*r": execute register
*/
static void
-ex_at(eap)
- exarg_T *eap;
+ex_at(exarg_T *eap)
{
int c;
int prev_len = typebuf.tb_len;
@@ -9411,8 +9276,7 @@ ex_at(eap)
* ":!".
*/
static void
-ex_bang(eap)
- exarg_T *eap;
+ex_bang(exarg_T *eap)
{
do_bang(eap->addr_count, eap, eap->forceit, TRUE, TRUE);
}
@@ -9421,8 +9285,7 @@ ex_bang(eap)
* ":undo".
*/
static void
-ex_undo(eap)
- exarg_T *eap UNUSED;
+ex_undo(exarg_T *eap UNUSED)
{
if (eap->addr_count == 1) /* :undo 123 */
undo_time(eap->line2, FALSE, FALSE, TRUE);
@@ -9432,8 +9295,7 @@ ex_undo(eap)
#ifdef FEAT_PERSISTENT_UNDO
static void
-ex_wundo(eap)
- exarg_T *eap;
+ex_wundo(exarg_T *eap)
{
char_u hash[UNDO_HASH_SIZE];
@@ -9442,8 +9304,7 @@ ex_wundo(eap)
}
static void
-ex_rundo(eap)
- exarg_T *eap;
+ex_rundo(exarg_T *eap)
{
char_u hash[UNDO_HASH_SIZE];
@@ -9456,8 +9317,7 @@ ex_rundo(eap)
* ":redo".
*/
static void
-ex_redo(eap)
- exarg_T *eap UNUSED;
+ex_redo(exarg_T *eap UNUSED)
{
u_redo(1);
}
@@ -9466,8 +9326,7 @@ ex_redo(eap)
* ":earlier" and ":later".
*/
static void
-ex_later(eap)
- exarg_T *eap;
+ex_later(exarg_T *eap)
{
long count = 0;
int sec = FALSE;
@@ -9500,8 +9359,7 @@ ex_later(eap)
* ":redir": start/stop redirection.
*/
static void
-ex_redir(eap)
- exarg_T *eap;
+ex_redir(exarg_T *eap)
{
char *mode;
char_u *fname;
@@ -9622,8 +9480,7 @@ ex_redir(eap)
* ":redraw": force redraw
*/
static void
-ex_redraw(eap)
- exarg_T *eap;
+ex_redraw(exarg_T *eap)
{
int r = RedrawingDisabled;
int p = p_lz;
@@ -9653,8 +9510,7 @@ ex_redraw(eap)
* ":redrawstatus": force redraw of status line(s)
*/
static void
-ex_redrawstatus(eap)
- exarg_T *eap UNUSED;
+ex_redrawstatus(exarg_T *eap UNUSED)
{
#if defined(FEAT_WINDOWS)
int r = RedrawingDisabled;
@@ -9674,7 +9530,7 @@ ex_redrawstatus(eap)
}
static void
-close_redir()
+close_redir(void)
{
if (redir_fd != NULL)
{
@@ -9700,8 +9556,8 @@ static int mksession_nl = FALSE; /* use NL only in put_eol() */
* ":mkexrc", ":mkvimrc", ":mkview" and ":mksession".
*/
static void
-ex_mkrc(eap)
- exarg_T *eap;
+ex_mkrc(
+ exarg_T *eap)
{
FILE *fd;
int failed = FALSE;
@@ -9926,9 +9782,7 @@ theend:
#if ((defined(FEAT_SESSION) || defined(FEAT_EVAL)) && defined(vim_mkdir)) \
|| defined(PROTO)
int
-vim_mkdir_emsg(name, prot)
- char_u *name;
- int prot UNUSED;
+vim_mkdir_emsg(char_u *name, int prot UNUSED)
{
if (vim_mkdir(name, prot) != 0)
{
@@ -9944,10 +9798,10 @@ vim_mkdir_emsg(name, prot)
* Return file descriptor, or NULL on failure.
*/
FILE *
-open_exfile(fname, forceit, mode)
- char_u *fname;
- int forceit;
- char *mode; /* "w" for create new file or "a" for append */
+open_exfile(
+ char_u *fname,
+ int forceit,
+ char *mode) /* "w" for create new file or "a" for append */
{
FILE *fd;
@@ -9975,8 +9829,7 @@ open_exfile(fname, forceit, mode)
* ":mark" and ":k".
*/
static void
-ex_mark(eap)
- exarg_T *eap;
+ex_mark(exarg_T *eap)
{
pos_T pos;
@@ -9999,7 +9852,7 @@ ex_mark(eap)
* Update w_topline, w_leftcol and the cursor position.
*/
void
-update_topline_cursor()
+update_topline_cursor(void)
{
check_cursor(); /* put cursor on valid line */
update_topline();
@@ -10013,8 +9866,7 @@ update_topline_cursor()
* ":normal[!] {commands}": Execute normal mode commands.
*/
static void
-ex_normal(eap)
- exarg_T *eap;
+ex_normal(exarg_T *eap)
{
int save_msg_scroll = msg_scroll;
int save_restart_edit = restart_edit;
@@ -10173,8 +10025,7 @@ ex_normal(eap)
* ":startinsert", ":startreplace" and ":startgreplace"
*/
static void
-ex_startinsert(eap)
- exarg_T *eap;
+ex_startinsert(exarg_T *eap)
{
if (eap->forceit)
{
@@ -10207,8 +10058,7 @@ ex_startinsert(eap)
* ":stopinsert"
*/
static void
-ex_stopinsert(eap)
- exarg_T *eap UNUSED;
+ex_stopinsert(exarg_T *eap UNUSED)
{
restart_edit = 0;
stop_insert_mode = TRUE;
@@ -10221,10 +10071,7 @@ ex_stopinsert(eap)
* "remap" can be REMAP_NONE or REMAP_YES.
*/
void
-exec_normal_cmd(cmd, remap, silent)
- char_u *cmd;
- int remap;
- int silent;
+exec_normal_cmd(char_u *cmd, int remap, int silent)
{
/* Stuff the argument into the typeahead buffer. */
ins_typebuf(cmd, remap, 0, TRUE, silent);
@@ -10255,8 +10102,7 @@ exec_normal(int was_typed)
#ifdef FEAT_FIND_ID
static void
-ex_checkpath(eap)
- exarg_T *eap;
+ex_checkpath(exarg_T *eap)
{
find_pattern_in_path(NULL, 0, 0, FALSE, FALSE, CHECK_PATH, 1L,
eap->forceit ? ACTION_SHOW_ALL : ACTION_SHOW,
@@ -10268,8 +10114,7 @@ ex_checkpath(eap)
* ":psearch"
*/
static void
-ex_psearch(eap)
- exarg_T *eap;
+ex_psearch(exarg_T *eap)
{
g_do_tagpreview = p_pvh;
ex_findpat(eap);
@@ -10278,8 +10123,7 @@ ex_psearch(eap)
#endif
static void
-ex_findpat(eap)
- exarg_T *eap;
+ex_findpat(exarg_T *eap)
{
int whole = TRUE;
long n;
@@ -10343,8 +10187,7 @@ ex_findpat(eap)
* ":ptag", ":ptselect", ":ptjump", ":ptnext", etc.
*/
static void
-ex_ptag(eap)
- exarg_T *eap;
+ex_ptag(exarg_T *eap)
{
g_do_tagpreview = p_pvh; /* will be reset to 0 in ex_tag_cmd() */
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name + 1);
@@ -10354,8 +10197,7 @@ ex_ptag(eap)
* ":pedit"
*/
static void
-ex_pedit(eap)
- exarg_T *eap;
+ex_pedit(exarg_T *eap)
{
win_T *curwin_save = curwin;
@@ -10379,8 +10221,7 @@ ex_pedit(eap)
* ":stag", ":stselect" and ":stjump".
*/
static void
-ex_stag(eap)
- exarg_T *eap;
+ex_stag(exarg_T *eap)
{
postponed_split = -1;
postponed_split_flags = cmdmod.split;
@@ -10395,16 +10236,13 @@ ex_stag(eap)
* ":tag", ":tselect", ":tjump", ":tnext", etc.
*/
static void
-ex_tag(eap)
- exarg_T *eap;
+ex_tag(exarg_T *eap)
{
ex_tag_cmd(eap, cmdnames[eap->cmdidx].cmd_name);
}
static void
-ex_tag_cmd(eap, name)
- exarg_T *eap;
- char_u *name;
+ex_tag_cmd(exarg_T *eap, char_u *name)
{
int cmd;
@@ -10459,9 +10297,7 @@ ex_tag_cmd(eap, name)
* the variable. Otherwise return -1 and "*usedlen" is unchanged.
*/
int
-find_cmdline_var(src, usedlen)
- char_u *src;
- int *usedlen;
+find_cmdline_var(char_u *src, int *usedlen)
{
int len;
int i;
@@ -10531,13 +10367,13 @@ find_cmdline_var(src, usedlen)
* number of characters to skip.
*/
char_u *
-eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped)
- char_u *src; /* pointer into commandline */
- char_u *srcstart; /* beginning of valid memory for src */
- int *usedlen; /* characters after src that are used */
- linenr_T *lnump; /* line number for :e command, or NULL */
- char_u **errormsg; /* pointer to error message */
- int *escaped; /* return value has escaped white space (can
+eval_vars(
+ char_u *src, /* pointer into commandline */
+ char_u *srcstart, /* beginning of valid memory for src */
+ int *usedlen, /* characters after src that are used */
+ linenr_T *lnump, /* line number for :e command, or NULL */
+ char_u **errormsg, /* pointer to error message */
+ int *escaped) /* return value has escaped white space (can
* be NULL) */
{
int i;
@@ -10794,7 +10630,7 @@ eval_vars(src, srcstart, usedlen, lnump, errormsg, escaped)
* Returns NULL when out of memory.
*/
static char_u *
-arg_all()
+arg_all(void)
{
int len;
int idx;
@@ -10864,8 +10700,7 @@ arg_all()
* Returns an allocated string, or NULL for any error.
*/
char_u *
-expand_sfile(arg)
- char_u *arg;
+expand_sfile(char_u *arg)
{
char_u *errormsg;
int len;
@@ -10938,9 +10773,9 @@ static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp);
* Return FAIL on error, OK otherwise.
*/
static int
-makeopens(fd, dirnow)
- FILE *fd;
- char_u *dirnow; /* Current directory name */
+makeopens(
+ FILE *fd,
+ char_u *dirnow) /* Current directory name */
{
buf_T *buf;
int only_save_windows = TRUE;
@@ -11256,10 +11091,10 @@ makeopens(fd, dirnow)
}
static int
-ses_winsizes(fd, restore_size, tab_firstwin)
- FILE *fd;
- int restore_size;
- win_T *tab_firstwin;
+ses_winsizes(
+ FILE *fd,
+ int restore_size,
+ win_T *tab_firstwin)
{
int n = 0;
win_T *wp;
@@ -11304,9 +11139,7 @@ ses_winsizes(fd, restore_size, tab_firstwin)
* Returns FAIL when writing the commands to "fd" fails.
*/
static int
-ses_win_rec(fd, fr)
- FILE *fd;
- frame_T *fr;
+ses_win_rec(FILE *fd, frame_T *fr)
{
frame_T *frc;
int count = 0;
@@ -11354,8 +11187,7 @@ ses_win_rec(fd, fr)
* Returns NULL when there none.
*/
static frame_T *
-ses_skipframe(fr)
- frame_T *fr;
+ses_skipframe(frame_T *fr)
{
frame_T *frc;
@@ -11370,8 +11202,7 @@ ses_skipframe(fr)
* the Session.
*/
static int
-ses_do_frame(fr)
- frame_T *fr;
+ses_do_frame(frame_T *fr)
{
frame_T *frc;
@@ -11387,8 +11218,7 @@ ses_do_frame(fr)
* Return non-zero if window "wp" is to be stored in the Session.
*/
static int
-ses_do_win(wp)
- win_T *wp;
+ses_do_win(win_T *wp)
{
if (wp->w_buffer->b_fname == NULL
#ifdef FEAT_QUICKFIX
@@ -11407,12 +11237,12 @@ ses_do_win(wp)
* Caller must make sure 'scrolloff' is zero.
*/
static int
-put_view(fd, wp, add_edit, flagp, current_arg_idx)
- FILE *fd;
- win_T *wp;
- int add_edit; /* add ":edit" command to view */
- unsigned *flagp; /* vop_flags or ssop_flags */
- int current_arg_idx; /* current argument index of the window, use
+put_view(
+ FILE *fd,
+ win_T *wp,
+ int add_edit, /* add ":edit" command to view */
+ unsigned *flagp, /* vop_flags or ssop_flags */
+ int current_arg_idx) /* current argument index of the window, use
* -1 if unknown */
{
win_T *save_curwin;
@@ -11612,12 +11442,12 @@ put_view(fd, wp, add_edit, flagp, current_arg_idx)
* Returns FAIL if writing fails.
*/
static int
-ses_arglist(fd, cmd, gap, fullname, flagp)
- FILE *fd;
- char *cmd;
- garray_T *gap;
- int fullname; /* TRUE: use full path name */
- unsigned *flagp;
+ses_arglist(
+ FILE *fd,
+ char *cmd,
+ garray_T *gap,
+ int fullname, /* TRUE: use full path name */
+ unsigned *flagp)
{
int i;
char_u *buf = NULL;
@@ -11661,10 +11491,7 @@ ses_arglist(fd, cmd, gap, fullname, flagp)
* Returns FAIL if writing fails.
*/
static int
-ses_fname(fd, buf, flagp)
- FILE *fd;
- buf_T *buf;
- unsigned *flagp;
+ses_fname(FILE *fd, buf_T *buf, unsigned *flagp)
{
char_u *name;
@@ -11695,10 +11522,7 @@ ses_fname(fd, buf, flagp)
* Returns FAIL if writing fails or out of memory.
*/
static int
-ses_put_fname(fd, name, flagp)
- FILE *fd;
- char_u *name;
- unsigned *flagp;
+ses_put_fname(FILE *fd, char_u *name, unsigned *flagp)
{
char_u *sname;
char_u *p;
@@ -11734,8 +11558,7 @@ ses_put_fname(fd, name, flagp)
* ":loadview [nr]"
*/
static void
-ex_loadview(eap)
- exarg_T *eap;
+ex_loadview(exarg_T *eap)
{
char_u *fname;
@@ -11751,8 +11574,7 @@ ex_loadview(eap)
* Get the name of the view file for the current buffer.
*/
static char_u *
-get_view_file(c)
- int c;
+get_view_file(int c)
{
int len = 0;
char_u *p, *s;
@@ -11820,8 +11642,7 @@ get_view_file(c)
* Return FAIL for a write error.
*/
int
-put_eol(fd)
- FILE *fd;
+put_eol(FILE *fd)
{
if (
#ifdef USE_CRNL
@@ -11841,9 +11662,7 @@ put_eol(fd)
* Return FAIL for a write error.
*/
int
-put_line(fd, s)
- FILE *fd;
- char *s;
+put_line(FILE *fd, char *s)
{
if (fputs(s, fd) < 0 || put_eol(fd) == FAIL)
return FAIL;
@@ -11855,8 +11674,8 @@ put_line(fd, s)
* ":rviminfo" and ":wviminfo".
*/
static void
-ex_viminfo(eap)
- exarg_T *eap;
+ex_viminfo(
+ exarg_T *eap)
{
char_u *save_viminfo;
@@ -11881,10 +11700,7 @@ ex_viminfo(eap)
* "format" must contain "%s".
*/
void
-dialog_msg(buff, format, fname)
- char_u *buff;
- char *format;
- char_u *fname;
+dialog_msg(char_u *buff, char *format, char_u *fname)
{
if (fname == NULL)
fname = (char_u *)_("Untitled");
@@ -11896,8 +11712,7 @@ dialog_msg(buff, format, fname)
* ":behave {mswin,xterm}"
*/
static void
-ex_behave(eap)
- exarg_T *eap;
+ex_behave(exarg_T *eap)
{
if (STRCMP(eap->arg, "mswin") == 0)
{
@@ -11924,9 +11739,7 @@ ex_behave(eap)
* ":behave {mswin,xterm}" command.
*/
char_u *
-get_behave_arg(xp, idx)
- expand_T *xp UNUSED;
- int idx;
+get_behave_arg(expand_T *xp UNUSED, int idx)
{
if (idx == 0)
return (char_u *)"mswin";
@@ -11951,8 +11764,7 @@ static int filetype_indent = FALSE;
* indent off: load indoff.vim
*/
static void
-ex_filetype(eap)
- exarg_T *eap;
+ex_filetype(exarg_T *eap)
{
char_u *arg = eap->arg;
int plugin = FALSE;
@@ -12037,8 +11849,7 @@ ex_filetype(eap)
* ":setfiletype {name}"
*/
static void
-ex_setfiletype(eap)
- exarg_T *eap;
+ex_setfiletype(exarg_T *eap)
{
if (!did_filetype)
set_option_value((char_u *)"filetype", 0L, eap->arg, OPT_LOCAL);
@@ -12046,8 +11857,7 @@ ex_setfiletype(eap)
#endif
static void
-ex_digraphs(eap)
- exarg_T *eap UNUSED;
+ex_digraphs(exarg_T *eap UNUSED)
{
#ifdef FEAT_DIGRAPHS
if (*eap->arg != NUL)
@@ -12060,8 +11870,7 @@ ex_digraphs(eap)
}
static void
-ex_set(eap)
- exarg_T *eap;
+ex_set(exarg_T *eap)
{
int flags = 0;
@@ -12082,8 +11891,7 @@ ex_set(eap)
* ":nohlsearch"
*/
static void
-ex_nohlsearch(eap)
- exarg_T *eap UNUSED;
+ex_nohlsearch(exarg_T *eap UNUSED)
{
SET_NO_HLSEARCH(TRUE);
redraw_all_later(SOME_VALID);
@@ -12095,8 +11903,7 @@ ex_nohlsearch(eap)
* skipping commands to find the next command.
*/
static void
-ex_match(eap)
- exarg_T *eap;
+ex_match(exarg_T *eap)
{
char_u *p;
char_u *g = NULL;
@@ -12166,8 +11973,7 @@ ex_match(eap)
* ":X": Get crypt key
*/
static void
-ex_X(eap)
- exarg_T *eap UNUSED;
+ex_X(exarg_T *eap UNUSED)
{
crypt_check_current_method();
(void)crypt_get_key(TRUE, TRUE);
@@ -12176,24 +11982,21 @@ ex_X(eap)
#ifdef FEAT_FOLDING
static void
-ex_fold(eap)
- exarg_T *eap;
+ex_fold(exarg_T *eap)
{
if (foldManualAllowed(TRUE))
foldCreate(eap->line1, eap->line2);
}
static void
-ex_foldopen(eap)
- exarg_T *eap;
+ex_foldopen(exarg_T *eap)
{
opFoldRange(eap->line1, eap->line2, eap->cmdidx == CMD_foldopen,
eap->forceit, FALSE);
}
static void
-ex_folddo(eap)
- exarg_T *eap;
+ex_folddo(exarg_T *eap)
{
linenr_T lnum;