proto.h 21.1 KB
Newer Older
Chris Allegretta's avatar
Chris Allegretta committed
1
/* $Id$ */
Chris Allegretta's avatar
Chris Allegretta committed
2
3
4
/**************************************************************************
 *   proto.h                                                              *
 *                                                                        *
5
 *   Copyright (C) 1999-2005 Chris Allegretta                             *
Chris Allegretta's avatar
Chris Allegretta committed
6
7
 *   This program is free software; you can redistribute it and/or modify *
 *   it under the terms of the GNU General Public License as published by *
8
 *   the Free Software Foundation; either version 2, or (at your option)  *
Chris Allegretta's avatar
Chris Allegretta committed
9
10
 *   any later version.                                                   *
 *                                                                        *
11
12
13
14
 *   This program is distributed in the hope that it will be useful, but  *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of           *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU    *
 *   General Public License for more details.                             *
Chris Allegretta's avatar
Chris Allegretta committed
15
16
17
 *                                                                        *
 *   You should have received a copy of the GNU General Public License    *
 *   along with this program; if not, write to the Free Software          *
18
19
 *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA            *
 *   02110-1301, USA.                                                     *
Chris Allegretta's avatar
Chris Allegretta committed
20
21
22
 *                                                                        *
 **************************************************************************/

23
24
25
#ifndef PROTO_H
#define PROTO_H 1

26
/* Externs. */
Chris Allegretta's avatar
Chris Allegretta committed
27
28
#include "nano.h"

29
#ifndef DISABLE_WRAPJUSTIFY
30
extern ssize_t fill;
31
extern ssize_t wrap_at;
32
#endif
33
extern int editwinrows;
34
extern long flags;
35
extern ssize_t tabsize;
36
extern int currslen;
Chris Allegretta's avatar
Chris Allegretta committed
37

38
39
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
extern char *whitespace;
40
extern int whitespace_len[2];
41
42
#endif

43
#ifndef DISABLE_JUSTIFY
44
45
extern char *punct;
extern char *brackets;
Chris Allegretta's avatar
Chris Allegretta committed
46
extern char *quotestr;
47
48
49
50
51
52
53
#ifdef HAVE_REGEX_H
extern regex_t quotereg;
extern int quoterc;
extern char *quoteerr;
#else
extern size_t quotelen;
#endif
54
55
#endif

56
57
58
59
#ifndef NANO_SMALL
extern char *backup_dir;
#endif

60
extern WINDOW *topwin, *edit, *bottomwin;
61
extern char *answer;
Chris Allegretta's avatar
Chris Allegretta committed
62
63
64
#ifndef DISABLE_HELP
extern char *help_text;
#endif
Chris Allegretta's avatar
Chris Allegretta committed
65
66
extern char *last_search;
extern char *last_replace;
67
68
#ifndef DISABLE_OPERATINGDIR
extern char *operating_dir;
69
extern char *full_operating_dir;
70
#endif
71
#ifndef DISABLE_SPELLER
72
extern char *alt_speller;
Chris Allegretta's avatar
Chris Allegretta committed
73
74
#endif

Chris Allegretta's avatar
Chris Allegretta committed
75
extern struct stat fileinfo;
76
extern filestruct *cutbuffer;
77
78
79
#ifndef DISABLE_JUSTIFY
extern filestruct *jusbuffer;
#endif
80
extern partition *filepart;
81

82
extern openfilestruct *openfile;
83

84
#ifdef ENABLE_COLOR
85
extern syntaxtype *syntaxes;
86
extern char *syntaxstr;
87
88
#endif

Chris Allegretta's avatar
Chris Allegretta committed
89
extern shortcut *shortcut_list;
90
extern shortcut *main_list, *whereis_list;
91
extern shortcut *replace_list, *gotoline_list;
92
extern shortcut *writefile_list, *insertfile_list;
93
extern shortcut *replace_list_2;
Chris Allegretta's avatar
Chris Allegretta committed
94
95
96
#ifndef NANO_SMALL
extern shortcut *extcmd_list;
#endif
97
#ifndef DISABLE_HELP
98
extern shortcut *help_list;
99
100
101
102
#endif
#ifndef DISABLE_SPELLER
extern shortcut *spell_list;
#endif
103
#ifndef DISABLE_BROWSER
104
extern shortcut *browser_list, *gotodir_list;
Chris Allegretta's avatar
Chris Allegretta committed
105
#endif
106

