proto.h 21 KB
Newer Older
Chris Allegretta's avatar
Chris Allegretta committed
1
/**************************************************************************
2
 *   proto.h  --  This file is part of GNU nano.                          *
Chris Allegretta's avatar
Chris Allegretta committed
3
 *                                                                        *
4
 *   Copyright (C) 1999-2011, 2013-2017 Free Software Foundation, Inc.    *
Chris Allegretta's avatar
Chris Allegretta committed
5
 *                                                                        *
6
7
8
9
10
11
12
13
14
 *   GNU nano is free software: you can redistribute it and/or modify     *
 *   it under the terms of the GNU General Public License as published    *
 *   by the Free Software Foundation, either version 3 of the License,    *
 *   or (at your option) any later version.                               *
 *                                                                        *
 *   GNU nano 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
 *                                                                        *
 *   You should have received a copy of the GNU General Public License    *
17
 *   along with this program.  If not, see http://www.gnu.org/licenses/.  *
Chris Allegretta's avatar
Chris Allegretta committed
18
19
20
 *                                                                        *
 **************************************************************************/

21
22
23
#ifndef PROTO_H
#define PROTO_H 1

Chris Allegretta's avatar
Chris Allegretta committed
24
25
#include "nano.h"

26
/* All external variables.  See global.c for their descriptions. */
27

28
#ifndef NANO_TINY
29
extern volatile sig_atomic_t the_window_resized;
30
31
#endif

32
#ifdef __linux__
33
extern bool console;
34
35
#endif

36
extern bool meta_key;
37
38
extern bool shift_held;

39
extern bool focusing;
40

41
42
extern bool as_an_at;

43
44
45
extern int margin;
extern int editwincols;

46
47
48
49
#ifndef DISABLE_COLOR
extern bool have_palette;
#endif

50
extern message_type lastmessage;
51

52
53
extern filestruct *pletion_line;

54
55
56
extern bool inhelp;
extern char *title;

57
58
extern int controlleft;
extern int controlright;
59
60
extern int controlup;
extern int controldown;
61
62
extern int controlhome;
extern int controlend;
63
#ifndef NANO_TINY
64
65
66
67
extern int shiftcontrolleft;
extern int shiftcontrolright;
extern int shiftcontrolup;
extern int shiftcontroldown;
68
69
extern int shiftcontrolhome;
extern int shiftcontrolend;
70
71
72
73
extern int shiftaltleft;
extern int shiftaltright;
extern int shiftaltup;
extern int shiftaltdown;
74
75
#endif

76
#ifndef DISABLE_WRAPJUSTIFY
77
extern ssize_t fill;
78
extern ssize_t wrap_at;
79
#endif
80
81
82

extern char *last_search;

83
84
extern char *present_path;

85
extern unsigned flags[4];
86
87
88
89
90
91
extern WINDOW *topwin;
extern WINDOW *edit;
extern WINDOW *bottomwin;
extern int editwinrows;

extern filestruct *cutbuffer;
92
extern filestruct *cutbottom;
93
94
extern partition *filepart;
extern openfilestruct *openfile;
Chris Allegretta's avatar
Chris Allegretta committed
95

96
97
98
99
#ifndef NANO_TINY
extern char *matchbrackets;
#endif

100
#ifndef NANO_TINY
101
extern char *whitespace;
102
extern int whitespace_len[2];
103
104
#endif

105
106
extern const char *exit_tag;
extern const char *close_tag;
107
extern const char *uncut_tag;
108
#ifndef DISABLE_JUSTIFY
109
extern const char *unjust_tag;
110
111
extern char *punct;
extern char *brackets;
Chris Allegretta's avatar
Chris Allegretta committed
112
extern char *quotestr;
113
114
115
extern regex_t quotereg;
extern int quoterc;
extern char *quoteerr;
116
117
#endif /* !DISABLE_JUSTIFY */

118
119
extern char *word_chars;

120
extern bool nodelay_mode;
121

