xref: /freebsd/usr.bin/vi/extern.h (revision 401ab69cff8fa2320a9f8ea4baa114a6da6c952b)
1 #ifdef CL_IN_EX /* cl.h */
2 int cl_waddstr(SCR *, const CHAR_T *, size_t);
3 int cl_addstr(SCR *, const char *, size_t);
4 int cl_attr(SCR *, scr_attr_t, int);
5 int cl_baud(SCR *, u_long *);
6 int cl_bell(SCR *);
7 int cl_clrtoeol(SCR *);
8 int cl_cursor(SCR *, size_t *, size_t *);
9 int cl_deleteln(SCR *);
10 int cl_discard(SCR *, SCR **);
11 int cl_ex_adjust(SCR *, exadj_t);
12 int cl_insertln(SCR *);
13 int cl_keyval(SCR *, scr_keyval_t, CHAR_T *, int *);
14 int cl_move(SCR *, size_t, size_t);
15 int cl_refresh(SCR *, int);
16 int cl_rename(SCR *, char *, int);
17 void cl_setname(GS *, char *);
18 int cl_split(SCR *, SCR *);
19 int cl_suspend(SCR *, int *);
20 void cl_usage(void);
21 int sig_init(GS *, SCR *);
22 int cl_event(SCR *, EVENT *, u_int32_t, int);
23 int cl_screen(SCR *, u_int32_t);
24 int cl_quit(GS *);
25 int cl_getcap(SCR *, char *, char **);
26 int cl_term_init(SCR *);
27 int cl_term_end(GS *);
28 int cl_fmap(SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t);
29 int cl_optchange(SCR *, int, char *, u_long *);
30 int cl_omesg(SCR *, CL_PRIVATE *, int);
31 int cl_ssize(SCR *, int, size_t *, size_t *, int *);
32 int cl_putchar(int);
33 #endif
34 #ifdef EXP /* ex.h */
35 int ex(SCR **);
36 int ex_cmd(SCR *);
37 int ex_range(SCR *, EXCMD *, int *);
38 int ex_is_abbrev(CHAR_T *, size_t);
39 int ex_is_unmap(CHAR_T *, size_t);
40 void ex_badaddr
41   (SCR *, EXCMDLIST const *, enum badaddr, enum nresult);
42 int ex_abbr(SCR *, EXCMD *);
43 int ex_unabbr(SCR *, EXCMD *);
44 int ex_append(SCR *, EXCMD *);
45 int ex_change(SCR *, EXCMD *);
46 int ex_insert(SCR *, EXCMD *);
47 int ex_next(SCR *, EXCMD *);
48 int ex_prev(SCR *, EXCMD *);
49 int ex_rew(SCR *, EXCMD *);
50 int ex_args(SCR *, EXCMD *);
51 char **ex_buildargv(SCR *, EXCMD *, char *);
52 int argv_init(SCR *, EXCMD *);
53 int argv_exp0(SCR *, EXCMD *, CHAR_T *, size_t);
54 int argv_exp1(SCR *, EXCMD *, CHAR_T *, size_t, int);
55 int argv_exp2(SCR *, EXCMD *, CHAR_T *, size_t);
56 int argv_exp3(SCR *, EXCMD *, CHAR_T *, size_t);
57 int argv_flt_ex(SCR *, EXCMD *, CHAR_T *, size_t);
58 int argv_free(SCR *);
59 int argv_flt_path(SCR *, EXCMD *, CHAR_T *, size_t);
60 CHAR_T *argv_esc(SCR *, EXCMD *, CHAR_T *, size_t);
61 CHAR_T *argv_uesc(SCR *, EXCMD *, CHAR_T *, size_t);
62 int ex_at(SCR *, EXCMD *);
63 int ex_bang(SCR *, EXCMD *);
64 int ex_cd(SCR *, EXCMD *);
65 int ex_cscope(SCR *, EXCMD *);
66 int cscope_end(SCR *);
67 int cscope_display(SCR *);
68 int cscope_search(SCR *, TAGQ *, TAG *);
69 int ex_delete(SCR *, EXCMD *);
70 int ex_display(SCR *, EXCMD *);
71 int ex_edit(SCR *, EXCMD *);
72 int ex_equal(SCR *, EXCMD *);
73 int ex_file(SCR *, EXCMD *);
74 int ex_filter(SCR *,
75    EXCMD *, MARK *, MARK *, MARK *, CHAR_T *, enum filtertype);
76 int ex_global(SCR *, EXCMD *);
77 int ex_v(SCR *, EXCMD *);
78 int ex_g_insdel(SCR *, lnop_t, recno_t);
79 int ex_screen_copy(SCR *, SCR *);
80 int ex_screen_end(SCR *);
81 int ex_optchange(SCR *, int, char *, u_long *);
82 int ex_exrc(SCR *);
83 int ex_run_str(SCR *, char *, CHAR_T *, size_t, int, int);
84 int ex_join(SCR *, EXCMD *);
85 int ex_map(SCR *, EXCMD *);
86 int ex_unmap(SCR *, EXCMD *);
87 int ex_mark(SCR *, EXCMD *);
88 int ex_mkexrc(SCR *, EXCMD *);
89 int ex_copy(SCR *, EXCMD *);
90 int ex_move(SCR *, EXCMD *);
91 int ex_open(SCR *, EXCMD *);
92 int ex_preserve(SCR *, EXCMD *);
93 int ex_recover(SCR *, EXCMD *);
94 int ex_list(SCR *, EXCMD *);
95 int ex_number(SCR *, EXCMD *);
96 int ex_pr(SCR *, EXCMD *);
97 int ex_print(SCR *, EXCMD *, MARK *, MARK *, u_int32_t);
98 int ex_ldisplay(SCR *, const CHAR_T *, size_t, size_t, u_int);
99 int ex_scprint(SCR *, MARK *, MARK *);
100 int ex_printf(SCR *, const char *, ...);
101 int ex_puts(SCR *, const char *);
102 int ex_fflush(SCR *sp);
103 int ex_put(SCR *, EXCMD *);
104 int ex_quit(SCR *, EXCMD *);
105 int ex_read(SCR *, EXCMD *);
106 int ex_readfp(SCR *, char *, FILE *, MARK *, recno_t *, int);
107 int ex_bg(SCR *, EXCMD *);
108 int ex_fg(SCR *, EXCMD *);
109 int ex_resize(SCR *, EXCMD *);
110 int ex_sdisplay(SCR *);
111 int ex_script(SCR *, EXCMD *);
112 int sscr_exec(SCR *, recno_t);
113 int sscr_input(SCR *);
114 int sscr_end(SCR *);
115 int ex_set(SCR *, EXCMD *);
116 int ex_shell(SCR *, EXCMD *);
117 int ex_exec_proc(SCR *, EXCMD *, char *, const char *, int);
118 int proc_wait(SCR *, long, const char *, int, int);
119 int ex_shiftl(SCR *, EXCMD *);
120 int ex_shiftr(SCR *, EXCMD *);
121 int ex_retab(SCR *, EXCMD *);
122 int ex_source(SCR *, EXCMD *);
123 int ex_stop(SCR *, EXCMD *);
124 int ex_s(SCR *, EXCMD *);
125 int ex_subagain(SCR *, EXCMD *);
126 int ex_subtilde(SCR *, EXCMD *);
127 int re_compile(SCR *,
128     CHAR_T *, size_t, CHAR_T **, size_t *, regex_t *, u_int);
129 void re_error(SCR *, int, regex_t *);
130 int ex_tag_first(SCR *, CHAR_T *);
131 int ex_tag_push(SCR *, EXCMD *);
132 int ex_tag_next(SCR *, EXCMD *);
133 int ex_tag_prev(SCR *, EXCMD *);
134 int ex_tag_nswitch(SCR *, TAG *, int);
135 int ex_tag_Nswitch(SCR *, TAG *, int);
136 int ex_tag_pop(SCR *, EXCMD *);
137 int ex_tag_top(SCR *, EXCMD *);
138 int ex_tag_display(SCR *);
139 int ex_tag_copy(SCR *, SCR *);
140 int tagq_free(SCR *, TAGQ *);
141 int tagq_push(SCR*, TAGQ*, int, int );
142 void tag_msg(SCR *, tagmsg_t, char *);
143 int ex_tagf_alloc(SCR *, char *);
144 int ex_tag_free(SCR *);
145 int ex_txt(SCR *, TEXTH *, ARG_CHAR_T, u_int32_t);
146 int ex_undo(SCR *, EXCMD *);
147 int ex_help(SCR *, EXCMD *);
148 int ex_usage(SCR *, EXCMD *);
149 int ex_viusage(SCR *, EXCMD *);
150 void ex_cinit(SCR *, EXCMD *, int, int, recno_t, recno_t, int);
151 int ex_getline(SCR *, FILE *, size_t *);
152 int ex_ncheck(SCR *, int);
153 int ex_init(SCR *);
154 void ex_wemsg(SCR *, CHAR_T *, exm_t);
155 void ex_emsg(SCR *, char *, exm_t);
156 int ex_version(SCR *, EXCMD *);
157 int ex_visual(SCR *, EXCMD *);
158 int ex_wn(SCR *, EXCMD *);
159 int ex_wq(SCR *, EXCMD *);
160 int ex_write(SCR *, EXCMD *);
161 int ex_xit(SCR *, EXCMD *);
162 int ex_writefp(SCR *,
163    char *, FILE *, MARK *, MARK *, u_long *, u_long *, int);
164 int ex_yank(SCR *, EXCMD *);
165 int ex_z(SCR *, EXCMD *);
166 #endif
167 #ifdef V_ABS /* vi.h */
168 int cs_init(SCR *, VCS *);
169 int cs_next(SCR *, VCS *);
170 int cs_fspace(SCR *, VCS *);
171 int cs_fblank(SCR *, VCS *);
172 int cs_prev(SCR *, VCS *);
173 int cs_bblank(SCR *, VCS *);
174 int v_at(SCR *, VICMD *);
175 int v_chrepeat(SCR *, VICMD *);
176 int v_chrrepeat(SCR *, VICMD *);
177 int v_cht(SCR *, VICMD *);
178 int v_chf(SCR *, VICMD *);
179 int v_chT(SCR *, VICMD *);
180 int v_chF(SCR *, VICMD *);
181 int v_delete(SCR *, VICMD *);
182 int v_again(SCR *, VICMD *);
183 int v_exmode(SCR *, VICMD *);
184 int v_join(SCR *, VICMD *);
185 int v_shiftl(SCR *, VICMD *);
186 int v_shiftr(SCR *, VICMD *);
187 int v_suspend(SCR *, VICMD *);
188 int v_switch(SCR *, VICMD *);
189 int v_tagpush(SCR *, VICMD *);
190 int v_tagpop(SCR *, VICMD *);
191 int v_filter(SCR *, VICMD *);
192 int v_ex(SCR *, VICMD *);
193 int v_ecl_exec(SCR *);
194 int v_increment(SCR *, VICMD *);
195 int v_screen_copy(SCR *, SCR *);
196 int v_screen_end(SCR *);
197 int v_optchange(SCR *, int, char *, u_long *);
198 int v_iA(SCR *, VICMD *);
199 int v_ia(SCR *, VICMD *);
200 int v_iI(SCR *, VICMD *);
201 int v_ii(SCR *, VICMD *);
202 int v_iO(SCR *, VICMD *);
203 int v_io(SCR *, VICMD *);
204 int v_change(SCR *, VICMD *);
205 int v_Replace(SCR *, VICMD *);
206 int v_subst(SCR *, VICMD *);
207 int v_left(SCR *, VICMD *);
208 int v_cfirst(SCR *, VICMD *);
209 int v_first(SCR *, VICMD *);
210 int v_ncol(SCR *, VICMD *);
211 int v_zero(SCR *, VICMD *);
212 int v_mark(SCR *, VICMD *);
213 int v_bmark(SCR *, VICMD *);
214 int v_fmark(SCR *, VICMD *);
215 int v_emark(SCR *, VICMD *);
216 int v_match(SCR *, VICMD *);
217 int v_buildmcs(SCR *, char *);
218 int v_paragraphf(SCR *, VICMD *);
219 int v_paragraphb(SCR *, VICMD *);
220 int v_buildps(SCR *, char *, char *);
221 int v_Put(SCR *, VICMD *);
222 int v_put(SCR *, VICMD *);
223 int v_redraw(SCR *, VICMD *);
224 int v_replace(SCR *, VICMD *);
225 int v_right(SCR *, VICMD *);
226 int v_dollar(SCR *, VICMD *);
227 int v_screen(SCR *, VICMD *);
228 int v_lgoto(SCR *, VICMD *);
229 int v_home(SCR *, VICMD *);
230 int v_middle(SCR *, VICMD *);
231 int v_bottom(SCR *, VICMD *);
232 int v_up(SCR *, VICMD *);
233 int v_cr(SCR *, VICMD *);
234 int v_down(SCR *, VICMD *);
235 int v_hpageup(SCR *, VICMD *);
236 int v_hpagedown(SCR *, VICMD *);
237 int v_pagedown(SCR *, VICMD *);
238 int v_pageup(SCR *, VICMD *);
239 int v_lineup(SCR *, VICMD *);
240 int v_linedown(SCR *, VICMD *);
241 int v_searchb(SCR *, VICMD *);
242 int v_searchf(SCR *, VICMD *);
243 int v_searchN(SCR *, VICMD *);
244 int v_searchn(SCR *, VICMD *);
245 int v_searchw(SCR *, VICMD *);
246 int v_correct(SCR *, VICMD *, int);
247 int v_sectionf(SCR *, VICMD *);
248 int v_sectionb(SCR *, VICMD *);
249 int v_sentencef(SCR *, VICMD *);
250 int v_sentenceb(SCR *, VICMD *);
251 int v_status(SCR *, VICMD *);
252 int v_tcmd(SCR *, VICMD *, ARG_CHAR_T, u_int);
253 int v_txt(SCR *, VICMD *, MARK *,
254    const CHAR_T *, size_t, ARG_CHAR_T, recno_t, u_long, u_int32_t);
255 int v_txt_auto(SCR *, recno_t, TEXT *, size_t, TEXT *);
256 int v_ulcase(SCR *, VICMD *);
257 int v_mulcase(SCR *, VICMD *);
258 int v_Undo(SCR *, VICMD *);
259 int v_undo(SCR *, VICMD *);
260 void v_eof(SCR *, MARK *);
261 void v_eol(SCR *, MARK *);
262 void v_nomove(SCR *);
263 void v_sof(SCR *, MARK *);
264 void v_sol(SCR *);
265 int v_isempty(CHAR_T *, size_t);
266 void v_emsg(SCR *, char *, vim_t);
267 int v_wordW(SCR *, VICMD *);
268 int v_wordw(SCR *, VICMD *);
269 int v_wordE(SCR *, VICMD *);
270 int v_worde(SCR *, VICMD *);
271 int v_wordB(SCR *, VICMD *);
272 int v_wordb(SCR *, VICMD *);
273 int v_xchar(SCR *, VICMD *);
274 int v_Xchar(SCR *, VICMD *);
275 int v_yank(SCR *, VICMD *);
276 int v_z(SCR *, VICMD *);
277 int vs_crel(SCR *, long);
278 int v_zexit(SCR *, VICMD *);
279 int vi(SCR **);
280 int v_curword(SCR *);
281 int vs_line(SCR *, SMAP *, size_t *, size_t *);
282 int vs_number(SCR *);
283 void vs_busy(SCR *, const char *, busy_t);
284 void vs_home(SCR *);
285 void vs_update(SCR *, const char *, const CHAR_T *);
286 void vs_msg(SCR *, mtype_t, char *, size_t);
287 int vs_ex_resolve(SCR *, int *);
288 int vs_resolve(SCR *, SCR *, int);
289 int vs_repaint(SCR *, EVENT *);
290 int vs_refresh(SCR *, int);
291 int vs_column(SCR *, size_t *);
292 size_t vs_screens(SCR *, recno_t, size_t *);
293 size_t vs_columns(SCR *, CHAR_T *, recno_t, size_t *, size_t *);
294 size_t vs_rcm(SCR *, recno_t, int);
295 size_t vs_colpos(SCR *, recno_t, size_t);
296 int vs_change(SCR *, recno_t, lnop_t);
297 int vs_sm_fill(SCR *, recno_t, pos_t);
298 int vs_sm_scroll(SCR *, MARK *, recno_t, scroll_t);
299 int vs_sm_1up(SCR *);
300 int vs_sm_1down(SCR *);
301 int vs_sm_next(SCR *, SMAP *, SMAP *);
302 int vs_sm_prev(SCR *, SMAP *, SMAP *);
303 int vs_sm_cursor(SCR *, SMAP **);
304 int vs_sm_position(SCR *, MARK *, u_long, pos_t);
305 recno_t vs_sm_nlines(SCR *, SMAP *, recno_t, size_t);
306 int vs_split(SCR *, SCR *, int);
307 int vs_vsplit(SCR *, SCR *);
308 int vs_discard(SCR *, SCR **);
309 int vs_fg(SCR *, SCR **, CHAR_T *, int);
310 int vs_bg(SCR *);
311 int vs_swap(SCR *, SCR **, char *);
312 int vs_resize(SCR *, long, adj_t);
313 #endif /* common.h */
314 char * codeset(void);
315 void conv_init(SCR *, SCR *);
316 int conv_enc(SCR *, int, char *);
317 void conv_end(SCR *);
318 int cut(SCR *, CHAR_T *, MARK *, MARK *, int);
319 int cut_line(SCR *, recno_t, size_t, size_t, CB *);
320 void cut_close(GS *);
321 TEXT *text_init(SCR *, const CHAR_T *, size_t, size_t);
322 void text_lfree(TEXTH *);
323 void text_free(TEXT *);
324 int del(SCR *, MARK *, MARK *, int);
325 int looks_utf8(const char *, size_t);
326 int looks_utf16(const char *, size_t);
327 int decode_utf8(const char *);
328 int decode_utf16(const char *, int);
329 FREF *file_add(SCR *, char *);
330 int file_init(SCR *, FREF *, char *, int);
331 int file_end(SCR *, EXF *, int);
332 int file_write(SCR *, MARK *, MARK *, char *, int);
333 int file_m1(SCR *, int, int);
334 int file_m2(SCR *, int);
335 int file_m3(SCR *, int);
336 int file_aw(SCR *, int);
337 void set_alt_name(SCR *, char *);
338 lockr_t file_lock(SCR *, char *, int, int);
339 int v_key_init(SCR *);
340 void v_key_ilookup(SCR *);
341 size_t v_key_len(SCR *, ARG_CHAR_T);
342 char *v_key_name(SCR *, ARG_CHAR_T);
343 e_key_t v_key_val(SCR *, ARG_CHAR_T);
344 int v_event_push(SCR *, EVENT *, CHAR_T *, size_t, u_int);
345 int v_event_get(SCR *, EVENT *, int, u_int32_t);
346 void v_event_err(SCR *, EVENT *);
347 int v_event_flush(SCR *, u_int);
348 int db_eget(SCR *, recno_t, CHAR_T **, size_t *, int *);
349 int db_get(SCR *, recno_t, u_int32_t, CHAR_T **, size_t *);
350 int db_delete(SCR *, recno_t);
351 int db_append(SCR *, int, recno_t, CHAR_T *, size_t);
352 int db_insert(SCR *, recno_t, CHAR_T *, size_t);
353 int db_set(SCR *, recno_t, CHAR_T *, size_t);
354 int db_exist(SCR *, recno_t);
355 int db_last(SCR *, recno_t *);
356 int db_rget(SCR *, recno_t, char **, size_t *);
357 int db_rset(SCR *, recno_t, char *, size_t);
358 void db_err(SCR *, recno_t);
359 int log_init(SCR *, EXF *);
360 int log_end(SCR *, EXF *);
361 int log_cursor(SCR *);
362 int log_line(SCR *, recno_t, u_int);
363 int log_mark(SCR *, LMARK *);
364 int log_backward(SCR *, MARK *);
365 int log_setline(SCR *);
366 int log_forward(SCR *, MARK *);
367 int editor(GS *, int, char *[]);
368 void v_end(GS *);
369 int mark_init(SCR *, EXF *);
370 int mark_end(SCR *, EXF *);
371 int mark_get(SCR *, ARG_CHAR_T, MARK *, mtype_t);
372 int mark_set(SCR *, ARG_CHAR_T, MARK *, int);
373 int mark_insdel(SCR *, lnop_t, recno_t);
374 void msgq(SCR *, mtype_t, const char *, ...);
375 void msgq_wstr(SCR *, mtype_t, const CHAR_T *, const char *);
376 void msgq_str(SCR *, mtype_t, const char *, const char *);
377 void mod_rpt(SCR *);
378 void msgq_status(SCR *, recno_t, u_int);
379 int msg_open(SCR *, char *);
380 void msg_close(GS *);
381 const char *msg_cmsg(SCR *, cmsg_t, size_t *);
382 const char *msg_cat(SCR *, const char *, size_t *);
383 char *msg_print(SCR *, const char *, int *);
384 int opts_init(SCR *, int *);
385 int opts_set(SCR *, ARGS *[], char *);
386 int o_set(SCR *, int, u_int, char *, u_long);
387 int opts_empty(SCR *, int, int);
388 void opts_dump(SCR *, enum optdisp);
389 int opts_save(SCR *, FILE *);
390 OPTLIST const *opts_search(CHAR_T *);
391 void opts_nomatch(SCR *, CHAR_T *);
392 int opts_copy(SCR *, SCR *);
393 void opts_free(SCR *);
394 int f_altwerase(SCR *, OPTION *, char *, u_long *);
395 int f_columns(SCR *, OPTION *, char *, u_long *);
396 int f_lines(SCR *, OPTION *, char *, u_long *);
397 int f_lisp(SCR *, OPTION *, char *, u_long *);
398 int f_msgcat(SCR *, OPTION *, char *, u_long *);
399 int f_print(SCR *, OPTION *, char *, u_long *);
400 int f_readonly(SCR *, OPTION *, char *, u_long *);
401 int f_recompile(SCR *, OPTION *, char *, u_long *);
402 int f_reformat(SCR *, OPTION *, char *, u_long *);
403 int f_ttywerase(SCR *, OPTION *, char *, u_long *);
404 int f_w300(SCR *, OPTION *, char *, u_long *);
405 int f_w1200(SCR *, OPTION *, char *, u_long *);
406 int f_w9600(SCR *, OPTION *, char *, u_long *);
407 int f_window(SCR *, OPTION *, char *, u_long *);
408 int f_encoding(SCR *, OPTION *, char *, u_long *);
409 int put(SCR *, CB *, CHAR_T *, MARK *, MARK *, int);
410 int rcv_tmp(SCR *, EXF *, char *);
411 int rcv_init(SCR *);
412 int rcv_sync(SCR *, u_int);
413 int rcv_list(SCR *);
414 int rcv_read(SCR *, FREF *);
415 int screen_init(GS *, SCR *, SCR **);
416 int screen_end(SCR *);
417 SCR *screen_next(SCR *);
418 int f_search(SCR *,
419    MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int);
420 int b_search(SCR *,
421    MARK *, MARK *, CHAR_T *, size_t, CHAR_T **, u_int);
422 void search_busy(SCR *, busy_t);
423 int seq_set(SCR *, CHAR_T *,
424    size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int);
425 int seq_delete(SCR *, CHAR_T *, size_t, seq_t);
426 int seq_free(SEQ *);
427 SEQ *seq_find
428   (SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *);
429 void seq_close(GS *);
430 int seq_dump(SCR *, seq_t, int);
431 int seq_save(SCR *, FILE *, char *, seq_t);
432 int e_memcmp(CHAR_T *, EVENT *, size_t);
433 void *binc(SCR *, void *, size_t *, size_t);
434 int nonblank(SCR *, recno_t, size_t *);
435 char *join(char *, char *);
436 char *expanduser(char *);
437 char *quote(char *);
438 char *v_strdup(SCR *, const char *, size_t);
439 CHAR_T *v_wstrdup(SCR *, const CHAR_T *, size_t);
440 enum nresult nget_uslong(u_long *, const CHAR_T *, CHAR_T **, int);
441 enum nresult nget_slong(long *, const CHAR_T *, CHAR_T **, int);
442 void timepoint_steady(struct timespec *);
443 void timepoint_system(struct timespec *);
444 void TRACE(SCR *, const char *, ...);
445