Chris Allegretta's avatar
Chris Allegretta committed
107
extern const shortcut *currshortcut;
108
109

#ifdef HAVE_REGEX_H
110
extern regex_t search_regexp;
111
extern regmatch_t regmatches[10];
112
#ifdef ENABLE_COLOR
113
extern regex_t syntaxfile_regexp;
114
extern regmatch_t synfilematches[1];
Chris Allegretta's avatar
Chris Allegretta committed
115
#endif /* ENABLE_COLOR */
Chris Allegretta's avatar
Chris Allegretta committed
116
#endif /* HAVE_REGEX_H */
117

Chris Allegretta's avatar
Chris Allegretta committed
118
#ifndef NANO_SMALL
119
extern toggle *toggles;
120
#endif
121

122
#ifndef NANO_SMALL
123
124
125
126
127
128
extern filestruct *search_history;
extern filestruct *searchage;
extern filestruct *searchbot;
extern filestruct *replace_history;
extern filestruct *replaceage;
extern filestruct *replacebot;
129
130
#endif

131
extern bool curses_ended;
132

133
134
extern char *homedir;

David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
135
/* The functions we want available. */
136

137
/* Public functions in chars.c. */
138
#ifndef HAVE_ISBLANK
139
bool nisblank(int c);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
140
#endif
141
#if !defined(HAVE_ISWBLANK) && defined(ENABLE_UTF8)
142
bool niswblank(wchar_t wc);
143
#endif
144
bool is_byte(int c);
145
bool is_alnum_mbchar(const char *c);
146
bool is_blank_mbchar(const char *c);
147
bool is_cntrl_char(int c);
148
#ifdef ENABLE_UTF8
149
bool is_cntrl_wchar(wchar_t wc);
150
#endif
151
bool is_cntrl_mbchar(const char *c);
152
bool is_punct_mbchar(const char *c);
153
bool is_word_mbchar(const char *c, bool allow_punct);
154
char control_rep(char c);
155
#ifdef ENABLE_UTF8
156
157
wchar_t control_wrep(wchar_t c);
#endif
158
char *control_mbrep(const char *c, char *crep, int *crep_len);
159
char *mbrep(const char *c, char *crep, int *crep_len);
160
161
int mbwidth(const char *c);
int mb_cur_max(void);
162
char *make_mbchar(long chr, int *chr_mb_len);
163
int parse_mbchar(const char *buf, char *chr, size_t *col);
164
165
size_t move_mbleft(const char *buf, size_t pos);
size_t move_mbright(const char *buf, size_t pos);
166
167
168
169
170
171
172
173
174
175
176
#ifndef HAVE_STRCASECMP
int nstrcasecmp(const char *s1, const char *s2);
#endif
int mbstrcasecmp(const char *s1, const char *s2);
#ifndef HAVE_STRNCASECMP
int nstrncasecmp(const char *s1, const char *s2, size_t n);
#endif
int mbstrncasecmp(const char *s1, const char *s2, size_t n);
#ifndef HAVE_STRCASESTR
const char *nstrcasestr(const char *haystack, const char *needle);
#endif
177
const char *mbstrcasestr(const char *haystack, const char *needle);
178
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
179
180
const char *revstrstr(const char *haystack, const char *needle, const
	char *rev_start);
181
#endif
182
#ifndef NANO_SMALL
183
184
const char *revstrcasestr(const char *haystack, const char *needle,
	const char *rev_start);
185
186
const char *mbrevstrcasestr(const char *haystack, const char *needle,
	const char *rev_start);