122
123
124
125
extern char *answer;

extern ssize_t tabsize;

126
#ifndef NANO_TINY
127
extern char *backup_dir;
128
129
extern const char *locking_prefix;
extern const char *locking_suffix;
130
#endif
131
132
#ifndef DISABLE_OPERATINGDIR
extern char *operating_dir;
133
extern char *full_operating_dir;
134
#endif
135

136
#ifndef DISABLE_SPELLER
137
extern char *alt_speller;
Chris Allegretta's avatar
Chris Allegretta committed
138
139
#endif

140
#ifndef DISABLE_COLOR
141
142
extern syntaxtype *syntaxes;
extern char *syntaxstr;
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
143
#endif
144

145
extern bool refresh_needed;
146

147
extern int currmenu;
148
149
150
151
extern sc *sclist;
extern subnfunc *allfuncs;
extern subnfunc *exitfunc;
extern subnfunc *uncutfunc;
152

153
#ifndef DISABLE_HISTORIES
154
155
156
157
158
159
extern filestruct *search_history;
extern filestruct *searchage;
extern filestruct *searchbot;
extern filestruct *replace_history;
extern filestruct *replaceage;
extern filestruct *replacebot;
160
extern poshiststruct *position_history;
161
162
#endif

163
164
165
extern regex_t search_regexp;
extern regmatch_t regmatches[10];

166
extern int hilite_attribute;
167
168
169
#ifndef DISABLE_COLOR
extern char* specified_color_combo[NUMBER_OF_ELEMENTS];
#endif
170
extern int interface_color_pair[NUMBER_OF_ELEMENTS];
171

172
173
extern char *homedir;

174
175
typedef void (*functionptrtype)(void);

176
/* Most functions in browser.c. */
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
177
178
#ifndef DISABLE_BROWSER
char *do_browse_from(const char *inpath);
179
void read_the_list(const char *path, DIR *dir);
180
functionptrtype parse_browser_input(int *kbinput);
181
void browser_refresh(void);
182
void browser_select_dirname(const char *needle);
183
184
185
186
void do_filesearch(void);
void do_fileresearch(void);
void do_first_file(void);
void do_last_file(void);
187
char *strip_last_component(const char *path);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
188
189
#endif

190
/* Most functions in chars.c. */
191
192
193
194
#ifdef ENABLE_UTF8
void utf8_init(void);
bool using_utf8(void);
#endif
195
char *addstrings(char* str1, size_t len1, char* str2, size_t len2);
196
bool is_byte(int c);
197
bool is_alpha_mbchar(const char *c);
198
bool is_blank_mbchar(const char *c);
199
bool is_ascii_cntrl_char(int c);
200
bool is_cntrl_mbchar(const char *c);
201
bool is_word_mbchar(const char *c, bool allow_punct);
202
char control_mbrep(const char *c, bool isdata);
203
int length_of_char(const char *c, int *width);
204
int mbwidth(const char *c);
205
char *make_mbchar(long chr, int *chr_mb_len);
206
int parse_mbchar(const char *buf, char *chr, size_t *col);
207
208
size_t move_mbleft(const char *buf, size_t pos);
size_t move_mbright(const char *buf, size_t pos);
209
210
int mbstrcasecmp(const char *s1, const char *s2);
int mbstrncasecmp(const char *s1, const char *s2, size_t n);
211
char *mbstrcasestr(const char *haystack, const char *needle);
212
char *revstrstr(const char *haystack, const char *needle,
213
214
215
	const char *index);
char *mbrevstrcasestr(const char *haystack, const char *needle,
	const char *index);
