2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
2020-06-20 10:09:31 +00:00
|
|
|
* prototypes.h -- This file is part of GNU nano. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
2020-01-15 10:42:38 +00:00
|
|
|
* Copyright (C) 1999-2011, 2013-2020 Free Software Foundation, Inc. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
2016-08-29 15:10:49 +00:00
|
|
|
* 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. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
2016-08-29 15:10:49 +00:00
|
|
|
* along with this program. If not, see http://www.gnu.org/licenses/. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
2020-06-20 10:09:31 +00:00
|
|
|
#include "definitions.h"
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All external variables. See global.c for their descriptions. */
|
2017-04-22 16:27:01 +00:00
|
|
|
|
2006-05-10 13:41:53 +00:00
|
|
|
#ifndef NANO_TINY
|
2016-12-14 19:37:03 +00:00
|
|
|
extern volatile sig_atomic_t the_window_resized;
|
2006-05-10 13:41:53 +00:00
|
|
|
#endif
|
|
|
|
|
2018-02-01 20:50:13 +00:00
|
|
|
extern bool on_a_vt;
|
2020-01-21 11:31:34 +00:00
|
|
|
extern bool shifted_metas;
|
2016-08-11 10:37:11 +00:00
|
|
|
|
2014-06-30 18:04:33 +00:00
|
|
|
extern bool meta_key;
|
2016-04-24 09:28:28 +00:00
|
|
|
extern bool shift_held;
|
2020-01-23 11:32:28 +00:00
|
|
|
extern bool mute_modifiers;
|
2020-01-03 23:52:21 +00:00
|
|
|
extern bool bracketed_paste;
|
2016-04-24 09:28:28 +00:00
|
|
|
|
2020-02-02 16:05:06 +00:00
|
|
|
extern bool we_are_running;
|
|
|
|
extern bool more_than_one;
|
|
|
|
|
2020-05-22 09:46:30 +00:00
|
|
|
extern bool ran_a_tool;
|
|
|
|
|
2020-02-02 16:05:06 +00:00
|
|
|
extern bool inhelp;
|
|
|
|
extern char *title;
|
|
|
|
|
2015-03-28 17:01:46 +00:00
|
|
|
extern bool focusing;
|
2016-05-19 18:43:08 +00:00
|
|
|
|
2016-12-20 18:27:41 +00:00
|
|
|
extern bool as_an_at;
|
|
|
|
|
2019-05-26 11:10:47 +00:00
|
|
|
extern bool control_C_was_pressed;
|
|
|
|
|
2016-05-19 18:43:08 +00:00
|
|
|
extern message_type lastmessage;
|
2014-06-30 18:04:33 +00:00
|
|
|
|
2019-03-21 16:08:52 +00:00
|
|
|
extern linestruct *pletion_line;
|
2016-12-07 04:13:47 +00:00
|
|
|
|
2017-12-24 11:26:55 +00:00
|
|
|
extern bool also_the_last;
|
|
|
|
|
2020-02-02 16:05:06 +00:00
|
|
|
extern char *answer;
|
|
|
|
|
|
|
|
extern char *last_search;
|
2017-05-03 10:41:24 +00:00
|
|
|
extern int didfind;
|
|
|
|
|
2020-02-02 16:05:06 +00:00
|
|
|
extern char *present_path;
|
|
|
|
|
|
|
|
extern unsigned flags[4];
|
|
|
|
|
2018-10-07 08:24:19 +00:00
|
|
|
extern int controlleft, controlright;
|
|
|
|
extern int controlup, controldown;
|
|
|
|
extern int controlhome, controlend;
|
2018-10-05 17:09:17 +00:00
|
|
|
#ifndef NANO_TINY
|
2018-10-15 19:46:15 +00:00
|
|
|
extern int controldelete, controlshiftdelete;
|
2018-10-07 08:24:19 +00:00
|
|
|
extern int shiftleft, shiftright;
|
|
|
|
extern int shiftup, shiftdown;
|
|
|
|
extern int shiftcontrolleft, shiftcontrolright;
|
|
|
|
extern int shiftcontrolup, shiftcontroldown;
|
|
|
|
extern int shiftcontrolhome, shiftcontrolend;
|
|
|
|
extern int altleft, altright;
|
|
|
|
extern int altup, altdown;
|
2018-12-04 01:45:18 +00:00
|
|
|
extern int altpageup, altpagedown;
|
|
|
|
extern int altinsert, altdelete;
|
2018-10-07 08:24:19 +00:00
|
|
|
extern int shiftaltleft, shiftaltright;
|
|
|
|
extern int shiftaltup, shiftaltdown;
|
2015-11-23 08:52:23 +00:00
|
|
|
#endif
|
|
|
|
|
2017-10-31 16:39:30 +00:00
|
|
|
#ifdef ENABLED_WRAPORJUSTIFY
|
2019-09-30 17:30:54 +00:00
|
|
|
extern ssize_t fill;
|
|
|
|
extern size_t wrap_at;
|
2003-10-03 20:26:25 +00:00
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
extern WINDOW *topwin;
|
|
|
|
extern WINDOW *edit;
|
|
|
|
extern WINDOW *bottomwin;
|
|
|
|
extern int editwinrows;
|
2018-04-01 17:53:51 +00:00
|
|
|
extern int editwincols;
|
|
|
|
extern int margin;
|
2020-04-25 15:19:03 +00:00
|
|
|
extern int thebar;
|
2019-03-14 18:32:10 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-04-25 15:19:03 +00:00
|
|
|
extern int *bardata;
|
2018-12-17 18:57:30 +00:00
|
|
|
extern ssize_t stripe_column;
|
2019-03-14 18:32:10 +00:00
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
|
2019-03-21 16:08:52 +00:00
|
|
|
extern linestruct *cutbuffer;
|
|
|
|
extern linestruct *cutbottom;
|
2018-12-30 12:36:29 +00:00
|
|
|
extern bool keep_cutbuffer;
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
extern openfilestruct *openfile;
|
2019-04-22 17:45:42 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
extern openfilestruct *startfile;
|
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-01-06 21:51:10 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
extern char *matchbrackets;
|
2004-05-29 16:47:52 +00:00
|
|
|
extern char *whitespace;
|
2019-03-21 18:21:45 +00:00
|
|
|
extern int whitelen[2];
|
2004-05-29 16:47:52 +00:00
|
|
|
#endif
|
|
|
|
|
2014-04-26 19:01:18 +00:00
|
|
|
extern const char *exit_tag;
|
|
|
|
extern const char *close_tag;
|
2017-10-31 16:34:07 +00:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2004-05-29 16:38:57 +00:00
|
|
|
extern char *punct;
|
|
|
|
extern char *brackets;
|
2002-03-10 01:22:21 +00:00
|
|
|
extern char *quotestr;
|
2004-07-30 03:54:34 +00:00
|
|
|
extern regex_t quotereg;
|
2017-11-26 17:01:02 +00:00
|
|
|
#endif
|
2014-06-20 10:48:26 +00:00
|
|
|
|
2016-06-30 16:02:45 +00:00
|
|
|
extern char *word_chars;
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
extern ssize_t tabsize;
|
|
|
|
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-02-28 16:24:31 +00:00
|
|
|
extern char *backup_dir;
|
|
|
|
#endif
|
2017-10-29 20:08:07 +00:00
|
|
|
#ifdef ENABLE_OPERATINGDIR
|
2001-09-19 03:19:43 +00:00
|
|
|
extern char *operating_dir;
|
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
|
2017-10-31 18:32:42 +00:00
|
|
|
#ifdef ENABLE_SPELLER
|
2002-09-06 20:35:28 +00:00
|
|
|
extern char *alt_speller;
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
|
|
|
|
2017-11-01 18:45:33 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2005-12-08 07:09:08 +00:00
|
|
|
extern syntaxtype *syntaxes;
|
|
|
|
extern char *syntaxstr;
|
2017-11-26 17:01:02 +00:00
|
|
|
extern bool have_palette;
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2000-09-06 13:39:17 +00:00
|
|
|
|
2016-04-25 19:14:18 +00:00
|
|
|
extern bool refresh_needed;
|
2014-06-20 07:55:24 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
extern int currmenu;
|
2019-04-03 15:34:05 +00:00
|
|
|
extern keystruct *sclist;
|
2019-04-03 15:11:24 +00:00
|
|
|
extern funcstruct *allfuncs;
|
|
|
|
extern funcstruct *exitfunc;
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2019-03-21 16:08:52 +00:00
|
|
|
extern linestruct *search_history;
|
|
|
|
extern linestruct *replace_history;
|
|
|
|
extern linestruct *execute_history;
|
2017-10-29 18:42:12 +00:00
|
|
|
#ifdef ENABLE_HISTORIES
|
2019-03-21 16:08:52 +00:00
|
|
|
extern linestruct *searchtop;
|
|
|
|
extern linestruct *searchbot;
|
|
|
|
extern linestruct *replacetop;
|
|
|
|
extern linestruct *replacebot;
|
|
|
|
extern linestruct *executetop;
|
|
|
|
extern linestruct *executebot;
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
extern regex_t search_regexp;
|
|
|
|
extern regmatch_t regmatches[10];
|
|
|
|
|
2014-05-04 08:53:06 +00:00
|
|
|
extern int hilite_attribute;
|
2017-11-01 18:45:33 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2018-01-15 15:07:24 +00:00
|
|
|
extern colortype *color_combo[NUMBER_OF_ELEMENTS];
|
2014-05-03 18:24:45 +00:00
|
|
|
#endif
|
2016-07-12 07:35:48 +00:00
|
|
|
extern int interface_color_pair[NUMBER_OF_ELEMENTS];
|
2003-02-03 03:32:08 +00:00
|
|
|
|
2004-08-17 05:23:38 +00:00
|
|
|
extern char *homedir;
|
2017-10-27 21:15:06 +00:00
|
|
|
extern char *statedir;
|
2019-11-25 18:17:41 +00:00
|
|
|
#if defined(ENABLE_NANORC) || defined(ENABLE_HISTORIES)
|
2019-10-20 12:25:22 +00:00
|
|
|
extern char *startup_problem;
|
2018-08-04 08:53:34 +00:00
|
|
|
#endif
|
2020-01-14 11:41:22 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
|
|
|
extern char *custom_nanorc;
|
|
|
|
#endif
|
2004-08-17 05:23:38 +00:00
|
|
|
|
2018-09-29 16:14:43 +00:00
|
|
|
extern bool spotlighted;
|
|
|
|
extern size_t light_from_col;
|
|
|
|
extern size_t light_to_col;
|
|
|
|
|
2014-07-02 08:47:09 +00:00
|
|
|
typedef void (*functionptrtype)(void);
|
|
|
|
|
2017-04-09 11:28:27 +00:00
|
|
|
/* Most functions in browser.c. */
|
2017-05-08 17:08:23 +00:00
|
|
|
#ifdef ENABLE_BROWSER
|
2005-11-14 21:32:42 +00:00
|
|
|
char *do_browse_from(const char *inpath);
|
2016-05-25 10:09:22 +00:00
|
|
|
void read_the_list(const char *path, DIR *dir);
|
2006-02-18 21:32:29 +00:00
|
|
|
void browser_refresh(void);
|
2015-04-08 18:40:40 +00:00
|
|
|
void browser_select_dirname(const char *needle);
|
2018-07-24 22:11:25 +00:00
|
|
|
void do_filesearch(bool forwards);
|
2017-08-14 20:58:25 +00:00
|
|
|
void do_fileresearch(bool forwards);
|
2017-12-26 13:15:49 +00:00
|
|
|
void to_first_file(void);
|
|
|
|
void to_last_file(void);
|
2017-03-20 11:24:42 +00:00
|
|
|
char *strip_last_component(const char *path);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
|
|
|
|
2016-02-16 10:09:26 +00:00
|
|
|
/* Most functions in chars.c. */
|
2006-04-12 15:27:40 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
|
|
|
void utf8_init(void);
|
|
|
|
bool using_utf8(void);
|
|
|
|
#endif
|
2020-03-12 14:35:02 +00:00
|
|
|
bool is_alpha_char(const char *c);
|
2020-03-12 11:29:44 +00:00
|
|
|
bool is_blank_char(const char *c);
|
2020-03-12 14:35:02 +00:00
|
|
|
bool is_cntrl_char(const char *c);
|
2020-03-12 11:38:01 +00:00
|
|
|
bool is_word_char(const char *c, bool allow_punct);
|
2016-12-18 08:40:09 +00:00
|
|
|
char control_mbrep(const char *c, bool isdata);
|
2019-10-03 08:25:58 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
2005-01-12 03:25:57 +00:00
|
|
|
int mbwidth(const char *c);
|
2019-10-03 08:25:58 +00:00
|
|
|
#endif
|
2020-06-20 02:20:39 +00:00
|
|
|
char *make_mbchar(long code, int *length);
|
2019-06-09 15:36:29 +00:00
|
|
|
int char_length(const char *pointer);
|
2020-06-20 02:20:39 +00:00
|
|
|
size_t mbstrlen(const char *pointer);
|
|
|
|
int collect_char(const char *string, char *thechar);
|
2019-10-21 10:21:46 +00:00
|
|
|
int advance_over(const char *string, size_t *column);
|
2019-06-09 17:37:56 +00:00
|
|
|
size_t step_left(const char *buf, size_t pos);
|
|
|
|
size_t step_right(const char *buf, size_t pos);
|
2005-01-16 18:49:19 +00:00
|
|
|
int mbstrcasecmp(const char *s1, const char *s2);
|
|
|
|
int mbstrncasecmp(const char *s1, const char *s2, size_t n);
|
2007-07-06 13:44:13 +00:00
|
|
|
char *mbstrcasestr(const char *haystack, const char *needle);
|
2020-06-20 02:20:39 +00:00
|
|
|
char *revstrstr(const char *haystack, const char *needle, const char *pointer);
|
|
|
|
char *mbrevstrcasestr(const char *haystack, const char *needle, const char *pointer);
|
2017-10-31 16:34:07 +00:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_JUSTIFY)
|
2020-06-20 02:20:39 +00:00
|
|
|
char *mbstrchr(const char *string, const char *chr);
|
2006-01-06 07:10:30 +00:00
|
|
|
#endif
|
2005-11-15 23:45:29 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-06-20 02:20:39 +00:00
|
|
|
char *mbstrpbrk(const char *string, const char *accept);
|
|
|
|
char *mbrevstrpbrk(const char *head, const char *accept, const char *pointer);
|
2005-11-15 23:45:29 +00:00
|
|
|
#endif
|
2017-10-31 16:34:07 +00:00
|
|
|
#if defined(ENABLE_NANORC) && (!defined(NANO_TINY) || defined(ENABLE_JUSTIFY))
|
2020-06-20 02:20:39 +00:00
|
|
|
bool has_blank_char(const char *string);
|
2005-06-14 01:55:56 +00:00
|
|
|
#endif
|
2020-06-20 02:20:39 +00:00
|
|
|
bool white_string(const char *string);
|
2005-08-05 03:14:29 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
|
|
|
bool is_valid_unicode(wchar_t wc);
|
|
|
|
#endif
|
2005-01-12 03:25:57 +00:00
|
|
|
|
2016-02-16 10:09:26 +00:00
|
|
|
/* Most functions in color.c. */
|
2017-11-01 18:45:33 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2020-04-28 14:43:11 +00:00
|
|
|
void set_interface_colorpairs(void);
|
2020-04-28 14:38:27 +00:00
|
|
|
void prepare_palette(void);
|
2020-04-28 14:32:04 +00:00
|
|
|
void find_and_prime_applicable_syntax(void);
|
2019-06-23 10:15:19 +00:00
|
|
|
void set_up_multicache(linestruct *line);
|
2019-06-23 10:28:13 +00:00
|
|
|
void check_the_multis(linestruct *line);
|
2015-12-22 16:51:00 +00:00
|
|
|
void precalc_multicolorinfo(void);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2017-04-09 11:28:27 +00:00
|
|
|
/* Most functions in cut.c. */
|
2019-01-01 16:29:08 +00:00
|
|
|
void do_delete(void);
|
|
|
|
void do_backspace(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2019-02-24 16:27:22 +00:00
|
|
|
void chop_previous_word(void);
|
|
|
|
void chop_next_word(void);
|
2020-01-08 15:04:49 +00:00
|
|
|
#endif
|
2020-06-20 02:20:39 +00:00
|
|
|
void extract_segment(linestruct *top, size_t top_x, linestruct *bot, size_t bot_x);
|
|
|
|
void ingraft_buffer(linestruct *topline);
|
2020-01-08 15:04:49 +00:00
|
|
|
void copy_from_buffer(linestruct *somebuffer);
|
|
|
|
#ifndef NANO_TINY
|
2020-03-29 11:14:17 +00:00
|
|
|
void cut_marked_region(void);
|
2005-03-26 22:49:46 +00:00
|
|
|
#endif
|
2020-03-30 14:44:55 +00:00
|
|
|
void do_snip(bool marked, bool until_eof, bool append);
|
2019-05-03 17:51:15 +00:00
|
|
|
void cut_text(void);
|
2006-04-25 02:23:28 +00:00
|
|
|
#ifndef NANO_TINY
|
2019-05-03 17:51:15 +00:00
|
|
|
void cut_till_eof(void);
|
2018-10-24 02:25:22 +00:00
|
|
|
void zap_text(void);
|
2020-03-30 17:20:18 +00:00
|
|
|
void copy_marked_region(void);
|
|
|
|
void copy_text(void);
|
2005-01-01 07:43:32 +00:00
|
|
|
#endif
|
2019-05-03 17:47:08 +00:00
|
|
|
void paste_text(void);
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2016-01-31 13:06:06 +00:00
|
|
|
/* Most functions in files.c. */
|
2019-05-20 09:53:22 +00:00
|
|
|
void make_new_buffer(void);
|
2020-02-02 11:14:32 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-02-09 13:24:26 +00:00
|
|
|
bool delete_lockfile(const char *lockfilename);
|
2020-02-02 11:14:32 +00:00
|
|
|
#endif
|
2020-06-07 09:51:14 +00:00
|
|
|
void compute_the_extra_rows_per_line_from(linestruct *fromline);
|
2020-06-20 02:20:39 +00:00
|
|
|
bool open_buffer(const char *filename, bool new_one);
|
2020-02-02 11:25:09 +00:00
|
|
|
void set_modified(void);
|
2017-05-01 14:48:13 +00:00
|
|
|
void prepare_for_display(void);
|
2017-05-01 18:20:34 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2018-07-12 11:09:17 +00:00
|
|
|
void mention_name_and_linecount(void);
|
2017-08-31 20:00:53 +00:00
|
|
|
void switch_to_prev_buffer(void);
|
|
|
|
void switch_to_next_buffer(void);
|
2019-05-31 07:15:12 +00:00
|
|
|
void close_buffer(void);
|
2005-07-08 02:47:05 +00:00
|
|
|
#endif
|
2018-03-22 09:41:39 +00:00
|
|
|
void read_file(FILE *f, int fd, const char *filename, bool undoable);
|
2020-06-20 02:20:39 +00:00
|
|
|
int open_file(const char *filename, bool new_one, FILE **f);
|
2005-05-29 02:22:55 +00:00
|
|
|
char *get_next_filename(const char *name, const char *suffix);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_insertfile_void(void);
|
2020-05-22 12:28:42 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
void do_execute(void);
|
|
|
|
#endif
|
2002-09-13 18:14:04 +00:00
|
|
|
char *get_full_path(const char *origpath);
|
2020-06-20 02:20:39 +00:00
|
|
|
char *safe_tempfile(FILE **stream);
|
2017-10-29 20:08:07 +00:00
|
|
|
#ifdef ENABLE_OPERATINGDIR
|
2002-09-13 18:14:04 +00:00
|
|
|
void init_operating_dir(void);
|
2017-08-12 13:52:07 +00:00
|
|
|
bool outside_of_confinement(const char *currpath, bool allow_tabcomp);
|
2001-09-19 03:19:43 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-02-28 16:24:31 +00:00
|
|
|
void init_backup_dir(void);
|
|
|
|
#endif
|
2017-04-04 07:29:31 +00:00
|
|
|
int copy_file(FILE *inn, FILE *out, bool close_out);
|
2020-06-20 02:20:39 +00:00
|
|
|
bool write_file(const char *name, FILE *thefile, bool tmp,
|
2017-12-29 18:27:33 +00:00
|
|
|
kind_of_writing_type method, bool fullbuffer);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-06-20 02:20:39 +00:00
|
|
|
bool write_marked_file(const char *name, FILE *stream, bool tmp,
|
2017-12-29 18:27:33 +00:00
|
|
|
kind_of_writing_type method);
|
2004-01-23 19:34:03 +00:00
|
|
|
#endif
|
2017-09-27 20:42:48 +00:00
|
|
|
int do_writeout(bool exiting, bool withprompt);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_writeout_void(void);
|
2015-07-25 19:25:50 +00:00
|
|
|
void do_savefile(void);
|
2020-06-20 02:20:39 +00:00
|
|
|
char *real_dir_from_tilde(const char *path);
|
2017-05-08 17:15:51 +00:00
|
|
|
#if defined(ENABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
2005-02-08 20:37:53 +00:00
|
|
|
int diralphasort(const void *va, const void *vb);
|
|
|
|
#endif
|
2017-05-08 17:15:51 +00:00
|
|
|
#ifdef ENABLE_TABCOMP
|
2020-06-20 16:40:36 +00:00
|
|
|
char *input_tab(char *buf, size_t *place, void (*refresh_func)(void), bool *listed);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2002-04-10 02:31:20 +00:00
|
|
|
|
2014-04-21 13:00:49 +00:00
|
|
|
/* Some functions in global.c. */
|
2019-04-03 15:34:05 +00:00
|
|
|
const keystruct *first_sc_for(int menu, void (*func)(void));
|
2019-09-27 17:07:25 +00:00
|
|
|
size_t shown_entries_for(int menu);
|
2020-06-20 02:20:39 +00:00
|
|
|
const keystruct *get_shortcut(int *keycode);
|
|
|
|
functionptrtype func_from_key(int *keycode);
|
2020-01-26 14:22:22 +00:00
|
|
|
#if defined(ENABLE_BROWSER) || defined(ENABLE_HELP)
|
|
|
|
functionptrtype interpret(int *keycode);
|
|
|
|
#endif
|
2017-08-11 12:23:56 +00:00
|
|
|
int keycode_from_string(const char *keystring);
|
2014-04-07 09:24:10 +00:00
|
|
|
void shortcut_init(void);
|
2014-06-20 10:34:52 +00:00
|
|
|
const char *flagtostr(int flag);
|
2002-04-10 02:31:20 +00:00
|
|
|
|
2020-06-20 02:20:39 +00:00
|
|
|
/* Most functions in help.c. */
|
2017-04-25 15:51:45 +00:00
|
|
|
#ifdef ENABLE_HELP
|
2019-09-30 17:01:04 +00:00
|
|
|
void wrap_help_text_into_buffer(void);
|
2005-11-01 23:00:56 +00:00
|
|
|
void help_init(void);
|
2005-11-01 19:32:45 +00:00
|
|
|
#endif
|
2019-12-15 18:47:05 +00:00
|
|
|
void do_help(void);
|
2005-11-01 19:32:45 +00:00
|
|
|
|
2017-09-17 10:10:12 +00:00
|
|
|
/* Most functions in history.c. */
|
2017-10-29 18:42:12 +00:00
|
|
|
#ifdef ENABLE_HISTORIES
|
2017-09-17 10:10:12 +00:00
|
|
|
void history_init(void);
|
2020-06-20 02:20:39 +00:00
|
|
|
void history_reset(const linestruct *list);
|
|
|
|
void update_history(linestruct **item, const char *text);
|
2019-03-21 16:08:52 +00:00
|
|
|
char *get_history_older(linestruct **h);
|
|
|
|
char *get_history_newer(linestruct **h);
|
2017-09-17 10:10:12 +00:00
|
|
|
void get_history_older_void(void);
|
|
|
|
void get_history_newer_void(void);
|
|
|
|
#ifdef ENABLE_TABCOMP
|
2019-03-21 16:08:52 +00:00
|
|
|
char *get_history_completion(linestruct **h, char *s, size_t len);
|
2017-09-17 10:10:12 +00:00
|
|
|
#endif
|
2017-10-27 21:15:06 +00:00
|
|
|
bool have_statedir(void);
|
2017-09-17 10:10:12 +00:00
|
|
|
void load_history(void);
|
|
|
|
void save_history(void);
|
|
|
|
void load_poshistory(void);
|
2020-05-08 08:40:03 +00:00
|
|
|
void update_poshistory(void);
|
2017-09-17 10:10:12 +00:00
|
|
|
bool has_old_position(const char *file, ssize_t *line, ssize_t *column);
|
|
|
|
#endif
|
|
|
|
|
2017-08-18 20:17:05 +00:00
|
|
|
/* Most functions in move.c. */
|
2017-12-26 13:15:49 +00:00
|
|
|
void to_first_line(void);
|
|
|
|
void to_last_line(void);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_page_up(void);
|
|
|
|
void do_page_down(void);
|
2017-10-31 16:34:07 +00:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2019-03-21 16:08:52 +00:00
|
|
|
void do_para_begin(linestruct **line);
|
|
|
|
void do_para_end(linestruct **line);
|
2020-03-11 18:47:21 +00:00
|
|
|
void to_para_begin(void);
|
|
|
|
void to_para_end(void);
|
2005-07-20 19:24:11 +00:00
|
|
|
#endif
|
2020-03-11 18:45:06 +00:00
|
|
|
void to_prev_block(void);
|
|
|
|
void to_next_block(void);
|
2018-09-09 19:01:09 +00:00
|
|
|
void do_prev_word(bool allow_punct);
|
|
|
|
bool do_next_word(bool after_ends, bool allow_punct);
|
2020-03-11 18:43:03 +00:00
|
|
|
void to_prev_word(void);
|
|
|
|
void to_next_word(void);
|
2017-08-17 21:50:04 +00:00
|
|
|
void do_home(void);
|
|
|
|
void do_end(void);
|
2018-03-12 17:28:44 +00:00
|
|
|
void do_up(void);
|
|
|
|
void do_down(void);
|
2018-10-24 15:30:27 +00:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
|
2016-07-25 15:23:45 +00:00
|
|
|
void do_scroll_up(void);
|
2005-10-24 02:12:09 +00:00
|
|
|
void do_scroll_down(void);
|
2016-04-27 13:10:06 +00:00
|
|
|
void do_center(void);
|
2005-10-24 02:12:09 +00:00
|
|
|
#endif
|
2005-09-13 04:53:44 +00:00
|
|
|
void do_left(void);
|
|
|
|
void do_right(void);
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2017-04-09 11:28:27 +00:00
|
|
|
/* Most functions in nano.c. */
|
2019-03-21 16:08:52 +00:00
|
|
|
linestruct *make_new_node(linestruct *prevnode);
|
|
|
|
void splice_node(linestruct *afterthis, linestruct *newnode);
|
2020-06-20 02:20:39 +00:00
|
|
|
void unlink_node(linestruct *line);
|
|
|
|
void delete_node(linestruct *line);
|
2019-03-21 16:18:50 +00:00
|
|
|
linestruct *copy_buffer(const linestruct *src);
|
|
|
|
void free_lines(linestruct *src);
|
2019-04-30 08:27:10 +00:00
|
|
|
void renumber_from(linestruct *line);
|
2005-07-08 02:47:05 +00:00
|
|
|
void print_view_warning(void);
|
2019-10-09 16:58:30 +00:00
|
|
|
bool in_restricted_mode(void);
|
2017-04-25 15:51:45 +00:00
|
|
|
#ifndef ENABLE_HELP
|
2015-07-30 18:10:16 +00:00
|
|
|
void say_there_is_no_help(void);
|
|
|
|
#endif
|
2005-07-08 02:47:05 +00:00
|
|
|
void finish(void);
|
2020-06-05 17:05:29 +00:00
|
|
|
void close_and_go(void);
|
|
|
|
void do_exit(void);
|
2005-07-08 02:47:05 +00:00
|
|
|
void die(const char *msg, ...);
|
|
|
|
void window_init(void);
|
2019-05-26 11:32:28 +00:00
|
|
|
void install_handler_for_Ctrl_C(void);
|
|
|
|
void restore_handler_for_Ctrl_C(void);
|
2019-05-28 09:06:42 +00:00
|
|
|
void reconnect_and_store_state(void);
|
2005-12-06 19:39:56 +00:00
|
|
|
RETSIGTYPE handle_hupterm(int signal);
|
2018-04-29 11:51:52 +00:00
|
|
|
#ifndef DEBUG
|
|
|
|
RETSIGTYPE handle_crash(int signal);
|
|
|
|
#endif
|
2005-12-06 19:39:56 +00:00
|
|
|
RETSIGTYPE do_suspend(int signal);
|
|
|
|
RETSIGTYPE do_continue(int signal);
|
2019-03-31 23:17:45 +00:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_SPELLER)
|
2019-03-30 18:23:15 +00:00
|
|
|
void block_sigwinch(bool blockit);
|
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-12-06 19:39:56 +00:00
|
|
|
RETSIGTYPE handle_sigwinch(int signal);
|
2015-05-28 13:02:29 +00:00
|
|
|
void regenerate_screen(void);
|
2008-03-05 07:34:01 +00:00
|
|
|
void do_toggle(int flag);
|
2019-05-26 12:48:14 +00:00
|
|
|
#endif
|
2019-05-27 15:24:35 +00:00
|
|
|
void disable_kb_interrupt(void);
|
|
|
|
void enable_kb_interrupt(void);
|
2004-05-18 01:20:36 +00:00
|
|
|
void disable_flow_control(void);
|
|
|
|
void enable_flow_control(void);
|
2004-07-27 16:46:35 +00:00
|
|
|
void terminal_init(void);
|
2018-05-25 15:57:04 +00:00
|
|
|
#ifdef ENABLE_LINENUMBERS
|
2018-05-25 18:09:24 +00:00
|
|
|
void confirm_margin(void);
|
2018-05-25 15:57:04 +00:00
|
|
|
#endif
|
2016-04-27 12:37:31 +00:00
|
|
|
void unbound_key(int code);
|
2019-04-03 15:34:05 +00:00
|
|
|
bool okay_for_view(const keystruct *shortcut);
|
2020-02-13 13:20:52 +00:00
|
|
|
void inject(char *burst, size_t count);
|
2002-04-10 02:31:20 +00:00
|
|
|
|
2016-12-03 19:37:30 +00:00
|
|
|
/* Most functions in prompt.c. */
|
2020-06-20 02:20:39 +00:00
|
|
|
size_t get_statusbar_page_start(size_t base, size_t column);
|
2018-07-11 09:02:45 +00:00
|
|
|
void put_cursor_at_end_of_answer(void);
|
2018-07-11 08:07:33 +00:00
|
|
|
void add_or_remove_pipe_symbol_from_answer(void);
|
2020-06-20 15:15:40 +00:00
|
|
|
int do_prompt(int menu, const char *provided, linestruct **history_list,
|
|
|
|
void (*refresh_func)(void), const char *msg, ...);
|
2005-11-07 21:45:44 +00:00
|
|
|
int do_yesno_prompt(bool all, const char *msg);
|
2005-11-01 17:37:44 +00:00
|
|
|
|
2014-05-12 13:52:50 +00:00
|
|
|
/* Most functions in rcfile.c. */
|
2019-11-25 18:17:41 +00:00
|
|
|
#if defined(ENABLE_NANORC) || defined(ENABLE_HISTORIES)
|
2019-09-30 17:01:04 +00:00
|
|
|
void display_rcfile_errors(void);
|
2019-10-20 12:25:22 +00:00
|
|
|
void jot_error(const char *msg, ...);
|
2019-11-25 18:17:41 +00:00
|
|
|
#endif
|
|
|
|
#ifdef ENABLE_NANORC
|
2017-11-01 18:45:33 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2019-06-17 07:59:15 +00:00
|
|
|
void parse_one_include(char *file, syntaxtype *syntax);
|
2016-03-10 11:00:59 +00:00
|
|
|
void grab_and_store(const char *kind, char *ptr, regexlisttype **storage);
|
2019-06-17 07:59:15 +00:00
|
|
|
bool parse_syntax_commands(char *keyword, char *ptr);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2019-06-14 08:46:50 +00:00
|
|
|
void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only);
|
2016-11-27 17:21:04 +00:00
|
|
|
void do_rcfiles(void);
|
2017-05-08 17:42:44 +00:00
|
|
|
#endif /* ENABLE_NANORC */
|
2001-04-18 04:28:54 +00:00
|
|
|
|
2017-04-09 11:28:27 +00:00
|
|
|
/* Most functions in search.c. */
|
2019-08-09 12:55:06 +00:00
|
|
|
bool regexp_init(const char *regexp);
|
|
|
|
void tidy_up_after_search(void);
|
2017-10-26 17:15:11 +00:00
|
|
|
int findnextstr(const char *needle, bool whole_word_only, int modus,
|
2019-03-21 16:08:52 +00:00
|
|
|
size_t *match_len, bool skipone, const linestruct *begin, size_t begin_x);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_search(void);
|
2017-09-17 20:07:25 +00:00
|
|
|
void do_search_forward(void);
|
|
|
|
void do_search_backward(void);
|
2015-07-26 09:23:24 +00:00
|
|
|
void do_findprevious(void);
|
|
|
|
void do_findnext(void);
|
2018-04-13 19:09:44 +00:00
|
|
|
void not_found_msg(const char *str);
|
2016-04-04 17:38:57 +00:00
|
|
|
void go_looking(void);
|
2016-10-23 15:59:26 +00:00
|
|
|
ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
2019-03-21 16:08:52 +00:00
|
|
|
const linestruct *real_current, size_t *real_current_x);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_replace(void);
|
2020-04-07 17:19:26 +00:00
|
|
|
void ask_for_and_do_replacements(void);
|
2015-12-31 16:49:07 +00:00
|
|
|
void goto_line_posx(ssize_t line, size_t pos_x);
|
2005-06-29 00:17:18 +00:00
|
|
|
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
2017-12-29 18:27:33 +00:00
|
|
|
bool interactive);
|
2005-05-17 18:06:26 +00:00
|
|
|
void do_gotolinecolumn_void(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-06-16 20:58:19 +00:00
|
|
|
void do_find_bracket(void);
|
2020-04-06 15:42:29 +00:00
|
|
|
void put_or_lift_anchor(void);
|
|
|
|
void to_prev_anchor(void);
|
|
|
|
void to_next_anchor(void);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2017-04-09 11:28:27 +00:00
|
|
|
/* Most functions in text.c. */
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-07-25 02:41:59 +00:00
|
|
|
void do_mark(void);
|
|
|
|
#endif
|
|
|
|
void do_tab(void);
|
2006-04-28 13:19:56 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-07-10 21:34:27 +00:00
|
|
|
void do_indent(void);
|
|
|
|
void do_unindent(void);
|
2006-04-28 13:19:56 +00:00
|
|
|
#endif
|
2016-09-08 19:00:51 +00:00
|
|
|
#ifdef ENABLE_COMMENT
|
2016-05-25 20:13:50 +00:00
|
|
|
void do_comment(void);
|
|
|
|
#endif
|
2016-12-15 12:04:52 +00:00
|
|
|
void do_undo(void);
|
|
|
|
void do_redo(void);
|
2015-11-11 19:04:31 +00:00
|
|
|
void do_enter(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-03-08 11:54:47 +00:00
|
|
|
void discard_until(const undostruct *thisitem);
|
2019-10-09 17:12:07 +00:00
|
|
|
void add_undo(undo_type action, const char *message);
|
2017-07-09 01:54:59 +00:00
|
|
|
void update_multiline_undo(ssize_t lineno, char *indentation);
|
2016-12-15 12:04:52 +00:00
|
|
|
void update_undo(undo_type action);
|
|
|
|
#endif /* !NANO_TINY */
|
2017-10-29 20:00:09 +00:00
|
|
|
#ifdef ENABLE_WRAPPING
|
2019-04-19 07:44:57 +00:00
|
|
|
bool do_wrap(void);
|
2005-07-24 19:57:51 +00:00
|
|
|
#endif
|
2017-10-31 16:39:30 +00:00
|
|
|
#if defined(ENABLE_HELP) || defined(ENABLED_WRAPORJUSTIFY)
|
2020-06-20 02:20:39 +00:00
|
|
|
ssize_t break_line(const char *textstart, ssize_t goal, bool snap_at_nl);
|
2005-07-24 19:57:51 +00:00
|
|
|
#endif
|
2019-12-22 11:56:18 +00:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLED_WRAPORJUSTIFY)
|
2005-07-24 19:57:51 +00:00
|
|
|
size_t indent_length(const char *line);
|
|
|
|
#endif
|
2017-10-31 16:34:07 +00:00
|
|
|
#ifdef ENABLE_JUSTIFY
|
2019-04-26 08:37:04 +00:00
|
|
|
size_t quote_length(const char *line);
|
2020-06-20 02:20:39 +00:00
|
|
|
bool begpar(const linestruct *const line, int depth);
|
|
|
|
bool inpar(const linestruct *const line);
|
2005-07-24 19:57:51 +00:00
|
|
|
void do_justify(bool full_justify);
|
|
|
|
void do_justify_void(void);
|
|
|
|
void do_full_justify(void);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2017-10-31 18:32:42 +00:00
|
|
|
#ifdef ENABLE_SPELLER
|
2005-07-25 02:33:45 +00:00
|
|
|
void do_spell(void);
|
|
|
|
#endif
|
2017-11-01 18:45:33 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2014-04-21 13:00:49 +00:00
|
|
|
void do_linter(void);
|
2019-10-25 15:17:48 +00:00
|
|
|
void do_formatter(void);
|
2014-04-21 13:00:49 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-07-25 04:21:46 +00:00
|
|
|
void do_wordlinechar_count(void);
|
2005-07-24 19:57:51 +00:00
|
|
|
#endif
|
2005-11-07 06:06:05 +00:00
|
|
|
void do_verbatim_input(void);
|
2016-12-07 04:13:47 +00:00
|
|
|
void complete_a_word(void);
|
2005-07-24 19:57:51 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in utils.c. */
|
2005-02-08 20:37:53 +00:00
|
|
|
void get_homedir(void);
|
2017-11-11 10:34:39 +00:00
|
|
|
const char *tail(const char *path);
|
2017-10-27 21:15:06 +00:00
|
|
|
char *concatenate(const char *path, const char *name);
|
2016-12-09 17:36:01 +00:00
|
|
|
#ifdef ENABLE_LINENUMBERS
|
|
|
|
int digits(ssize_t n);
|
|
|
|
#endif
|
2020-06-20 02:20:39 +00:00
|
|
|
bool parse_num(const char *str, ssize_t *result);
|
2005-06-28 06:25:34 +00:00
|
|
|
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
|
2020-04-15 15:20:03 +00:00
|
|
|
void recode_NUL_to_LF(char *string, size_t length);
|
|
|
|
void recode_LF_to_NUL(char *string);
|
2017-11-20 18:33:23 +00:00
|
|
|
#if !defined(ENABLE_TINY) || defined(ENABLE_TABCOMP) || defined(ENABLE_BROWSER)
|
|
|
|
void free_chararray(char **array, size_t len);
|
|
|
|
#endif
|
2017-10-31 18:32:42 +00:00
|
|
|
#ifdef ENABLE_SPELLER
|
2016-05-02 20:20:19 +00:00
|
|
|
bool is_separate_word(size_t position, size_t length, const char *buf);
|
2005-11-16 05:59:06 +00:00
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
const char *strstrwrapper(const char *haystack, const char *needle,
|
2017-12-29 18:27:33 +00:00
|
|
|
const char *start);
|
2002-07-19 01:08:59 +00:00
|
|
|
void *nmalloc(size_t howmuch);
|
|
|
|
void *nrealloc(void *ptr, size_t howmuch);
|
2020-06-20 02:20:39 +00:00
|
|
|
char *measured_copy(const char *string, size_t count);
|
2002-09-06 20:35:28 +00:00
|
|
|
char *mallocstrcpy(char *dest, const char *src);
|
2019-10-13 10:24:27 +00:00
|
|
|
char *copy_of(const char *string);
|
2016-07-13 13:04:40 +00:00
|
|
|
char *free_and_assign(char *dest, char *src);
|
2005-11-01 17:45:31 +00:00
|
|
|
size_t get_page_start(size_t column);
|
2005-10-31 23:07:58 +00:00
|
|
|
size_t xplustabs(void);
|
2017-08-06 16:20:56 +00:00
|
|
|
size_t actual_x(const char *text, size_t column);
|
2019-04-24 07:08:23 +00:00
|
|
|
size_t wideness(const char *text, size_t maxlen);
|
2019-04-24 06:49:18 +00:00
|
|
|
size_t breadth(const char *text);
|
2002-07-19 01:08:59 +00:00
|
|
|
void new_magicline(void);
|
2017-04-25 15:51:45 +00:00
|
|
|
#if !defined(NANO_TINY) || defined(ENABLE_HELP)
|
2004-11-03 22:03:41 +00:00
|
|
|
void remove_magicline(void);
|
2017-04-25 15:51:45 +00:00
|
|
|
#endif
|
|
|
|
#ifndef NANO_TINY
|
2020-03-05 15:09:56 +00:00
|
|
|
bool mark_is_before_cursor(void);
|
2020-03-29 18:17:32 +00:00
|
|
|
void get_region(linestruct **top, size_t *top_x, linestruct **bot, size_t *bot_x);
|
|
|
|
void get_range(linestruct **top, linestruct **bot);
|
2003-09-16 01:16:49 +00:00
|
|
|
#endif
|
2020-04-09 10:27:07 +00:00
|
|
|
size_t number_of_characters_in(const linestruct *begin, const linestruct *end);
|
2016-12-15 11:45:02 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-06-20 02:20:39 +00:00
|
|
|
linestruct *line_from_number(ssize_t number);
|
2016-12-15 11:45:02 +00:00
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2015-12-22 19:00:25 +00:00
|
|
|
/* Most functions in winio.c. */
|
2017-10-09 22:03:51 +00:00
|
|
|
void record_macro(void);
|
|
|
|
void run_macro(void);
|
2005-07-13 20:18:46 +00:00
|
|
|
size_t get_key_buffer_len(void);
|
2018-02-27 12:34:32 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
|
|
|
void implant(const char *string);
|
|
|
|
#endif
|
2014-06-30 18:04:33 +00:00
|
|
|
int parse_kbinput(WINDOW *win);
|
2020-01-26 14:41:09 +00:00
|
|
|
int get_kbinput(WINDOW *win, bool showcursor);
|
2006-05-10 13:41:53 +00:00
|
|
|
int get_byte_kbinput(int kbinput);
|
2004-12-04 17:41:52 +00:00
|
|
|
int get_control_kbinput(int kbinput);
|
2020-02-12 16:16:27 +00:00
|
|
|
char *get_verbatim_kbinput(WINDOW *win, size_t *count);
|
2017-05-01 18:45:07 +00:00
|
|
|
#ifdef ENABLE_MOUSE
|
2020-06-20 02:20:39 +00:00
|
|
|
int get_mouseinput(int *mouse_y, int *mouse_x, bool allow_shortcuts);
|
2004-08-25 15:39:10 +00:00
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
void blank_edit(void);
|
|
|
|
void blank_statusbar(void);
|
2017-12-29 16:34:03 +00:00
|
|
|
void wipe_statusbar(void);
|
2004-05-18 01:20:36 +00:00
|
|
|
void blank_bottombars(void);
|
2005-03-17 17:56:48 +00:00
|
|
|
void check_statusblank(void);
|
2019-02-27 20:37:53 +00:00
|
|
|
char *display_string(const char *buf, size_t column, size_t span,
|
|
|
|
bool isdata, bool isprompt);
|
2003-02-13 22:25:01 +00:00
|
|
|
void titlebar(const char *path);
|
2019-10-13 14:21:31 +00:00
|
|
|
void statusline(message_type importance, const char *msg, ...);
|
2016-04-30 15:31:43 +00:00
|
|
|
void statusbar(const char *msg);
|
2020-05-28 14:59:50 +00:00
|
|
|
void warn_and_briefly_pause(const char *msg);
|
2008-03-05 07:34:01 +00:00
|
|
|
void bottombars(int menu);
|
2017-11-11 19:57:18 +00:00
|
|
|
void post_one_key(const char *keystroke, const char *tag, int width);
|
2017-07-22 04:26:59 +00:00
|
|
|
void place_the_cursor(void);
|
2020-06-20 02:20:39 +00:00
|
|
|
int update_line(linestruct *line, size_t index);
|
softwrap: move the updating of a softwrapped line to a new function
The new function, update_softwrapped_line(), is called from inside
update_line() when softwrap mode is on, so that existing calls remain
unchanged. It takes no index, instead displaying edittop from column
firstcolumn, and all other lines from column zero.
If current is on edittop, it's displayed using the edittop rules, but
this is not a problem: if current[current_x] is above edittop at column
firstcolumn, it's offscreen, and that should be handled before calling
update_line() anyway.
Together with the preceding bunch of changes,
this fixes https://savannah.gnu.org/bugs/?47667.
2017-02-01 00:11:05 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-06-20 02:20:39 +00:00
|
|
|
int update_softwrapped_line(linestruct *line);
|
softwrap: move the updating of a softwrapped line to a new function
The new function, update_softwrapped_line(), is called from inside
update_line() when softwrap mode is on, so that existing calls remain
unchanged. It takes no index, instead displaying edittop from column
firstcolumn, and all other lines from column zero.
If current is on edittop, it's displayed using the edittop rules, but
this is not a problem: if current[current_x] is above edittop at column
firstcolumn, it's offscreen, and that should be handled before calling
update_line() anyway.
Together with the preceding bunch of changes,
this fixes https://savannah.gnu.org/bugs/?47667.
2017-02-01 00:11:05 +00:00
|
|
|
#endif
|
2017-01-31 22:51:06 +00:00
|
|
|
bool line_needs_update(const size_t old_column, const size_t new_column);
|
2019-03-21 16:08:52 +00:00
|
|
|
int go_back_chunks(int nrows, linestruct **line, size_t *leftedge);
|
|
|
|
int go_forward_chunks(int nrows, linestruct **line, size_t *leftedge);
|
2017-01-15 22:01:17 +00:00
|
|
|
bool less_than_a_screenful(size_t was_lineno, size_t was_leftedge);
|
2018-03-10 11:24:42 +00:00
|
|
|
void edit_scroll(bool direction);
|
2017-05-05 10:33:25 +00:00
|
|
|
#ifndef NANO_TINY
|
2017-02-22 18:31:57 +00:00
|
|
|
size_t get_softwrap_breakpoint(const char *text, size_t leftedge,
|
2017-12-29 18:27:33 +00:00
|
|
|
bool *end_of_line);
|
2019-03-21 16:08:52 +00:00
|
|
|
size_t get_chunk_and_edge(size_t column, linestruct *line, size_t *leftedge);
|
|
|
|
size_t chunk_for(size_t column, linestruct *line);
|
|
|
|
size_t leftedge_for(size_t column, linestruct *line);
|
2020-05-13 10:41:17 +00:00
|
|
|
size_t extra_chunks_in(linestruct *line);
|
softwrap: adjust firstcolumn when the window width changes
If the number of columns in the edit window changes (which currently
only happens in two places: in regenerate_screen(), called when the
window is resized; and in main(), when line numbering mode is toggled),
the display will break if we're in softwrap mode and firstcolumn is
nonzero. This is because the column width of softwrapped chunks has
changed, and firstcolumn is no longer the starting column of a chunk,
an assumption that all code using firstcolumn relies on.
To fix this problem, add a new function, ensure_firstcolumn_is_aligned(),
to adjust firstcolumn to the starting column of the chunk it's on, and
use it when the number of columns in the edit window changes.
(Note that this function uses the simplest possible fix, and could
probably be made more sophisticated.)
2017-01-23 19:40:03 +00:00
|
|
|
void ensure_firstcolumn_is_aligned(void);
|
2017-05-05 10:33:25 +00:00
|
|
|
#endif
|
2017-06-29 19:53:49 +00:00
|
|
|
size_t actual_last_column(size_t leftedge, size_t column);
|
2019-03-21 16:08:52 +00:00
|
|
|
void edit_redraw(linestruct *old_current, update_type manner);
|
2002-07-19 01:08:59 +00:00
|
|
|
void edit_refresh(void);
|
2020-06-20 02:20:39 +00:00
|
|
|
void adjust_viewport(update_type manner);
|
2020-05-31 14:41:07 +00:00
|
|
|
void full_refresh(void);
|
2020-05-31 14:14:43 +00:00
|
|
|
void draw_all_subwindows(void);
|
2020-07-03 07:32:25 +00:00
|
|
|
void report_cursor_position(void);
|
2018-09-29 16:19:57 +00:00
|
|
|
void spotlight(size_t from_col, size_t to_col);
|
2017-03-06 07:34:45 +00:00
|
|
|
#ifndef NANO_TINY
|
2018-09-29 16:19:57 +00:00
|
|
|
void spotlight_softwrapped(size_t from_col, size_t to_col);
|
2017-03-06 07:34:45 +00:00
|
|
|
#endif
|
2008-03-13 08:23:52 +00:00
|
|
|
void do_suspend_void(void);
|
2017-06-04 10:32:27 +00:00
|
|
|
void disable_waiting(void);
|
|
|
|
void enable_waiting(void);
|
2017-11-01 19:33:14 +00:00
|
|
|
#ifdef ENABLE_EXTRA
|
2002-07-19 01:08:59 +00:00
|
|
|
void do_credits(void);
|
2001-10-22 03:15:31 +00:00
|
|
|
#endif
|
2005-04-15 18:07:26 +00:00
|
|
|
|
2017-05-08 10:57:15 +00:00
|
|
|
/* These are just name definitions. */
|
2011-02-07 14:45:56 +00:00
|
|
|
void case_sens_void(void);
|
|
|
|
void regexp_void(void);
|
2017-05-08 12:23:47 +00:00
|
|
|
void backwards_void(void);
|
|
|
|
void flip_replace(void);
|
2018-02-04 09:34:39 +00:00
|
|
|
void flip_goto(void);
|
2017-05-08 17:08:23 +00:00
|
|
|
#ifdef ENABLE_BROWSER
|
2020-01-26 15:36:23 +00:00
|
|
|
void to_files(void);
|
|
|
|
void goto_dir(void);
|
2017-05-08 12:23:47 +00:00
|
|
|
#endif
|
2017-05-08 10:57:15 +00:00
|
|
|
#ifndef NANO_TINY
|
2020-02-05 10:41:31 +00:00
|
|
|
void do_nothing(void);
|
2018-04-17 08:34:57 +00:00
|
|
|
void do_toggle_void(void);
|
2011-02-07 14:45:56 +00:00
|
|
|
void dos_format_void(void);
|
|
|
|
void mac_format_void(void);
|
|
|
|
void append_void(void);
|
|
|
|
void prepend_void(void);
|
|
|
|
void backup_file_void(void);
|
2017-05-08 12:23:47 +00:00
|
|
|
void flip_execute(void);
|
2018-05-16 01:20:11 +00:00
|
|
|
void flip_pipe(void);
|
2018-08-19 10:35:15 +00:00
|
|
|
void flip_convert(void);
|
2017-05-08 10:57:15 +00:00
|
|
|
#endif
|
2017-05-08 11:20:07 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
2017-05-08 12:23:47 +00:00
|
|
|
void flip_newbuffer(void);
|
2017-05-08 11:20:07 +00:00
|
|
|
#endif
|
2017-05-08 12:23:47 +00:00
|
|
|
void discard_buffer(void);
|
2018-04-17 08:34:57 +00:00
|
|
|
void do_cancel(void);
|