2000-08-06 21:13:45 +00:00
|
|
|
/* $Id$ */
|
2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* proto.h *
|
|
|
|
* *
|
2009-12-02 03:36:22 +00:00
|
|
|
* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, *
|
2014-04-30 20:18:26 +00:00
|
|
|
* 2008, 2009, 2010, 2011, 2013, 2014 Free Software Foundation, Inc. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* 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 *
|
2007-08-11 05:17:36 +00:00
|
|
|
* the Free Software Foundation; either version 3, or (at your option) *
|
2000-06-06 05:53:49 +00:00
|
|
|
* any later version. *
|
|
|
|
* *
|
2005-05-15 19:57:17 +00:00
|
|
|
* 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. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU General Public License *
|
|
|
|
* along with this program; if not, write to the Free Software *
|
2005-05-15 19:57:17 +00:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
|
|
|
|
* 02110-1301, USA. *
|
2000-06-06 05:53:49 +00:00
|
|
|
* *
|
|
|
|
**************************************************************************/
|
|
|
|
|
2005-04-15 18:07:26 +00:00
|
|
|
#ifndef PROTO_H
|
|
|
|
#define PROTO_H 1
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
#include "nano.h"
|
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All external variables. See global.c for their descriptions. */
|
2006-05-10 13:41:53 +00:00
|
|
|
#ifndef NANO_TINY
|
2015-05-28 13:02:29 +00:00
|
|
|
extern volatile sig_atomic_t sigwinch_counter;
|
2006-05-10 13:41:53 +00:00
|
|
|
#endif
|
|
|
|
|
2014-06-30 18:04:33 +00:00
|
|
|
extern bool meta_key;
|
|
|
|
extern bool func_key;
|
2015-03-28 17:01:46 +00:00
|
|
|
extern bool focusing;
|
2014-06-30 18:04:33 +00:00
|
|
|
|
2015-11-23 08:52:23 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
extern int controlleft;
|
|
|
|
extern int controlright;
|
|
|
|
#endif
|
|
|
|
|
2003-10-03 20:26:25 +00:00
|
|
|
#ifndef DISABLE_WRAPJUSTIFY
|
2005-07-24 19:57:51 +00:00
|
|
|
extern ssize_t fill;
|
2004-07-12 16:07:14 +00:00
|
|
|
extern ssize_t wrap_at;
|
2003-10-03 20:26:25 +00:00
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
extern char *last_search;
|
|
|
|
extern char *last_replace;
|
|
|
|
|
2009-08-14 03:18:29 +00:00
|
|
|
extern unsigned flags[4];
|
2005-12-08 07:09:08 +00:00
|
|
|
extern WINDOW *topwin;
|
|
|
|
extern WINDOW *edit;
|
|
|
|
extern WINDOW *bottomwin;
|
|
|
|
extern int editwinrows;
|
2009-11-16 04:28:40 +00:00
|
|
|
extern int maxrows;
|
2005-12-08 07:09:08 +00:00
|
|
|
|
|
|
|
extern filestruct *cutbuffer;
|
2008-07-31 04:24:04 +00:00
|
|
|
extern filestruct *cutbottom;
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
extern filestruct *jusbuffer;
|
|
|
|
#endif
|
|
|
|
extern partition *filepart;
|
|
|
|
extern openfilestruct *openfile;
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2006-01-06 21:51:10 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
extern char *matchbrackets;
|
|
|
|
#endif
|
|
|
|
|
2015-08-09 16:05:50 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-05-29 16:47:52 +00:00
|
|
|
extern char *whitespace;
|
2005-03-10 22:52:21 +00:00
|
|
|
extern int whitespace_len[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;
|
2014-04-07 09:02:22 +00:00
|
|
|
extern const char *uncut_tag;
|
2002-03-03 22:36:36 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2014-04-07 09:02:22 +00:00
|
|
|
extern const char *unjust_tag;
|
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
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
extern regex_t quotereg;
|
|
|
|
extern int quoterc;
|
|
|
|
extern char *quoteerr;
|
|
|
|
#else
|
|
|
|
extern size_t quotelen;
|
|
|
|
#endif
|
2014-06-20 10:48:26 +00:00
|
|
|
#endif /* !DISABLE_JUSTIFY */
|
|
|
|
|
2009-02-25 04:32:15 +00:00
|
|
|
extern bool nodelay_mode;
|
2005-12-08 07:09:08 +00:00
|
|
|
extern char *answer;
|
|
|
|
|
|
|
|
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;
|
2013-01-03 04:36:39 +00:00
|
|
|
extern const char *locking_prefix;
|
|
|
|
extern const char *locking_suffix;
|
2004-02-28 16:24:31 +00:00
|
|
|
#endif
|
2001-09-19 03:19:43 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
|
|
|
extern char *operating_dir;
|
2002-02-27 04:14:16 +00:00
|
|
|
extern char *full_operating_dir;
|
2001-09-19 03:19:43 +00:00
|
|
|
#endif
|
2005-12-08 07:09:08 +00:00
|
|
|
|
2001-04-18 04:28:54 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2002-09-06 20:35:28 +00:00
|
|
|
extern char *alt_speller;
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
|
|
|
|
2014-04-04 11:59:03 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
2005-12-08 07:09:08 +00:00
|
|
|
extern syntaxtype *syntaxes;
|
|
|
|
extern char *syntaxstr;
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2000-09-06 13:39:17 +00:00
|
|
|
|
2009-02-06 03:41:02 +00:00
|
|
|
extern bool edit_refresh_needed;
|
2014-06-20 07:55:24 +00:00
|
|
|
|
2008-03-05 07:34:01 +00:00
|
|
|
extern int currmenu;
|
2014-06-20 07:55:24 +00:00
|
|
|
extern sc *sclist;
|
|
|
|
extern subnfunc *allfuncs;
|
|
|
|
extern subnfunc *exitfunc;
|
|
|
|
extern subnfunc *uncutfunc;
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2014-06-19 20:05:24 +00:00
|
|
|
#ifndef DISABLE_HISTORIES
|
2005-05-23 16:30:06 +00:00
|
|
|
extern filestruct *search_history;
|
|
|
|
extern filestruct *searchage;
|
|
|
|
extern filestruct *searchbot;
|
|
|
|
extern filestruct *replace_history;
|
|
|
|
extern filestruct *replaceage;
|
|
|
|
extern filestruct *replacebot;
|
2011-02-16 06:52:30 +00:00
|
|
|
extern poshiststruct *poshistory;
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2005-12-08 07:09:08 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
extern regex_t search_regexp;
|
|
|
|
extern regmatch_t regmatches[10];
|
|
|
|
#endif
|
|
|
|
|
2014-05-04 08:53:06 +00:00
|
|
|
extern int hilite_attribute;
|
2014-05-03 18:24:45 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
|
|
|
extern char* specified_color_combo[NUMBER_OF_ELEMENTS];
|
|
|
|
#endif
|
2014-05-10 19:15:04 +00:00
|
|
|
extern color_pair 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;
|
|
|
|
|
2014-07-02 08:47:09 +00:00
|
|
|
typedef void (*functionptrtype)(void);
|
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in browser.c. */
|
2005-11-14 21:32:42 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2006-07-11 18:12:24 +00:00
|
|
|
char *do_browser(char *path, DIR *dir);
|
2005-11-14 21:32:42 +00:00
|
|
|
char *do_browse_from(const char *inpath);
|
2006-02-18 21:32:29 +00:00
|
|
|
void browser_init(const char *path, DIR *dir);
|
2014-07-02 09:29:05 +00:00
|
|
|
functionptrtype parse_browser_input(int *kbinput);
|
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);
|
2006-03-30 07:03:04 +00:00
|
|
|
int filesearch_init(void);
|
2015-04-07 13:34:12 +00:00
|
|
|
void findnextfile(const char *needle);
|
2006-03-30 07:03:04 +00:00
|
|
|
void filesearch_abort(void);
|
|
|
|
void do_filesearch(void);
|
|
|
|
void do_fileresearch(void);
|
|
|
|
void do_first_file(void);
|
|
|
|
void do_last_file(void);
|
2006-06-30 14:14:40 +00:00
|
|
|
char *striponedir(const char *path);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in chars.c. */
|
2006-04-12 15:27:40 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
|
|
|
void utf8_init(void);
|
|
|
|
bool using_utf8(void);
|
|
|
|
#endif
|
2014-05-25 19:41:49 +00:00
|
|
|
char *addstrings(char* str1, size_t len1, char* str2, size_t len2);
|
2005-06-12 17:48:46 +00:00
|
|
|
#ifndef HAVE_ISBLANK
|
2005-06-29 18:17:54 +00:00
|
|
|
bool nisblank(int c);
|
2005-03-16 17:00:27 +00:00
|
|
|
#endif
|
2005-07-17 02:40:07 +00:00
|
|
|
#if !defined(HAVE_ISWBLANK) && defined(ENABLE_UTF8)
|
2005-06-29 18:17:54 +00:00
|
|
|
bool niswblank(wchar_t wc);
|
2005-01-12 03:25:57 +00:00
|
|
|
#endif
|
2005-06-13 19:51:56 +00:00
|
|
|
bool is_byte(int c);
|
2005-06-15 06:04:08 +00:00
|
|
|
bool is_alnum_mbchar(const char *c);
|
2005-06-12 17:48:46 +00:00
|
|
|
bool is_blank_mbchar(const char *c);
|
2006-05-24 17:36:00 +00:00
|
|
|
bool is_ascii_cntrl_char(int c);
|
2005-02-08 20:37:53 +00:00
|
|
|
bool is_cntrl_char(int c);
|
2005-07-17 02:40:07 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
2005-06-15 16:07:14 +00:00
|
|
|
bool is_cntrl_wchar(wchar_t wc);
|
2005-01-12 03:25:57 +00:00
|
|
|
#endif
|
2005-06-12 17:48:46 +00:00
|
|
|
bool is_cntrl_mbchar(const char *c);
|
2005-06-15 06:04:08 +00:00
|
|
|
bool is_punct_mbchar(const char *c);
|
2005-06-15 03:03:45 +00:00
|
|
|
bool is_word_mbchar(const char *c, bool allow_punct);
|
2005-06-12 18:05:42 +00:00
|
|
|
char control_rep(char c);
|
2005-07-17 02:40:07 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
2005-01-12 03:25:57 +00:00
|
|
|
wchar_t control_wrep(wchar_t c);
|
|
|
|
#endif
|
2005-06-12 17:48:46 +00:00
|
|
|
char *control_mbrep(const char *c, char *crep, int *crep_len);
|
2005-07-26 06:13:45 +00:00
|
|
|
char *mbrep(const char *c, char *crep, int *crep_len);
|
2005-01-12 03:25:57 +00:00
|
|
|
int mbwidth(const char *c);
|
|
|
|
int mb_cur_max(void);
|
2005-08-08 23:03:25 +00:00
|
|
|
char *make_mbchar(long chr, int *chr_mb_len);
|
2005-07-26 06:13:45 +00:00
|
|
|
int parse_mbchar(const char *buf, char *chr, size_t *col);
|
2005-01-14 21:50:32 +00:00
|
|
|
size_t move_mbleft(const char *buf, size_t pos);
|
|
|
|
size_t move_mbright(const char *buf, size_t pos);
|
2005-01-16 18:49:19 +00:00
|
|
|
#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
|
2007-07-06 13:44:13 +00:00
|
|
|
char *nstrcasestr(const char *haystack, const char *needle);
|
2005-01-16 18:49:19 +00:00
|
|
|
#endif
|
2007-07-06 13:44:13 +00:00
|
|
|
char *mbstrcasestr(const char *haystack, const char *needle);
|
2005-11-15 03:17:35 +00:00
|
|
|
#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
|
2007-07-06 13:44:13 +00:00
|
|
|
char *revstrstr(const char *haystack, const char *needle, const char
|
|
|
|
*rev_start);
|
2005-06-13 13:25:36 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2007-07-06 13:44:13 +00:00
|
|
|
char *revstrcasestr(const char *haystack, const char *needle, const char
|
|
|
|
*rev_start);
|
|
|
|
char *mbrevstrcasestr(const char *haystack, const char *needle, const
|
|
|
|
char *rev_start);
|
2005-01-16 18:49:19 +00:00
|
|
|
#endif
|
2005-01-25 19:21:11 +00:00
|
|
|
size_t mbstrlen(const char *s);
|
2005-01-16 18:49:19 +00:00
|
|
|
#ifndef HAVE_STRNLEN
|
|
|
|
size_t nstrnlen(const char *s, size_t maxlen);
|
|
|
|
#endif
|
|
|
|
size_t mbstrnlen(const char *s, size_t maxlen);
|
2006-01-06 07:10:30 +00:00
|
|
|
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
|
|
|
|
char *mbstrchr(const char *s, const char *c);
|
|
|
|
#endif
|
2005-11-15 23:45:29 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-01-06 07:10:30 +00:00
|
|
|
char *mbstrpbrk(const char *s, const char *accept);
|
2005-11-15 23:45:29 +00:00
|
|
|
char *revstrpbrk(const char *s, const char *accept, const char
|
|
|
|
*rev_start);
|
2006-01-06 07:10:30 +00:00
|
|
|
char *mbrevstrpbrk(const char *s, const char *accept, const char
|
|
|
|
*rev_start);
|
2005-11-15 23:45:29 +00:00
|
|
|
#endif
|
2014-04-13 20:50:20 +00:00
|
|
|
#if !defined(DISABLE_NANORC) && (!defined(NANO_TINY) || !defined(DISABLE_JUSTIFY))
|
2005-06-14 01:55:56 +00:00
|
|
|
bool has_blank_chars(const char *s);
|
|
|
|
bool has_blank_mbchars(const char *s);
|
|
|
|
#endif
|
2005-08-05 03:14:29 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
|
|
|
bool is_valid_unicode(wchar_t wc);
|
|
|
|
#endif
|
2014-04-13 20:50:20 +00:00
|
|
|
#ifndef DISABLE_NANORC
|
2005-06-14 23:36:13 +00:00
|
|
|
bool is_valid_mbstring(const char *s);
|
|
|
|
#endif
|
2005-01-12 03:25:57 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in color.c. */
|
2014-04-04 11:59:03 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
2002-09-27 14:21:59 +00:00
|
|
|
void set_colorpairs(void);
|
2005-07-13 20:18:46 +00:00
|
|
|
void color_init(void);
|
2005-07-14 18:31:45 +00:00
|
|
|
void color_update(void);
|
2015-12-22 16:51:00 +00:00
|
|
|
void reset_multis(filestruct *fileptr, bool force);
|
|
|
|
void alloc_multidata_if_needed(filestruct *fileptr);
|
|
|
|
void precalc_multicolorinfo(void);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in cut.c. */
|
2004-05-29 15:36:58 +00:00
|
|
|
void cutbuffer_reset(void);
|
2014-06-18 19:04:35 +00:00
|
|
|
bool keeping_cutbuffer(void);
|
2004-11-23 04:08:28 +00:00
|
|
|
void cut_line(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-11-23 04:08:28 +00:00
|
|
|
void cut_marked(void);
|
|
|
|
void cut_to_eol(void);
|
2006-05-21 20:03:43 +00:00
|
|
|
void cut_to_eof(void);
|
2005-03-26 22:49:46 +00:00
|
|
|
#endif
|
2006-04-25 02:23:28 +00:00
|
|
|
void do_cut_text(
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2015-11-02 13:46:40 +00:00
|
|
|
bool copy_text, bool cut_till_eof
|
2006-04-25 02:23:28 +00:00
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
void do_cut_text_void(void);
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
void do_copy_text(void);
|
2014-06-30 20:39:27 +00:00
|
|
|
void do_cut_till_eof(void);
|
2005-01-01 07:43:32 +00:00
|
|
|
#endif
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_uncut_text(void);
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in files.c. */
|
2005-07-08 20:09:16 +00:00
|
|
|
void make_new_buffer(void);
|
2005-07-23 00:41:45 +00:00
|
|
|
void initialize_buffer_text(void);
|
2008-08-03 04:48:05 +00:00
|
|
|
void open_buffer(const char *filename, bool undoable);
|
2005-11-08 19:15:58 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
void replace_buffer(const char *filename);
|
|
|
|
#endif
|
2005-07-12 23:06:22 +00:00
|
|
|
void display_buffer(void);
|
2014-04-03 20:23:07 +00:00
|
|
|
#ifndef DISABLE_MULTIBUFFER
|
2015-01-20 06:15:34 +00:00
|
|
|
void switch_to_prevnext_buffer(bool next, bool quiet);
|
2005-07-08 20:09:16 +00:00
|
|
|
void switch_to_prev_buffer_void(void);
|
|
|
|
void switch_to_next_buffer_void(void);
|
2015-01-20 06:15:34 +00:00
|
|
|
bool close_buffer(bool quiet);
|
2005-07-08 02:47:05 +00:00
|
|
|
#endif
|
2015-12-18 19:18:23 +00:00
|
|
|
filestruct *read_line(char *buf, size_t buf_len, filestruct *prevnode);
|
2009-12-09 16:51:43 +00:00
|
|
|
void read_file(FILE *f, int fd, const char *filename, bool undoable, bool checkwritable);
|
2015-01-20 06:15:34 +00:00
|
|
|
int open_file(const char *filename, bool newfie, bool quiet, FILE **f);
|
2005-05-29 02:22:55 +00:00
|
|
|
char *get_next_filename(const char *name, const char *suffix);
|
2004-10-01 18:34:30 +00:00
|
|
|
void do_insertfile(
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-10-01 18:34:30 +00:00
|
|
|
bool execute
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_insertfile_void(void);
|
2002-09-13 18:14:04 +00:00
|
|
|
char *get_full_path(const char *origpath);
|
|
|
|
char *check_writable_directory(const char *path);
|
2005-05-31 04:28:15 +00:00
|
|
|
char *safe_tempfile(FILE **f);
|
2001-09-19 03:19:43 +00:00
|
|
|
#ifndef DISABLE_OPERATINGDIR
|
2002-09-13 18:14:04 +00:00
|
|
|
void init_operating_dir(void);
|
2005-02-11 20:09:11 +00:00
|
|
|
bool check_operating_dir(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);
|
2013-01-01 03:24:39 +00:00
|
|
|
int delete_lockfile(const char *lockfilename);
|
2013-01-03 03:57:18 +00:00
|
|
|
int write_lockfile(const char *lockfilename, const char *origfilename, bool modified);
|
2004-02-28 16:24:31 +00:00
|
|
|
#endif
|
2004-07-30 03:54:34 +00:00
|
|
|
int copy_file(FILE *inn, FILE *out);
|
2007-01-11 21:36:29 +00:00
|
|
|
bool write_file(const char *name, FILE *f_open, bool tmp, append_type
|
2005-08-01 18:27:10 +00:00
|
|
|
append, bool nonamechange);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2007-01-11 21:36:29 +00:00
|
|
|
bool write_marked_file(const char *name, FILE *f_open, bool tmp,
|
2005-08-01 18:27:10 +00:00
|
|
|
append_type append);
|
2004-01-23 19:34:03 +00:00
|
|
|
#endif
|
2007-01-11 21:36:29 +00:00
|
|
|
bool do_writeout(bool exiting);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_writeout_void(void);
|
2015-07-25 19:25:50 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
void do_savefile(void);
|
|
|
|
#endif
|
2002-09-13 18:14:04 +00:00
|
|
|
char *real_dir_from_tilde(const char *buf);
|
2005-02-08 20:37:53 +00:00
|
|
|
#if !defined(DISABLE_TABCOMP) || !defined(DISABLE_BROWSER)
|
|
|
|
int diralphasort(const void *va, const void *vb);
|
2005-06-15 06:30:05 +00:00
|
|
|
void free_chararray(char **array, size_t len);
|
2005-02-08 20:37:53 +00:00
|
|
|
#endif
|
2003-01-13 01:35:15 +00:00
|
|
|
#ifndef DISABLE_TABCOMP
|
2007-01-11 21:36:29 +00:00
|
|
|
bool is_dir(const char *buf);
|
2005-02-08 20:37:53 +00:00
|
|
|
char **username_tab_completion(const char *buf, size_t *num_matches,
|
2007-10-11 15:38:32 +00:00
|
|
|
size_t buf_len);
|
2006-02-07 21:11:05 +00:00
|
|
|
char **cwd_tab_completion(const char *buf, bool allow_files, size_t
|
2007-10-11 15:38:32 +00:00
|
|
|
*num_matches, size_t buf_len);
|
2006-02-07 21:11:05 +00:00
|
|
|
char *input_tab(char *buf, bool allow_files, size_t *place, bool
|
2006-02-18 21:32:29 +00:00
|
|
|
*lastwastab, void (*refresh_func)(void), bool *list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2004-02-28 16:24:31 +00:00
|
|
|
const char *tail(const char *foo);
|
2014-06-19 20:05:24 +00:00
|
|
|
#ifndef DISABLE_HISTORIES
|
2004-08-17 05:23:38 +00:00
|
|
|
char *histfilename(void);
|
2004-08-11 05:13:08 +00:00
|
|
|
void load_history(void);
|
2005-05-23 16:30:06 +00:00
|
|
|
bool writehist(FILE *hist, filestruct *histhead);
|
2004-08-11 05:13:08 +00:00
|
|
|
void save_history(void);
|
2011-02-16 06:52:30 +00:00
|
|
|
int check_dotnano(void);
|
|
|
|
void load_poshistory(void);
|
|
|
|
void save_poshistory(void);
|
2014-06-20 07:55:24 +00:00
|
|
|
void update_poshistory(char *filename, ssize_t lineno, ssize_t xpos);
|
2011-02-16 06:52:30 +00:00
|
|
|
int check_poshistory(const char *file, ssize_t *line, ssize_t *column);
|
2004-08-11 05:13:08 +00:00
|
|
|
#endif
|
2002-04-10 02:31:20 +00:00
|
|
|
|
2014-04-21 13:00:49 +00:00
|
|
|
/* Some functions in global.c. */
|
2008-03-05 07:34:01 +00:00
|
|
|
size_t length_of_list(int menu);
|
2014-06-20 10:34:52 +00:00
|
|
|
key_type strtokeytype(const char *str);
|
|
|
|
const sc *first_sc_for(int menu, void (*func)(void));
|
|
|
|
int sc_seq_or(void (*func)(void), int defaultval);
|
2014-07-02 08:47:09 +00:00
|
|
|
functionptrtype func_from_key(int *kbinput);
|
2014-06-20 10:34:52 +00:00
|
|
|
void assign_keyinfo(sc *s);
|
|
|
|
void print_sclist(void);
|
2014-04-07 09:24:10 +00:00
|
|
|
void shortcut_init(void);
|
2014-06-20 10:34:52 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
2015-01-03 07:24:17 +00:00
|
|
|
void set_lint_or_format_shortcuts(void);
|
2014-06-20 10:34:52 +00:00
|
|
|
void set_spell_shortcuts(void);
|
|
|
|
#endif
|
|
|
|
const subnfunc *sctofunc(sc *s);
|
|
|
|
const char *flagtostr(int flag);
|
|
|
|
sc *strtosc(char *input);
|
|
|
|
int strtomenu(char *input);
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
void thanks_for_all_the_fish(void);
|
2002-04-10 02:31:20 +00:00
|
|
|
#endif
|
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in help.c. */
|
2008-08-30 21:00:00 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2015-08-16 09:28:33 +00:00
|
|
|
void do_help(void);
|
2005-11-01 23:00:56 +00:00
|
|
|
void help_init(void);
|
2014-07-02 09:29:05 +00:00
|
|
|
functionptrtype parse_help_input(int *kbinput);
|
2005-11-01 20:11:55 +00:00
|
|
|
size_t help_line_len(const char *ptr);
|
2005-11-01 19:32:45 +00:00
|
|
|
#endif
|
2014-04-21 13:00:49 +00:00
|
|
|
void do_help_void(void);
|
2005-11-01 19:32:45 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in move.c. */
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_first_line(void);
|
|
|
|
void do_last_line(void);
|
|
|
|
void do_page_up(void);
|
|
|
|
void do_page_down(void);
|
2005-07-20 19:24:11 +00:00
|
|
|
#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
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-07-20 21:31:19 +00:00
|
|
|
bool do_next_word(bool allow_punct, bool allow_update);
|
|
|
|
void do_next_word_void(void);
|
2015-09-05 09:22:50 +00:00
|
|
|
void do_prev_word(bool allow_punct, bool allow_update);
|
2005-07-20 21:31:19 +00:00
|
|
|
void do_prev_word_void(void);
|
|
|
|
#endif
|
2005-07-20 19:24:11 +00:00
|
|
|
void do_home(void);
|
|
|
|
void do_end(void);
|
2006-07-06 22:17:47 +00:00
|
|
|
void do_up(
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
bool scroll_only
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
void do_up_void(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-10-24 02:12:09 +00:00
|
|
|
void do_scroll_up(void);
|
|
|
|
#endif
|
2006-07-06 22:17:47 +00:00
|
|
|
void do_down(
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
bool scroll_only
|
|
|
|
#else
|
|
|
|
void
|
|
|
|
#endif
|
|
|
|
);
|
|
|
|
void do_down_void(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-10-24 02:12:09 +00:00
|
|
|
void do_scroll_down(void);
|
|
|
|
#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
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in nano.c. */
|
2002-09-06 20:35:28 +00:00
|
|
|
filestruct *make_new_node(filestruct *prevnode);
|
|
|
|
filestruct *copy_node(const filestruct *src);
|
2015-11-24 13:28:32 +00:00
|
|
|
void splice_node(filestruct *afterthis, filestruct *newnode);
|
2015-11-22 16:14:42 +00:00
|
|
|
void unlink_node(filestruct *fileptr);
|
2002-09-06 20:35:28 +00:00
|
|
|
void delete_node(filestruct *fileptr);
|
|
|
|
filestruct *copy_filestruct(const filestruct *src);
|
2002-07-19 01:08:59 +00:00
|
|
|
void free_filestruct(filestruct *src);
|
2005-07-08 02:47:05 +00:00
|
|
|
void renumber(filestruct *fileptr);
|
2004-11-03 22:03:41 +00:00
|
|
|
partition *partition_filestruct(filestruct *top, size_t top_x,
|
|
|
|
filestruct *bot, size_t bot_x);
|
2004-11-22 00:16:23 +00:00
|
|
|
void unpartition_filestruct(partition **p);
|
2004-11-23 04:08:28 +00:00
|
|
|
void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
|
|
|
|
filestruct *top, size_t top_x, filestruct *bot, size_t bot_x);
|
2014-04-14 09:14:39 +00:00
|
|
|
void copy_from_filestruct(filestruct *somebuffer);
|
2005-07-20 21:08:38 +00:00
|
|
|
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
|
2005-07-08 02:47:05 +00:00
|
|
|
void print_view_warning(void);
|
2015-07-30 18:10:16 +00:00
|
|
|
void show_restricted_warning(void);
|
|
|
|
#ifdef DISABLE_HELP
|
|
|
|
void say_there_is_no_help(void);
|
|
|
|
#endif
|
2005-07-08 02:47:05 +00:00
|
|
|
void finish(void);
|
|
|
|
void die(const char *msg, ...);
|
2009-11-22 21:35:56 +00:00
|
|
|
void die_save_file(const char *die_filename
|
|
|
|
#ifndef NANO_TINY
|
|
|
|
, struct stat *die_stat
|
|
|
|
#endif
|
|
|
|
);
|
2005-07-08 02:47:05 +00:00
|
|
|
void window_init(void);
|
|
|
|
#ifndef DISABLE_MOUSE
|
2006-06-09 18:24:37 +00:00
|
|
|
void disable_mouse_support(void);
|
|
|
|
void enable_mouse_support(void);
|
2005-07-08 02:47:05 +00:00
|
|
|
void mouse_init(void);
|
|
|
|
#endif
|
2006-05-12 19:30:28 +00:00
|
|
|
void print_opt_full(const char *shortflag
|
2005-03-21 07:24:47 +00:00
|
|
|
#ifdef HAVE_GETOPT_LONG
|
|
|
|
, const char *longflag
|
|
|
|
#endif
|
|
|
|
, const char *desc);
|
2002-09-06 20:35:28 +00:00
|
|
|
void usage(void);
|
|
|
|
void version(void);
|
2014-06-19 11:58:11 +00:00
|
|
|
int more_space(void);
|
2002-09-06 20:35:28 +00:00
|
|
|
int no_help(void);
|
2015-10-29 10:36:07 +00:00
|
|
|
void no_current_file_name_warning(void);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_exit(void);
|
2002-07-19 01:08:59 +00:00
|
|
|
void signal_init(void);
|
2005-12-06 19:39:56 +00:00
|
|
|
RETSIGTYPE handle_hupterm(int signal);
|
|
|
|
RETSIGTYPE do_suspend(int signal);
|
|
|
|
RETSIGTYPE do_continue(int signal);
|
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);
|
2004-08-05 22:10:22 +00:00
|
|
|
void allow_pending_sigwinch(bool allow);
|
2008-03-05 07:34:01 +00:00
|
|
|
void do_toggle(int flag);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2015-03-08 12:10:52 +00:00
|
|
|
void do_toggle_void(void);
|
2005-06-09 04:02:57 +00:00
|
|
|
void disable_extended_io(void);
|
2007-12-18 15:55:48 +00:00
|
|
|
#ifdef USE_SLANG
|
|
|
|
void disable_signals(void);
|
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-05-18 01:20:36 +00:00
|
|
|
void enable_signals(void);
|
|
|
|
#endif
|
|
|
|
void disable_flow_control(void);
|
|
|
|
void enable_flow_control(void);
|
2004-07-27 16:46:35 +00:00
|
|
|
void terminal_init(void);
|
2014-06-30 18:04:33 +00:00
|
|
|
int do_input(bool allow_funcs);
|
2004-12-04 17:41:52 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
2007-05-20 23:41:56 +00:00
|
|
|
int do_mouse(void);
|
2004-12-04 17:41:52 +00:00
|
|
|
#endif
|
2005-03-17 03:52:08 +00:00
|
|
|
void do_output(char *output, size_t output_len, bool allow_cntrls);
|
2002-04-10 02:31:20 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in prompt.c. */
|
2014-06-30 18:04:33 +00:00
|
|
|
int do_statusbar_input(bool *ran_func, bool *finished,
|
|
|
|
void (*refresh_func)(void));
|
2005-11-01 17:37:44 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
2007-05-20 23:41:56 +00:00
|
|
|
int do_statusbar_mouse(void);
|
2005-11-01 17:37:44 +00:00
|
|
|
#endif
|
|
|
|
void do_statusbar_output(char *output, size_t output_len, bool
|
2006-11-27 04:56:16 +00:00
|
|
|
*got_enter, bool allow_cntrls);
|
2005-11-01 17:37:44 +00:00
|
|
|
void do_statusbar_home(void);
|
|
|
|
void do_statusbar_end(void);
|
|
|
|
void do_statusbar_left(void);
|
2005-12-08 07:09:08 +00:00
|
|
|
void do_statusbar_right(void);
|
2005-11-01 17:37:44 +00:00
|
|
|
void do_statusbar_backspace(void);
|
|
|
|
void do_statusbar_delete(void);
|
|
|
|
void do_statusbar_cut_text(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-11-01 17:37:44 +00:00
|
|
|
bool do_statusbar_next_word(bool allow_punct);
|
|
|
|
bool do_statusbar_prev_word(bool allow_punct);
|
|
|
|
#endif
|
|
|
|
void do_statusbar_verbatim_input(bool *got_enter);
|
|
|
|
size_t statusbar_xplustabs(void);
|
|
|
|
size_t get_statusbar_page_start(size_t start_col, size_t column);
|
2005-11-07 21:45:44 +00:00
|
|
|
void reset_statusbar_cursor(void);
|
2006-05-15 15:17:50 +00:00
|
|
|
void update_statusbar_line(const char *curranswer, size_t index);
|
2015-04-20 08:35:41 +00:00
|
|
|
bool need_statusbar_update(size_t pww_save);
|
2006-05-15 15:17:50 +00:00
|
|
|
void total_statusbar_refresh(void (*refresh_func)(void));
|
2014-07-02 08:47:09 +00:00
|
|
|
functionptrtype get_prompt_string(int *value, bool allow_tabs,
|
2006-02-07 21:11:05 +00:00
|
|
|
#ifndef DISABLE_TABCOMP
|
|
|
|
bool allow_files,
|
2014-07-01 11:50:35 +00:00
|
|
|
bool *list,
|
2006-02-07 21:11:05 +00:00
|
|
|
#endif
|
|
|
|
const char *curranswer,
|
2014-06-19 20:05:24 +00:00
|
|
|
#ifndef DISABLE_HISTORIES
|
2005-11-01 17:37:44 +00:00
|
|
|
filestruct **history_list,
|
|
|
|
#endif
|
2014-07-01 11:50:35 +00:00
|
|
|
void (*refresh_func)(void));
|
2006-02-07 21:11:05 +00:00
|
|
|
int do_prompt(bool allow_tabs,
|
|
|
|
#ifndef DISABLE_TABCOMP
|
|
|
|
bool allow_files,
|
|
|
|
#endif
|
2008-03-05 07:34:01 +00:00
|
|
|
int menu, const char *curranswer,
|
2014-06-19 20:05:24 +00:00
|
|
|
#ifndef DISABLE_HISTORIES
|
2005-11-01 17:37:44 +00:00
|
|
|
filestruct **history_list,
|
|
|
|
#endif
|
2006-02-18 21:32:29 +00:00
|
|
|
void (*refresh_func)(void), const char *msg, ...);
|
2005-11-07 21:45:44 +00:00
|
|
|
void do_prompt_abort(void);
|
|
|
|
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. */
|
2014-06-19 20:05:24 +00:00
|
|
|
#if !defined(DISABLE_NANORC) || !defined(DISABLE_HISTORIES)
|
|
|
|
char *parse_next_word(char *ptr);
|
|
|
|
#endif
|
2014-04-13 20:50:20 +00:00
|
|
|
#ifndef DISABLE_NANORC
|
2002-09-06 20:35:28 +00:00
|
|
|
void rcfile_error(const char *msg, ...);
|
|
|
|
char *parse_argument(char *ptr);
|
2014-04-04 11:59:03 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
2002-09-06 20:35:28 +00:00
|
|
|
char *parse_next_regex(char *ptr);
|
2013-03-17 22:09:38 +00:00
|
|
|
bool nregcomp(const char *regex, int eflags);
|
2002-09-06 20:35:28 +00:00
|
|
|
void parse_syntax(char *ptr);
|
2006-04-13 02:43:54 +00:00
|
|
|
void parse_include(char *ptr);
|
2006-05-28 22:24:03 +00:00
|
|
|
short color_to_short(const char *colorname, bool *bright);
|
2005-06-27 03:07:10 +00:00
|
|
|
void parse_colors(char *ptr, bool icase);
|
2014-05-03 18:24:45 +00:00
|
|
|
bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2006-04-13 02:43:54 +00:00
|
|
|
void parse_rcfile(FILE *rcstream
|
2014-04-04 11:59:03 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
2006-04-13 02:43:54 +00:00
|
|
|
, bool syntax_only
|
|
|
|
#endif
|
|
|
|
);
|
2001-04-18 04:28:54 +00:00
|
|
|
void do_rcfile(void);
|
2014-06-19 20:05:24 +00:00
|
|
|
#endif /* !DISABLE_NANORC */
|
2001-04-18 04:28:54 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in search.c. */
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2007-01-09 23:35:02 +00:00
|
|
|
bool regexp_init(const char *regexp);
|
2002-09-06 20:35:28 +00:00
|
|
|
void regexp_cleanup(void);
|
|
|
|
#endif
|
|
|
|
void not_found_msg(const char *str);
|
2005-12-08 07:09:08 +00:00
|
|
|
void search_replace_abort(void);
|
2004-10-04 22:37:56 +00:00
|
|
|
int search_init(bool replacing, bool use_answer);
|
2005-11-16 05:59:06 +00:00
|
|
|
bool findnextstr(
|
|
|
|
#ifndef DISABLE_SPELLER
|
2015-04-25 15:26:09 +00:00
|
|
|
bool whole_word_only,
|
2005-11-16 05:59:06 +00:00
|
|
|
#endif
|
2015-04-25 15:17:22 +00:00
|
|
|
const filestruct *begin, size_t begin_x,
|
|
|
|
const char *needle, size_t *needle_len);
|
2004-10-31 13:20:30 +00:00
|
|
|
void findnextstr_wrap_reset(void);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_search(void);
|
2015-07-26 09:23:24 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
void do_findprevious(void);
|
|
|
|
void do_findnext(void);
|
|
|
|
#endif
|
2014-04-04 15:31:40 +00:00
|
|
|
#if !defined(NANO_TINY) || !defined(DISABLE_BROWSER)
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_research(void);
|
2004-05-05 21:36:50 +00:00
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2005-05-26 03:47:24 +00:00
|
|
|
int replace_regexp(char *string, bool create);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2004-02-24 20:41:39 +00:00
|
|
|
char *replace_line(const char *needle);
|
2005-11-16 05:59:06 +00:00
|
|
|
ssize_t do_replace_loop(
|
|
|
|
#ifndef DISABLE_SPELLER
|
2015-04-25 15:26:09 +00:00
|
|
|
bool whole_word_only,
|
2005-11-16 05:59:06 +00:00
|
|
|
#endif
|
|
|
|
bool *canceled, const filestruct *real_current, size_t
|
|
|
|
*real_current_x, const char *needle);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_replace(void);
|
2005-06-29 00:17:18 +00:00
|
|
|
void do_gotolinecolumn(ssize_t line, ssize_t column, bool use_answer,
|
2005-07-16 07:06:36 +00:00
|
|
|
bool interactive, bool save_pos, bool allow_update);
|
2005-05-17 18:06:26 +00:00
|
|
|
void do_gotolinecolumn_void(void);
|
2005-07-16 22:35:11 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2005-12-08 07:09:08 +00:00
|
|
|
void do_gotopos(ssize_t pos_line, size_t pos_x, ssize_t pos_y, size_t
|
2005-06-28 06:25:34 +00:00
|
|
|
pos_pww);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2014-05-15 20:00:46 +00:00
|
|
|
void goto_line_posx(ssize_t line, size_t pos_x);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-11-15 23:45:29 +00:00
|
|
|
bool find_bracket_match(bool reverse, const char *bracket_set);
|
2005-06-16 20:58:19 +00:00
|
|
|
void do_find_bracket(void);
|
2014-06-19 20:05:24 +00:00
|
|
|
#ifndef DISABLE_TABCOMP
|
|
|
|
char *get_history_completion(filestruct **h, const char *s, size_t len);
|
|
|
|
#endif
|
2005-06-03 19:28:30 +00:00
|
|
|
#endif
|
2014-06-19 20:05:24 +00:00
|
|
|
#ifndef DISABLE_HISTORIES
|
|
|
|
bool history_has_changed(void);
|
2003-01-05 20:41:21 +00:00
|
|
|
void history_init(void);
|
2005-07-18 07:48:50 +00:00
|
|
|
void history_reset(const filestruct *h);
|
2005-07-19 04:53:45 +00:00
|
|
|
filestruct *find_history(const filestruct *h_start, const filestruct
|
|
|
|
*h_end, const char *s, size_t len);
|
2005-06-02 18:41:31 +00:00
|
|
|
void update_history(filestruct **h, const char *s);
|
2005-05-23 16:30:06 +00:00
|
|
|
char *get_history_older(filestruct **h);
|
|
|
|
char *get_history_newer(filestruct **h);
|
2011-02-07 14:45:56 +00:00
|
|
|
void get_history_older_void(void);
|
|
|
|
void get_history_newer_void(void);
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All 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_delete(void);
|
|
|
|
void do_backspace(void);
|
2015-07-31 11:52:26 +00:00
|
|
|
#ifndef NANO_TINY
|
|
|
|
void do_cut_prev_word(void);
|
|
|
|
void do_cut_next_word(void);
|
|
|
|
#endif
|
2005-07-25 02:41:59 +00:00
|
|
|
void do_tab(void);
|
2006-04-28 13:19:56 +00:00
|
|
|
#ifndef NANO_TINY
|
2006-07-05 18:42:22 +00:00
|
|
|
void do_indent(ssize_t cols);
|
|
|
|
void do_indent_void(void);
|
|
|
|
void do_unindent(void);
|
2008-07-10 20:13:04 +00:00
|
|
|
void do_undo(void);
|
|
|
|
void do_redo(void);
|
2006-04-28 13:19:56 +00:00
|
|
|
#endif
|
2015-11-11 19:04:31 +00:00
|
|
|
void do_enter(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2005-12-06 19:39:56 +00:00
|
|
|
RETSIGTYPE cancel_command(int signal);
|
2005-07-24 19:57:51 +00:00
|
|
|
bool execute_command(const char *command);
|
2003-03-11 03:50:40 +00:00
|
|
|
#endif
|
2005-07-24 19:57:51 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
|
|
|
void wrap_reset(void);
|
2014-06-09 10:01:54 +00:00
|
|
|
bool do_wrap(filestruct *line);
|
2005-07-24 19:57:51 +00:00
|
|
|
#endif
|
2005-11-29 21:30:00 +00:00
|
|
|
#if !defined(DISABLE_HELP) || !defined(DISABLE_WRAPJUSTIFY)
|
2005-11-22 21:13:36 +00:00
|
|
|
ssize_t break_line(const char *line, ssize_t goal
|
|
|
|
#ifndef DISABLE_HELP
|
2008-05-31 23:09:40 +00:00
|
|
|
, bool newln
|
2005-11-22 21:13:36 +00:00
|
|
|
#endif
|
|
|
|
);
|
2005-07-24 19:57:51 +00:00
|
|
|
#endif
|
2005-11-15 03:17:35 +00:00
|
|
|
#if !defined(NANO_TINY) || !defined(DISABLE_JUSTIFY)
|
2005-07-24 19:57:51 +00:00
|
|
|
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);
|
2005-11-10 21:20:32 +00:00
|
|
|
void backup_lines(filestruct *first_line, size_t par_len);
|
2005-11-29 18:34:45 +00:00
|
|
|
bool find_paragraph(size_t *const quote, size_t *const par);
|
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
|
2005-07-25 02:33:45 +00:00
|
|
|
#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
|
2014-04-21 13:00:49 +00:00
|
|
|
#ifndef DISABLE_COLOR
|
|
|
|
void do_linter(void);
|
2015-01-03 07:24:17 +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);
|
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);
|
2004-08-04 18:24:53 +00:00
|
|
|
bool parse_num(const char *str, ssize_t *val);
|
2005-06-28 06:25:34 +00:00
|
|
|
bool parse_line_column(const char *str, ssize_t *line, ssize_t *column);
|
2005-06-13 14:00:22 +00:00
|
|
|
void align(char **str);
|
2002-07-19 01:08:59 +00:00
|
|
|
void null_at(char **data, size_t index);
|
|
|
|
void unsunder(char *str, size_t true_len);
|
|
|
|
void sunder(char *str);
|
2014-04-13 20:50:20 +00:00
|
|
|
#if !defined(NANO_TINY) && !defined(DISABLE_NANORC)
|
2004-08-17 05:23:38 +00:00
|
|
|
#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
|
2005-11-14 21:32:42 +00:00
|
|
|
#endif
|
2005-07-24 19:57:51 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2008-08-30 05:16:20 +00:00
|
|
|
const char *fixbounds(const char *r);
|
2005-07-24 19:57:51 +00:00
|
|
|
#endif
|
2005-11-16 05:59:06 +00:00
|
|
|
#ifndef DISABLE_SPELLER
|
2005-07-24 19:57:51 +00:00
|
|
|
bool is_whole_word(size_t pos, const char *buf, const char *word);
|
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,
|
2004-02-24 20:41:39 +00:00
|
|
|
const char *start);
|
2002-07-19 01:08:59 +00:00
|
|
|
void nperror(const char *s);
|
|
|
|
void *nmalloc(size_t howmuch);
|
|
|
|
void *nrealloc(void *ptr, size_t howmuch);
|
2004-11-02 15:18:30 +00:00
|
|
|
char *mallocstrncpy(char *dest, const char *src, size_t n);
|
2002-09-06 20:35:28 +00:00
|
|
|
char *mallocstrcpy(char *dest, const char *src);
|
2004-09-05 21:40:31 +00:00
|
|
|
char *mallocstrassn(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);
|
|
|
|
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);
|
2002-07-19 01:08:59 +00:00
|
|
|
void new_magicline(void);
|
2005-11-15 03:17:35 +00:00
|
|
|
#ifndef NANO_TINY
|
2004-11-03 22:03:41 +00:00
|
|
|
void remove_magicline(void);
|
2004-07-08 17:15:10 +00:00
|
|
|
void mark_order(const filestruct **top, size_t *top_x, const filestruct
|
2004-11-05 23:03:03 +00:00
|
|
|
**bot, size_t *bot_x, bool *right_side_up);
|
2015-12-04 11:01:48 +00:00
|
|
|
void discard_until(undo *thisone);
|
2015-06-17 11:18:20 +00:00
|
|
|
void add_undo(undo_type action);
|
2008-08-03 04:48:05 +00:00
|
|
|
void update_undo(undo_type action);
|
2003-09-16 01:16:49 +00:00
|
|
|
#endif
|
2005-07-17 01:44:35 +00:00
|
|
|
size_t get_totsize(const filestruct *begin, const filestruct *end);
|
2008-08-03 04:48:05 +00:00
|
|
|
filestruct *fsfromline(ssize_t lineno);
|
2005-11-02 15:44:01 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
void dump_filestruct(const filestruct *inptr);
|
|
|
|
void dump_filestruct_reverse(void);
|
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2007-01-01 05:15:32 +00:00
|
|
|
/* All functions in winio.c. */
|
2005-07-13 20:18:46 +00:00
|
|
|
void get_key_buffer(WINDOW *win);
|
|
|
|
size_t get_key_buffer_len(void);
|
2005-01-12 03:25:57 +00:00
|
|
|
void unget_input(int *input, size_t input_len);
|
2014-06-30 18:04:33 +00:00
|
|
|
void unget_kbinput(int kbinput, bool metakey, bool funckey);
|
2005-01-12 03:25:57 +00:00
|
|
|
int *get_input(WINDOW *win, size_t input_len);
|
2014-06-30 18:04:33 +00:00
|
|
|
int get_kbinput(WINDOW *win);
|
|
|
|
int parse_kbinput(WINDOW *win);
|
2006-07-25 19:23:35 +00:00
|
|
|
int get_escape_seq_kbinput(const int *seq, size_t seq_len);
|
2004-01-23 19:26:17 +00:00
|
|
|
int get_escape_seq_abcd(int kbinput);
|
2006-07-23 17:54:35 +00:00
|
|
|
int parse_escape_seq_kbinput(WINDOW *win, int kbinput);
|
2006-05-10 13:41:53 +00:00
|
|
|
int get_byte_kbinput(int kbinput);
|
2006-05-27 17:39:19 +00:00
|
|
|
#ifdef ENABLE_UTF8
|
2006-05-27 15:52:26 +00:00
|
|
|
long add_unicode_digit(int kbinput, long factor, long *uni);
|
2006-05-28 17:30:28 +00:00
|
|
|
long get_unicode_kbinput(int kbinput);
|
2006-05-27 17:39:19 +00:00
|
|
|
#endif
|
2004-12-04 17:41:52 +00:00
|
|
|
int get_control_kbinput(int kbinput);
|
2005-01-12 03:25:57 +00:00
|
|
|
void unparse_kbinput(char *output, size_t output_len);
|
2004-12-04 17:41:52 +00:00
|
|
|
int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
|
|
|
int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
|
2004-05-22 20:19:15 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
2007-05-20 23:41:56 +00:00
|
|
|
int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
|
2004-08-25 15:39:10 +00:00
|
|
|
#endif
|
2014-07-01 10:41:10 +00:00
|
|
|
const sc *get_shortcut(int *kbinput);
|
2005-07-10 02:37:38 +00:00
|
|
|
void blank_line(WINDOW *win, int y, int x, int n);
|
2004-05-18 01:20:36 +00:00
|
|
|
void blank_titlebar(void);
|
2005-01-17 05:06:55 +00:00
|
|
|
void blank_topbar(void);
|
2002-09-06 20:35:28 +00:00
|
|
|
void blank_edit(void);
|
|
|
|
void blank_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);
|
2004-12-23 17:43:27 +00:00
|
|
|
char *display_string(const char *buf, size_t start_col, size_t len, bool
|
|
|
|
dollars);
|
2003-02-13 22:25:01 +00:00
|
|
|
void titlebar(const char *path);
|
2015-01-03 07:24:17 +00:00
|
|
|
extern void set_modified(void);
|
2004-05-18 01:20:36 +00:00
|
|
|
void statusbar(const char *msg, ...);
|
2008-03-05 07:34:01 +00:00
|
|
|
void bottombars(int menu);
|
2004-05-23 21:11:14 +00:00
|
|
|
void onekey(const char *keystroke, const char *desc, size_t len);
|
2002-09-06 20:35:28 +00:00
|
|
|
void reset_cursor(void);
|
2009-01-25 07:25:17 +00:00
|
|
|
void edit_draw(filestruct *fileptr, const char *converted, int
|
2005-10-27 20:10:45 +00:00
|
|
|
line, size_t start);
|
2009-08-17 07:52:10 +00:00
|
|
|
int update_line(filestruct *fileptr, size_t index);
|
2015-04-20 08:16:41 +00:00
|
|
|
bool need_screen_update(size_t pww_save);
|
2005-08-01 21:05:29 +00:00
|
|
|
void edit_scroll(scroll_dir direction, ssize_t nlines);
|
2009-01-25 07:25:17 +00:00
|
|
|
void edit_redraw(filestruct *old_current, size_t pww_save);
|
2002-07-19 01:08:59 +00:00
|
|
|
void edit_refresh(void);
|
2005-08-01 18:27:10 +00:00
|
|
|
void edit_update(update_type location);
|
2005-06-18 15:49:17 +00:00
|
|
|
void total_redraw(void);
|
2004-07-02 14:31:03 +00:00
|
|
|
void total_refresh(void);
|
2002-09-06 20:35:28 +00:00
|
|
|
void display_main_list(void);
|
2004-08-25 15:39:10 +00:00
|
|
|
void do_cursorpos(bool constant);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_cursorpos_void(void);
|
2005-06-30 03:55:55 +00:00
|
|
|
void do_replace_highlight(bool highlight, const char *word);
|
2008-03-05 07:34:01 +00:00
|
|
|
void xon_complaint(void);
|
|
|
|
void xoff_complaint(void);
|
2008-03-13 08:23:52 +00:00
|
|
|
void do_suspend_void(void);
|
2009-01-24 22:40:41 +00:00
|
|
|
void enable_nodelay(void);
|
|
|
|
void disable_nodelay(void);
|
2014-04-03 20:57:44 +00:00
|
|
|
#ifndef DISABLE_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
|
|
|
|
2014-04-08 18:38:45 +00:00
|
|
|
/* May as well throw these here, since they are just placeholders. */
|
2011-02-07 14:45:56 +00:00
|
|
|
void do_cancel(void);
|
2014-02-24 10:18:15 +00:00
|
|
|
void do_page_up(void);
|
|
|
|
void do_page_down(void);
|
2011-02-07 14:45:56 +00:00
|
|
|
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);
|
|
|
|
void new_buffer_void(void);
|
|
|
|
void backwards_void(void);
|
|
|
|
void goto_dir_void(void);
|
2014-06-23 18:30:35 +00:00
|
|
|
void flip_replace_void(void);
|
2014-06-04 19:15:16 +00:00
|
|
|
void flip_execute_void(void);
|
2011-02-07 14:45:56 +00:00
|
|
|
|
2005-04-15 18:07:26 +00:00
|
|
|
#endif /* !PROTO_H */
|