216
size_t mbstrlen(const char *s);
217
size_t mbstrnlen(const char *s, size_t maxlen);
218
219
220
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
char *mbstrchr(const char *s, const char *c);
#endif
221
#ifndef NANO_TINY
222
char *mbstrpbrk(const char *s, const char *accept);
223
224
char *revstrpbrk(const char *head, const char *accept, const char *index);
char *mbrevstrpbrk(const char *head, const char *accept, const char *index);
225
#endif
226
#if !defined(DISABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
227
228
bool has_blank_mbchars(const char *s);
#endif
229
230
231
#ifdef ENABLE_UTF8
bool is_valid_unicode(wchar_t wc);
#endif
232
#ifndef DISABLE_NANORC
233
234
bool is_valid_mbstring(const char *s);
#endif
235

236
/* Most functions in color.c. */
237
#ifndef DISABLE_COLOR
238
void set_colorpairs(void);
239
void color_init(void);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
240
void color_update(void);
241
void check_the_multis(filestruct *line);
242
243
void alloc_multidata_if_needed(filestruct *fileptr);
void precalc_multicolorinfo(void);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
244
#endif
245

246
/* Most functions in cut.c. */
247
void cutbuffer_reset(void);
248
bool keeping_cutbuffer(void);
249
#ifndef NANO_TINY
250
void cut_marked(bool *right_side_up);
251
#endif
252
void do_cut_text(bool copy_text, bool cut_till_eof);
253
254
255
void do_cut_text_void(void);
#ifndef NANO_TINY
void do_copy_text(void);
256
void do_cut_till_eof(void);
257
#endif
258
void do_uncut_text(void);
Chris Allegretta's avatar
Chris Allegretta committed
259

260
/* Most functions in files.c. */
261
void initialize_buffer_text(void);
262
bool open_buffer(const char *filename, bool undoable);
263
264
#ifndef DISABLE_SPELLER
void replace_buffer(const char *filename);
265
266
267
268
#ifndef NANO_TINY
void replace_marked_buffer(const char *filename, filestruct *top, size_t top_x,
	filestruct *bot, size_t bot_x);
#endif
269
#endif
270
void prepare_for_display(void);
271
#ifdef ENABLE_MULTIBUFFER
272
273
void switch_to_prev_buffer_void(void);
void switch_to_next_buffer_void(void);
274
bool close_buffer(void);
275
#endif
276
277
void read_file(FILE *f, int fd, const char *filename, bool undoable,
		bool checkwritable);
278
int open_file(const char *filename, bool newfie, bool quiet, FILE **f);
279
char *get_next_filename(const char *name, const char *suffix);
280
void do_insertfile_void(void);
281
char *get_full_path(const char *origpath);
282
char *safe_tempfile(FILE **f);
283
#ifndef DISABLE_OPERATINGDIR
284
void init_operating_dir(void);
285
bool check_operating_dir(const char *currpath, bool allow_tabcomp);
286
#endif
287
#ifndef NANO_TINY
288
void init_backup_dir(void);
289
int delete_lockfile(const char *lockfilename);
290
int write_lockfile(const char *lockfilename, const char *origfilename, bool modified);
291
#endif
292
int copy_file(FILE *inn, FILE *out, bool close_out);
293
294
bool write_file(const char *name, FILE *f_open, bool tmp,
	kind_of_writing_type method, bool nonamechange);
295
#ifndef NANO_TINY
296
bool write_marked_file(const char *name, FILE *f_open, bool tmp,
297
	kind_of_writing_type method);
298
#endif
299
int do_writeout(bool exiting);
300
void do_writeout_void(void);
301
302
303
#ifndef NANO_TINY
void do_savefile(void);
#endif
304
char *real_dir_from_tilde(const char *buf);
305
306
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
int diralphasort(const void *va, const void *vb);
307
void free_chararray(char **array, size_t len);
308
#endif
Chris Allegretta's avatar
Chris Allegretta committed
309
#ifndef DISABLE_TABCOMP
310
char *input_tab(char *buf, bool allow_files, size_t *place,
311
	bool *lastwastab, void (*refresh_func)(void), bool *listed);