187
#endif
188
size_t mbstrlen(const char *s);
189
190
191
192
#ifndef HAVE_STRNLEN
size_t nstrnlen(const char *s, size_t maxlen);
#endif
size_t mbstrnlen(const char *s, size_t maxlen);
193
#ifndef DISABLE_JUSTIFY
194
char *mbstrchr(const char *s, char *c);
195
196
197
198
#ifdef ENABLE_NANORC
bool has_blank_chars(const char *s);
bool has_blank_mbchars(const char *s);
#endif
199
#endif
200
201
202
#ifdef ENABLE_UTF8
bool is_valid_unicode(wchar_t wc);
#endif
203
204
205
#ifdef ENABLE_NANORC
bool is_valid_mbstring(const char *s);
#endif
206

207
/* Public functions in color.c. */
Chris Allegretta's avatar
Chris Allegretta committed
208
#ifdef ENABLE_COLOR
209
void set_colorpairs(void);
210
void color_init(void);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
211
void color_update(void);
Chris Allegretta's avatar
Chris Allegretta committed
212
#endif /* ENABLE_COLOR */
213

214
/* Public functions in cut.c. */
215
void cutbuffer_reset(void);
216
void cut_line(void);
217
#ifndef NANO_SMALL
218
219
void cut_marked(void);
void cut_to_eol(void);
220
#endif
221
void do_cut_text(void);
222
223
224
#ifndef NANO_SMALL
void do_cut_till_end(void);
#endif
225
void do_uncut_text(void);
Chris Allegretta's avatar
Chris Allegretta committed
226

227
/* Public functions in files.c. */
228
void make_new_buffer(void);
229
void initialize_buffer(void);
230
void initialize_buffer_text(void);
231
void open_buffer(const char *filename);
232
void display_buffer(void);
233
234
235
236
237
#ifdef ENABLE_MULTIBUFFER
void switch_to_prevnext_buffer(bool next);
void switch_to_prev_buffer_void(void);
void switch_to_next_buffer_void(void);
bool close_buffer(void);
238
#endif
239
filestruct *read_line(char *buf, filestruct *prevnode, bool
240
	*first_line_ins, size_t buf_len);
241
242
void read_file(FILE *f, const char *filename);
int open_file(const char *filename, bool newfie, FILE **f);
243
char *get_next_filename(const char *name, const char *suffix);
244
245
246
247
248
249
250
void do_insertfile(
#ifndef NANO_SMALL
	bool execute
#else
	void
#endif
	);
251
void do_insertfile_void(void);
252
253
char *get_full_path(const char *origpath);
char *check_writable_directory(const char *path);
254
char *safe_tempfile(FILE **f);
255
#ifndef DISABLE_OPERATINGDIR
256
void init_operating_dir(void);
257
bool check_operating_dir(const char *currpath, bool allow_tabcomp);
258
#endif
259
260
261
#ifndef NANO_SMALL
void init_backup_dir(void);
#endif
262
int copy_file(FILE *inn, FILE *out);
263
264
int write_file(const char *name, FILE *f_open, bool tmp, append_type
	append, bool nonamechange);
265
#ifndef NANO_SMALL
266
267
int write_marked_file(const char *name, FILE *f_open, bool tmp,
	append_type append);
268
#endif
269
int do_writeout(bool exiting);
270
void do_writeout_void(void);
271
char *real_dir_from_tilde(const char *buf);
272
273
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
int diralphasort(const void *va, const void *vb);
274
void free_chararray(char **array, size_t len);
275
#endif
Chris Allegretta's avatar
Chris Allegretta committed
276
#ifndef DISABLE_TABCOMP
277
278
279
280
281
char **username_tab_completion(const char *buf, size_t *num_matches,
	size_t buflen);
char **cwd_tab_completion(const char *buf, size_t *num_matches, size_t
	buflen);
char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list);
Chris Allegretta's avatar
Chris Allegretta committed
282
#endif
283
const char *tail(const char *foo);
284
#ifndef DISABLE_BROWSER
285
286
287
288
void striponedir(char *path);
char **browser_init(const char *path, int *longest, size_t *numents, DIR
	*dir);
char *do_browser(char *path, DIR *dir);
289
char *do_browse_from(const char *inpath);
Chris Allegretta's avatar
Chris Allegretta committed
290
#endif
291
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
292
char *histfilename(void);
293
void load_history(void);
294
bool writehist(FILE *hist, filestruct *histhead);
295
296
void save_history(void);
#endif
297

