Problem: Functions used in one file are global.
Solution: Add "static". (Yegappan Lakshmanan, closes #4840)
/*
* Return TRUE when there is a CursorHold autocommand defined.
*/
- int
+ static int
has_cursorhold(void)
{
return (first_autopat[(int)(get_real_state() == NORMAL_BUSY
#include "vim.h"
+static void enter_buffer(buf_T *buf);
+static void buflist_getfpos(void);
static char_u *buflist_match(regmatch_T *rmp, buf_T *buf, int ignore_case);
static char_u *fname_match(regmatch_T *rmp, char_u *name, int ignore_case);
#ifdef UNIX
static void free_buffer(buf_T *);
static void free_buffer_stuff(buf_T *buf, int free_options);
static void clear_wininfo(buf_T *buf);
+#if defined(FEAT_JOB_CHANNEL) \
+ || defined(FEAT_PYTHON) || defined(FEAT_PYTHON3)
+static int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
+#endif
#ifdef UNIX
# define dev_T dev_t
* Old curbuf must have been abandoned already! This also means "curbuf" may
* be pointing to freed memory.
*/
- void
+ static void
enter_buffer(buf_T *buf)
{
/* Copy buffer and window local option values. Not for a help buffer. */
/*
* go to the last know line number for the current buffer
*/
- void
+ static void
buflist_getfpos(void)
{
pos_T *fpos;
* If found OK is returned and "wp" and "tp" are set to the window and tabpage.
* If not found FAIL is returned.
*/
- int
+ static int
find_win_for_buf(
buf_T *buf,
win_T **wp,
* Like changed_bytes() but also adjust text properties for "added" bytes.
* When "added" is negative text was deleted.
*/
- void
+ static void
inserted_bytes(linenr_T lnum, colnr_T col, int added UNUSED)
{
#ifdef FEAT_TEXT_PROP
#endif
static void channel_read(channel_T *channel, ch_part_T part, char *func);
+# if defined(MSWIN) || defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK)
+static channel_T *channel_fd2channel(sock_T fd, ch_part_T *partp);
+# endif
+static ch_mode_T channel_get_mode(channel_T *channel, ch_part_T part);
+static int channel_get_timeout(channel_T *channel, ch_part_T part);
+static ch_part_T channel_part_send(channel_T *channel);
+static ch_part_T channel_part_read(channel_T *channel);
+static void free_job_options(jobopt_T *opt);
/* Whether a redraw is needed for appending a line to a buffer. */
static int channel_need_redraw = FALSE;
/*
* Implements ch_open().
*/
- channel_T *
+ static channel_T *
channel_open_func(typval_T *argvars)
{
char_u *address;
/*
* Set the callback for "channel"/"part" for the response with "id".
*/
- void
+ static void
channel_set_req_callback(
channel_T *channel,
ch_part_T part,
/*
* Return TRUE if "channel" has JSON or other typeahead.
*/
- int
+ static int
channel_has_readahead(channel_T *channel, ch_part_T part)
{
ch_mode_T ch_mode = channel->ch_part[part].ch_mode;
dict_add_number(dict, namebuf, chanpart->ch_timeout);
}
- void
+ static void
channel_info(channel_T *channel, dict_T *dict)
{
dict_add_number(dict, "id", channel->ch_id);
/*
* Close the "in" part channel "channel".
*/
- void
+ static void
channel_close_in(channel_T *channel)
{
ch_close_part(channel, PART_IN);
/*
* Common for ch_read() and ch_readraw().
*/
- void
+ static void
common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob)
{
channel_T *channel;
* Lookup the channel from the socket. Set "partp" to the fd index.
* Returns NULL when the socket isn't found.
*/
- channel_T *
+ static channel_T *
channel_fd2channel(sock_T fd, ch_part_T *partp)
{
channel_T *channel;
/*
* common for "ch_evalexpr()" and "ch_sendexpr()"
*/
- void
+ static void
ch_expr_common(typval_T *argvars, typval_T *rettv, int eval)
{
char_u *text;
/*
* common for "ch_evalraw()" and "ch_sendraw()"
*/
- void
+ static void
ch_raw_common(typval_T *argvars, typval_T *rettv, int eval)
{
char_u buf[NUMBUFLEN];
/*
* Return the "part" to write to for "channel".
*/
- ch_part_T
+ static ch_part_T
channel_part_send(channel_T *channel)
{
if (channel->CH_SOCK_FD == INVALID_FD)
/*
* Return the default "part" to read from for "channel".
*/
- ch_part_T
+ static ch_part_T
channel_part_read(channel_T *channel)
{
if (channel->CH_SOCK_FD == INVALID_FD)
* Return the mode of "channel"/"part"
* If "channel" is invalid returns MODE_JSON.
*/
- ch_mode_T
+ static ch_mode_T
channel_get_mode(channel_T *channel, ch_part_T part)
{
if (channel == NULL)
/*
* Return the timeout of "channel"/"part"
*/
- int
+ static int
channel_get_timeout(channel_T *channel, ch_part_T part)
{
return channel->ch_part[part].ch_timeout;
/*
* Free any members of a jobopt_T.
*/
- void
+ static void
free_job_options(jobopt_T *opt)
{
if (opt->jo_callback.cb_partial != NULL)
}
}
-job_T *jobs_to_free = NULL;
+static job_T *jobs_to_free = NULL;
/*
* Put "job" in a list to be freed later, when it's no longer referenced.
#define CT_ID_CHAR 0x20 /* flag: set for ID chars */
#define CT_FNAME_CHAR 0x40 /* flag: set for file name chars */
+static int in_win_border(win_T *wp, colnr_T vcol);
+
/*
* Fill g_chartab[]. Also fills curbuf->b_chartab[] with flags for keyword
* characters for current buffer.
* Return TRUE if virtual column "vcol" is in the rightmost column of window
* "wp".
*/
- int
+ static int
in_win_border(win_T *wp, colnr_T vcol)
{
int width1; /* width of first line (after line number) */
* "what" == 1: list of values
* "what" == 2: list of items
*/
- void
+ static void
dict_list(typval_T *argvars, typval_T *rettv, int what)
{
list_T *l2;
wrong, in which case we messed up ScreenLines */
}
-struct dg_header_entry {
+static struct dg_header_entry {
int dg_start;
char *dg_header;
} header_table[] = {
static int free_unref_items(int copyID);
static int get_env_tv(char_u **arg, typval_T *rettv, int evaluate);
static int get_env_len(char_u **arg);
-static char_u * make_expanded_name(char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end);
+static int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose);
+static char_u *make_expanded_name(char_u *in_start, char_u *expr_start, char_u *expr_end, char_u *in_end);
+static int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload);
static void check_vars(char_u *name, int len);
static typval_T *alloc_string_tv(char_u *string);
static void delete_var(hashtab_T *ht, hashitem_T *hi);
* If the name contains 'magic' {}'s, expand them and return the
* expanded name in an allocated string via 'alias' - caller must free.
*/
- int
+ static int
get_name_len(
char_u **arg,
char_u **alias,
* Get the value of internal variable "name".
* Return OK or FAIL. If OK is returned "rettv" must be cleared.
*/
- int
+ static int
get_var_tv(
char_u *name,
int len, /* length of "name" */
* Turn a typeval into a string. Similar to tv_get_string_buf() but uses
* string() on Dict, List, etc.
*/
- char_u *
+ static char_u *
tv_stringify(typval_T *varp, char_u *buf)
{
if (varp->v_type == VAR_LIST
static int linelen(int *has_tab);
static void do_filter(linenr_T line1, linenr_T line2, exarg_T *eap, char_u *cmd, int do_in, int do_out);
-
+static int not_writing(void);
static int check_readonly(int *forceit, buf_T *buf);
static void delbuf_msg(char_u *name);
static int help_compare(const void *s1, const void *s2);
* Check the 'write' option.
* Return TRUE and give a message when it's not set.
*/
- int
+ static int
not_writing(void)
{
if (p_write)
* If something pending in a finally clause is resumed at the ":endtry", report
* it if required by the 'verbose' option or when debugging.
*/
- void
+ static void
report_resume_pending(int pending, void *value)
{
if (p_verbose >= 14 || debug_break_level > 0)
* If something pending in a finally clause is discarded, report it if required
* by the 'verbose' option or when debugging.
*/
- void
+ static void
report_discard_pending(int pending, void *value)
{
if (p_verbose >= 14 || debug_break_level > 0)
#endif
static char *e_auchangedbuf = N_("E812: Autocommands changed buffer or buffer name");
- void
+ static void
filemess(
buf_T *buf,
char_u *name,
#else
static int ff_check_visited(ff_visited_T **, char_u *);
#endif
+static void vim_findfile_free_visited(void *search_ctx_arg);
static void vim_findfile_free_visited_list(ff_visited_list_hdr_T **list_headp);
static void ff_free_visited_list(ff_visited_T *vl);
static ff_visited_list_hdr_T* ff_get_visited_list(char_u *, ff_visited_list_hdr_T **list_headp);
* Free the list of lists of visited files and directories
* Can handle it if the passed search_context is NULL;
*/
- void
+ static void
vim_findfile_free_visited(void *search_ctx_arg)
{
ff_search_ctx_T *search_ctx;
static int read_readbuf(buffheader_T *buf, int advance);
static void init_typebuf(void);
static void may_sync_undo(void);
+static void free_typebuf(void);
static void closescript(void);
+static void updatescript(int c);
static int vgetorpeek(int);
static int inchar(char_u *buf, int maxlen, long wait_time);
* Make "typebuf" empty and allocate new buffers.
* Returns FAIL when out of memory.
*/
- int
+ static int
alloc_typebuf(void)
{
typebuf.tb_buf = alloc(TYPELEN_INIT);
/*
* Free the buffers of "typebuf".
*/
- void
+ static void
free_typebuf(void)
{
if (typebuf.tb_buf == typebuf_init)
* All the changed memfiles are synced if c == 0 or when the number of typed
* characters reaches 'updatecount' and 'updatecount' is non-zero.
*/
- void
+ static void
updatescript(int c)
{
static int count = 0;
static void set_guifontwide(char_u *font_name);
#endif
static void gui_check_pos(void);
+static void gui_reset_scroll_region(void);
static void gui_outstr(char_u *, int);
static int gui_screenchar(int off, int flags, guicolor_T fg, guicolor_T bg, int back);
+static int gui_outstr_nowrap(char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back);
static void gui_delete_lines(int row, int count);
static void gui_insert_lines(int row, int count);
+static int gui_xy2colrow(int x, int y, int *colp);
#if defined(FEAT_GUI_TABLINE) || defined(PROTO)
static int gui_has_tabline(void);
#endif
return OK;
}
- void
+ static void
gui_set_cursor(int row, int col)
{
gui.row = row;
/*
* Make scroll region cover whole screen.
*/
- void
+ static void
gui_reset_scroll_region(void)
{
gui.scroll_region_top = 0;
gui.scroll_region_right = gui.num_cols - 1;
}
- void
+ static void
gui_start_highlight(int mask)
{
if (mask > HL_ALL) /* highlight code */
* Returns OK, unless "back" is non-zero and using the bold trick, then return
* FAIL (the caller should start drawing "back" chars back).
*/
- int
+ static int
gui_outstr_nowrap(
char_u *s,
int len,
* Corrects for multi-byte character.
* returns column in "*colp" and row as return value;
*/
- int
+ static int
gui_xy2colrow(int x, int y, int *colp)
{
int col = check_col(X_2_COL(x));
#if defined(FEAT_CINDENT) || defined(FEAT_SMARTINDENT)
+static int cin_iscase(char_u *s, int strict);
+static int cin_isscopedecl(char_u *s);
+
/*
* Return TRUE if the string "line" starts with a word from 'cinwords'.
*/
* Recognize a label: "label:".
* Note: curwin->w_cursor must be where we are looking for the label.
*/
- int
+ static int
cin_islabel(void) // XXX
{
char_u *s;
/*
* Recognize a switch label: "case .*:" or "default:".
*/
- int
+ static int
cin_iscase(
char_u *s,
int strict) // Allow relaxed check of case statement for JS
/*
* Recognize a "public/private/protected" scope declaration label.
*/
- int
+ static int
cin_isscopedecl(char_u *s)
{
int i;
* "options" can be JSON_JS or zero;
* Return FAIL if not the whole message was consumed.
*/
- int
+ static int
json_decode_all(js_read_T *reader, typval_T *res, int options)
{
int ret;
* Just before removing an item from a list: advance watchers to the next
* item.
*/
- void
+ static void
list_fix_watch(list_T *l, listitem_T *item)
{
listwatch_T *lw;
*/
static xfmark_T namedfm[NMARKS + EXTRA_MARKS]; /* marks with file nr */
+static void fname2fnum(xfmark_T *fm);
static void fmarks_check_one(xfmark_T *fm, char_u *name, buf_T *buf);
static char_u *mark_line(pos_T *mp, int lead_len);
static void show_one_mark(int, char_u *, pos_T *, char_u *, int current);
* This is used for marks obtained from the .viminfo file. It's postponed
* until the mark is used to avoid a long startup delay.
*/
- void
+ static void
fname2fnum(xfmark_T *fm)
{
char_u *p;
static void free_menu_string(vimmenu_T *, int);
static int show_menus(char_u *, int);
static void show_menus_recursive(vimmenu_T *, int, int);
+static char_u *menu_name_skip(char_u *name);
static int menu_name_equal(char_u *name, vimmenu_T *menu);
static int menu_namecmp(char_u *name, char_u *mname);
static int get_menu_cmd_modes(char_u *, int, int *, int *);
* element. Any \ and ^Vs are removed from the current element.
* "name" may be modified.
*/
- char_u *
+ static char_u *
menu_name_skip(char_u *name)
{
char_u *p;
static void msg_puts_printf(char_u *str, int maxlen);
static int do_more_prompt(int typed_char);
static void msg_screen_putchar(int c, int attr);
+static void msg_moremsg(int full);
static int msg_check_screen(void);
static void redir_write(char_u *s, int maxlen);
#ifdef FEAT_CON_DIALOG
static int confirm_msg_used = FALSE; /* displaying confirm_msg */
static char_u *confirm_msg = NULL; /* ":confirm" message */
static char_u *confirm_msg_tail; /* tail of confirm_msg */
+static void display_confirm_msg(void);
#endif
#ifdef FEAT_JOB_CHANNEL
static int emsg_to_channel_log = FALSE;
* If "msg" is in 'debug': do error message but without side effects.
* If "emsg_skip" is set: never do error messages.
*/
- int
+ static int
emsg_not_now(void)
{
if ((emsg_off > 0 && vim_strchr(p_debug, 'm') == NULL
* part in the middle and replace it with "..." when necessary.
* Does not handle multi-byte characters!
*/
- void
-msg_outtrans_long_attr(char_u *longstr, int attr)
-{
- msg_outtrans_long_len_attr(longstr, (int)STRLEN(longstr), attr);
-}
-
- void
+ static void
msg_outtrans_long_len_attr(char_u *longstr, int len, int attr)
{
int slen = len;
msg_outtrans_len_attr(longstr + len - slen, slen, attr);
}
+ void
+msg_outtrans_long_attr(char_u *longstr, int attr)
+{
+ msg_outtrans_long_len_attr(longstr, (int)STRLEN(longstr), attr);
+}
+
/*
* Basic function for writing a message with highlight attributes.
*/
}
}
- void
+ static void
msg_moremsg(int full)
{
int attr;
/*
* Display the ":confirm" message. Also called when screen resized.
*/
- void
+ static void
display_confirm_msg(void)
{
/* avoid that 'q' at the more prompt truncates the message here */
return new_fname;
}
- void
+ static void
prepare_to_exit(void)
{
#if defined(SIGHUP) && defined(SIG_IGN)
* Return the modifier mask bit (MOD_MASK_*) which corresponds to the given
* modifier name ('S' for Shift, 'C' for Ctrl etc).
*/
- int
+ static int
name_to_mod_mask(int c)
{
int i;
static void copy_yank_reg(yankreg_T *reg);
static void may_set_selection(void);
#endif
+#if defined(FEAT_SMARTINDENT) || defined(FEAT_CINDENT)
+static int preprocs_left(void);
+#endif
static void dis_msg(char_u *p, int skip_esc);
static void block_prep(oparg_T *oap, struct block_def *, linenr_T, int);
static int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1);
/*
* Get the '=' register expression itself, without evaluating it.
*/
- char_u *
+ static char_u *
get_expr_line_src(void)
{
if (expr_line == NULL)
/*
* Return TRUE if lines starting with '#' should be left aligned.
*/
- int
+ static int
preprocs_left(void)
{
return
static void set_string_option_global(int opt_idx, char_u **varp);
static char *did_set_string_option(int opt_idx, char_u **varp, int new_value_alloced, char_u *oldval, char *errbuf, int opt_flags, int *value_checked);
static char *set_chars_option(char_u **varp);
+#ifdef FEAT_STL_OPT
+static char *check_stl_option(char_u *s);
+#endif
#ifdef FEAT_CLIPBOARD
static char *check_clipboard_option(void);
#endif
static int istermoption(struct vimoption *);
static char_u *get_varp_scope(struct vimoption *p, int opt_flags);
static char_u *get_varp(struct vimoption *);
+static void check_win_options(win_T *win);
static void option_value2string(struct vimoption *, int opt_flags);
static void check_winopt(winopt_T *wop);
static int wc_use_keyname(char_u *varp, long *wcp);
* Check validity of options with the 'statusline' format.
* Return error message or NULL.
*/
- char *
+ static char *
check_stl_option(char_u *s)
{
int itemcnt = 0;
/*
* Check string options in a window for a NULL value.
*/
- void
+ static void
check_win_options(win_T *win)
{
check_winopt(&win->w_onebuf_opt);
return get_sw_value_col(buf, 0);
}
-/*
- * Idem, using the first non-black in the current line.
- */
- long
-get_sw_value_indent(buf_T *buf)
-{
- pos_T pos = curwin->w_cursor;
-
- pos.col = getwhitecols_curline();
- return get_sw_value_pos(buf, &pos);
-}
-
/*
* Idem, using "pos".
*/
- long
+ static long
get_sw_value_pos(buf_T *buf, pos_T *pos)
{
pos_T save_cursor = curwin->w_cursor;
return sw_value;
}
+/*
+ * Idem, using the first non-black in the current line.
+ */
+ long
+get_sw_value_indent(buf_T *buf)
+{
+ pos_T pos = curwin->w_cursor;
+
+ pos.col = getwhitecols_curline();
+ return get_sw_value_pos(buf, &pos);
+}
+
/*
* Idem, using virtual column "col".
*/
{"center", POPPOS_CENTER}
};
+static void popup_adjust_position(win_T *wp);
+
/*
* Get option value for "key", which is "line" or "col".
* Handles "cursor+N" and "cursor-N".
/*
* Adjust the position and size of the popup to fit on the screen.
*/
- void
+ static void
popup_adjust_position(win_T *wp)
{
linenr_T lnum;
/*
* Get the current waittime.
*/
- void
+ static void
profile_get_wait(proftime_T *tm)
{
*tm = prof_wait_time;
/*
* Return TRUE if "tm1" and "tm2" are equal.
*/
- int
+ static int
profile_equal(proftime_T *tm1, proftime_T *tm2)
{
# ifdef MSWIN
int apply_autocmds(event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf);
int apply_autocmds_exarg(event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, exarg_T *eap);
int apply_autocmds_retval(event_T event, char_u *fname, char_u *fname_io, int force, buf_T *buf, int *retval);
-int has_cursorhold(void);
int trigger_cursorhold(void);
int has_cursormoved(void);
int has_cursormovedI(void);
char *do_bufdel(int command, char_u *arg, int addr_count, int start_bnr, int end_bnr, int forceit);
int do_buffer(int action, int start, int dir, int count, int forceit);
void set_curbuf(buf_T *buf, int action);
-void enter_buffer(buf_T *buf);
void do_autochdir(void);
void no_write_message(void);
void no_write_message_nobang(buf_T *buf);
buf_T *buflist_new(char_u *ffname_arg, char_u *sfname_arg, linenr_T lnum, int flags);
void free_buf_options(buf_T *buf, int free_p_ff);
int buflist_getfile(int n, linenr_T lnum, int options, int forceit);
-void buflist_getfpos(void);
buf_T *buflist_findname_exp(char_u *fname);
buf_T *buflist_findname(char_u *ffname);
int buflist_findpat(char_u *pattern, char_u *pattern_end, int unlisted, int diffmode, int curtab_only);
char_u *buf_spname(buf_T *buf);
void switch_to_win_for_buf(buf_T *buf, win_T **save_curwinp, tabpage_T **save_curtabp, bufref_T *save_curbuf);
void restore_win_for_buf(win_T *save_curwin, tabpage_T *save_curtab, bufref_T *save_curbuf);
-int find_win_for_buf(buf_T *buf, win_T **wp, tabpage_T **tp);
void set_buflisted(int on);
int buf_contents_changed(buf_T *buf);
void wipe_buffer(buf_T *buf, int aucmd);
void may_invoke_listeners(buf_T *buf, linenr_T lnum, linenr_T lnume, int added);
void invoke_listeners(buf_T *buf);
void changed_bytes(linenr_T lnum, colnr_T col);
-void inserted_bytes(linenr_T lnum, colnr_T col, int added);
void appended_lines(linenr_T lnum, long count);
void appended_lines_mark(linenr_T lnum, long count);
void deleted_lines(linenr_T lnum, long count);
void free_unused_channels(int copyID, int mask);
void channel_gui_register_all(void);
channel_T *channel_open(char *hostname, int port_in, int waittime, void (*nb_close_cb)(void));
-channel_T *channel_open_func(typval_T *argvars);
void channel_set_pipes(channel_T *channel, sock_T in, sock_T out, sock_T err);
void channel_set_job(channel_T *channel, job_T *job, jobopt_T *options);
-void channel_set_req_callback(channel_T *channel, ch_part_T part, callback_T *callback, int id);
void channel_buffer_free(buf_T *buf);
void channel_write_any_lines(void);
void channel_write_new_lines(buf_T *buf);
int channel_collapse(channel_T *channel, ch_part_T part, int want_nl);
int channel_can_write_to(channel_T *channel);
int channel_is_open(channel_T *channel);
-int channel_has_readahead(channel_T *channel, ch_part_T part);
char *channel_status(channel_T *channel, int req_part);
-void channel_info(channel_T *channel, dict_T *dict);
void channel_close(channel_T *channel, int invoke_close_cb);
-void channel_close_in(channel_T *channel);
void channel_clear(channel_T *channel);
void channel_free_all(void);
-void common_channel_read(typval_T *argvars, typval_T *rettv, int raw, int blob);
-channel_T *channel_fd2channel(sock_T fd, ch_part_T *partp);
void channel_handle_events(int only_keep_open);
int channel_any_keep_open(void);
void channel_set_nonblock(channel_T *channel, ch_part_T part);
int channel_send(channel_T *channel, ch_part_T part, char_u *buf_arg, int len_arg, char *fun);
-void ch_expr_common(typval_T *argvars, typval_T *rettv, int eval);
-void ch_raw_common(typval_T *argvars, typval_T *rettv, int eval);
int channel_poll_setup(int nfd_in, void *fds_in, int *towait);
int channel_poll_check(int ret_in, void *fds_in);
int channel_select_setup(int maxfd_in, void *rfds_in, void *wfds_in, struct timeval *tv, struct timeval **tvp);
int channel_parse_messages(void);
int channel_any_readahead(void);
int set_ref_in_channel(int copyID);
-ch_part_T channel_part_send(channel_T *channel);
-ch_part_T channel_part_read(channel_T *channel);
-ch_mode_T channel_get_mode(channel_T *channel, ch_part_T part);
-int channel_get_timeout(channel_T *channel, ch_part_T part);
void clear_job_options(jobopt_T *opt);
-void free_job_options(jobopt_T *opt);
int get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2);
void job_free_all(void);
int job_any_running(void);
int lbr_chartabsize(char_u *line, unsigned char *s, colnr_T col);
int lbr_chartabsize_adv(char_u *line, char_u **s, colnr_T col);
int win_lbr_chartabsize(win_T *wp, char_u *line, char_u *s, colnr_T col, int *headp);
-int in_win_border(win_T *wp, colnr_T vcol);
void getvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end);
colnr_T getvcol_nolist(pos_T *posp);
void getvvcol(win_T *wp, pos_T *pos, colnr_T *start, colnr_T *cursor, colnr_T *end);
void dict_extend(dict_T *d1, dict_T *d2, char_u *action);
dictitem_T *dict_lookup(hashitem_T *hi);
int dict_equal(dict_T *d1, dict_T *d2, int ic, int recursive);
-void dict_list(typval_T *argvars, typval_T *rettv, int what);
void f_items(typval_T *argvars, typval_T *rettv);
void f_keys(typval_T *argvars, typval_T *rettv);
void f_values(typval_T *argvars, typval_T *rettv);
pos_T *var2fpos(typval_T *varp, int dollar_lnum, int *fnum);
int list2fpos(typval_T *arg, pos_T *posp, int *fnump, colnr_T *curswantp);
int get_id_len(char_u **arg);
-int get_name_len(char_u **arg, char_u **alias, int evaluate, int verbose);
char_u *find_name_end(char_u *arg, char_u **expr_start, char_u **expr_end, int flags);
int eval_isnamec(int c);
int eval_isnamec1(int c);
char_u *v_exception(char_u *oldval);
char_u *v_throwpoint(char_u *oldval);
char_u *set_cmdarg(exarg_T *eap, char_u *oldarg);
-int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload);
int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose, char_u *start_leader, char_u **end_leaderp);
typval_T *alloc_tv(void);
void free_tv(typval_T *varp);
char_u *tv_get_string_buf(typval_T *varp, char_u *buf);
char_u *tv_get_string_chk(typval_T *varp);
char_u *tv_get_string_buf_chk(typval_T *varp, char_u *buf);
-char_u *tv_stringify(typval_T *varp, char_u *buf);
dictitem_T *find_var(char_u *name, hashtab_T **htp, int no_autoload);
dictitem_T *find_var_in_ht(hashtab_T *ht, int htname, char_u *varname, int no_autoload);
hashtab_T *find_var_ht(char_u *name, char_u **varname);
int check_overwrite(exarg_T *eap, buf_T *buf, char_u *fname, char_u *ffname, int other);
void ex_wnext(exarg_T *eap);
void do_wqall(exarg_T *eap);
-int not_writing(void);
int getfile(int fnum, char_u *ffname_arg, char_u *sfname_arg, int setpm, linenr_T lnum, int forceit);
int do_ecmd(int fnum, char_u *ffname, char_u *sfname, exarg_T *eap, linenr_T newlnum, int flags, win_T *oldwin);
void ex_append(exarg_T *eap);
char *get_exception_string(void *value, except_type_T type, char_u *cmdname, int *should_free);
void discard_current_exception(void);
void report_make_pending(int pending, void *value);
-void report_resume_pending(int pending, void *value);
-void report_discard_pending(int pending, void *value);
void ex_eval(exarg_T *eap);
void ex_if(exarg_T *eap);
void ex_endif(exarg_T *eap);
/* fileio.c */
-void filemess(buf_T *buf, char_u *name, char_u *s, int attr);
int readfile(char_u *fname, char_u *sfname, linenr_T from, linenr_T lines_to_skip, linenr_T lines_to_read, exarg_T *eap, int flags);
int is_dev_fd_file(char_u *fname);
int prep_exarg(exarg_T *eap, buf_T *buf);
char_u *vim_findfile_stopdir(char_u *buf);
void vim_findfile_cleanup(void *ctx);
char_u *vim_findfile(void *search_ctx_arg);
-void vim_findfile_free_visited(void *search_ctx_arg);
char_u *find_file_in_path(char_u *ptr, int len, int options, int first, char_u *rel_fname);
void free_findfile(void);
char_u *find_directory_in_path(char_u *ptr, int len, int options, char_u *rel_fname);
int typebuf_typed(void);
int typebuf_maplen(void);
void del_typebuf(int len, int offset);
-int alloc_typebuf(void);
-void free_typebuf(void);
int save_typebuf(void);
void save_typeahead(tasave_T *tp);
void restore_typeahead(tasave_T *tp);
void close_all_scripts(void);
int using_script(void);
void before_blocking(void);
-void updatescript(int c);
int vgetc(void);
int safe_vgetc(void);
int plain_vgetc(void);
void gui_shell_closed(void);
int gui_init_font(char_u *font_list, int fontset);
int gui_get_wide_font(void);
-void gui_set_cursor(int row, int col);
void gui_update_cursor(int force, int clear_selection);
void gui_position_menu(void);
int gui_get_base_width(void);
int gui_get_shellsize(void);
void gui_set_shellsize(int mustset, int fit_to_display, int direction);
void gui_new_shellsize(void);
-void gui_reset_scroll_region(void);
-void gui_start_highlight(int mask);
void gui_stop_highlight(int mask);
void gui_clear_block(int row1, int col1, int row2, int col2);
void gui_update_cursor_later(void);
void gui_disable_flush(void);
void gui_enable_flush(void);
void gui_may_flush(void);
-int gui_outstr_nowrap(char_u *s, int len, int flags, guicolor_T fg, guicolor_T bg, int back);
void gui_undraw_cursor(void);
void gui_redraw(int x, int y, int w, int h);
int gui_redraw_block(int row1, int col1, int row2, int col2, int flags);
int gui_wait_for_chars(long wtime, int tb_change_cnt);
int gui_inchar(char_u *buf, int maxlen, long wtime, int tb_change_cnt);
void gui_send_mouse_event(int button, int x, int y, int repeated_click, int_u modifiers);
-int gui_xy2colrow(int x, int y, int *colp);
void gui_menu_cb(vimmenu_T *menu);
void gui_init_which_components(char_u *oldval);
int gui_use_tabline(void);
int cin_is_cinword(char_u *line);
pos_T *find_start_comment(int ind_maxcomment);
int cindent_on(void);
-int cin_islabel(void);
-int cin_iscase(char_u *s, int strict);
-int cin_isscopedecl(char_u *s);
void parse_cino(buf_T *buf);
int get_c_indent(void);
int get_expr_indent(void);
/* json.c */
char_u *json_encode(typval_T *val, int options);
char_u *json_encode_nr_expr(int nr, typval_T *val, int options);
-int json_decode_all(js_read_T *reader, typval_T *res, int options);
int json_decode(js_read_T *reader, typval_T *res, int options);
int json_find_end(js_read_T *reader, int options);
void f_js_decode(typval_T *argvars, typval_T *rettv);
/* list.c */
void list_add_watch(list_T *l, listwatch_T *lw);
void list_rem_watch(list_T *l, listwatch_T *lwrem);
-void list_fix_watch(list_T *l, listitem_T *item);
list_T *list_alloc(void);
list_T *list_alloc_id(alloc_id_T id);
int rettv_list_alloc(typval_T *rettv);
pos_T *getmark(int c, int changefile);
pos_T *getmark_buf_fnum(buf_T *buf, int c, int changefile, int *fnum);
pos_T *getnextmark(pos_T *startpos, int dir, int begin_line);
-void fname2fnum(xfmark_T *fm);
void fmarks_check_names(buf_T *buf);
int check_mark(pos_T *pos);
void clrallmarks(buf_T *buf);
char_u *set_context_in_menu_cmd(expand_T *xp, char_u *cmd, char_u *arg, int forceit);
char_u *get_menu_name(expand_T *xp, int idx);
char_u *get_menu_names(expand_T *xp, int idx);
-char_u *menu_name_skip(char_u *name);
int get_menu_index(vimmenu_T *menu, int state);
int menu_is_menubar(char_u *name);
int menu_is_popup(char_u *name);
void trunc_string(char_u *s, char_u *buf, int room_in, int buflen);
void reset_last_sourcing(void);
void msg_source(int attr);
-int emsg_not_now(void);
void ignore_error_for_testing(char_u *error);
void do_perror(char *msg);
int emsg(char *s);
void msg_puts(char *s);
void msg_puts_title(char *s);
void msg_outtrans_long_attr(char_u *longstr, int attr);
-void msg_outtrans_long_len_attr(char_u *longstr, int len, int attr);
void msg_puts_attr(char *s, int attr);
int message_filtered(char_u *msg);
void may_clear_sb_text(void);
int msg_use_printf(void);
void mch_errmsg(char *str);
void mch_msg(char *str);
-void msg_moremsg(int full);
void repeat_message(void);
void msg_clr_eos(void);
void msg_clr_eos_force(void);
void give_warning2(char_u *message, char_u *a1, int hl);
void msg_advance(int col);
int do_dialog(int type, char_u *title, char_u *message, char_u *buttons, int dfltbutton, char_u *textfield, int ex_cmd);
-void display_confirm_msg(void);
int vim_dialog_yesno(int type, char_u *title, char_u *message, int dflt);
int vim_dialog_yesnocancel(int type, char_u *title, char_u *message, int dflt);
int vim_dialog_yesnoallcancel(int type, char_u *title, char_u *message, int dflt);
char_u *concat_str(char_u *str1, char_u *str2);
void add_pathsep(char_u *p);
char_u *FullName_save(char_u *fname, int force);
-void prepare_to_exit(void);
void preserve_exit(void);
int vim_fexists(char_u *fname);
void line_breakcheck(void);
void ga_concat(garray_T *gap, char_u *s);
void ga_append(garray_T *gap, int c);
void append_ga_line(garray_T *gap);
-int name_to_mod_mask(int c);
int simplify_key(int key, int *modifiers);
int handle_x_keys(int key);
char_u *get_special_key_name(int c, int modifiers);
int get_expr_register(void);
void set_expr_line(char_u *new_line);
char_u *get_expr_line(void);
-char_u *get_expr_line_src(void);
int valid_yank_reg(int regname, int writing);
int get_yank_register(int regname, int writing);
int may_get_selection(int regname);
int op_yank(oparg_T *oap, int deleting, int mess);
void do_put(int regname, int dir, long count, int flags);
void adjust_cursor_eol(void);
-int preprocs_left(void);
int get_register_name(int num);
void ex_display(exarg_T *eap);
char_u *skip_comment(char_u *line, int process, int include_space, int *is_comment);
void set_string_option_direct_in_buf(buf_T *buf, char_u *name, int opt_idx, char_u *val, int opt_flags, int set_sid);
int valid_spellang(char_u *val);
char *check_colorcolumn(win_T *wp);
-char *check_stl_option(char_u *s);
void set_term_option_sctx_idx(char *name, int opt_idx);
int get_option_value(char_u *name, long *numval, char_u **stringval, int opt_flags);
int get_option_value_strict(char_u *name, long *numval, char_u **stringval, int opt_type, void *from);
char_u *get_equalprg(void);
void win_copy_options(win_T *wp_from, win_T *wp_to);
void copy_winopt(winopt_T *from, winopt_T *to);
-void check_win_options(win_T *win);
void clear_winopt(winopt_T *wop);
void buf_copy_options(buf_T *buf, int flags);
void reset_modifiable(void);
int tabstop_first(int *ts);
long get_sw_value(buf_T *buf);
long get_sw_value_indent(buf_T *buf);
-long get_sw_value_pos(buf_T *buf, pos_T *pos);
long get_sw_value_col(buf_T *buf, colnr_T col);
long get_sts_value(void);
long get_scrolloff_value(void);
int popup_height(win_T *wp);
int popup_width(win_T *wp);
int popup_extra_width(win_T *wp);
-void popup_adjust_position(win_T *wp);
int parse_previewpopup(win_T *wp);
int parse_completepopup(win_T *wp);
void popup_set_wantpos_cursor(win_T *wp, int width);
void profile_divide(proftime_T *tm, int count, proftime_T *tm2);
void profile_add(proftime_T *tm, proftime_T *tm2);
void profile_self(proftime_T *self, proftime_T *total, proftime_T *children);
-void profile_get_wait(proftime_T *tm);
void profile_sub_wait(proftime_T *tm, proftime_T *tma);
-int profile_equal(proftime_T *tm1, proftime_T *tm2);
int profile_cmp(const proftime_T *tm1, const proftime_T *tm2);
void ex_profile(exarg_T *eap);
char_u *get_profile_name(expand_T *xp, int idx);
void check_quickfix_busy(void);
void copy_loclist_stack(win_T *from, win_T *to);
void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit);
-void qf_jump_newwin(qf_info_T *qi, int dir, int errornr, int forceit, int newwin);
void qf_list(exarg_T *eap);
void qf_age(exarg_T *eap);
void qf_history(exarg_T *eap);
void close_spellbuf(buf_T *buf);
void clear_spell_chartab(spelltab_T *sp);
void init_spell_chartab(void);
-int spell_iswordp_nmw(char_u *p, win_T *wp);
int spell_casefold(char_u *str, int len, char_u *buf, int buflen);
int spell_check_sps(void);
void spell_suggest(int count);
/* term.c */
-guicolor_T termgui_mch_get_color(char_u *name);
guicolor_T termgui_get_color(char_u *name);
guicolor_T termgui_mch_get_rgb(guicolor_T color);
int set_termname(char_u *term);
void add_termcode(char_u *name, char_u *string, int flags);
char_u *find_termcode(char_u *name);
char_u *get_termcode(int i);
-void del_termcode(char_u *name);
void set_mouse_topline(win_T *wp);
int check_termcode(int max_offset, char_u *buf, int bufsize, int *buflen);
void term_get_fg_color(char_u *r, char_u *g, char_u *b);
void term_get_bg_color(char_u *r, char_u *g, char_u *b);
char_u *replace_termcodes(char_u *from, char_u **bufp, int from_part, int do_lt, int special);
-int find_term_bykeys(char_u *src);
void show_termcodes(void);
int show_one_termcode(char_u *name, char_u *code, int printit);
char_u *translate_mapping(char_u *str);
void f_prop_clear(typval_T *argvars, typval_T *rettv);
void f_prop_list(typval_T *argvars, typval_T *rettv);
void f_prop_remove(typval_T *argvars, typval_T *rettv);
-void prop_type_set(typval_T *argvars, int add);
void f_prop_type_add(typval_T *argvars, typval_T *rettv);
void f_prop_type_change(typval_T *argvars, typval_T *rettv);
void f_prop_type_delete(typval_T *argvars, typval_T *rettv);
void clip_may_clear_selection(int row1, int row2);
void clip_scroll_selection(int rows);
void clip_copy_modeless_selection(int both);
-int clip_gen_own_selection(Clipboard_T *cbd);
-void clip_gen_lose_selection(Clipboard_T *cbd);
void clip_gen_set_selection(Clipboard_T *cbd);
void clip_gen_request_selection(Clipboard_T *cbd);
int clip_gen_owner_exists(Clipboard_T *cbd);
void clip_x11_lose_selection(Widget myShell, Clipboard_T *cbd);
int clip_x11_own_selection(Widget myShell, Clipboard_T *cbd);
void clip_x11_set_selection(Clipboard_T *cbd);
-int clip_x11_owner_exists(Clipboard_T *cbd);
void yank_cut_buffer0(Display *dpy, Clipboard_T *cbd);
int jump_to_mouse(int flags, int *inclusive, int which_button);
int mouse_comp_pos(win_T *win, int *rowp, int *colp, linenr_T *lnump, int *plines_cache);
void u_find_first_changed(void);
void u_update_save_nr(buf_T *buf);
void u_clearall(buf_T *buf);
-void u_saveline(linenr_T lnum);
void u_clearline(void);
void u_undoline(void);
void u_blockfree(buf_T *buf);
win_T *winframe_remove(win_T *win, int *dirp, tabpage_T *tp);
void close_others(int message, int forceit);
void curwin_init(void);
-void win_init_empty(win_T *wp);
int win_alloc_first(void);
win_T *win_alloc_popup_win(void);
void win_init_popup_win(win_T *wp, buf_T *buf);
void win_init_size(void);
void free_tabpage(tabpage_T *tp);
int win_new_tabpage(int after);
-int may_open_tabpage(void);
int make_tabpages(int maxcount);
int valid_tabpage(tabpage_T *tpc);
int valid_tabpage_win(tabpage_T *tpc);
void win_enter(win_T *wp, int undo_sync);
win_T *buf_jump_open_win(buf_T *buf);
win_T *buf_jump_open_tab(buf_T *buf);
-int win_unlisted(win_T *wp);
void win_free_popup(win_T *win);
-void win_append(win_T *after, win_T *wp);
void win_remove(win_T *wp, tabpage_T *tp);
int win_alloc_lines(win_T *wp);
void win_free_lsize(win_T *wp);
static char_u *qf_push_dir(char_u *, struct dir_stack_T **, int is_file_stack);
static char_u *qf_pop_dir(struct dir_stack_T **);
static char_u *qf_guess_filepath(qf_list_T *qfl, char_u *);
+static void qf_jump_newwin(qf_info_T *qi, int dir, int errornr, int forceit, int newwin);
static void qf_fmt_text(char_u *text, char_u *buf, int bufsize);
static int qf_win_pos_update(qf_info_T *qi, int old_qf_index);
static win_T *qf_find_win(qf_info_T *qi);
* If 'forceit' is TRUE, then can discard changes to the current buffer.
* If 'newwin' is TRUE, then open the file in a new window.
*/
- void
+ static void
qf_jump_newwin(qf_info_T *qi,
int dir,
int errornr,
/*
* Table for equivalence class "c". (IBM-1047)
*/
-char *EQUIVAL_CLASS_C[16] = {
+static char *EQUIVAL_CLASS_C[16] = {
"A\x62\x63\x64\x65\x66\x67",
"C\x68",
"E\x71\x72\x73\x74",
static int regrepeat(char_u *p, long maxcount);
#ifdef DEBUG
-int regnarrate = 0;
+static int regnarrate = 0;
#endif
/*
static void clear_midword(win_T *buf);
static void use_midword(slang_T *lp, win_T *buf);
static int find_region(char_u *rp, char_u *region);
+static int spell_iswordp_nmw(char_u *p, win_T *wp);
static int check_need_cap(linenr_T lnum, colnr_T col);
static void spell_find_suggest(char_u *badptr, int badlen, suginfo_T *su, int maxcount, int banbadword, int need_cap, int interactive);
#ifdef FEAT_EVAL
* Return TRUE if "p" points to a word character.
* Unlike spell_iswordp() this doesn't check for "midword" characters.
*/
- int
+ static int
spell_iswordp_nmw(char_u *p, win_T *wp)
{
int c;
|| defined(FEAT_MOUSE_GPM) || defined(FEAT_SYSMOUSE)))
static int get_bytes_from_buf(char_u *, char_u *, int);
#endif
+static void del_termcode(char_u *name);
static void del_termcode_idx(int idx);
+static int find_term_bykeys(char_u *src);
static int term_is_builtin(char_u *name);
static int term_7to8bit(char_u *p);
}; /* end of builtin_termcaps */
#if defined(FEAT_TERMGUICOLORS) || defined(PROTO)
- guicolor_T
+ static guicolor_T
termgui_mch_get_color(char_u *name)
{
return gui_get_color_cmn(name);
return &termcodes[i].name[0];
}
- void
+ static void
del_termcode(char_u *name)
{
int i;
* Find a termcode with keys 'src' (must be NUL terminated).
* Return the index in termcodes[], or -1 if not found.
*/
- int
+ static int
find_term_bykeys(char_u *src)
{
int i;
/*
* Common for f_prop_type_add() and f_prop_type_change().
*/
- void
+ static void
prop_type_set(typval_T *argvars, int add)
{
char_u *name;
#if defined(FEAT_CLIPBOARD) || defined(PROTO)
+static void clip_gen_lose_selection(Clipboard_T *cbd);
+static int clip_gen_own_selection(Clipboard_T *cbd);
+#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)
+static int clip_x11_owner_exists(Clipboard_T *cbd);
+#endif
+
/*
* Selection stuff using Visual mode, for cutting and pasting text to other
* windows.
}
}
- int
+ static int
clip_gen_own_selection(Clipboard_T *cbd)
{
#ifdef FEAT_XCLIPBOARD
#endif
}
- void
+ static void
clip_gen_lose_selection(Clipboard_T *cbd)
{
#ifdef FEAT_XCLIPBOARD
#if (defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(USE_SYSTEM)) \
|| defined(PROTO)
- int
+ static int
clip_x11_owner_exists(Clipboard_T *cbd)
{
return XGetSelectionOwner(X_DISPLAY, cbd->sel_atom) != None;
static void serialize_visualinfo(bufinfo_T *bi, visualinfo_T *info);
static void unserialize_visualinfo(bufinfo_T *bi, visualinfo_T *info);
#endif
+static void u_saveline(linenr_T lnum);
#define U_ALLOC_LINE(size) lalloc(size, FALSE)
/*
* Save the line "lnum" for the "U" command.
*/
- void
+ static void
u_saveline(linenr_T lnum)
{
if (lnum == curbuf->b_u_line_lnum) /* line is already saved */
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1891,
/**/
1890,
/**/
static void enter_tabpage(tabpage_T *tp, buf_T *old_curbuf, int trigger_enter_autocmds, int trigger_leave_autocmds);
static void frame_fix_height(win_T *wp);
static int frame_minheight(frame_T *topfrp, win_T *next_curwin);
+static int may_open_tabpage(void);
static void win_enter_ext(win_T *wp, int undo_sync, int no_curwin, int trigger_new_autocmds, int trigger_enter_autocmds, int trigger_leave_autocmds);
static void win_free(win_T *wp, tabpage_T *tp);
+static int win_unlisted(win_T *wp);
+static void win_append(win_T *after, win_T *wp);
static void frame_append(frame_T *after, frame_T *frp);
static void frame_insert(frame_T *before, frame_T *frp);
static void frame_remove(frame_T *frp);
emsg(_("E445: Other window contains changes"));
}
-/*
- * Init the current window "curwin".
- * Called when a new file is being edited.
- */
- void
-curwin_init(void)
-{
- win_init_empty(curwin);
-}
-
- void
+ static void
win_init_empty(win_T *wp)
{
redraw_win_later(wp, NOT_VALID);
#endif
}
+/*
+ * Init the current window "curwin".
+ * Called when a new file is being edited.
+ */
+ void
+curwin_init(void)
+{
+ win_init_empty(curwin);
+}
+
/*
* Allocate the first window and put an empty buffer in it.
* Called from main().
* like with ":split".
* Returns OK if a new tab page was created, FAIL otherwise.
*/
- int
+ static int
may_open_tabpage(void)
{
int n = (cmdmod.tab == 0) ? postponed_split_tab : cmdmod.tab;
* Return TRUE if "wp" is not in the list of windows: the autocmd window or a
* popup window.
*/
- int
+ static int
win_unlisted(win_T *wp)
{
return wp == aucmd_win || WIN_IS_POPUP(wp);
/*
* Append window "wp" in the window list after window "after".
*/
- void
+ static void
win_append(win_T *after, win_T *wp)
{
win_T *before;