Chris Allegretta's avatar
Chris Allegretta committed
312
#endif
313
const char *tail(const char *path);
314
#ifndef DISABLE_HISTORIES
315
316
void load_history(void);
void save_history(void);
317
318
319
int check_dotnano(void);
void load_poshistory(void);
void save_poshistory(void);
320
void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos);
321
bool has_old_position(const char *file, ssize_t *line, ssize_t *column);
322
#endif
323

324
/* Some functions in global.c. */
325
size_t length_of_list(int menu);
326
const sc *first_sc_for(int menu, void (*func)(void));
327
int the_code_for(void (*func)(void), int defaultval);
328
functionptrtype func_from_key(int *kbinput);
329
void assign_keyinfo(sc *s, const char *keystring, const int keycode);
330
void print_sclist(void);
331
void shortcut_init(void);
332
#ifndef DISABLE_COLOR
333
void set_lint_or_format_shortcuts(void);
334
335
void set_spell_shortcuts(void);
#endif
336
const subnfunc *sctofunc(const sc *s);
337
const char *flagtostr(int flag);
338
339
sc *strtosc(const char *input);
int strtomenu(const char *input);
Chris Allegretta's avatar
Chris Allegretta committed
340
341
#ifdef DEBUG
void thanks_for_all_the_fish(void);
342
343
#endif

344
/* All functions in help.c. */
345
#ifdef ENABLE_HELP
346
void wrap_the_help_text(bool redisplaying);
347
void do_help(void);
348
void help_init(void);
349
functionptrtype parse_help_input(int *kbinput);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
350
size_t help_line_len(const char *ptr);
351
#endif
352
void do_help_void(void);
353

354
/* All functions in move.c. */
355
356
357
358
void do_first_line(void);
void do_last_line(void);
void do_page_up(void);
void do_page_down(void);
359
#ifndef DISABLE_JUSTIFY
360
void do_para_begin(bool update_screen);
361
void do_para_begin_void(void);
362
void do_para_end(bool update_screen);
363
364
void do_para_end_void(void);
#endif
365
366
void do_prev_block(void);
void do_next_block(void);
367
void do_prev_word(bool allow_punct, bool update_screen);
368
void do_prev_word_void(void);
369
bool do_next_word(bool allow_punct, bool update_screen);
370
void do_next_word_void(void);
371
void do_home(bool be_clever);
372
void do_home_void(void);
373
void do_end(bool be_clever);
374
void do_end_void(void);
375
void do_up(bool scroll_only);
376
void do_up_void(void);
377
void do_down(bool scroll_only);
378
void do_down_void(void);
379
#ifndef NANO_TINY
380
void do_scroll_up(void);
381
382
void do_scroll_down(void);
#endif
383
384
void do_left(void);
void do_right(void);
Chris Allegretta's avatar
Chris Allegretta committed
385

386
/* Most functions in nano.c. */
387
filestruct *make_new_node(filestruct *prevnode);
388
void splice_node(filestruct *afterthis, filestruct *newnode);
389
void unlink_node(filestruct *fileptr);
390
391
void delete_node(filestruct *fileptr);
filestruct *copy_filestruct(const filestruct *src);
Chris Allegretta's avatar
Chris Allegretta committed
392
void free_filestruct(filestruct *src);
393
void renumber(filestruct *fileptr);
394
395
partition *partition_filestruct(filestruct *top, size_t top_x,
	filestruct *bot, size_t bot_x);
396
void unpartition_filestruct(partition **p);
397
void extract_buffer(filestruct **file_top, filestruct **file_bot,
398
	filestruct *top, size_t top_x, filestruct *bot, size_t bot_x);