298
/* Public functions in global.c. */
299
size_t length_of_list(const shortcut *s);
300
#ifndef NANO_SMALL
301
void toggle_init_one(int val, const char *desc, long flag);
302
303
void toggle_init(void);
#endif
304
305
306
307
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
#ifndef DISABLE_HELP
	const char *help,
#endif
308
	int metaval, int funcval, int miscval, bool view, void
309
	(*func)(void));
310
void shortcut_init(bool unjustify);
311
void free_shortcutage(shortcut **shortcutage);
Chris Allegretta's avatar
Chris Allegretta committed
312
313
#ifdef DEBUG
void thanks_for_all_the_fish(void);
314
315
#endif

316
/* Public functions in move.c. */
317
318
319
320
void do_first_line(void);
void do_last_line(void);
void do_page_up(void);
void do_page_down(void);
321
322
323
324
325
326
#ifndef DISABLE_JUSTIFY
void do_para_begin(bool allow_update);
void do_para_begin_void(void);
void do_para_end(bool allow_update);
void do_para_end_void(void);
#endif
327
328
329
330
331
332
#ifndef NANO_SMALL
bool do_next_word(bool allow_punct, bool allow_update);
void do_next_word_void(void);
bool do_prev_word(bool allow_punct, bool allow_update);
void do_prev_word_void(void);
#endif
333
334
void do_home(void);
void do_end(void);
335
void do_up(void);
336
337
338
#ifndef NANO_SMALL
void do_scroll_up(void);
#endif
339
void do_down(void);
340
341
342
#ifndef NANO_SMALL
void do_scroll_down(void);
#endif
343
344
void do_left(void);
void do_right(void);
Chris Allegretta's avatar
Chris Allegretta committed
345

346
/* Public functions in nano.c. */
347
348
filestruct *make_new_node(filestruct *prevnode);
filestruct *copy_node(const filestruct *src);
349
350
void splice_node(filestruct *begin, filestruct *newnode, filestruct
	*end);
351
352
353
void unlink_node(const filestruct *fileptr);
void delete_node(filestruct *fileptr);
filestruct *copy_filestruct(const filestruct *src);
Chris Allegretta's avatar
Chris Allegretta committed
354
void free_filestruct(filestruct *src);
355
void renumber(filestruct *fileptr);
356
357
partition *partition_filestruct(filestruct *top, size_t top_x,
	filestruct *bot, size_t bot_x);
358
void unpartition_filestruct(partition **p);
359
360
361
void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
	filestruct *top, size_t top_x, filestruct *bot, size_t bot_x);
void copy_from_filestruct(filestruct *file_top, filestruct *file_bot);
362
363
364
365
366
367
368
369
openfilestruct *make_new_opennode(void);
void splice_opennode(openfilestruct *begin, openfilestruct *newnode,
	openfilestruct *end);
void unlink_opennode(openfilestruct *fileptr);
void delete_opennode(openfilestruct *fileptr);
#ifdef DEBUG
void free_openfilestruct(openfilestruct *src);
#endif
370
371
372
373
374
375
376
377
378
379
380
void print_view_warning(void);
void finish(void);
void die(const char *msg, ...);
void die_save_file(const char *die_filename);
void window_init(void);
#ifndef DISABLE_MOUSE
void mouse_init(void);
#endif
#ifndef DISABLE_HELP
void help_init(void);
#endif
381
382
383
384
385
void print1opt_full(const char *shortflag
#ifdef HAVE_GETOPT_LONG
	, const char *longflag
#endif
	, const char *desc);
386
387
void usage(void);
void version(void);
388
int no_more_space(void);
389
int no_help(void);
390
391
392
void nano_disabled_msg(void);
void do_verbatim_input(void);
void do_exit(void);
Chris Allegretta's avatar
Chris Allegretta committed
393
void signal_init(void);
394
395
396
void handle_hupterm(int signal);
void do_suspend(int signal);
void do_cont(int signal);
397
#ifndef NANO_SMALL
Chris Allegretta's avatar
Chris Allegretta committed
398
void handle_sigwinch(int s);
399
void allow_pending_sigwinch(bool allow);
400
#endif
401
402
403
#ifndef NANO_SMALL
void do_toggle(const toggle *which);
#endif
404
void disable_extended_io(void);
405
406
407
408
409
410
void disable_signals(void);
#ifndef NANO_SMALL
void enable_signals(void);
#endif
void disable_flow_control(void);
void enable_flow_control(void);
411
void terminal_init(void);
412
int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
413
	*ran_func, bool *finished, bool allow_funcs);
