blob: bd6fd72abba10f5739af697cd98ec8ea432f561b [file] [log] [blame]
Chris Allegretta11b00112000-08-06 21:13:45 +00001/* $Id$ */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +00002/**************************************************************************
3 * proto.h *
4 * *
David Lawrence Ramseyc13b7f02005-01-01 07:28:15 +00005 * Copyright (C) 1999-2005 Chris Allegretta *
Chris Allegrettaa2ea1932000-06-06 05:53:49 +00006 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
Chris Allegretta3a24f3f2001-10-24 11:33:54 +00008 * the Free Software Foundation; either version 2, or (at your option) *
Chris Allegrettaa2ea1932000-06-06 05:53:49 +00009 * any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
19 * *
20 **************************************************************************/
21
David Lawrence Ramseyf28f50e2004-01-09 23:04:55 +000022/* Externs. */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000023
David Lawrence Ramseyfd3039a2004-07-17 19:49:12 +000024#include <sys/types.h>
David Lawrence Ramsey84d0d592004-11-04 03:53:11 +000025#include <sys/stat.h>
Chris Allegretta805c26d2000-09-06 13:39:17 +000026#ifdef HAVE_REGEX_H
Chris Allegretta9fc8d432000-07-07 01:49:52 +000027#include <regex.h>
Chris Allegretta805c26d2000-09-06 13:39:17 +000028#endif
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000029#include "nano.h"
30
David Lawrence Ramseyf5b256b2003-10-03 20:26:25 +000031#ifndef DISABLE_WRAPJUSTIFY
David Lawrence Ramsey49c3f242004-07-12 16:07:14 +000032extern ssize_t wrap_at;
David Lawrence Ramseyf5b256b2003-10-03 20:26:25 +000033#endif
Chris Allegretta17dcb722001-01-20 21:40:07 +000034extern int editwinrows;
David Lawrence Ramsey7a97e182004-10-30 01:03:15 +000035extern size_t current_x;
36extern int current_y;
37extern int totlines;
David Lawrence Ramsey86e851b2004-07-28 20:46:25 +000038extern size_t placewewant;
David Lawrence Ramsey9b13ff32002-12-22 16:30:00 +000039#ifndef NANO_SMALL
David Lawrence Ramsey687776b2004-10-30 01:16:08 +000040extern size_t mark_beginx;
David Lawrence Ramsey9b13ff32002-12-22 16:30:00 +000041#endif
Chris Allegrettab3655b42001-10-22 03:15:31 +000042extern long totsize;
David Lawrence Ramseyedab0cc2004-07-03 03:09:12 +000043extern long flags;
David Lawrence Ramsey49c3f242004-07-12 16:07:14 +000044extern ssize_t tabsize;
Chris Allegretta6b58acd2001-04-12 03:01:53 +000045extern int currslen;
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000046
David Lawrence Ramsey89bb9372004-05-29 16:47:52 +000047#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
48extern char *whitespace;
49#endif
50
Chris Allegrettae4f940d2002-03-03 22:36:36 +000051#ifndef DISABLE_JUSTIFY
David Lawrence Ramsey2c62b072004-05-29 16:38:57 +000052extern char *punct;
53extern char *brackets;
Chris Allegretta45329a12002-03-10 01:22:21 +000054extern char *quotestr;
David Lawrence Ramsey819c7f02004-07-30 03:54:34 +000055#ifdef HAVE_REGEX_H
56extern regex_t quotereg;
57extern int quoterc;
58extern char *quoteerr;
59#else
60extern size_t quotelen;
61#endif
Chris Allegrettae4f940d2002-03-03 22:36:36 +000062#endif
63
David Lawrence Ramsey04e42a62004-02-28 16:24:31 +000064#ifndef NANO_SMALL
65extern char *backup_dir;
66#endif
67
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +000068extern WINDOW *topwin, *edit, *bottomwin;
Chris Allegretta1a6e9042000-12-14 13:56:28 +000069extern char *filename;
David Lawrence Ramsey5db0cdc2002-06-28 22:45:14 +000070extern struct stat originalfilestat;
Chris Allegretta31925e42000-11-02 04:40:39 +000071extern char *answer;
Chris Allegretta6df90f52002-07-19 01:08:59 +000072extern char *hblank;
73#ifndef DISABLE_HELP
74extern char *help_text;
75#endif
Chris Allegretta27eb13f2000-11-05 16:52:21 +000076extern char *last_search;
77extern char *last_replace;
Chris Allegrettae1f14522001-09-19 03:19:43 +000078#ifndef DISABLE_OPERATINGDIR
79extern char *operating_dir;
Chris Allegrettaf5de33a2002-02-27 04:14:16 +000080extern char *full_operating_dir;
Chris Allegrettae1f14522001-09-19 03:19:43 +000081#endif
Chris Allegretta8d8e0122001-04-18 04:28:54 +000082#ifndef DISABLE_SPELLER
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +000083extern char *alt_speller;
Chris Allegretta6df90f52002-07-19 01:08:59 +000084#endif
85
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000086extern struct stat fileinfo;
David Lawrence Ramseyb9775152004-03-19 02:15:42 +000087extern filestruct *current, *fileage, *edittop, *filebot;
David Lawrence Ramsey9b13ff32002-12-22 16:30:00 +000088extern filestruct *cutbuffer;
David Lawrence Ramsey93c84052004-11-23 04:08:28 +000089#ifndef DISABLE_JUSTIFY
90extern filestruct *jusbuffer;
91#endif
David Lawrence Ramsey40bdb682004-11-03 22:03:41 +000092extern partition *filepart;
David Lawrence Ramseyb73c0c02004-11-05 15:25:53 +000093#ifndef NANO_SMALL
David Lawrence Ramsey9b13ff32002-12-22 16:30:00 +000094extern filestruct *mark_beginbuf;
95#endif
Chris Allegretta2d7893d2001-07-11 02:08:33 +000096
Chris Allegretta355fbe52001-07-14 19:32:47 +000097#ifdef ENABLE_MULTIBUFFER
Chris Allegrettaf2387fb2002-04-10 02:31:20 +000098extern openfilestruct *open_files;
Chris Allegretta2d7893d2001-07-11 02:08:33 +000099#endif
100
Chris Allegretta08893e02001-11-29 02:42:27 +0000101#ifdef ENABLE_COLOR
David Lawrence Ramsey1f28b8f2002-09-27 14:21:59 +0000102extern const colortype *colorstrings;
Chris Allegrettab6c5dc22002-05-04 03:47:33 +0000103extern syntaxtype *syntaxes;
Chris Allegretta09900ff2002-05-04 04:23:30 +0000104extern char *syntaxstr;
Chris Allegretta08893e02001-11-29 02:42:27 +0000105#endif
106
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000107extern shortcut *shortcut_list;
Chris Allegrettaa8c22572002-02-15 19:17:02 +0000108extern shortcut *main_list, *whereis_list;
David Lawrence Ramseye5d8f322004-09-30 22:07:21 +0000109extern shortcut *replace_list, *gotoline_list;
Chris Allegrettaa8c22572002-02-15 19:17:02 +0000110extern shortcut *writefile_list, *insertfile_list;
Chris Allegretta201f1d92003-02-05 02:51:19 +0000111extern shortcut *replace_list_2;
Chris Allegretta7162e3d2002-04-06 05:02:14 +0000112#ifndef NANO_SMALL
113extern shortcut *extcmd_list;
114#endif
Chris Allegretta201f1d92003-02-05 02:51:19 +0000115#ifndef DISABLE_HELP
Chris Allegrettaa8c22572002-02-15 19:17:02 +0000116extern shortcut *help_list;
Chris Allegretta201f1d92003-02-05 02:51:19 +0000117#endif
118#ifndef DISABLE_SPELLER
119extern shortcut *spell_list;
120#endif
Rocco Corsiaf5c3022001-01-12 07:51:05 +0000121#ifndef DISABLE_BROWSER
Chris Allegrettaa8c22572002-02-15 19:17:02 +0000122extern shortcut *browser_list, *gotodir_list;
Chris Allegrettaf4b96012001-01-03 07:11:47 +0000123#endif
Chris Allegretta201f1d92003-02-05 02:51:19 +0000124
Chris Allegretta6df90f52002-07-19 01:08:59 +0000125extern const shortcut *currshortcut;
Chris Allegretta805c26d2000-09-06 13:39:17 +0000126
127#ifdef HAVE_REGEX_H
Chris Allegretta9fc8d432000-07-07 01:49:52 +0000128extern regex_t search_regexp;
David Lawrence Ramseyc3724882004-05-27 18:39:16 +0000129extern regmatch_t regmatches[10];
Chris Allegretta3533a342002-03-24 23:19:32 +0000130#ifdef ENABLE_COLOR
Chris Allegrettab6c5dc22002-05-04 03:47:33 +0000131extern regex_t syntaxfile_regexp;
David Lawrence Ramseyc3724882004-05-27 18:39:16 +0000132extern regmatch_t synfilematches[1];
Chris Allegretta7162e3d2002-04-06 05:02:14 +0000133#endif /* ENABLE_COLOR */
Chris Allegretta6df90f52002-07-19 01:08:59 +0000134#endif /* HAVE_REGEX_H */
135
136#ifndef NANO_SMALL
137extern toggle *toggles;
Chris Allegretta805c26d2000-09-06 13:39:17 +0000138#endif
139
Chris Allegretta5beed502003-01-05 20:41:21 +0000140#ifndef NANO_SMALL
141extern historyheadtype search_history;
142extern historyheadtype replace_history;
143#endif
144
David Lawrence Ramsey76356bd2004-08-12 04:30:22 +0000145extern bool curses_ended;
Chris Allegrettaa0d89972003-02-03 03:32:08 +0000146
David Lawrence Ramseya27bd652004-08-17 05:23:38 +0000147#ifdef ENABLE_NANORC
148extern char *homedir;
149#endif
150
David Lawrence Ramseyf28f50e2004-01-09 23:04:55 +0000151/* Functions we want available. */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000152
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000153/* Public functions in color.c. */
Chris Allegretta6df90f52002-07-19 01:08:59 +0000154#ifdef ENABLE_COLOR
David Lawrence Ramsey1f28b8f2002-09-27 14:21:59 +0000155void set_colorpairs(void);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000156void do_colorinit(void);
157void update_color(void);
158#endif /* ENABLE_COLOR */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000159
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000160/* Public functions in cut.c. */
David Lawrence Ramseyc833d9e2004-05-29 15:36:58 +0000161void cutbuffer_reset(void);
David Lawrence Ramsey93c84052004-11-23 04:08:28 +0000162void cut_line(void);
David Lawrence Ramsey50af6ea2004-11-07 15:29:40 +0000163#ifndef NANO_SMALL
David Lawrence Ramsey93c84052004-11-23 04:08:28 +0000164void cut_marked(void);
David Lawrence Ramsey50af6ea2004-11-07 15:29:40 +0000165#endif
David Lawrence Ramsey93c84052004-11-23 04:08:28 +0000166void cut_to_eol(void);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000167void do_cut_text(void);
David Lawrence Ramsey295d1722005-01-01 07:43:32 +0000168#ifndef NANO_SMALL
169void do_cut_till_end(void);
170#endif
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000171void do_uncut_text(void);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000172
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000173/* Public functions in files.c. */
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000174void new_file(void);
David Lawrence Ramsey02517e02004-09-05 21:40:31 +0000175filestruct *read_line(char *buf, filestruct *prev, bool *first_line_ins,
176 size_t len);
177void load_file(void);
178void read_file(FILE *f, const char *filename);
179int open_file(const char *filename, bool newfie, FILE **f);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000180char *get_next_filename(const char *name);
David Lawrence Ramsey02517e02004-09-05 21:40:31 +0000181#ifndef NANO_SMALL
182void execute_command(const char *command);
183#endif
184void load_buffer(const char *name);
David Lawrence Ramseybe908f62004-10-01 18:34:30 +0000185void do_insertfile(
186#ifndef NANO_SMALL
187 bool execute
188#else
189 void
190#endif
191 );
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000192void do_insertfile_void(void);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000193#ifdef ENABLE_MULTIBUFFER
David Lawrence Ramsey5b3dd0f2004-11-25 04:39:07 +0000194openfilestruct *make_new_opennode(void);
David Lawrence Ramseyf7080372004-07-08 17:15:10 +0000195void splice_opennode(openfilestruct *begin, openfilestruct *newnode,
196 openfilestruct *end);
David Lawrence Ramsey5b3dd0f2004-11-25 04:39:07 +0000197void unlink_opennode(openfilestruct *fileptr);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000198void delete_opennode(openfilestruct *fileptr);
David Lawrence Ramsey5b3dd0f2004-11-25 04:39:07 +0000199#ifdef DEBUG
Chris Allegretta6df90f52002-07-19 01:08:59 +0000200void free_openfilestruct(openfilestruct *src);
David Lawrence Ramsey5b3dd0f2004-11-25 04:39:07 +0000201#endif
David Lawrence Ramsey3e189a82004-10-03 19:18:48 +0000202void add_open_file(bool update);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000203void load_open_file(void);
David Lawrence Ramsey5b3dd0f2004-11-25 04:39:07 +0000204void open_prevnext_file(bool next);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000205void open_prevfile_void(void);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000206void open_nextfile_void(void);
David Lawrence Ramsey3e189a82004-10-03 19:18:48 +0000207bool close_open_file(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000208#endif
209#if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR)
David Lawrence Ramseye21adfa2002-09-13 18:14:04 +0000210char *get_full_path(const char *origpath);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000211#endif
212#ifndef DISABLE_SPELLER
David Lawrence Ramseye21adfa2002-09-13 18:14:04 +0000213char *check_writable_directory(const char *path);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000214char *safe_tempnam(const char *dirname, const char *filename_prefix);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000215#endif
216#ifndef DISABLE_OPERATINGDIR
David Lawrence Ramseye21adfa2002-09-13 18:14:04 +0000217void init_operating_dir(void);
David Lawrence Ramsey3e819142004-12-31 04:10:28 +0000218int check_operating_dir(const char *currpath, bool allow_tabcomp);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000219#endif
David Lawrence Ramsey04e42a62004-02-28 16:24:31 +0000220#ifndef NANO_SMALL
221void init_backup_dir(void);
222#endif
David Lawrence Ramsey819c7f02004-07-30 03:54:34 +0000223int copy_file(FILE *inn, FILE *out);
David Lawrence Ramsey8c16bac2004-11-06 15:10:57 +0000224int write_file(const char *name, bool tmp, int append, bool
225 nonamechange);
David Lawrence Ramsey35961c42004-01-23 19:34:03 +0000226#ifndef NANO_SMALL
David Lawrence Ramsey8c16bac2004-11-06 15:10:57 +0000227int write_marked(const char *name, bool tmp, int append);
David Lawrence Ramsey35961c42004-01-23 19:34:03 +0000228#endif
David Lawrence Ramsey951d7142004-10-04 15:23:47 +0000229int do_writeout(bool exiting);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000230void do_writeout_void(void);
David Lawrence Ramseye21adfa2002-09-13 18:14:04 +0000231char *real_dir_from_tilde(const char *buf);
Chris Allegretta7662c862003-01-13 01:35:15 +0000232#ifndef DISABLE_TABCOMP
David Lawrence Ramsey4d44d2d2004-08-01 22:35:31 +0000233int append_slash_if_dir(char *buf, bool *lastwastab, int *place);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000234char **username_tab_completion(char *buf, int *num_matches);
235char **cwd_tab_completion(char *buf, int *num_matches);
David Lawrence Ramsey4d44d2d2004-08-01 22:35:31 +0000236char *input_tab(char *buf, int place, bool *lastwastab, int *newplace,
237 bool *list);
Chris Allegretta7662c862003-01-13 01:35:15 +0000238#endif
David Lawrence Ramsey04e42a62004-02-28 16:24:31 +0000239const char *tail(const char *foo);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000240#ifndef DISABLE_BROWSER
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000241int diralphasort(const void *va, const void *vb);
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +0000242void free_charptrarray(char **array, size_t len);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000243void striponedir(char *foo);
Chris Allegretta858d9d92003-01-30 00:53:32 +0000244int readable_dir(const char *path);
David Lawrence Ramseye21adfa2002-09-13 18:14:04 +0000245char **browser_init(const char *path, int *longest, int *numents);
246char *do_browser(const char *inpath);
247char *do_browse_from(const char *inpath);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000248#endif
David Lawrence Ramsey6420d442004-08-11 05:13:08 +0000249#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
David Lawrence Ramseya27bd652004-08-17 05:23:38 +0000250char *histfilename(void);
David Lawrence Ramsey6420d442004-08-11 05:13:08 +0000251void load_history(void);
David Lawrence Ramseya27bd652004-08-17 05:23:38 +0000252bool writehist(FILE *hist, historyheadtype *histhead);
David Lawrence Ramsey6420d442004-08-11 05:13:08 +0000253void save_history(void);
254#endif
Chris Allegretta6df90f52002-07-19 01:08:59 +0000255
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000256/* Public functions in global.c. */
David Lawrence Ramseyebd0d7c2004-07-01 18:59:52 +0000257size_t length_of_list(const shortcut *s);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000258#ifndef NANO_SMALL
David Lawrence Ramsey2ad32092004-07-07 14:36:44 +0000259void toggle_init_one(int val, const char *desc, long flag);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000260void toggle_init(void);
261#ifdef DEBUG
262void free_toggles(void);
263#endif
264#endif
David Lawrence Ramsey576bf332004-07-12 03:10:30 +0000265void sc_init_one(shortcut **shortcutage, int key, const char *desc,
266#ifndef DISABLE_HELP
267 const char *help,
268#endif
269 int metaval, int funcval, int miscval, int view, void
270 (*func)(void));
David Lawrence Ramsey1f1ebb82004-11-11 21:50:01 +0000271void shortcut_init(bool unjustify);
David Lawrence Ramsey576bf332004-07-12 03:10:30 +0000272void free_shortcutage(shortcut **shortcutage);
Chris Allegretta6232d662002-05-12 19:52:15 +0000273#ifdef DEBUG
Chris Allegrettadab017e2002-04-23 10:56:06 +0000274void thanks_for_all_the_fish(void);
Chris Allegretta6232d662002-05-12 19:52:15 +0000275#endif
Chris Allegrettadab017e2002-04-23 10:56:06 +0000276
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000277/* Public functions in move.c. */
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000278void do_first_line(void);
279void do_last_line(void);
280void do_home(void);
281void do_end(void);
282void do_page_up(void);
283void do_page_down(void);
284void do_up(void);
285void do_down(void);
David Lawrence Ramsey3e819142004-12-31 04:10:28 +0000286void do_left(bool allow_update);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000287void do_left_void(void);
David Lawrence Ramsey3e819142004-12-31 04:10:28 +0000288void do_right(bool allow_update);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000289void do_right_void(void);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000290
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000291/* Public functions in nano.c. */
David Lawrence Ramseyda141062004-05-25 19:41:11 +0000292void finish(void);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000293void die(const char *msg, ...);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000294void die_save_file(const char *die_filename);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000295void die_too_small(void);
296void print_view_warning(void);
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000297void global_init(bool save_cutbuffer);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000298void window_init(void);
David Lawrence Ramseyf5b256b2003-10-03 20:26:25 +0000299#ifndef DISABLE_MOUSE
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000300void mouse_init(void);
David Lawrence Ramsey9b13ff32002-12-22 16:30:00 +0000301#endif
Chris Allegretta6df90f52002-07-19 01:08:59 +0000302#ifndef DISABLE_HELP
303void help_init(void);
Chris Allegrettaf2387fb2002-04-10 02:31:20 +0000304#endif
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000305filestruct *make_new_node(filestruct *prevnode);
306filestruct *copy_node(const filestruct *src);
David Lawrence Ramseyf7080372004-07-08 17:15:10 +0000307void splice_node(filestruct *begin, filestruct *newnode, filestruct
308 *end);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000309void unlink_node(const filestruct *fileptr);
310void delete_node(filestruct *fileptr);
311filestruct *copy_filestruct(const filestruct *src);
312void free_filestruct(filestruct *src);
David Lawrence Ramsey40bdb682004-11-03 22:03:41 +0000313partition *partition_filestruct(filestruct *top, size_t top_x,
314 filestruct *bot, size_t bot_x);
David Lawrence Ramsey74d87072004-11-22 00:16:23 +0000315void unpartition_filestruct(partition **p);
David Lawrence Ramsey93c84052004-11-23 04:08:28 +0000316void move_to_filestruct(filestruct **file_top, filestruct **file_bot,
317 filestruct *top, size_t top_x, filestruct *bot, size_t bot_x);
318void copy_from_filestruct(filestruct *file_top, filestruct *file_bot);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000319void renumber_all(void);
320void renumber(filestruct *fileptr);
David Lawrence Ramseyf7080372004-07-08 17:15:10 +0000321void print1opt(const char *shortflag, const char *longflag, const char
322 *desc);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000323void usage(void);
324void version(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000325int no_help(void);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000326void nano_disabled_msg(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000327#ifndef NANO_SMALL
328RETSIGTYPE cancel_fork(int signal);
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000329bool open_pipe(const char *command);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000330#endif
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000331void do_verbatim_input(void);
332void do_backspace(void);
333void do_delete(void);
334void do_tab(void);
335void do_enter(void);
David Lawrence Ramseyc97acfb2003-09-10 20:08:00 +0000336#ifndef NANO_SMALL
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000337void do_next_word(void);
338void do_prev_word(void);
339void do_mark(void);
David Lawrence Ramseyd893fa92004-04-30 04:49:02 +0000340#endif
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000341#ifndef DISABLE_WRAPPING
David Lawrence Ramseyc97acfb2003-09-10 20:08:00 +0000342void wrap_reset(void);
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000343bool do_wrap(filestruct *inptr);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000344#endif
345#ifndef DISABLE_SPELLER
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000346bool do_int_spell_fix(const char *word);
347const char *do_int_speller(const char *tempfile_name);
David Lawrence Ramseyfa394042004-05-23 21:11:14 +0000348const char *do_alt_speller(char *tempfile_name);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000349void do_spell(void);
David Lawrence Ramseyd893fa92004-04-30 04:49:02 +0000350#endif
David Lawrence Ramseybb50b302004-08-12 21:43:00 +0000351#if !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY)
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000352size_t indent_length(const char *line);
353#endif
354#ifndef DISABLE_JUSTIFY
David Lawrence Ramsey1cadddd2004-05-17 20:32:51 +0000355void justify_format(filestruct *line, size_t skip);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000356size_t quote_length(const char *line);
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000357bool quotes_match(const char *a_line, size_t a_quote, const char
358 *b_line);
359bool indents_match(const char *a_line, size_t a_indent, const char
David Lawrence Ramseyd4693cb2004-05-14 01:17:25 +0000360 *b_line, size_t b_indent);
David Lawrence Ramsey819c7f02004-07-30 03:54:34 +0000361bool begpar(const filestruct *const foo);
362void do_para_begin(void);
363bool inpar(const char *str);
364void do_para_end(void);
David Lawrence Ramseyd4693cb2004-05-14 01:17:25 +0000365filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t
366 quote_len);
David Lawrence Ramseyd08348b2004-09-18 22:02:21 +0000367bool breakable(const char *line, ssize_t goal);
368ssize_t break_line(const char *line, ssize_t goal, bool force);
David Lawrence Ramsey819c7f02004-07-30 03:54:34 +0000369bool do_para_search(size_t *const quote, size_t *const par);
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000370void do_justify(bool full_justify);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000371void do_justify_void(void);
372void do_full_justify(void);
David Lawrence Ramseyd893fa92004-04-30 04:49:02 +0000373#endif /* !DISABLE_JUSTIFY */
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000374void do_exit(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000375void signal_init(void);
David Lawrence Ramsey2ab03f62002-10-17 02:19:31 +0000376RETSIGTYPE handle_hupterm(int signal);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000377RETSIGTYPE do_suspend(int signal);
378RETSIGTYPE do_cont(int signal);
379#ifndef NANO_SMALL
380void handle_sigwinch(int s);
David Lawrence Ramseyce62e822004-08-05 22:10:22 +0000381void allow_pending_sigwinch(bool allow);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000382#endif
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000383#ifndef NANO_SMALL
384void do_toggle(const toggle *which);
385#endif
David Lawrence Ramsey013344c2004-09-22 22:45:08 +0000386void disable_extended_input(void);
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +0000387void disable_signals(void);
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +0000388#ifndef NANO_SMALL
389void enable_signals(void);
390#endif
391void disable_flow_control(void);
392void enable_flow_control(void);
David Lawrence Ramsey8aaf0302004-07-27 16:46:35 +0000393void terminal_init(void);
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000394int do_input(bool *meta_key, bool *func_key, bool *s_or_t, bool
David Lawrence Ramseyc13b7f02005-01-01 07:28:15 +0000395 *finished, bool allow_funcs);
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000396#ifndef DISABLE_MOUSE
397bool do_mouse(void);
398#endif
399void do_output(int *kbinput, size_t kbinput_len);
Chris Allegrettaf2387fb2002-04-10 02:31:20 +0000400
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000401/* Public functions in rcfile.c. */
Chris Allegretta7a500092001-04-19 21:13:46 +0000402#ifdef ENABLE_NANORC
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000403void rcfile_error(const char *msg, ...);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000404char *parse_next_word(char *ptr);
405char *parse_argument(char *ptr);
406#ifdef ENABLE_COLOR
407int colortoint(const char *colorname, int *bright);
408char *parse_next_regex(char *ptr);
David Lawrence Ramseyedab0cc2004-07-03 03:09:12 +0000409int nregcomp(regex_t *preg, const char *regex, int eflags);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000410void parse_syntax(char *ptr);
411void parse_colors(char *ptr);
412#endif /* ENABLE_COLOR */
413void parse_rcfile(FILE *rcstream);
Chris Allegretta8d8e0122001-04-18 04:28:54 +0000414void do_rcfile(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000415#endif /* ENABLE_NANORC */
Chris Allegretta8d8e0122001-04-18 04:28:54 +0000416
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000417/* Public functions in search.c. */
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000418#ifdef HAVE_REGEX_H
Chris Allegretta5d715142003-01-29 04:18:37 +0000419int regexp_init(const char *regexp);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000420void regexp_cleanup(void);
421#endif
422void not_found_msg(const char *str);
423void search_abort(void);
424void search_init_globals(void);
David Lawrence Ramseyd532f192004-10-04 22:37:56 +0000425int search_init(bool replacing, bool use_answer);
David Lawrence Ramseyc5100422004-08-27 20:28:34 +0000426bool is_whole_word(int curr_pos, const char *datastr, const char
David Lawrence Ramsey1044d742004-02-24 20:41:39 +0000427 *searchword);
David Lawrence Ramseyc5100422004-08-27 20:28:34 +0000428bool findnextstr(bool can_display_wrap, bool wholeword, bool
429 no_sameline, const filestruct *begin, size_t beginx, const char
David Lawrence Ramsey77b284a2004-10-27 02:21:01 +0000430 *needle, size_t *needle_len);
David Lawrence Ramseye5e88fd2004-10-31 13:20:30 +0000431void findnextstr_wrap_reset(void);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000432void do_search(void);
David Lawrence Ramsey5aa39832004-05-05 21:36:50 +0000433#ifndef NANO_SMALL
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000434void do_research(void);
David Lawrence Ramsey5aa39832004-05-05 21:36:50 +0000435#endif
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000436void replace_abort(void);
437#ifdef HAVE_REGEX_H
David Lawrence Ramseyc5100422004-08-27 20:28:34 +0000438int replace_regexp(char *string, bool create_flag);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000439#endif
David Lawrence Ramsey1044d742004-02-24 20:41:39 +0000440char *replace_line(const char *needle);
David Lawrence Ramsey182b2c92004-11-03 16:02:41 +0000441ssize_t do_replace_loop(const char *needle, const filestruct
442 *real_current, size_t *real_current_x, bool wholewords, bool
443 *canceled);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000444void do_replace(void);
David Lawrence Ramseyc53ab2a2004-08-04 18:24:53 +0000445void do_gotoline(int line, bool save_pos);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000446void do_gotoline_void(void);
David Lawrence Ramsey02517e02004-09-05 21:40:31 +0000447#if defined(ENABLE_MULTIBUFFER) || !defined(DISABLE_SPELLER)
David Lawrence Ramsey7a97e182004-10-30 01:03:15 +0000448void do_gotopos(int line, size_t pos_x, int pos_y, size_t pos_pww);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000449#endif
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000450void do_find_bracket(void);
Chris Allegretta5beed502003-01-05 20:41:21 +0000451#ifndef NANO_SMALL
452void history_init(void);
David Lawrence Ramsey6420d442004-08-11 05:13:08 +0000453historytype *find_node(historytype *h, const char *s);
Chris Allegretta5beed502003-01-05 20:41:21 +0000454void remove_node(historytype *r);
455void insert_node(historytype *h, const char *s);
David Lawrence Ramsey6420d442004-08-11 05:13:08 +0000456void update_history(historyheadtype *h, const char *s);
Chris Allegretta5beed502003-01-05 20:41:21 +0000457char *get_history_older(historyheadtype *h);
458char *get_history_newer(historyheadtype *h);
459char *get_history_completion(historyheadtype *h, char *s);
David Lawrence Ramsey6420d442004-08-11 05:13:08 +0000460#ifdef DEBUG
Chris Allegretta5beed502003-01-05 20:41:21 +0000461void free_history(historyheadtype *h);
Chris Allegrettaf3de8b52003-01-16 23:44:46 +0000462#endif
Chris Allegretta5beed502003-01-05 20:41:21 +0000463#endif
Chris Allegretta6df90f52002-07-19 01:08:59 +0000464
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000465/* Public functions in utils.c. */
David Lawrence Ramsey1044d742004-02-24 20:41:39 +0000466#ifdef HAVE_REGEX_H
Chris Allegrettad8451932003-03-11 03:50:40 +0000467#ifdef BROKEN_REGEXEC
468int regexec_safe(const regex_t *preg, const char *string, size_t nmatch,
469 regmatch_t pmatch[], int eflags);
470#endif
David Lawrence Ramsey1044d742004-02-24 20:41:39 +0000471int regexp_bol_or_eol(const regex_t *preg, const char *string);
472#endif
David Lawrence Ramsey9830d752004-05-13 17:19:54 +0000473#ifndef HAVE_ISBLANK
474int is_blank_char(int c);
475#endif
Chris Allegrettacf287c82002-07-20 13:57:41 +0000476int is_cntrl_char(int c);
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000477bool is_byte_char(int c);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000478int num_of_digits(int n);
David Lawrence Ramseyfc693212004-12-23 17:43:27 +0000479unsigned char control_rep(unsigned char c);
David Lawrence Ramseyc53ab2a2004-08-04 18:24:53 +0000480bool parse_num(const char *str, ssize_t *val);
David Lawrence Ramseyfc693212004-12-23 17:43:27 +0000481int parse_char(const char *str, int *chr, size_t *col
482#ifdef NANO_WIDE
483 , bool *bad_char
484#endif
485 );
486size_t move_left(const char *str, size_t pos);
487size_t move_right(const char *str, size_t pos);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000488void align(char **strp);
489void null_at(char **data, size_t index);
490void unsunder(char *str, size_t true_len);
491void sunder(char *str);
Chris Allegretta4f5335d2003-08-04 02:51:12 +0000492#ifndef HAVE_STRCASECMP
493int nstricmp(const char *s1, const char *s2);
494#endif
495#ifndef HAVE_STRNCASECMP
496int nstrnicmp(const char *s1, const char *s2, size_t n);
497#endif
David Lawrence Ramsey14bf8032004-05-22 20:19:15 +0000498#ifndef HAVE_STRCASESTR
David Lawrence Ramseya3370c42004-04-05 01:08:14 +0000499const char *nstristr(const char *haystack, const char *needle);
David Lawrence Ramsey14bf8032004-05-22 20:19:15 +0000500#endif
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000501#ifndef NANO_SMALL
David Lawrence Ramseya3370c42004-04-05 01:08:14 +0000502const char *revstrstr(const char *haystack, const char *needle, const
503 char *rev_start);
504const char *revstristr(const char *haystack, const char *needle, const
505 char *rev_start);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000506#endif
David Lawrence Ramseyfa394042004-05-23 21:11:14 +0000507#ifndef HAVE_STRNLEN
508size_t nstrnlen(const char *s, size_t maxlen);
509#endif
David Lawrence Ramseya8834702004-08-17 20:34:57 +0000510#if !defined(NANO_SMALL) && defined(ENABLE_NANORC)
David Lawrence Ramseya27bd652004-08-17 05:23:38 +0000511#ifndef HAVE_GETLINE
512ssize_t ngetline(char **lineptr, size_t *n, FILE *stream);
513#endif
514#ifndef HAVE_GETDELIM
515ssize_t ngetdelim(char **lineptr, size_t *n, int delim, FILE *stream);
516#endif
David Lawrence Ramseya8834702004-08-17 20:34:57 +0000517#endif /* !NANO_SMALL && ENABLE_NANORC */
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000518const char *strstrwrapper(const char *haystack, const char *needle,
David Lawrence Ramsey1044d742004-02-24 20:41:39 +0000519 const char *start);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000520void nperror(const char *s);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000521void *nmalloc(size_t howmuch);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000522void *nrealloc(void *ptr, size_t howmuch);
David Lawrence Ramsey4a1fc552004-11-02 15:18:30 +0000523char *mallocstrncpy(char *dest, const char *src, size_t n);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000524char *mallocstrcpy(char *dest, const char *src);
David Lawrence Ramsey02517e02004-09-05 21:40:31 +0000525char *mallocstrassn(char *dest, char *src);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000526void new_magicline(void);
David Lawrence Ramsey5ffbec52003-09-16 01:16:49 +0000527#ifndef NANO_SMALL
David Lawrence Ramsey40bdb682004-11-03 22:03:41 +0000528void remove_magicline(void);
David Lawrence Ramseyf7080372004-07-08 17:15:10 +0000529void mark_order(const filestruct **top, size_t *top_x, const filestruct
David Lawrence Ramsey90e59c12004-11-05 23:03:03 +0000530 **bot, size_t *bot_x, bool *right_side_up);
David Lawrence Ramsey5ffbec52003-09-16 01:16:49 +0000531#endif
David Lawrence Ramsey93c84052004-11-23 04:08:28 +0000532void get_totals(const filestruct *begin, const filestruct *end, int
533 *lines, long *size);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000534#ifndef DISABLE_TABCOMP
535int check_wildcard_match(const char *text, const char *pattern);
536#endif
Chris Allegretta6df90f52002-07-19 01:08:59 +0000537
David Lawrence Ramsey8001e272004-11-12 00:48:18 +0000538/* Public functions in winio.c. */
David Lawrence Ramsey48ae9862004-05-28 17:23:33 +0000539#ifndef NANO_SMALL
540void reset_kbinput(void);
541#endif
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000542void get_buffer(WINDOW *win);
543size_t get_buffer_len(void);
544int *buffer_to_keys(buffer *input, size_t input_len);
David Lawrence Ramseyd9ad76b2005-01-02 22:35:31 +0000545buffer *keys_to_buffer(int *input, size_t input_len);
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000546void unget_input(buffer *input, size_t input_len);
547void unget_kbinput(int kbinput, bool meta_key, bool func_key);
548buffer *get_input(WINDOW *win, size_t input_len);
David Lawrence Ramseyeb16f432004-09-27 01:04:50 +0000549int get_kbinput(WINDOW *win, bool *meta_key, bool *func_key);
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000550int parse_kbinput(WINDOW *win, bool *meta_key, bool *func_key
David Lawrence Ramsey48ae9862004-05-28 17:23:33 +0000551#ifndef NANO_SMALL
David Lawrence Ramseya0b5ba22004-08-25 15:39:10 +0000552 , bool reset
David Lawrence Ramsey48ae9862004-05-28 17:23:33 +0000553#endif
554 );
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000555int get_escape_seq_kbinput(const int *sequence, size_t seq_len, bool
556 *ignore_seq);
557int get_escape_seq_abcd(int kbinput);
558int get_word_kbinput(int kbinput
David Lawrence Ramsey48ae9862004-05-28 17:23:33 +0000559#ifndef NANO_SMALL
David Lawrence Ramseya0b5ba22004-08-25 15:39:10 +0000560 , bool reset
David Lawrence Ramsey48ae9862004-05-28 17:23:33 +0000561#endif
562 );
563int get_control_kbinput(int kbinput);
David Lawrence Ramseyd9ad76b2005-01-02 22:35:31 +0000564void unparse_kbinput(size_t pos, int *kbinput, size_t kbinput_len);
David Lawrence Ramsey74835712004-12-04 17:41:52 +0000565int *get_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
566int *parse_verbatim_kbinput(WINDOW *win, size_t *kbinput_len);
David Lawrence Ramsey14bf8032004-05-22 20:19:15 +0000567#ifndef DISABLE_MOUSE
David Lawrence Ramseya0b5ba22004-08-25 15:39:10 +0000568bool get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts);
569#endif
David Lawrence Ramsey1483ee32004-11-29 00:30:07 +0000570const shortcut *get_shortcut(const shortcut *s_list, int *kbinput, bool
David Lawrence Ramseyeb16f432004-09-27 01:04:50 +0000571 *meta_key, bool *func_key);
David Lawrence Ramseya0b5ba22004-08-25 15:39:10 +0000572#ifndef NANO_SMALL
573const toggle *get_toggle(int kbinput, bool meta_key);
574#endif
David Lawrence Ramseyc13b7f02005-01-01 07:28:15 +0000575int do_statusbar_input(bool *meta_key, bool *func_key, bool *s_or_t,
576 bool *finished, bool allow_funcs);
577#ifndef DISABLE_MOUSE
578bool do_statusbar_mouse(void);
579#endif
580void do_statusbar_home(void);
581void do_statusbar_end(void);
582void do_statusbar_right(void);
583void do_statusbar_left(void);
584void do_statusbar_backspace(void);
585void do_statusbar_delete(void);
586void do_statusbar_cut_text(void);
David Lawrence Ramseyd9ad76b2005-01-02 22:35:31 +0000587void do_statusbar_verbatim_input(bool *got_enter);
588void do_statusbar_output(int *kbinput, size_t kbinput_len, bool
589 *got_enter);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000590size_t xplustabs(void);
David Lawrence Ramsey5ffbec52003-09-16 01:16:49 +0000591size_t actual_x(const char *str, size_t xplus);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000592size_t strnlenpt(const char *buf, size_t size);
593size_t strlenpt(const char *buf);
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +0000594void blank_titlebar(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000595void blank_edit(void);
596void blank_statusbar(void);
David Lawrence Ramseye5d8f322004-09-30 22:07:21 +0000597void check_statusblank(void);
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +0000598void blank_bottombars(void);
David Lawrence Ramseyfc693212004-12-23 17:43:27 +0000599size_t display_string_len(const char *buf, size_t start_col, size_t
600 end_col);
601char *display_string(const char *buf, size_t start_col, size_t len, bool
602 dollars);
David Lawrence Ramsey5ffbec52003-09-16 01:16:49 +0000603void nanoget_repaint(const char *buf, const char *inputbuf, size_t x);
David Lawrence Ramsey045883a2004-10-05 20:11:31 +0000604int nanogetstr(bool allow_tabs, const char *buf, const char *def,
Chris Allegretta5beed502003-01-05 20:41:21 +0000605#ifndef NANO_SMALL
606 historyheadtype *history_list,
607#endif
David Lawrence Ramsey045883a2004-10-05 20:11:31 +0000608 const shortcut *s
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000609#ifndef DISABLE_TABCOMP
David Lawrence Ramsey4d44d2d2004-08-01 22:35:31 +0000610 , bool *list
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000611#endif
Chris Allegretta65f075d2003-02-13 03:03:49 +0000612 );
David Lawrence Ramsey045883a2004-10-05 20:11:31 +0000613int statusq(bool allow_tabs, const shortcut *s, const char *def,
614#ifndef NANO_SMALL
615 historyheadtype *history_list,
616#endif
617 const char *msg, ...);
618void statusq_abort(void);
Chris Allegrettaf717f982003-02-13 22:25:01 +0000619void titlebar(const char *path);
David Lawrence Ramseyd7fd2002004-05-18 01:20:36 +0000620void set_modified(void);
621void statusbar(const char *msg, ...);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000622void bottombars(const shortcut *s);
David Lawrence Ramseyfa394042004-05-23 21:11:14 +0000623void onekey(const char *keystroke, const char *desc, size_t len);
David Lawrence Ramsey1f28b8f2002-09-27 14:21:59 +0000624#ifndef NDEBUG
625int check_linenumbers(const filestruct *fileptr);
626#endif
David Lawrence Ramsey2dd7ed12003-09-29 05:15:24 +0000627size_t get_page_start(size_t column);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000628void reset_cursor(void);
David Lawrence Ramsey07d3feb2004-04-16 05:15:11 +0000629void edit_add(const filestruct *fileptr, const char *converted, int
630 yval, size_t start);
David Lawrence Ramsey5ffbec52003-09-16 01:16:49 +0000631void update_line(const filestruct *fileptr, size_t index);
David Lawrence Ramsey86e851b2004-07-28 20:46:25 +0000632int need_horizontal_update(size_t old_pww);
633int need_vertical_update(size_t old_pww);
David Lawrence Ramsey2ed225f2004-05-28 20:44:09 +0000634void edit_scroll(updown direction, int nlines);
David Lawrence Ramsey86e851b2004-07-28 20:46:25 +0000635void edit_redraw(const filestruct *old_current, size_t old_pww);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000636void edit_refresh(void);
David Lawrence Ramsey20b83502004-08-26 18:07:58 +0000637void edit_update(topmidnone location);
David Lawrence Ramsey045883a2004-10-05 20:11:31 +0000638int do_yesno(bool all, const char *msg);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000639void total_refresh(void);
David Lawrence Ramseyad40fdb2002-09-06 20:35:28 +0000640void display_main_list(void);
David Lawrence Ramseya0b5ba22004-08-25 15:39:10 +0000641void do_cursorpos(bool constant);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000642void do_cursorpos_void(void);
David Lawrence Ramsey8037fe02004-07-23 12:30:40 +0000643#ifndef DISABLE_HELP
644int help_line_len(const char *ptr);
David Lawrence Ramsey72e51ab2004-07-02 14:31:03 +0000645void do_help(void);
David Lawrence Ramsey8037fe02004-07-23 12:30:40 +0000646#endif
David Lawrence Ramsey423326f2005-01-03 19:14:39 +0000647void do_replace_highlight(bool highlight_flag, const char *word);
Chris Allegretta6df90f52002-07-19 01:08:59 +0000648#ifdef DEBUG
649void dump_buffer(const filestruct *inptr);
650void dump_buffer_reverse(void);
651#endif
Chris Allegretta8a0de3b2000-11-24 20:45:14 +0000652#ifdef NANO_EXTRA
Chris Allegretta34318ed2001-01-31 23:22:36 +0000653void do_credits(void);
Chris Allegretta8a0de3b2000-11-24 20:45:14 +0000654#endif