399
void ingraft_buffer(filestruct *somebuffer);
400
void copy_from_buffer(filestruct *somebuffer);
401
402
403
openfilestruct *make_new_opennode(void);
void unlink_opennode(openfilestruct *fileptr);
void delete_opennode(openfilestruct *fileptr);
404
void print_view_warning(void);
405
void show_restricted_warning(void);
406
#ifndef ENABLE_HELP
407
408
void say_there_is_no_help(void);
#endif
409
410
void finish(void);
void die(const char *msg, ...);
411
void die_save_file(const char *die_filename, struct stat *die_stat);
412
void window_init(void);
413
void do_exit(void);
414
void close_and_go(void);
415
416
417
RETSIGTYPE handle_hupterm(int signal);
RETSIGTYPE do_suspend(int signal);
RETSIGTYPE do_continue(int signal);
418
#ifndef NANO_TINY
419
RETSIGTYPE handle_sigwinch(int signal);
420
void regenerate_screen(void);
421
void allow_sigwinch(bool allow);
422
void do_toggle(int flag);
423
void do_toggle_void(void);
424
425
426
427
void enable_signals(void);
#endif
void disable_flow_control(void);
void enable_flow_control(void);
428
void terminal_init(void);
429
void unbound_key(int code);
430
int do_input(bool allow_funcs);
431
#ifdef ENABLE_MOUSE
432
int do_mouse(void);
433
#endif
434
void do_output(char *output, size_t output_len, bool allow_cntrls);
435

436
/* Most functions in prompt.c. */
437
#ifdef ENABLE_MOUSE
438
int do_statusbar_mouse(void);
439
#endif
440
void do_statusbar_output(int *the_input, size_t input_len,
441
	bool filtering);
442
443
444
void do_statusbar_home(void);
void do_statusbar_end(void);
void do_statusbar_left(void);
445
void do_statusbar_right(void);
446
447
448
void do_statusbar_backspace(void);
void do_statusbar_delete(void);
void do_statusbar_cut_text(void);
449
#ifndef NANO_TINY
450
void do_statusbar_prev_word(void);
451
void do_statusbar_next_word(void);
452
#endif
453
void do_statusbar_verbatim_input(void);
454
455
size_t statusbar_xplustabs(void);
size_t get_statusbar_page_start(size_t start_col, size_t column);
456
void reinit_statusbar_x(void);
457
void update_the_statusbar(void);
458
int do_prompt(bool allow_tabs, bool allow_files,
459
	int menu, const char *curranswer,
460
#ifndef DISABLE_HISTORIES
461
462
	filestruct **history_list,
#endif
463
	void (*refresh_func)(void), const char *msg, ...);
464
int do_yesno_prompt(bool all, const char *msg);
465

466
/* Most functions in rcfile.c. */
467
#ifndef DISABLE_NANORC
468
#ifndef DISABLE_COLOR
469
bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright);
470
void grab_and_store(const char *kind, char *ptr, regexlisttype **storage);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
471
#endif
472
void parse_rcfile(FILE *rcstream, bool syntax_only);
473
void do_rcfiles(void);
474
#endif /* !DISABLE_NANORC */
475

476
/* Most functions in search.c. */
477
void not_found_msg(const char *str);
478
void search_replace_abort(void);
479
480
int findnextstr(const char *needle, bool whole_word_only, bool have_region,
	size_t *match_len, bool skipone, const filestruct *begin, size_t begin_x);
481
void do_search(void);
482
483
484
485
#ifndef NANO_TINY
void do_findprevious(void);
void do_findnext(void);
#endif
486
void do_research(void);
487
void go_looking(void);
488
489
ssize_t do_replace_loop(const char *needle, bool whole_word_only,
	const filestruct *real_current, size_t *real_current_x);
490
void do_replace(void);
491
void goto_line_posx(ssize_t line, size_t pos_x);
492
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
493
	bool interactive);
494
void do_gotolinecolumn_void(void);
495
#ifndef NANO_TINY
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
496
void do_find_bracket(void);
497
#ifndef DISABLE_TABCOMP
498
char *get_history_completion(filestruct **h, char *s, size_t len);
499
#endif
500
#endif
501
502
#ifndef DISABLE_HISTORIES
bool history_has_changed(void);
503
void history_init(void);
504
void history_reset(const filestruct *h);
505
void update_history(filestruct **h, const char *s);
506
507
char *get_history_older(filestruct **h);
char *get_history_newer(filestruct **h);
508
509
void get_history_older_void(void);
void get_history_newer_void(void);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
510
#endif
Chris Allegretta's avatar
Chris Allegretta committed
511

