1#ifndef DEFINE_FUNC_ATTRIBUTES
2# define DEFINE_FUNC_ATTRIBUTES
3#endif
4#include "nvim/func_attr.h"
5#undef DEFINE_FUNC_ATTRIBUTES
6static void save_dbg_stuff(struct dbg_stuff *dsp);
7static void restore_dbg_stuff(struct dbg_stuff *dsp);
8static char_u *get_loop_line(int c, void *cookie, int indent);
9static void store_loop_line(garray_T *gap, char_u *line);
10static int compute_buffer_local_count(int addr_type, int lnum, int offset);
11static int current_win_nr(win_T *win);
12static int current_tab_nr(tabpage_T *tab);
13static void get_wincmd_addr_type(char_u *arg, exarg_T *eap);
14static char_u *do_one_cmd(char_u **cmdlinep, int flags, struct condstack *cstack, LineGetter fgetline, void *cookie );
15static void append_command(char_u *cmd);
16static char_u *find_command(exarg_T *eap, int *full);
17static char_u *find_ucmd(exarg_T *eap, char_u *p, int *full, expand_T *xp, int *complp );
18static linenr_T get_address(exarg_T *eap, char_u **ptr, int addr_type, int skip, int to_other_file, int address_count);
19static void get_flags(exarg_T *eap);
20static void ex_script_ni(exarg_T *eap);
21static char_u *invalid_range(exarg_T *eap);
22static void correct_range(exarg_T *eap);
23static char_u *skip_grep_pat(exarg_T *eap);
24static char_u *replace_makeprg(exarg_T *eap, char_u *p, char_u **cmdlinep);
25static char_u *repl_cmdline(exarg_T *eap, char_u *src, size_t srclen, char_u *repl, char_u **cmdlinep);
26static char_u *getargcmd(char_u **argp);
27static char_u *skip_cmd_arg(char_u *p, int rembs );
28static int getargopt(exarg_T *eap);
29static int get_tabpage_arg(exarg_T *eap);
30static void ex_abbreviate(exarg_T *eap);
31static void ex_map(exarg_T *eap);
32static void ex_unmap(exarg_T *eap);
33static void ex_mapclear(exarg_T *eap);
34static void ex_abclear(exarg_T *eap);
35static void ex_autocmd(exarg_T *eap);
36static void ex_doautocmd(exarg_T *eap);
37static void ex_bunload(exarg_T *eap);
38static void ex_buffer(exarg_T *eap);
39static void ex_bmodified(exarg_T *eap);
40static void ex_bnext(exarg_T *eap);
41static void ex_bprevious(exarg_T *eap);
42static void ex_brewind(exarg_T *eap);
43static void ex_blast(exarg_T *eap);
44static int check_more(int message, int forceit );
45static int uc_add_command(char_u *name, size_t name_len, char_u *rep, uint32_t argt, long def, int flags, int compl, char_u *compl_arg, int addr_type, int force);
46static char *get_command_complete(int arg);
47static void uc_list(char_u *name, size_t name_len);
48static int uc_scan_attr(char_u *attr, size_t len, uint32_t *argt, long *def, int *flags, int *complp, char_u **compl_arg, int *addr_type_arg);
49static void ex_command(exarg_T *eap);
50static void free_ucmd(ucmd_T *cmd);
51static void ex_delcommand(exarg_T *eap);
52static char_u *uc_split_args(char_u *arg, size_t *lenp);
53static size_t add_cmd_modifier(char_u *buf, char *mod_str, _Bool *multi_mods);
54static 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 );
55static void do_ucmd(exarg_T *eap);
56static char_u *get_user_command_name(int idx);
57static void ex_colorscheme(exarg_T *eap);
58static void ex_highlight(exarg_T *eap);
59static _Bool before_quit_autocmds(win_T *wp, _Bool quit_all, int forceit);
60static void ex_quit(exarg_T *eap);
61static void ex_cquit(exarg_T *eap);
62static void ex_quit_all(exarg_T *eap);
63static void ex_close(exarg_T *eap);
64static void ex_pclose(exarg_T *eap);
65static void ex_tabclose(exarg_T *eap);
66static void ex_tabonly(exarg_T *eap);
67static void ex_only(exarg_T *eap);
68static void ex_hide(exarg_T *eap);
69static void ex_stop(exarg_T *eap);
70static void ex_exit(exarg_T *eap);
71static void ex_print(exarg_T *eap);
72static void ex_goto(exarg_T *eap);
73static void ex_preserve(exarg_T *eap);
74static void ex_recover(exarg_T *eap);
75static void ex_wrongmodifier(exarg_T *eap);
76static void ex_tabnext(exarg_T *eap);
77static void ex_tabmove(exarg_T *eap);
78static void ex_tabs(exarg_T *eap);
79static void ex_mode(exarg_T *eap);
80static void ex_resize(exarg_T *eap);
81static void ex_find(exarg_T *eap);
82static void ex_edit(exarg_T *eap);
83static void ex_nogui(exarg_T *eap);
84static void ex_swapname(exarg_T *eap);
85static void ex_syncbind(exarg_T *eap);
86static void ex_read(exarg_T *eap);
87static void ex_pwd(exarg_T *eap);
88static void ex_equal(exarg_T *eap);
89static void ex_sleep(exarg_T *eap);
90static void do_exmap(exarg_T *eap, int isabbrev);
91static void ex_winsize(exarg_T *eap);
92static void ex_wincmd(exarg_T *eap);
93static void ex_operators(exarg_T *eap);
94static void ex_put(exarg_T *eap);
95static void ex_copymove(exarg_T *eap);
96static void ex_submagic(exarg_T *eap);
97static void ex_join(exarg_T *eap);
98static void ex_at(exarg_T *eap);
99static void ex_bang(exarg_T *eap);
100static void ex_undo(exarg_T *eap);
101static void ex_wundo(exarg_T *eap);
102static void ex_rundo(exarg_T *eap);
103static void ex_redo(exarg_T *eap);
104static void ex_later(exarg_T *eap);
105static void ex_redir(exarg_T *eap);
106static void ex_redraw(exarg_T *eap);
107static void ex_redrawstatus(exarg_T *eap);
108static void ex_redrawtabline(exarg_T *eap FUNC_ATTR_UNUSED);
109static void close_redir(void);
110static void ex_mkrc(exarg_T *eap);
111static void ex_mark(exarg_T *eap);
112static void ex_normal(exarg_T *eap);
113static void ex_startinsert(exarg_T *eap);
114static void ex_stopinsert(exarg_T *eap);
115static void ex_checkpath(exarg_T *eap);
116static void ex_psearch(exarg_T *eap);
117static void ex_findpat(exarg_T *eap);
118static void ex_ptag(exarg_T *eap);
119static void ex_pedit(exarg_T *eap);
120static void ex_stag(exarg_T *eap);
121static void ex_tag(exarg_T *eap);
122static void ex_tag_cmd(exarg_T *eap, char_u *name);
123static char_u *arg_all(void);
124static int makeopens(FILE *fd, char_u *dirnow );
125static int ses_winsizes(FILE *fd, int restore_size, win_T *tab_firstwin);
126static int ses_win_rec(FILE *fd, frame_T *fr);
127static frame_T *ses_skipframe(frame_T *fr);
128static _Bool ses_do_frame(const frame_T *fr) FUNC_ATTR_NONNULL_ARG(1);
129static int ses_do_win(win_T *wp);
130static int put_view_curpos(FILE *fd, const win_T *wp, char *spaces);
131static int put_view(FILE *fd, win_T *wp, int add_edit, unsigned *flagp, int current_arg_idx );
132static int ses_arglist(FILE *fd, char *cmd, garray_T *gap, int fullname, unsigned *flagp );
133static int ses_fname(FILE *fd, buf_T *buf, unsigned *flagp, _Bool add_eol);
134static int ses_put_fname(FILE *fd, char_u *name, unsigned *flagp);
135static void ex_loadview(exarg_T *eap);
136static char *get_view_file(int c);
137static void ex_shada(exarg_T *eap);
138static void ex_behave(exarg_T *eap);
139static void ex_filetype(exarg_T *eap);
140static void ex_setfiletype(exarg_T *eap);
141static void ex_digraphs(exarg_T *eap);
142static void ex_set(exarg_T *eap);
143static void ex_nohlsearch(exarg_T *eap);
144static void ex_match(exarg_T *eap);
145static void ex_fold(exarg_T *eap);
146static void ex_foldopen(exarg_T *eap);
147static void ex_folddo(exarg_T *eap);
148static void ex_terminal(exarg_T *eap);
149#include "nvim/func_attr.h"
150