414
415
416
#ifndef DISABLE_MOUSE
bool do_mouse(void);
#endif
417
void do_output(char *output, size_t output_len, bool allow_cntrls);
418

419
/* Public functions in rcfile.c. */
420
#ifdef ENABLE_NANORC
421
422
423
424
void rcfile_error(const char *msg, ...);
char *parse_next_word(char *ptr);
char *parse_argument(char *ptr);
#ifdef ENABLE_COLOR
425
short color_to_short(const char *colorname, bool *bright);
426
char *parse_next_regex(char *ptr);
427
bool nregcomp(const char *regex, int eflags);
428
void parse_syntax(char *ptr);
429
void parse_colors(char *ptr, bool icase);
430
431
#endif /* ENABLE_COLOR */
void parse_rcfile(FILE *rcstream);
432
void do_rcfile(void);
433
#endif /* ENABLE_NANORC */
434

435
/* Public functions in search.c. */
436
#ifdef HAVE_REGEX_H
437
int regexp_init(const char *regexp);
438
439
440
441
442
void regexp_cleanup(void);
#endif
void not_found_msg(const char *str);
void search_abort(void);
void search_init_globals(void);
443
int search_init(bool replacing, bool use_answer);
444
bool findnextstr(bool can_display_wrap, bool wholeword, bool
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
445
	no_sameline, const filestruct *begin, size_t begin_x, const char
446
	*needle, size_t *needle_len);
447
void findnextstr_wrap_reset(void);
448
void do_search(void);
449
#ifndef NANO_SMALL
450
void do_research(void);
451
#endif
452
453
void replace_abort(void);
#ifdef HAVE_REGEX_H
454
int replace_regexp(char *string, bool create);
455
#endif
456
char *replace_line(const char *needle);
457
458
459
ssize_t do_replace_loop(const char *needle, const filestruct
	*real_current, size_t *real_current_x, bool wholewords, bool
	*canceled);
460
void do_replace(void);
461
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
462
	bool interactive, bool save_pos, bool allow_update);
463
void do_gotolinecolumn_void(void);
464
#ifndef DISABLE_SPELLER
465
466
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
	pos_pww);
Chris Allegretta's avatar
Chris Allegretta committed
467
#endif
468
#ifndef NANO_SMALL
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
469
470
471
#ifdef HAVE_REGEX_H
void do_find_bracket(void);
#endif
472
#ifdef ENABLE_NANORC
473
bool history_has_changed(void);
474
#endif
475
void history_init(void);
476
void history_reset(const filestruct *h);
477
478
filestruct *find_history(const filestruct *h_start, const filestruct
	*h_end, const char *s, size_t len);
479
void update_history(filestruct **h, const char *s);
480
481
char *get_history_older(filestruct **h);
char *get_history_newer(filestruct **h);
482
#ifndef DISABLE_TABCOMP
483
char *get_history_completion(filestruct **h, const char *s, size_t len);
484
#endif
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
485
#endif /* !NANO_SMALL */
Chris Allegretta's avatar
Chris Allegretta committed
486

487
488
/* Public functions in text.c. */
#ifndef NANO_SMALL
489
490
491
492
493
494
495
void do_mark(void);
#endif
void do_delete(void);
void do_backspace(void);
void do_tab(void);
void do_enter(void);
#ifndef NANO_SMALL
496
497
void cancel_command(int signal);
bool execute_command(const char *command);
498
#endif
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
#ifndef DISABLE_WRAPPING
void wrap_reset(void);
bool do_wrap(filestruct *line);
#endif
#if !defined(DISABLE_HELP) || !defined(DISABLE_JUSTIFY) || !defined(DISABLE_WRAPPING)
ssize_t break_line(const char *line, ssize_t goal, bool newline);
#endif
#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
size_t indent_length(const char *line);
#endif
#ifndef DISABLE_JUSTIFY
void justify_format(filestruct *paragraph, size_t skip);
size_t quote_length(const char *line);
bool quotes_match(const char *a_line, size_t a_quote, const char
	*b_line);