512
/* Most functions in text.c. */
513
#ifndef NANO_TINY
514
515
516
517
void do_mark(void);
#endif
void do_delete(void);
void do_backspace(void);
518
519
520
521
#ifndef NANO_TINY
void do_cut_prev_word(void);
void do_cut_next_word(void);
#endif
522
void do_tab(void);
523
#ifndef NANO_TINY
524
525
526
void do_indent(ssize_t cols);
void do_indent_void(void);
void do_unindent(void);
527
#endif
528
529
bool white_string(const char *s);
#ifdef ENABLE_COMMENT
530
void do_comment(void);
531
bool comment_line(undo_type action, filestruct *f, const char *comment_seq);
532
#endif
533
534
void do_undo(void);
void do_redo(void);
535
void do_enter(void);
536
#ifndef NANO_TINY
537
RETSIGTYPE cancel_command(int signal);
538
bool execute_command(const char *command);
539
540
541
542
void discard_until(const undo *thisitem, openfilestruct *thefile);
void add_undo(undo_type action);
#ifndef DISABLE_COMMENT
void update_comment_undo(ssize_t lineno);
543
#endif
544
545
void update_undo(undo_type action);
#endif /* !NANO_TINY */
546
547
#ifndef DISABLE_WRAPPING
void wrap_reset(void);
548
bool do_wrap(filestruct *line);
549
#endif
550
#if defined(ENABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY)
551
ssize_t break_line(const char *line, ssize_t goal, bool snap_at_nl);
552
#endif
553
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
554
555
556
557
558
559
560
561
562
size_t indent_length(const char *line);
#endif
#ifndef DISABLE_JUSTIFY
void justify_format(filestruct *paragraph, size_t skip);
bool begpar(const filestruct *const foo);
bool inpar(const filestruct *const foo);
void do_justify(bool full_justify);
void do_justify_void(void);
void do_full_justify(void);
David Lawrence Ramsey's avatar
David Lawrence Ramsey committed
563
#endif
564
565
566
#ifndef DISABLE_SPELLER
void do_spell(void);
#endif
567
568
#ifndef DISABLE_COLOR
void do_linter(void);
569
void do_formatter(void);
570
#endif
571
#ifndef NANO_TINY
572
void do_wordlinechar_count(void);
573
#endif
574
void do_verbatim_input(void);
575
void complete_a_word(void);
576

577
/* All functions in utils.c. */
578
void get_homedir(void);
579
580
581
#ifdef ENABLE_LINENUMBERS
int digits(ssize_t n);
#endif
582
bool parse_num(const char *str, ssize_t *val);
583
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
584
void snuggly_fit(char **str);
Chris Allegretta's avatar
Chris Allegretta committed
585
586
587
void null_at(char **data, size_t index);
void unsunder(char *str, size_t true_len);
void sunder(char *str);
588
const char *fixbounds(const char *r);
589
#ifndef DISABLE_SPELLER
590
bool is_separate_word(size_t position, size_t length, const char *buf);
591
#endif
592
const char *strstrwrapper(const char *haystack, const char *needle,
593
	const char *start);
Chris Allegretta's avatar
Chris Allegretta committed
594
595
596
void nperror(const char *s);
void *nmalloc(size_t howmuch);
void *nrealloc(void *ptr, size_t howmuch);
597
char *mallocstrncpy(char *dest, const char *src, size_t n);
598
char *mallocstrcpy(char *dest, const char *src);
599
char *free_and_assign(char *dest, char *src);
600
size_t get_page_start(size_t column);
601
602
603
604
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
605
void new_magicline(void);
606
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
607
void remove_magicline(void);
608
609
#endif
#ifndef NANO_TINY
610
void mark_order(const filestruct **top, size_t *top_x, const filestruct
611
	**bot, size_t *bot_x, bool *right_side_up);
