2000-08-06 21:13:45 +00:00
|
|
|
/* $Id$ */
|
2000-06-06 05:53:49 +00:00
|
|
|
/**************************************************************************
|
|
|
|
* proto.h *
|
|
|
|
* *
|
2005-01-01 07:28:15 +00:00
|
|
|
* Copyright (C) 1999-2005 Chris Allegretta *
|
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 *
|
2001-10-24 11:33:54 +00:00
|
|
|
* the Free Software Foundation; either version 2, 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
|
|
|
|
|
2004-01-09 23:04:55 +00:00
|
|
|
/* Externs. */
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-07-17 19:49:12 +00:00
|
|
|
#include <sys/types.h>
|
2004-11-04 03:53:11 +00:00
|
|
|
#include <sys/stat.h>
|
2005-02-14 05:00:15 +00:00
|
|
|
#include <dirent.h>
|
2000-09-06 13:39:17 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2000-07-07 01:49:52 +00:00
|
|
|
#include <regex.h>
|
2000-09-06 13:39:17 +00:00
|
|
|
#endif
|
2000-06-06 05:53:49 +00:00
|
|
|
#include "nano.h"
|
|
|
|
|
2003-10-03 20:26:25 +00:00
|
|
|
#ifndef DISABLE_WRAPJUSTIFY
|
2004-07-12 16:07:14 +00:00
|
|
|
extern ssize_t wrap_at;
|
2003-10-03 20:26:25 +00:00
|
|
|
#endif
|
2001-01-20 21:40:07 +00:00
|
|
|
extern int editwinrows;
|
2005-07-13 20:18:46 +00:00
|
|
|
extern long flags;
|
2004-07-12 16:07:14 +00:00
|
|
|
extern ssize_t tabsize;
|
2001-04-12 03:01:53 +00:00
|
|
|
extern int currslen;
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2004-05-29 16:47:52 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
|
|
|
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
|
|
|
|
|
2002-03-03 22:36:36 +00:00
|
|
|
#ifndef DISABLE_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
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
extern regex_t quotereg;
|
|
|
|
extern int quoterc;
|
|
|
|
extern char *quoteerr;
|
|
|
|
#else
|
|
|
|
extern size_t quotelen;
|
|
|
|
#endif
|
2002-03-03 22:36:36 +00:00
|
|
|
#endif
|
|
|
|
|
2004-02-28 16:24:31 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
extern char *backup_dir;
|
|
|
|
#endif
|
|
|
|
|
2004-05-18 01:20:36 +00:00
|
|
|
extern WINDOW *topwin, *edit, *bottomwin;
|
2000-11-02 04:40:39 +00:00
|
|
|
extern char *answer;
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
extern char *help_text;
|
|
|
|
#endif
|
2000-11-05 16:52:21 +00:00
|
|
|
extern char *last_search;
|
|
|
|
extern char *last_replace;
|
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
|
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
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
extern struct stat fileinfo;
|
2002-12-22 16:30:00 +00:00
|
|
|
extern filestruct *cutbuffer;
|
2004-11-23 04:08:28 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
|
|
|
extern filestruct *jusbuffer;
|
|
|
|
#endif
|
2004-11-03 22:03:41 +00:00
|
|
|
extern partition *filepart;
|
2001-07-11 02:08:33 +00:00
|
|
|
|
2005-07-08 19:57:25 +00:00
|
|
|
extern openfilestruct *openfile;
|
2001-07-11 02:08:33 +00:00
|
|
|
|
2001-11-29 02:42:27 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2002-05-04 03:47:33 +00:00
|
|
|
extern syntaxtype *syntaxes;
|
2002-05-04 04:23:30 +00:00
|
|
|
extern char *syntaxstr;
|
2001-11-29 02:42:27 +00:00
|
|
|
#endif
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
extern shortcut *shortcut_list;
|
2002-02-15 19:17:02 +00:00
|
|
|
extern shortcut *main_list, *whereis_list;
|
2004-09-30 22:07:21 +00:00
|
|
|
extern shortcut *replace_list, *gotoline_list;
|
2002-02-15 19:17:02 +00:00
|
|
|
extern shortcut *writefile_list, *insertfile_list;
|
2003-02-05 02:51:19 +00:00
|
|
|
extern shortcut *replace_list_2;
|
2002-04-06 05:02:14 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
extern shortcut *extcmd_list;
|
|
|
|
#endif
|
2003-02-05 02:51:19 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2002-02-15 19:17:02 +00:00
|
|
|
extern shortcut *help_list;
|
2003-02-05 02:51:19 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
extern shortcut *spell_list;
|
|
|
|
#endif
|
2001-01-12 07:51:05 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2002-02-15 19:17:02 +00:00
|
|
|
extern shortcut *browser_list, *gotodir_list;
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2003-02-05 02:51:19 +00:00
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
extern const shortcut *currshortcut;
|
2000-09-06 13:39:17 +00:00
|
|
|
|
|
|
|
#ifdef HAVE_REGEX_H
|
2000-07-07 01:49:52 +00:00
|
|
|
extern regex_t search_regexp;
|
2004-05-27 18:39:16 +00:00
|
|
|
extern regmatch_t regmatches[10];
|
2002-03-24 23:19:32 +00:00
|
|
|
#ifdef ENABLE_COLOR
|
2002-05-04 03:47:33 +00:00
|
|
|
extern regex_t syntaxfile_regexp;
|
2004-05-27 18:39:16 +00:00
|
|
|
extern regmatch_t synfilematches[1];
|
2002-04-06 05:02:14 +00:00
|
|
|
#endif /* ENABLE_COLOR */
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif /* HAVE_REGEX_H */
|
2000-09-06 13:39:17 +00:00
|
|
|
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-02-15 19:17:02 +00:00
|
|
|
extern toggle *toggles;
|
2002-05-12 19:52:15 +00:00
|
|
|
#endif
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2003-01-05 20:41:21 +00:00
|
|
|
#ifndef NANO_SMALL
|
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;
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
|
|
|
|
2004-08-12 04:30:22 +00:00
|
|
|
extern bool curses_ended;
|
2003-02-03 03:32:08 +00:00
|
|
|
|
2004-08-17 05:23:38 +00:00
|
|
|
extern char *homedir;
|
|
|
|
|
2005-06-21 04:16:12 +00:00
|
|
|
/* The functions we want available. */
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2005-01-12 03:25:57 +00:00
|
|
|
/* Public functions in chars.c. */
|
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-06-22 02:31:12 +00:00
|
|
|
#if !defined(HAVE_ISWBLANK) && defined(NANO_WIDE)
|
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);
|
2005-02-08 20:37:53 +00:00
|
|
|
bool is_cntrl_char(int c);
|
2005-01-12 03:25:57 +00:00
|
|
|
#ifdef NANO_WIDE
|
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-01-12 03:25:57 +00:00
|
|
|
#ifdef NANO_WIDE
|
|
|
|
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-01-12 03:25:57 +00:00
|
|
|
int mbwidth(const char *c);
|
|
|
|
int mb_cur_max(void);
|
2005-03-14 18:47:21 +00:00
|
|
|
char *make_mbchar(int chr, int *chr_mb_len);
|
2005-02-11 20:09:11 +00:00
|
|
|
int parse_mbchar(const char *buf, char *chr, bool *bad_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
|
|
|
|
const char *nstrcasestr(const char *haystack, const char *needle);
|
|
|
|
#endif
|
2005-01-22 18:24:16 +00:00
|
|
|
const char *mbstrcasestr(const char *haystack, const char *needle);
|
2005-06-15 06:30:05 +00:00
|
|
|
#if !defined(NANO_SMALL) || !defined(DISABLE_TABCOMP)
|
2005-01-16 18:49:19 +00:00
|
|
|
const char *revstrstr(const char *haystack, const char *needle, const
|
|
|
|
char *rev_start);
|
2005-06-13 13:25:36 +00:00
|
|
|
#endif
|
2005-06-15 06:30:05 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-01-22 20:49:14 +00:00
|
|
|
const char *revstrcasestr(const char *haystack, const char *needle,
|
|
|
|
const char *rev_start);
|
2005-01-24 01:14:17 +00:00
|
|
|
const 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);
|
2005-03-15 05:44:03 +00:00
|
|
|
#ifndef DISABLE_JUSTIFY
|
2005-06-14 01:55:56 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
|
|
|
bool has_blank_chars(const char *s);
|
|
|
|
bool has_blank_mbchars(const char *s);
|
|
|
|
#endif
|
2005-03-15 05:44:03 +00:00
|
|
|
char *mbstrchr(const char *s, char *c);
|
|
|
|
#endif
|
2005-06-14 23:36:13 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
|
|
|
bool is_valid_mbstring(const char *s);
|
|
|
|
#endif
|
2005-01-12 03:25:57 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in color.c. */
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifdef ENABLE_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);
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif /* ENABLE_COLOR */
|
2002-04-23 10:56:06 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in cut.c. */
|
2004-05-29 15:36:58 +00:00
|
|
|
void cutbuffer_reset(void);
|
2004-11-23 04:08:28 +00:00
|
|
|
void cut_line(void);
|
2004-11-07 15:29:40 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-11-23 04:08:28 +00:00
|
|
|
void cut_marked(void);
|
|
|
|
void cut_to_eol(void);
|
2005-03-26 22:49:46 +00:00
|
|
|
#endif
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_cut_text(void);
|
2005-01-01 07:43:32 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
void do_cut_till_end(void);
|
|
|
|
#endif
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_uncut_text(void);
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in files.c. */
|
2005-07-08 02:47:05 +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 20:09:16 +00:00
|
|
|
void make_new_buffer(void);
|
2005-07-10 02:37:38 +00:00
|
|
|
void initialize_buffer(void);
|
|
|
|
#ifndef DISABLE_SPELLER
|
|
|
|
void reinitialize_buffer(void);
|
|
|
|
#endif
|
2005-07-08 20:09:16 +00:00
|
|
|
void open_buffer(const char *filename);
|
2005-07-12 23:06:22 +00:00
|
|
|
void display_buffer(void);
|
2005-07-08 20:09:16 +00:00
|
|
|
#ifdef ENABLE_MULTIBUFFER
|
|
|
|
void switch_to_prevnext_buffer(bool next);
|
|
|
|
void switch_to_prev_buffer_void(void);
|
|
|
|
void switch_to_next_buffer_void(void);
|
|
|
|
bool close_buffer(void);
|
2005-07-08 02:47:05 +00:00
|
|
|
#endif
|
2005-05-16 20:13:09 +00:00
|
|
|
filestruct *read_line(char *buf, filestruct *prevnode, bool
|
2005-06-19 19:57:13 +00:00
|
|
|
*first_line_ins, size_t buf_len);
|
2004-09-05 21:40:31 +00:00
|
|
|
void read_file(FILE *f, const char *filename);
|
|
|
|
int open_file(const char *filename, bool newfie, 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(
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
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
|
2004-02-28 16:24:31 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
void init_backup_dir(void);
|
|
|
|
#endif
|
2004-07-30 03:54:34 +00:00
|
|
|
int copy_file(FILE *inn, FILE *out);
|
2005-05-31 04:28:15 +00:00
|
|
|
int write_file(const char *name, FILE *f_open, bool tmp, int append,
|
|
|
|
bool nonamechange);
|
2004-01-23 19:34:03 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-07-12 20:09:24 +00:00
|
|
|
int write_marked_file(const char *name, FILE *f_open, bool tmp, int
|
|
|
|
append);
|
2004-01-23 19:34:03 +00:00
|
|
|
#endif
|
2004-10-04 15:23:47 +00:00
|
|
|
int do_writeout(bool exiting);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_writeout_void(void);
|
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
|
2005-02-08 20:37:53 +00:00
|
|
|
char **username_tab_completion(const char *buf, size_t *num_matches,
|
|
|
|
size_t buflen);
|
|
|
|
char **cwd_tab_completion(const char *buf, size_t *num_matches, size_t
|
|
|
|
buflen);
|
|
|
|
char *input_tab(char *buf, size_t *place, bool *lastwastab, bool *list);
|
2003-01-13 01:35:15 +00:00
|
|
|
#endif
|
2004-02-28 16:24:31 +00:00
|
|
|
const char *tail(const char *foo);
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef DISABLE_BROWSER
|
2005-02-14 05:00:15 +00:00
|
|
|
void striponedir(char *path);
|
|
|
|
char **browser_init(const char *path, int *longest, size_t *numents, DIR
|
|
|
|
*dir);
|
|
|
|
char *do_browser(char *path, DIR *dir);
|
2002-09-13 18:14:04 +00:00
|
|
|
char *do_browse_from(const char *inpath);
|
2002-07-19 01:08:59 +00:00
|
|
|
#endif
|
2004-08-11 05:13:08 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
|
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);
|
|
|
|
#endif
|
2002-04-10 02:31:20 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in global.c. */
|
2004-07-01 18:59:52 +00:00
|
|
|
size_t length_of_list(const shortcut *s);
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-07-07 14:36:44 +00:00
|
|
|
void toggle_init_one(int val, const char *desc, long flag);
|
2002-09-06 20:35:28 +00:00
|
|
|
void toggle_init(void);
|
|
|
|
#endif
|
2004-07-12 03:10:30 +00:00
|
|
|
void sc_init_one(shortcut **shortcutage, int key, const char *desc,
|
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
const char *help,
|
|
|
|
#endif
|
2005-01-08 06:04:19 +00:00
|
|
|
int metaval, int funcval, int miscval, bool view, void
|
2004-07-12 03:10:30 +00:00
|
|
|
(*func)(void));
|
2004-11-11 21:50:01 +00:00
|
|
|
void shortcut_init(bool unjustify);
|
2004-07-12 03:10:30 +00:00
|
|
|
void free_shortcutage(shortcut **shortcutage);
|
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
|
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in move.c. */
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_first_line(void);
|
|
|
|
void do_last_line(void);
|
|
|
|
void do_home(void);
|
|
|
|
void do_end(void);
|
|
|
|
void do_page_up(void);
|
|
|
|
void do_page_down(void);
|
|
|
|
void do_up(void);
|
|
|
|
void do_down(void);
|
2004-12-31 04:10:28 +00:00
|
|
|
void do_left(bool allow_update);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_left_void(void);
|
2004-12-31 04:10:28 +00:00
|
|
|
void do_right(bool allow_update);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_right_void(void);
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in nano.c. */
|
2002-09-06 20:35:28 +00:00
|
|
|
filestruct *make_new_node(filestruct *prevnode);
|
|
|
|
filestruct *copy_node(const filestruct *src);
|
2004-07-08 17:15:10 +00:00
|
|
|
void splice_node(filestruct *begin, filestruct *newnode, filestruct
|
|
|
|
*end);
|
2002-09-06 20:35:28 +00:00
|
|
|
void unlink_node(const filestruct *fileptr);
|
|
|
|
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);
|
|
|
|
void copy_from_filestruct(filestruct *file_top, filestruct *file_bot);
|
2005-07-08 02:47:05 +00:00
|
|
|
void print_view_warning(void);
|
|
|
|
void finish(void);
|
|
|
|
void die(const char *msg, ...);
|
|
|
|
void die_save_file(const char *die_filename);
|
|
|
|
void check_die_too_small(void);
|
2005-07-10 02:37:38 +00:00
|
|
|
void window_size_init(void);
|
2005-07-08 02:47:05 +00:00
|
|
|
void window_init(void);
|
|
|
|
#ifndef DISABLE_MOUSE
|
|
|
|
void mouse_init(void);
|
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_HELP
|
|
|
|
void help_init(void);
|
|
|
|
#endif
|
2005-03-21 07:24:47 +00:00
|
|
|
void print1opt_full(const char *shortflag
|
|
|
|
#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);
|
2005-01-17 05:06:55 +00:00
|
|
|
int no_more_space(void);
|
2002-09-06 20:35:28 +00:00
|
|
|
int no_help(void);
|
2004-07-02 14:31:03 +00:00
|
|
|
void nano_disabled_msg(void);
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-07-09 04:42:47 +00:00
|
|
|
void cancel_command(int signal);
|
|
|
|
bool execute_command(const char *command);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_verbatim_input(void);
|
|
|
|
void do_backspace(void);
|
|
|
|
void do_delete(void);
|
|
|
|
void do_tab(void);
|
|
|
|
void do_enter(void);
|
2003-09-10 20:08:00 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-06-26 19:03:48 +00:00
|
|
|
bool do_next_word(bool allow_punct, bool allow_update);
|
2005-06-12 22:31:03 +00:00
|
|
|
void do_next_word_void(void);
|
2005-06-26 19:03:48 +00:00
|
|
|
bool do_prev_word(bool allow_punct, bool allow_update);
|
|
|
|
void do_prev_word_void(void);
|
2005-06-12 22:31:03 +00:00
|
|
|
void do_word_count(void);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_mark(void);
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef DISABLE_WRAPPING
|
2003-09-10 20:08:00 +00:00
|
|
|
void wrap_reset(void);
|
2005-03-19 21:15:30 +00:00
|
|
|
bool do_wrap(filestruct *line);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_SPELLER
|
2004-08-05 22:10:22 +00:00
|
|
|
bool do_int_spell_fix(const char *word);
|
|
|
|
const char *do_int_speller(const char *tempfile_name);
|
2004-05-23 21:11:14 +00:00
|
|
|
const char *do_alt_speller(char *tempfile_name);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_spell(void);
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif
|
2005-03-19 21:15:30 +00:00
|
|
|
#if !defined(DISABLE_HELP) || !defined(DISABLE_JUSTIFY) || !defined(DISABLE_WRAPPING)
|
|
|
|
ssize_t break_line(const char *line, ssize_t goal, bool newline);
|
2005-03-18 21:29:33 +00:00
|
|
|
#endif
|
2004-08-12 21:43:00 +00:00
|
|
|
#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
|
2002-09-06 20:35:28 +00:00
|
|
|
size_t indent_length(const char *line);
|
|
|
|
#endif
|
|
|
|
#ifndef DISABLE_JUSTIFY
|
2005-03-13 03:28:37 +00:00
|
|
|
void justify_format(filestruct *paragraph, size_t skip);
|
2002-09-06 20:35:28 +00:00
|
|
|
size_t quote_length(const char *line);
|
2004-08-05 22:10:22 +00:00
|
|
|
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
|
2004-05-14 01:17:25 +00:00
|
|
|
*b_line, size_t b_indent);
|
2004-07-30 03:54:34 +00:00
|
|
|
bool begpar(const filestruct *const foo);
|
2005-03-13 21:12:25 +00:00
|
|
|
void do_para_begin(bool allow_update);
|
|
|
|
void do_para_begin_void(void);
|
|
|
|
bool inpar(const filestruct *const foo);
|
|
|
|
void do_para_end(bool allow_update);
|
|
|
|
void do_para_end_void(void);
|
2004-05-14 01:17:25 +00:00
|
|
|
filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
|
|
|
|
quote_len);
|
2005-03-13 21:12:25 +00:00
|
|
|
bool find_paragraph(size_t *const quote, size_t *const par);
|
2004-08-05 22:10:22 +00:00
|
|
|
void do_justify(bool full_justify);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_justify_void(void);
|
|
|
|
void do_full_justify(void);
|
2004-04-30 04:49:02 +00:00
|
|
|
#endif /* !DISABLE_JUSTIFY */
|
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-01-19 19:52:42 +00:00
|
|
|
void handle_hupterm(int signal);
|
|
|
|
void do_suspend(int signal);
|
|
|
|
void do_cont(int signal);
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
2002-07-19 01:08:59 +00:00
|
|
|
void handle_sigwinch(int s);
|
2004-08-05 22:10:22 +00:00
|
|
|
void allow_pending_sigwinch(bool allow);
|
2002-04-10 02:31:20 +00:00
|
|
|
#endif
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
void do_toggle(const toggle *which);
|
|
|
|
#endif
|
2005-06-09 04:02:57 +00:00
|
|
|
void disable_extended_io(void);
|
2004-05-18 01:20:36 +00:00
|
|
|
void disable_signals(void);
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
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);
|
2004-12-04 17:41:52 +00:00
|
|
|
int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
|
2005-01-11 23:05:05 +00:00
|
|
|
*ran_func, bool *finished, bool allow_funcs);
|
2004-12-04 17:41:52 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
|
|
|
bool do_mouse(void);
|
|
|
|
#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
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in rcfile.c. */
|
2001-04-19 21:13:46 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
2002-09-06 20:35:28 +00:00
|
|
|
void rcfile_error(const char *msg, ...);
|
|
|
|
char *parse_next_word(char *ptr);
|
|
|
|
char *parse_argument(char *ptr);
|
|
|
|
#ifdef ENABLE_COLOR
|
2005-07-13 20:18:46 +00:00
|
|
|
int color_to_short(const char *colorname, bool *bright);
|
2002-09-06 20:35:28 +00:00
|
|
|
char *parse_next_regex(char *ptr);
|
2005-03-10 20:55:11 +00:00
|
|
|
bool nregcomp(regex_t *preg, const char *regex, int eflags);
|
2002-09-06 20:35:28 +00:00
|
|
|
void parse_syntax(char *ptr);
|
2005-06-27 03:07:10 +00:00
|
|
|
void parse_colors(char *ptr, bool icase);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif /* ENABLE_COLOR */
|
|
|
|
void parse_rcfile(FILE *rcstream);
|
2001-04-18 04:28:54 +00:00
|
|
|
void do_rcfile(void);
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif /* ENABLE_NANORC */
|
2001-04-18 04:28:54 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in search.c. */
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2003-01-29 04:18:37 +00:00
|
|
|
int 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);
|
|
|
|
void search_abort(void);
|
|
|
|
void search_init_globals(void);
|
2004-10-04 22:37:56 +00:00
|
|
|
int search_init(bool replacing, bool use_answer);
|
2005-02-12 23:09:27 +00:00
|
|
|
bool is_whole_word(size_t pos, const char *buf, const char *word);
|
2004-08-27 20:28:34 +00:00
|
|
|
bool findnextstr(bool can_display_wrap, bool wholeword, bool
|
2005-07-12 17:40:16 +00:00
|
|
|
no_sameline, const filestruct *begin, size_t begin_x, const char
|
2004-10-27 02:21:01 +00:00
|
|
|
*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);
|
2004-05-05 21:36:50 +00:00
|
|
|
#ifndef NANO_SMALL
|
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
|
|
|
void replace_abort(void);
|
|
|
|
#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);
|
2004-11-03 16:02:41 +00:00
|
|
|
ssize_t do_replace_loop(const char *needle, const filestruct
|
|
|
|
*real_current, size_t *real_current_x, bool wholewords, bool
|
|
|
|
*canceled);
|
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-06-28 06:25:34 +00:00
|
|
|
void do_gotopos(ssize_t line, size_t pos_x, ssize_t pos_y, size_t
|
|
|
|
pos_pww);
|
2001-01-03 07:11:47 +00:00
|
|
|
#endif
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-06-16 20:58:19 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
void do_find_bracket(void);
|
|
|
|
#endif
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifdef ENABLE_NANORC
|
2005-05-23 16:30:06 +00:00
|
|
|
bool history_has_changed(void);
|
2005-06-03 19:28:30 +00:00
|
|
|
#endif
|
2003-01-05 20:41:21 +00:00
|
|
|
void history_init(void);
|
2005-06-02 18:41:31 +00:00
|
|
|
filestruct *find_history(filestruct *h_start, filestruct *h_end, const
|
|
|
|
char *s, size_t len);
|
|
|
|
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);
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifndef DISABLE_TABCOMP
|
|
|
|
char *get_history_completion(filestruct **h, char *s, size_t len);
|
|
|
|
#endif
|
2005-06-16 20:58:19 +00:00
|
|
|
#endif /* !NANO_SMALL */
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in utils.c. */
|
2004-02-24 20:41:39 +00:00
|
|
|
#ifdef HAVE_REGEX_H
|
2003-03-11 03:50:40 +00:00
|
|
|
#ifdef BROKEN_REGEXEC
|
2005-03-21 06:33:41 +00:00
|
|
|
int safe_regexec(const regex_t *preg, const char *string, size_t nmatch,
|
2003-03-11 03:50:40 +00:00
|
|
|
regmatch_t pmatch[], int eflags);
|
|
|
|
#endif
|
2004-02-24 20:41:39 +00:00
|
|
|
int regexp_bol_or_eol(const regex_t *preg, const char *string);
|
|
|
|
#endif
|
2005-04-19 16:32:08 +00:00
|
|
|
int digits(size_t n);
|
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);
|
2004-08-17 20:34:57 +00:00
|
|
|
#if !defined(NANO_SMALL) && defined(ENABLE_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
|
2004-08-17 20:34:57 +00:00
|
|
|
#endif /* !NANO_SMALL && ENABLE_NANORC */
|
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);
|
2002-07-19 01:08:59 +00:00
|
|
|
void new_magicline(void);
|
2003-09-16 01:16:49 +00:00
|
|
|
#ifndef NANO_SMALL
|
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);
|
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);
|
2002-07-19 01:08:59 +00:00
|
|
|
|
2004-11-12 00:48:18 +00:00
|
|
|
/* Public functions in winio.c. */
|
2004-05-28 17:23:33 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
void reset_kbinput(void);
|
|
|
|
#endif
|
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);
|
2004-12-04 17:41:52 +00:00
|
|
|
void unget_kbinput(int kbinput, bool meta_key, bool func_key);
|
2005-01-12 03:25:57 +00:00
|
|
|
int *get_input(WINDOW *win, size_t input_len);
|
2004-09-27 01:04:50 +00:00
|
|
|
int get_kbinput(WINDOW *win, bool *meta_key, bool *func_key);
|
2004-12-04 17:41:52 +00:00
|
|
|
int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
|
2004-05-28 17:23:33 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-08-25 15:39:10 +00:00
|
|
|
, bool reset
|
2004-05-28 17:23:33 +00:00
|
|
|
#endif
|
|
|
|
);
|
2005-01-12 03:25:57 +00:00
|
|
|
int get_escape_seq_kbinput(const int *seq, size_t seq_len, bool
|
2004-06-04 18:18:17 +00:00
|
|
|
*ignore_seq);
|
2004-01-23 19:26:17 +00:00
|
|
|
int get_escape_seq_abcd(int kbinput);
|
2005-01-03 19:56:56 +00:00
|
|
|
int get_byte_kbinput(int kbinput
|
|
|
|
#ifndef NANO_SMALL
|
|
|
|
, bool reset
|
|
|
|
#endif
|
|
|
|
);
|
2004-12-04 17:41:52 +00:00
|
|
|
int get_word_kbinput(int kbinput
|
2004-05-28 17:23:33 +00:00
|
|
|
#ifndef NANO_SMALL
|
2004-08-25 15:39:10 +00:00
|
|
|
, bool reset
|
2004-05-28 17:23:33 +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
|
2004-08-25 15:39:10 +00:00
|
|
|
bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
|
|
|
|
#endif
|
2004-11-29 00:30:07 +00:00
|
|
|
const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
|
2004-09-27 01:04:50 +00:00
|
|
|
*meta_key, bool *func_key);
|
2004-08-25 15:39:10 +00:00
|
|
|
#ifndef NANO_SMALL
|
|
|
|
const toggle *get_toggle(int kbinput, bool meta_key);
|
|
|
|
#endif
|
2005-01-01 07:28:15 +00:00
|
|
|
int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
|
2005-01-11 23:05:05 +00:00
|
|
|
bool *ran_func, bool *finished, bool allow_funcs);
|
2005-01-01 07:28:15 +00:00
|
|
|
#ifndef DISABLE_MOUSE
|
|
|
|
bool do_statusbar_mouse(void);
|
|
|
|
#endif
|
|
|
|
void do_statusbar_home(void);
|
|
|
|
void do_statusbar_end(void);
|
|
|
|
void do_statusbar_right(void);
|
|
|
|
void do_statusbar_left(void);
|
|
|
|
void do_statusbar_backspace(void);
|
|
|
|
void do_statusbar_delete(void);
|
|
|
|
void do_statusbar_cut_text(void);
|
2005-01-18 21:25:38 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-06-26 19:03:48 +00:00
|
|
|
bool do_statusbar_next_word(bool allow_punct);
|
|
|
|
bool do_statusbar_prev_word(bool allow_punct);
|
2005-01-18 21:25:38 +00:00
|
|
|
#endif
|
2005-01-02 22:35:31 +00:00
|
|
|
void do_statusbar_verbatim_input(bool *got_enter);
|
2005-01-12 03:25:57 +00:00
|
|
|
void do_statusbar_output(char *output, size_t output_len, bool
|
2005-03-17 03:52:08 +00:00
|
|
|
*got_enter, bool allow_cntrls);
|
2002-09-06 20:35:28 +00:00
|
|
|
size_t xplustabs(void);
|
2003-09-16 01:16:49 +00:00
|
|
|
size_t actual_x(const char *str, size_t xplus);
|
2002-09-06 20:35:28 +00:00
|
|
|
size_t strnlenpt(const char *buf, size_t size);
|
|
|
|
size_t strlenpt(const char *buf);
|
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-09-16 01:16:49 +00:00
|
|
|
void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
|
2005-05-20 02:57:05 +00:00
|
|
|
int nanogetstr(bool allow_tabs, const char *buf, const char *curranswer,
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-06-02 18:41:31 +00:00
|
|
|
filestruct **history_list,
|
2003-01-05 20:41:21 +00:00
|
|
|
#endif
|
2005-05-14 23:14:47 +00:00
|
|
|
const shortcut *s
|
2002-09-06 20:35:28 +00:00
|
|
|
#ifndef DISABLE_TABCOMP
|
2005-05-14 23:14:47 +00:00
|
|
|
, bool *list
|
2002-09-06 20:35:28 +00:00
|
|
|
#endif
|
2005-05-14 23:14:47 +00:00
|
|
|
);
|
2005-05-20 02:57:05 +00:00
|
|
|
int statusq(bool allow_tabs, const shortcut *s, const char *curranswer,
|
2005-06-03 19:28:30 +00:00
|
|
|
#ifndef NANO_SMALL
|
2005-06-02 18:41:31 +00:00
|
|
|
filestruct **history_list,
|
2004-10-05 20:11:31 +00:00
|
|
|
#endif
|
2005-05-14 23:14:47 +00:00
|
|
|
const char *msg, ...);
|
2004-10-05 20:11:31 +00:00
|
|
|
void statusq_abort(void);
|
2003-02-13 22:25:01 +00:00
|
|
|
void titlebar(const char *path);
|
2004-05-18 01:20:36 +00:00
|
|
|
void set_modified(void);
|
|
|
|
void statusbar(const char *msg, ...);
|
2002-09-06 20:35:28 +00:00
|
|
|
void bottombars(const shortcut *s);
|
2004-05-23 21:11:14 +00:00
|
|
|
void onekey(const char *keystroke, const char *desc, size_t len);
|
2003-09-29 05:15:24 +00:00
|
|
|
size_t get_page_start(size_t column);
|
2002-09-06 20:35:28 +00:00
|
|
|
void reset_cursor(void);
|
2004-04-16 05:15:11 +00:00
|
|
|
void edit_add(const filestruct *fileptr, const char *converted, int
|
|
|
|
yval, size_t start);
|
2003-09-16 01:16:49 +00:00
|
|
|
void update_line(const filestruct *fileptr, size_t index);
|
2004-07-28 20:46:25 +00:00
|
|
|
int need_horizontal_update(size_t old_pww);
|
|
|
|
int need_vertical_update(size_t old_pww);
|
2004-05-28 20:44:09 +00:00
|
|
|
void edit_scroll(updown direction, int nlines);
|
2004-07-28 20:46:25 +00:00
|
|
|
void edit_redraw(const filestruct *old_current, size_t old_pww);
|
2002-07-19 01:08:59 +00:00
|
|
|
void edit_refresh(void);
|
2005-07-16 22:47:12 +00:00
|
|
|
void edit_update(centernone location);
|
2004-10-05 20:11:31 +00:00
|
|
|
int do_yesno(bool all, const char *msg);
|
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);
|
2004-07-23 12:30:40 +00:00
|
|
|
#ifndef DISABLE_HELP
|
2005-03-18 21:29:33 +00:00
|
|
|
size_t help_line_len(const char *ptr);
|
2004-07-02 14:31:03 +00:00
|
|
|
void do_help(void);
|
2004-07-23 12:30:40 +00:00
|
|
|
#endif
|
2005-06-30 03:55:55 +00:00
|
|
|
void do_replace_highlight(bool highlight, const char *word);
|
2005-06-05 19:08:59 +00:00
|
|
|
#ifndef NDEBUG
|
|
|
|
int check_linenumbers(const filestruct *fileptr);
|
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifdef DEBUG
|
2005-07-08 20:09:16 +00:00
|
|
|
void dump_filestruct(const filestruct *inptr);
|
|
|
|
void dump_filestruct_reverse(void);
|
2002-04-10 02:31:20 +00:00
|
|
|
#endif
|
2002-07-19 01:08:59 +00:00
|
|
|
#ifdef NANO_EXTRA
|
|
|
|
void do_credits(void);
|
2001-10-22 03:15:31 +00:00
|
|
|
#endif
|
2005-04-15 18:07:26 +00:00
|
|
|
|
|
|
|
#endif /* !PROTO_H */
|