bool indents_match(const char *a_line, size_t a_indent, const char
	*b_line, size_t b_indent);
bool begpar(const filestruct *const foo);
bool inpar(const filestruct *const foo);
filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
	quote_len);
bool find_paragraph(size_t *const quote, size_t *const par);
void do_justify(bool full_justify);
void do_justify_void(void);
void do_full_justify(void);
#endif /* !DISABLE_JUSTIFY */
525
526
527
528
529
530
#ifndef DISABLE_SPELLER
bool do_int_spell_fix(const char *word);
const char *do_int_speller(const char *tempfile_name);
const char *do_alt_speller(char *tempfile_name);
void do_spell(void);
#endif
531
#ifndef NANO_SMALL
532
void do_wordlinechar_count(void);
533
534
535
#endif

/* Public functions in utils.c. */
536
int digits(size_t n);
537
void get_homedir(void);
538
bool parse_num(const char *str, ssize_t *val);
539
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
540
void align(char **str);
Chris Allegretta's avatar
Chris Allegretta committed
541
542
543
void null_at(char **data, size_t index);
void unsunder(char *str, size_t true_len);
void sunder(char *str);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
544
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
545
546
547
548
549
550
#ifndef HAVE_GETLINE
ssize_t ngetline(char **lineptr, size_t *n, FILE *stream);
#endif
#ifndef HAVE_GETDELIM
ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream);
#endif
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
551
#endif /* !NANO_SMALL && ENABLE_NANORC */
552
553
554
555
556
557
558
559
#ifdef HAVE_REGEX_H
#ifdef BROKEN_REGEXEC
int safe_regexec(const regex_t *preg, const char *string, size_t nmatch,
	regmatch_t pmatch[], int eflags);
#endif
int regexp_bol_or_eol(const regex_t *preg, const char *string);
#endif
bool is_whole_word(size_t pos, const char *buf, const char *word);
560
const char *strstrwrapper(const char *haystack, const char *needle,
561
	const char *start);
Chris Allegretta's avatar
Chris Allegretta committed
562
563
564
void nperror(const char *s);
void *nmalloc(size_t howmuch);
void *nrealloc(void *ptr, size_t howmuch);
565
char *mallocstrncpy(char *dest, const char *src, size_t n);
566
char *mallocstrcpy(char *dest, const char *src);
567
char *mallocstrassn(char *dest, char *src);
568
569
570
571
size_t xplustabs(void);
size_t actual_x(const char *s, size_t column);
size_t strnlenpt(const char *s, size_t maxlen);
size_t strlenpt(const char *s);
Chris Allegretta's avatar
Chris Allegretta committed
572
void new_magicline(void);
573
#ifndef NANO_SMALL
574
void remove_magicline(void);
575
void mark_order(const filestruct **top, size_t *top_x, const filestruct
576
	**bot, size_t *bot_x, bool *right_side_up);
577
#endif
578
size_t get_totsize(const filestruct *begin, const filestruct *end);
Chris Allegretta's avatar
Chris Allegretta committed
579

580
/* Public functions in winio.c. */
581
582
583
#ifndef NANO_SMALL
void reset_kbinput(void);
#endif
584
585
void get_key_buffer(WINDOW *win);
size_t get_key_buffer_len(void);
586
void unget_input(int *input, size_t input_len);
587
void unget_kbinput(int kbinput, bool meta_key, bool func_key);
588
int *get_input(WINDOW *win, size_t input_len);
589
int get_kbinput(WINDOW *win, bool *meta_key, bool *func_key);
590
int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
591
#ifndef NANO_SMALL
592
	, bool reset
593
594
#endif
	);
595
int get_escape_seq_kbinput(const int *seq, size_t seq_len, bool
596
	*ignore_seq);
597
int get_escape_seq_abcd(int kbinput);
598
599
600
601
602
int get_byte_kbinput(int kbinput
#ifndef NANO_SMALL
	, bool reset
#endif
	);