612
#endif
613
size_t get_totsize(const filestruct *begin, const filestruct *end);
614
#ifndef NANO_TINY
615
filestruct *fsfromline(ssize_t lineno);
616
#endif
617
618
619
620
#ifdef DEBUG
void dump_filestruct(const filestruct *inptr);
void dump_filestruct_reverse(void);
#endif
Chris Allegretta's avatar
Chris Allegretta committed
621

622
/* Most functions in winio.c. */
623
624
void get_key_buffer(WINDOW *win);
size_t get_key_buffer_len(void);
625
void unget_kbinput(int kbinput, bool metakey);
626
627
int get_kbinput(WINDOW *win);
int parse_kbinput(WINDOW *win);
628
629
int arrow_from_abcd(int kbinput);
int parse_escape_sequence(WINDOW *win, int kbinput);
630
int get_byte_kbinput(int kbinput);
631
632
int get_control_kbinput(int kbinput);
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
633
int *parse_verbatim_kbinput(WINDOW *win, size_t *count);
634
#ifdef ENABLE_MOUSE
635
int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
636
#endif
637
const sc *get_shortcut(int *kbinput);
638
void blank_row(WINDOW *win, int y, int x, int n);
639
640
void blank_edit(void);
void blank_statusbar(void);
641
void blank_bottombars(void);
642
void check_statusblank(void);
643
char *display_string(const char *buf, size_t column, size_t span, bool isdata);
644
void titlebar(const char *path);
645
extern void set_modified(void);
646
void statusbar(const char *msg);
647
void warn_and_shortly_pause(const char *msg);
648
void statusline(message_type importance, const char *msg, ...);
649
void bottombars(int menu);
650
void onekey(const char *keystroke, const char *desc, int length);
651
void place_the_cursor(void);
652
653
void edit_draw(filestruct *fileptr, const char *converted,
	int line, size_t from_col);
654
int update_line(filestruct *fileptr, size_t index);
655
656
657
#ifndef NANO_TINY
int update_softwrapped_line(filestruct *fileptr);
#endif
658
bool line_needs_update(const size_t old_column, const size_t new_column);
659
660
int go_back_chunks(int nrows, filestruct **line, size_t *leftedge);
int go_forward_chunks(int nrows, filestruct **line, size_t *leftedge);
661
bool less_than_a_screenful(size_t was_lineno, size_t was_leftedge);
662
void edit_scroll(scroll_dir direction, int nrows);
663
void ensure_firstcolumn_is_aligned(void);
664
void edit_redraw(filestruct *old_current);
Chris Allegretta's avatar
Chris Allegretta committed
665
void edit_refresh(void);
666
void adjust_viewport(update_type location);
667
void total_redraw(void);
668
void total_refresh(void);
669
void display_main_list(void);
670
void do_cursorpos(bool force);
671
void do_cursorpos_void(void);
672
void spotlight(bool active, const char *word);
673
674
void xon_complaint(void);
void xoff_complaint(void);
675
void do_suspend_void(void);
676
677
void enable_nodelay(void);
void disable_nodelay(void);
678
#ifndef DISABLE_EXTRA
Chris Allegretta's avatar
Chris Allegretta committed
679
void do_credits(void);
680
#endif
681

682
/* May as well throw these here, since they are just placeholders. */
683
684
685
686
687
688
689
690
691
692
void do_cancel(void);
void case_sens_void(void);
void regexp_void(void);
void gototext_void(void);
void to_files_void(void);
void dos_format_void(void);
void mac_format_void(void);
void append_void(void);
void prepend_void(void);
void backup_file_void(void);
693
void discard_buffer(void);
694
695
696
void new_buffer_void(void);
void backwards_void(void);
void goto_dir_void(void);
697
void flip_replace_void(void);
698
void flip_execute_void(void);
699

700
#endif /* !PROTO_H */