603
long get_unicode_kbinput(int kbinput
604
#ifndef NANO_SMALL
605
	, bool reset
606
607
#endif
	);
608
int get_control_kbinput(int kbinput);
609
void unparse_kbinput(char *output, size_t output_len);
610
611
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
612
#ifndef DISABLE_MOUSE
613
614
bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
#endif
615
const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
616
	*meta_key, bool *func_key);
617
618
619
#ifndef NANO_SMALL
const toggle *get_toggle(int kbinput, bool meta_key);
#endif
620
int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
621
	bool *ran_func, bool *finished, bool allow_funcs);
622
623
624
#ifndef DISABLE_MOUSE
bool do_statusbar_mouse(void);
#endif
625
626
void do_statusbar_output(char *output, size_t output_len, bool
	*got_enter, bool allow_cntrls);
627
628
629
630
631
632
633
void do_statusbar_home(void);
void do_statusbar_end(void);
void do_statusbar_right(void);
void do_statusbar_left(void);
void do_statusbar_backspace(void);
void do_statusbar_delete(void);
void do_statusbar_cut_text(void);
634
#ifndef NANO_SMALL
635
636
bool do_statusbar_next_word(bool allow_punct);
bool do_statusbar_prev_word(bool allow_punct);
637
#endif
638
void do_statusbar_verbatim_input(bool *got_enter);
639
size_t statusbar_xplustabs(void);
640
size_t get_statusbar_page_start(size_t start_col, size_t column);
641
void blank_line(WINDOW *win, int y, int x, int n);
642
void blank_titlebar(void);
643
void blank_topbar(void);
644
645
void blank_edit(void);
void blank_statusbar(void);
646
void blank_bottombars(void);
647
void check_statusblank(void);
648
649
char *display_string(const char *buf, size_t start_col, size_t len, bool
	dollars);
650
void nanoget_repaint(const char *buf, size_t x);
651
int nanogetstr(bool allow_tabs, const char *curranswer,
652
#ifndef NANO_SMALL
653
	filestruct **history_list,
654
#endif
655
	const shortcut *s
656
#ifndef DISABLE_TABCOMP
657
	, bool *list
658
#endif
659
	);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
660
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
661
#ifndef NANO_SMALL
662
	filestruct **history_list,
663
#endif
664
	const char *msg, ...);
665
void statusq_abort(void);
666
void titlebar(const char *path);
667
668
void set_modified(void);
void statusbar(const char *msg, ...);
669
void bottombars(const shortcut *s);
670
void onekey(const char *keystroke, const char *desc, size_t len);
671
size_t get_page_start(size_t column);
672
void reset_cursor(void);
673
674
void edit_draw(const filestruct *fileptr, const char *converted, int
	line, size_t start);
675
void update_line(const filestruct *fileptr, size_t index);
676
677
bool need_horizontal_update(size_t old_pww);
bool need_vertical_update(size_t old_pww);
678
void edit_scroll(scroll_dir direction, ssize_t nlines);
679
void edit_redraw(const filestruct *old_current, size_t old_pww);
Chris Allegretta's avatar
Chris Allegretta committed
680
void edit_refresh(void);
681
void edit_update(update_type location);
682
int do_yesno(bool all, const char *msg);
683
void total_redraw(void);
684
void total_refresh(void);
685
void display_main_list(void);
686
void do_cursorpos(bool constant);
687
void do_cursorpos_void(void);
688
#ifndef DISABLE_HELP
689
size_t help_line_len(const char *ptr);
690
void do_help(void);
691
#endif
692
void do_replace_highlight(bool highlight, const char *word);
693
694
695
#ifndef NDEBUG
int check_linenumbers(const filestruct *fileptr);
#endif
Chris Allegretta's avatar
Chris Allegretta committed
696
#ifdef DEBUG
697
698
void dump_filestruct(const filestruct *inptr);
void dump_filestruct_reverse(void);
699
#endif
Chris Allegretta's avatar
Chris Allegretta committed
700
701
#ifdef NANO_EXTRA
void do_credits(void);
702
#endif
703
704

#endif /* !PROTO_H */