Chris Allegretta | 11b0011 | 2000-08-06 21:13:45 +0000 | [diff] [blame] | 1 | /* $Id$ */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 2 | /************************************************************************** |
| 3 | * proto.h * |
| 4 | * * |
David Lawrence Ramsey | f28f50e | 2004-01-09 23:04:55 +0000 | [diff] [blame] | 5 | * Copyright (C) 1999-2004 Chris Allegretta * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 6 | * 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 Allegretta | 3a24f3f | 2001-10-24 11:33:54 +0000 | [diff] [blame] | 8 | * the Free Software Foundation; either version 2, or (at your option) * |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 9 | * 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 Ramsey | f28f50e | 2004-01-09 23:04:55 +0000 | [diff] [blame] | 22 | /* Externs. */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 23 | |
| 24 | #include <sys/stat.h> |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 25 | |
| 26 | #ifdef HAVE_REGEX_H |
Chris Allegretta | 9fc8d43 | 2000-07-07 01:49:52 +0000 | [diff] [blame] | 27 | #include <regex.h> |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 28 | #endif |
| 29 | |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 30 | #include "nano.h" |
| 31 | |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 32 | #ifndef DISABLE_WRAPJUSTIFY |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 33 | extern int wrap_at; |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 34 | #endif |
Chris Allegretta | 17dcb72 | 2001-01-20 21:40:07 +0000 | [diff] [blame] | 35 | extern int editwinrows; |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 36 | extern int current_x, current_y, totlines; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 37 | extern int placewewant; |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 38 | #ifndef NANO_SMALL |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 39 | extern int mark_beginx; |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 40 | #endif |
Chris Allegretta | b3655b4 | 2001-10-22 03:15:31 +0000 | [diff] [blame] | 41 | extern long totsize; |
| 42 | extern int temp_opt; |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 43 | extern int flags; |
| 44 | extern int tabsize; |
Chris Allegretta | 27eb13f | 2000-11-05 16:52:21 +0000 | [diff] [blame] | 45 | extern int search_last_line; |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 46 | extern int search_offscreen; |
Chris Allegretta | 6b58acd | 2001-04-12 03:01:53 +0000 | [diff] [blame] | 47 | extern int currslen; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 48 | |
Chris Allegretta | e4f940d | 2002-03-03 22:36:36 +0000 | [diff] [blame] | 49 | #ifndef DISABLE_JUSTIFY |
Chris Allegretta | 45329a1 | 2002-03-10 01:22:21 +0000 | [diff] [blame] | 50 | extern char *quotestr; |
Chris Allegretta | e4f940d | 2002-03-03 22:36:36 +0000 | [diff] [blame] | 51 | #endif |
| 52 | |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 53 | #ifndef NANO_SMALL |
| 54 | extern char *backup_dir; |
| 55 | #endif |
| 56 | |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 57 | extern WINDOW *topwin, *edit, *bottomwin; |
Chris Allegretta | 1a6e904 | 2000-12-14 13:56:28 +0000 | [diff] [blame] | 58 | extern char *filename; |
David Lawrence Ramsey | 5db0cdc | 2002-06-28 22:45:14 +0000 | [diff] [blame] | 59 | extern struct stat originalfilestat; |
Chris Allegretta | 31925e4 | 2000-11-02 04:40:39 +0000 | [diff] [blame] | 60 | extern char *answer; |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 61 | extern char *hblank; |
| 62 | #ifndef DISABLE_HELP |
| 63 | extern char *help_text; |
| 64 | #endif |
Chris Allegretta | 27eb13f | 2000-11-05 16:52:21 +0000 | [diff] [blame] | 65 | extern char *last_search; |
| 66 | extern char *last_replace; |
Chris Allegretta | e1f1452 | 2001-09-19 03:19:43 +0000 | [diff] [blame] | 67 | #ifndef DISABLE_OPERATINGDIR |
| 68 | extern char *operating_dir; |
Chris Allegretta | f5de33a | 2002-02-27 04:14:16 +0000 | [diff] [blame] | 69 | extern char *full_operating_dir; |
Chris Allegretta | e1f1452 | 2001-09-19 03:19:43 +0000 | [diff] [blame] | 70 | #endif |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 71 | #ifndef DISABLE_SPELLER |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 72 | extern char *alt_speller; |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 73 | #endif |
| 74 | |
Chris Allegretta | 65f075d | 2003-02-13 03:03:49 +0000 | [diff] [blame] | 75 | extern int resetstatuspos; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 76 | extern struct stat fileinfo; |
David Lawrence Ramsey | b977515 | 2004-03-19 02:15:42 +0000 | [diff] [blame] | 77 | extern filestruct *current, *fileage, *edittop, *filebot; |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 78 | extern filestruct *cutbuffer; |
| 79 | #ifndef NANO_SMALL |
| 80 | extern filestruct *mark_beginbuf; |
| 81 | #endif |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 82 | |
Chris Allegretta | 355fbe5 | 2001-07-14 19:32:47 +0000 | [diff] [blame] | 83 | #ifdef ENABLE_MULTIBUFFER |
Chris Allegretta | f2387fb | 2002-04-10 02:31:20 +0000 | [diff] [blame] | 84 | extern openfilestruct *open_files; |
Chris Allegretta | 2d7893d | 2001-07-11 02:08:33 +0000 | [diff] [blame] | 85 | #endif |
| 86 | |
Chris Allegretta | 08893e0 | 2001-11-29 02:42:27 +0000 | [diff] [blame] | 87 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | 1f28b8f | 2002-09-27 14:21:59 +0000 | [diff] [blame] | 88 | extern const colortype *colorstrings; |
Chris Allegretta | b6c5dc2 | 2002-05-04 03:47:33 +0000 | [diff] [blame] | 89 | extern syntaxtype *syntaxes; |
Chris Allegretta | 09900ff | 2002-05-04 04:23:30 +0000 | [diff] [blame] | 90 | extern char *syntaxstr; |
Chris Allegretta | 08893e0 | 2001-11-29 02:42:27 +0000 | [diff] [blame] | 91 | #endif |
| 92 | |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 93 | extern shortcut *shortcut_list; |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 94 | extern shortcut *main_list, *whereis_list; |
| 95 | extern shortcut *replace_list, *goto_list; |
| 96 | extern shortcut *writefile_list, *insertfile_list; |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 97 | extern shortcut *replace_list_2; |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 98 | #ifndef NANO_SMALL |
| 99 | extern shortcut *extcmd_list; |
| 100 | #endif |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 101 | #ifndef DISABLE_HELP |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 102 | extern shortcut *help_list; |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 103 | #endif |
| 104 | #ifndef DISABLE_SPELLER |
| 105 | extern shortcut *spell_list; |
| 106 | #endif |
Rocco Corsi | af5c302 | 2001-01-12 07:51:05 +0000 | [diff] [blame] | 107 | #ifndef DISABLE_BROWSER |
Chris Allegretta | a8c2257 | 2002-02-15 19:17:02 +0000 | [diff] [blame] | 108 | extern shortcut *browser_list, *gotodir_list; |
Chris Allegretta | f4b9601 | 2001-01-03 07:11:47 +0000 | [diff] [blame] | 109 | #endif |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 110 | |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 111 | #if !defined(DISABLE_BROWSER) || !defined(DISABLE_HELP) || !defined(DISABLE_MOUSE) |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 112 | extern const shortcut *currshortcut; |
Chris Allegretta | 201f1d9 | 2003-02-05 02:51:19 +0000 | [diff] [blame] | 113 | #endif |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 114 | |
| 115 | #ifdef HAVE_REGEX_H |
Chris Allegretta | 9fc8d43 | 2000-07-07 01:49:52 +0000 | [diff] [blame] | 116 | extern regex_t search_regexp; |
David Lawrence Ramsey | c372488 | 2004-05-27 18:39:16 +0000 | [diff] [blame] | 117 | extern regmatch_t regmatches[10]; |
Chris Allegretta | 3533a34 | 2002-03-24 23:19:32 +0000 | [diff] [blame] | 118 | #ifdef ENABLE_COLOR |
Chris Allegretta | b6c5dc2 | 2002-05-04 03:47:33 +0000 | [diff] [blame] | 119 | extern regex_t syntaxfile_regexp; |
David Lawrence Ramsey | c372488 | 2004-05-27 18:39:16 +0000 | [diff] [blame] | 120 | extern regmatch_t synfilematches[1]; |
Chris Allegretta | 7162e3d | 2002-04-06 05:02:14 +0000 | [diff] [blame] | 121 | #endif /* ENABLE_COLOR */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 122 | #endif /* HAVE_REGEX_H */ |
| 123 | |
| 124 | #ifndef NANO_SMALL |
| 125 | extern toggle *toggles; |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 126 | #endif |
| 127 | |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 128 | #ifndef NANO_SMALL |
| 129 | extern historyheadtype search_history; |
| 130 | extern historyheadtype replace_history; |
| 131 | #endif |
| 132 | |
Chris Allegretta | a0d8997 | 2003-02-03 03:32:08 +0000 | [diff] [blame] | 133 | extern int curses_ended; |
| 134 | |
David Lawrence Ramsey | f28f50e | 2004-01-09 23:04:55 +0000 | [diff] [blame] | 135 | /* Functions we want available. */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 136 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 137 | /* Public functions in color.c */ |
| 138 | #ifdef ENABLE_COLOR |
David Lawrence Ramsey | 1f28b8f | 2002-09-27 14:21:59 +0000 | [diff] [blame] | 139 | void set_colorpairs(void); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 140 | void do_colorinit(void); |
| 141 | void update_color(void); |
| 142 | #endif /* ENABLE_COLOR */ |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 143 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 144 | /* Public functions in cut.c */ |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 145 | filestruct *get_cutbottom(void); |
David Lawrence Ramsey | 44e7f82 | 2004-03-30 04:17:10 +0000 | [diff] [blame] | 146 | void add_to_cutbuffer(filestruct *inptr, int allow_concat); |
David Lawrence Ramsey | 8213850 | 2003-12-24 08:03:54 +0000 | [diff] [blame] | 147 | void cut_marked_segment(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 148 | int do_cut_text(void); |
| 149 | int do_uncut_text(void); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 150 | |
| 151 | /* Public functions in files.c */ |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 152 | void load_file(int update); |
| 153 | void new_file(void); |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 154 | filestruct *read_line(char *buf, filestruct *prev, int *line1ins, size_t |
| 155 | len); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 156 | int read_file(FILE *f, const char *filename, int quiet); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 157 | int open_file(const char *filename, int insert, int quiet); |
| 158 | char *get_next_filename(const char *name); |
| 159 | int do_insertfile(int loading_file); |
| 160 | int do_insertfile_void(void); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 161 | #ifdef ENABLE_MULTIBUFFER |
| 162 | openfilestruct *make_new_opennode(openfilestruct *prevnode); |
| 163 | void splice_opennode(openfilestruct *begin, openfilestruct *newnode, openfilestruct *end); |
| 164 | void unlink_opennode(const openfilestruct *fileptr); |
| 165 | void delete_opennode(openfilestruct *fileptr); |
| 166 | void free_openfilestruct(openfilestruct *src); |
| 167 | int add_open_file(int update); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 168 | int load_open_file(void); |
| 169 | int open_prevfile(int closing_file); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 170 | int open_prevfile_void(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 171 | int open_nextfile(int closing_file); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 172 | int open_nextfile_void(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 173 | int close_open_file(void); |
| 174 | #endif |
| 175 | #if !defined(DISABLE_SPELLER) || !defined(DISABLE_OPERATINGDIR) |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 176 | char *get_full_path(const char *origpath); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 177 | #endif |
| 178 | #ifndef DISABLE_SPELLER |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 179 | char *check_writable_directory(const char *path); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 180 | char *safe_tempnam(const char *dirname, const char *filename_prefix); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 181 | #endif |
| 182 | #ifndef DISABLE_OPERATINGDIR |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 183 | void init_operating_dir(void); |
| 184 | int check_operating_dir(const char *currpath, int allow_tabcomp); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 185 | #endif |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 186 | #ifndef NANO_SMALL |
| 187 | void init_backup_dir(void); |
| 188 | #endif |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 189 | int write_file(const char *name, int tmp, int append, int nonamechange); |
David Lawrence Ramsey | 35961c4 | 2004-01-23 19:34:03 +0000 | [diff] [blame] | 190 | #ifndef NANO_SMALL |
David Lawrence Ramsey | 2f0d03b | 2004-05-28 00:15:28 +0000 | [diff] [blame] | 191 | int write_marked(const char *name, int tmp, int append); |
David Lawrence Ramsey | 35961c4 | 2004-01-23 19:34:03 +0000 | [diff] [blame] | 192 | #endif |
David Lawrence Ramsey | 6aec4b8 | 2004-03-15 20:26:30 +0000 | [diff] [blame] | 193 | int do_writeout(int exiting); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 194 | int do_writeout_void(void); |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 195 | char *real_dir_from_tilde(const char *buf); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 196 | #ifndef DISABLE_TABCOMP |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 197 | int append_slash_if_dir(char *buf, int *lastwastab, int *place); |
| 198 | char **username_tab_completion(char *buf, int *num_matches); |
| 199 | char **cwd_tab_completion(char *buf, int *num_matches); |
| 200 | char *input_tab(char *buf, int place, int *lastwastab, int *newplace, int *list); |
Chris Allegretta | 7662c86 | 2003-01-13 01:35:15 +0000 | [diff] [blame] | 201 | #endif |
David Lawrence Ramsey | 04e42a6 | 2004-02-28 16:24:31 +0000 | [diff] [blame] | 202 | const char *tail(const char *foo); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 203 | #ifndef DISABLE_BROWSER |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 204 | int diralphasort(const void *va, const void *vb); |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 205 | void free_charptrarray(char **array, size_t len); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 206 | void striponedir(char *foo); |
Chris Allegretta | 858d9d9 | 2003-01-30 00:53:32 +0000 | [diff] [blame] | 207 | int readable_dir(const char *path); |
David Lawrence Ramsey | e21adfa | 2002-09-13 18:14:04 +0000 | [diff] [blame] | 208 | char **browser_init(const char *path, int *longest, int *numents); |
| 209 | char *do_browser(const char *inpath); |
| 210 | char *do_browse_from(const char *inpath); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 211 | #endif |
| 212 | |
| 213 | /* Public functions in global.c */ |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 214 | int length_of_list(const shortcut *s); |
Chris Allegretta | f717f98 | 2003-02-13 22:25:01 +0000 | [diff] [blame] | 215 | void sc_init_one(shortcut **shortcutage, int key, const char *desc, |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 216 | #ifndef DISABLE_HELP |
Chris Allegretta | f717f98 | 2003-02-13 22:25:01 +0000 | [diff] [blame] | 217 | const char *help, |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 218 | #endif |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 219 | int metaval, int funcval, int miscval, int view, int |
| 220 | (*func)(void)); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 221 | #ifndef NANO_SMALL |
| 222 | void toggle_init_one(int val, const char *desc, int flag); |
| 223 | void toggle_init(void); |
| 224 | #ifdef DEBUG |
| 225 | void free_toggles(void); |
| 226 | #endif |
| 227 | #endif |
| 228 | void free_shortcutage(shortcut **shortcutage); |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 229 | void shortcut_init(int unjustify); |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 230 | #ifdef DEBUG |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 231 | void thanks_for_all_the_fish(void); |
Chris Allegretta | 6232d66 | 2002-05-12 19:52:15 +0000 | [diff] [blame] | 232 | #endif |
Chris Allegretta | dab017e | 2002-04-23 10:56:06 +0000 | [diff] [blame] | 233 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 234 | /* Public functions in move.c */ |
David Lawrence Ramsey | 4be15f0 | 2004-05-23 21:33:23 +0000 | [diff] [blame] | 235 | int do_first_line(void); |
| 236 | int do_last_line(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 237 | int do_home(void); |
| 238 | int do_end(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 239 | int do_page_up(void); |
| 240 | int do_page_down(void); |
Chris Allegretta | bceb1b2 | 2000-06-19 04:22:15 +0000 | [diff] [blame] | 241 | int do_up(void); |
| 242 | int do_down(void); |
David Lawrence Ramsey | 2ed225f | 2004-05-28 20:44:09 +0000 | [diff] [blame^] | 243 | int do_left(int allow_update); |
| 244 | int do_left_void(void); |
| 245 | int do_right(int allow_update); |
| 246 | int do_right_void(void); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 247 | |
| 248 | /* Public functions in nano.c */ |
David Lawrence Ramsey | da14106 | 2004-05-25 19:41:11 +0000 | [diff] [blame] | 249 | void finish(void); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 250 | void die(const char *msg, ...); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 251 | void die_save_file(const char *die_filename); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 252 | void die_too_small(void); |
| 253 | void print_view_warning(void); |
| 254 | void global_init(int save_cutbuffer); |
| 255 | void window_init(void); |
David Lawrence Ramsey | f5b256b | 2003-10-03 20:26:25 +0000 | [diff] [blame] | 256 | #ifndef DISABLE_MOUSE |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 257 | void mouse_init(void); |
David Lawrence Ramsey | 9b13ff3 | 2002-12-22 16:30:00 +0000 | [diff] [blame] | 258 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 259 | #ifndef DISABLE_HELP |
| 260 | void help_init(void); |
Chris Allegretta | f2387fb | 2002-04-10 02:31:20 +0000 | [diff] [blame] | 261 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 262 | filestruct *make_new_node(filestruct *prevnode); |
| 263 | filestruct *copy_node(const filestruct *src); |
| 264 | void splice_node(filestruct *begin, filestruct *newnode, filestruct *end); |
| 265 | void unlink_node(const filestruct *fileptr); |
| 266 | void delete_node(filestruct *fileptr); |
| 267 | filestruct *copy_filestruct(const filestruct *src); |
| 268 | void free_filestruct(filestruct *src); |
| 269 | void renumber_all(void); |
| 270 | void renumber(filestruct *fileptr); |
| 271 | void print1opt(const char *shortflag, const char *longflag, |
| 272 | const char *desc); |
| 273 | void usage(void); |
| 274 | void version(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 275 | int no_help(void); |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 276 | int nano_disabled_msg(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 277 | #ifndef NANO_SMALL |
| 278 | RETSIGTYPE cancel_fork(int signal); |
| 279 | int open_pipe(const char *command); |
| 280 | #endif |
| 281 | #ifndef DISABLE_MOUSE |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 282 | void do_mouse(void); |
| 283 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 284 | void do_char(char ch); |
David Lawrence Ramsey | a593f53 | 2003-11-28 19:47:42 +0000 | [diff] [blame] | 285 | int do_verbatim_input(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 286 | int do_backspace(void); |
| 287 | int do_delete(void); |
| 288 | int do_tab(void); |
| 289 | int do_enter(void); |
David Lawrence Ramsey | c97acfb | 2003-09-10 20:08:00 +0000 | [diff] [blame] | 290 | #ifndef NANO_SMALL |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 291 | int do_next_word(void); |
| 292 | int do_prev_word(void); |
| 293 | int do_mark(void); |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 294 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 295 | #ifndef DISABLE_WRAPPING |
David Lawrence Ramsey | c97acfb | 2003-09-10 20:08:00 +0000 | [diff] [blame] | 296 | void wrap_reset(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 297 | int do_wrap(filestruct *inptr); |
| 298 | #endif |
| 299 | #ifndef DISABLE_SPELLER |
| 300 | int do_int_spell_fix(const char *word); |
David Lawrence Ramsey | fa39404 | 2004-05-23 21:11:14 +0000 | [diff] [blame] | 301 | const char *do_int_speller(char *tempfile_name); |
| 302 | const char *do_alt_speller(char *tempfile_name); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 303 | int do_spell(void); |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 304 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 305 | #if !defined(DISABLE_WRAPPING) && !defined(NANO_SMALL) || !defined(DISABLE_JUSTIFY) |
| 306 | size_t indent_length(const char *line); |
| 307 | #endif |
| 308 | #ifndef DISABLE_JUSTIFY |
David Lawrence Ramsey | 1cadddd | 2004-05-17 20:32:51 +0000 | [diff] [blame] | 309 | void justify_format(filestruct *line, size_t skip); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 310 | #ifdef HAVE_REGEX_H |
| 311 | size_t quote_length(const char *line, const regex_t *qreg); |
| 312 | #else |
| 313 | size_t quote_length(const char *line); |
| 314 | #endif |
| 315 | #ifdef HAVE_REGEX_H |
| 316 | # define IFREG(a, b) a, b |
| 317 | #else |
| 318 | # define IFREG(a, b) a |
| 319 | #endif |
David Lawrence Ramsey | d4693cb | 2004-05-14 01:17:25 +0000 | [diff] [blame] | 320 | int quotes_match(const char *a_line, size_t a_quote, IFREG(const char |
| 321 | *b_line, const regex_t *qreg)); |
| 322 | size_t indents_match(const char *a_line, size_t a_indent, const char |
| 323 | *b_line, size_t b_indent); |
| 324 | filestruct *backup_lines(filestruct *first_line, size_t par_len, size_t |
| 325 | quote_len); |
Chris Allegretta | cff6e6f | 2003-02-03 03:22:02 +0000 | [diff] [blame] | 326 | int breakable(const char *line, int goal); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 327 | int break_line(const char *line, int goal, int force); |
David Lawrence Ramsey | 2e3aeae | 2004-05-24 05:52:35 +0000 | [diff] [blame] | 328 | int do_para_search(justbegend search_type, size_t *quote, size_t *par, |
| 329 | size_t *indent, int do_refresh); |
David Lawrence Ramsey | 8faf305 | 2003-09-04 20:25:29 +0000 | [diff] [blame] | 330 | int do_para_begin(void); |
| 331 | int do_para_end(void); |
David Lawrence Ramsey | 8d3e7f3 | 2004-05-13 17:28:03 +0000 | [diff] [blame] | 332 | int do_justify(int justify_all); |
| 333 | int do_justify_void(void); |
| 334 | int do_full_justify(void); |
David Lawrence Ramsey | d893fa9 | 2004-04-30 04:49:02 +0000 | [diff] [blame] | 335 | #endif /* !DISABLE_JUSTIFY */ |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 336 | int do_exit(void); |
| 337 | void signal_init(void); |
David Lawrence Ramsey | 2ab03f6 | 2002-10-17 02:19:31 +0000 | [diff] [blame] | 338 | RETSIGTYPE handle_hupterm(int signal); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 339 | RETSIGTYPE do_suspend(int signal); |
| 340 | RETSIGTYPE do_cont(int signal); |
| 341 | #ifndef NANO_SMALL |
| 342 | void handle_sigwinch(int s); |
David Lawrence Ramsey | 369732f | 2004-02-16 20:32:40 +0000 | [diff] [blame] | 343 | void allow_pending_sigwinch(int allow); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 344 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 345 | #ifndef NANO_SMALL |
| 346 | void do_toggle(const toggle *which); |
| 347 | #endif |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 348 | #if !defined(NANO_SMALL) || defined(USE_SLANG) |
| 349 | void disable_signals(void); |
| 350 | #endif |
| 351 | #ifndef NANO_SMALL |
| 352 | void enable_signals(void); |
| 353 | #endif |
| 354 | void disable_flow_control(void); |
| 355 | void enable_flow_control(void); |
Chris Allegretta | f2387fb | 2002-04-10 02:31:20 +0000 | [diff] [blame] | 356 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 357 | /* Public functions in rcfile.c */ |
Chris Allegretta | 7a50009 | 2001-04-19 21:13:46 +0000 | [diff] [blame] | 358 | #ifdef ENABLE_NANORC |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 359 | void rcfile_error(const char *msg, ...); |
| 360 | void rcfile_msg(const char *msg, ...); |
| 361 | char *parse_next_word(char *ptr); |
| 362 | char *parse_argument(char *ptr); |
| 363 | #ifdef ENABLE_COLOR |
| 364 | int colortoint(const char *colorname, int *bright); |
| 365 | char *parse_next_regex(char *ptr); |
Chris Allegretta | ce452fb | 2003-02-03 02:56:44 +0000 | [diff] [blame] | 366 | int nregcomp(regex_t *preg, const char *regex, int flags); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 367 | void parse_syntax(char *ptr); |
| 368 | void parse_colors(char *ptr); |
| 369 | #endif /* ENABLE_COLOR */ |
| 370 | void parse_rcfile(FILE *rcstream); |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 371 | void do_rcfile(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 372 | #endif /* ENABLE_NANORC */ |
Chris Allegretta | 8d8e012 | 2001-04-18 04:28:54 +0000 | [diff] [blame] | 373 | |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 374 | /* Public functions in search.c */ |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 375 | #ifdef HAVE_REGEX_H |
Chris Allegretta | 5d71514 | 2003-01-29 04:18:37 +0000 | [diff] [blame] | 376 | int regexp_init(const char *regexp); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 377 | void regexp_cleanup(void); |
| 378 | #endif |
| 379 | void not_found_msg(const char *str); |
| 380 | void search_abort(void); |
| 381 | void search_init_globals(void); |
| 382 | int search_init(int replacing); |
David Lawrence Ramsey | 1044d74 | 2004-02-24 20:41:39 +0000 | [diff] [blame] | 383 | int is_whole_word(int curr_pos, const char *datastr, const char |
| 384 | *searchword); |
| 385 | int findnextstr(int can_display_wrap, int wholeword, const filestruct |
| 386 | *begin, size_t beginx, const char *needle, int no_sameline); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 387 | int do_search(void); |
David Lawrence Ramsey | 5aa3983 | 2004-05-05 21:36:50 +0000 | [diff] [blame] | 388 | #ifndef NANO_SMALL |
David Lawrence Ramsey | e049706 | 2003-08-23 21:11:06 +0000 | [diff] [blame] | 389 | int do_research(void); |
David Lawrence Ramsey | 5aa3983 | 2004-05-05 21:36:50 +0000 | [diff] [blame] | 390 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 391 | void replace_abort(void); |
| 392 | #ifdef HAVE_REGEX_H |
| 393 | int replace_regexp(char *string, int create_flag); |
| 394 | #endif |
David Lawrence Ramsey | 1044d74 | 2004-02-24 20:41:39 +0000 | [diff] [blame] | 395 | char *replace_line(const char *needle); |
| 396 | int do_replace_loop(const char *needle, const filestruct *real_current, |
| 397 | size_t *real_current_x, int wholewords); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 398 | int do_replace(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 399 | int do_gotoline(int line, int save_pos); |
| 400 | int do_gotoline_void(void); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 401 | #if defined (ENABLE_MULTIBUFFER) || !defined (DISABLE_SPELLER) |
| 402 | void do_gotopos(int line, int pos_x, int pos_y, int pos_placewewant); |
| 403 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 404 | int do_find_bracket(void); |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 405 | #ifndef NANO_SMALL |
| 406 | void history_init(void); |
| 407 | historytype *find_node(historytype *h, char *s); |
| 408 | void remove_node(historytype *r); |
| 409 | void insert_node(historytype *h, const char *s); |
| 410 | void update_history(historyheadtype *h, char *s); |
| 411 | char *get_history_older(historyheadtype *h); |
| 412 | char *get_history_newer(historyheadtype *h); |
| 413 | char *get_history_completion(historyheadtype *h, char *s); |
| 414 | void free_history(historyheadtype *h); |
Chris Allegretta | f3de8b5 | 2003-01-16 23:44:46 +0000 | [diff] [blame] | 415 | #ifdef ENABLE_NANORC |
David Lawrence Ramsey | c372488 | 2004-05-27 18:39:16 +0000 | [diff] [blame] | 416 | void load_history(void); |
Chris Allegretta | f3de8b5 | 2003-01-16 23:44:46 +0000 | [diff] [blame] | 417 | void save_history(void); |
| 418 | #endif |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 419 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 420 | |
| 421 | /* Public functions in utils.c */ |
David Lawrence Ramsey | 1044d74 | 2004-02-24 20:41:39 +0000 | [diff] [blame] | 422 | #ifdef HAVE_REGEX_H |
Chris Allegretta | d845193 | 2003-03-11 03:50:40 +0000 | [diff] [blame] | 423 | #ifdef BROKEN_REGEXEC |
| 424 | int regexec_safe(const regex_t *preg, const char *string, size_t nmatch, |
| 425 | regmatch_t pmatch[], int eflags); |
| 426 | #endif |
David Lawrence Ramsey | 1044d74 | 2004-02-24 20:41:39 +0000 | [diff] [blame] | 427 | int regexp_bol_or_eol(const regex_t *preg, const char *string); |
| 428 | #endif |
David Lawrence Ramsey | 9830d75 | 2004-05-13 17:19:54 +0000 | [diff] [blame] | 429 | #ifndef HAVE_ISBLANK |
| 430 | int is_blank_char(int c); |
| 431 | #endif |
Chris Allegretta | cf287c8 | 2002-07-20 13:57:41 +0000 | [diff] [blame] | 432 | int is_cntrl_char(int c); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 433 | int num_of_digits(int n); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 434 | void align(char **strp); |
| 435 | void null_at(char **data, size_t index); |
| 436 | void unsunder(char *str, size_t true_len); |
| 437 | void sunder(char *str); |
Chris Allegretta | 4f5335d | 2003-08-04 02:51:12 +0000 | [diff] [blame] | 438 | #ifndef HAVE_STRCASECMP |
| 439 | int nstricmp(const char *s1, const char *s2); |
| 440 | #endif |
| 441 | #ifndef HAVE_STRNCASECMP |
| 442 | int nstrnicmp(const char *s1, const char *s2, size_t n); |
| 443 | #endif |
David Lawrence Ramsey | 14bf803 | 2004-05-22 20:19:15 +0000 | [diff] [blame] | 444 | #ifndef HAVE_STRCASESTR |
David Lawrence Ramsey | a3370c4 | 2004-04-05 01:08:14 +0000 | [diff] [blame] | 445 | const char *nstristr(const char *haystack, const char *needle); |
David Lawrence Ramsey | 14bf803 | 2004-05-22 20:19:15 +0000 | [diff] [blame] | 446 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 447 | #ifndef NANO_SMALL |
David Lawrence Ramsey | a3370c4 | 2004-04-05 01:08:14 +0000 | [diff] [blame] | 448 | const char *revstrstr(const char *haystack, const char *needle, const |
| 449 | char *rev_start); |
| 450 | const char *revstristr(const char *haystack, const char *needle, const |
| 451 | char *rev_start); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 452 | #endif |
David Lawrence Ramsey | fa39404 | 2004-05-23 21:11:14 +0000 | [diff] [blame] | 453 | #ifndef HAVE_STRNLEN |
| 454 | size_t nstrnlen(const char *s, size_t maxlen); |
| 455 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 456 | const char *strstrwrapper(const char *haystack, const char *needle, |
David Lawrence Ramsey | 1044d74 | 2004-02-24 20:41:39 +0000 | [diff] [blame] | 457 | const char *start); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 458 | void nperror(const char *s); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 459 | void *nmalloc(size_t howmuch); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 460 | void *nrealloc(void *ptr, size_t howmuch); |
| 461 | char *mallocstrcpy(char *dest, const char *src); |
| 462 | void new_magicline(void); |
David Lawrence Ramsey | 5ffbec5 | 2003-09-16 01:16:49 +0000 | [diff] [blame] | 463 | #ifndef NANO_SMALL |
| 464 | void mark_order(const filestruct **top, size_t *top_x, |
| 465 | const filestruct **bot, size_t *bot_x); |
| 466 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 467 | #ifndef DISABLE_TABCOMP |
| 468 | int check_wildcard_match(const char *text, const char *pattern); |
| 469 | #endif |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 470 | |
| 471 | /* Public functions in winio.c */ |
David Lawrence Ramsey | 48ae986 | 2004-05-28 17:23:33 +0000 | [diff] [blame] | 472 | #ifndef NANO_SMALL |
| 473 | void reset_kbinput(void); |
| 474 | #endif |
David Lawrence Ramsey | 1576d53 | 2004-03-19 21:46:34 +0000 | [diff] [blame] | 475 | int get_kbinput(WINDOW *win, int *meta_key); |
David Lawrence Ramsey | 48ae986 | 2004-05-28 17:23:33 +0000 | [diff] [blame] | 476 | int get_translated_kbinput(int kbinput, int *es |
| 477 | #ifndef NANO_SMALL |
| 478 | , int reset |
| 479 | #endif |
| 480 | ); |
| 481 | int get_ascii_kbinput(int kbinput, size_t ascii_digits |
| 482 | #ifndef NANO_SMALL |
| 483 | , int reset |
| 484 | #endif |
| 485 | ); |
| 486 | int get_control_kbinput(int kbinput); |
| 487 | int get_escape_seq_kbinput(int *escape_seq, size_t es_len); |
David Lawrence Ramsey | c2c5a51 | 2004-01-23 19:26:17 +0000 | [diff] [blame] | 488 | int get_escape_seq_abcd(int kbinput); |
David Lawrence Ramsey | 48ae986 | 2004-05-28 17:23:33 +0000 | [diff] [blame] | 489 | int *get_verbatim_kbinput(WINDOW *win, int *verbatim_kbinput, size_t |
| 490 | *verbatim_len, int allow_ascii); |
| 491 | int get_untranslated_kbinput(int kbinput, size_t position, int |
| 492 | allow_ascii |
| 493 | #ifndef NANO_SMALL |
| 494 | , int reset |
| 495 | #endif |
| 496 | ); |
David Lawrence Ramsey | 14bf803 | 2004-05-22 20:19:15 +0000 | [diff] [blame] | 497 | #ifndef DISABLE_MOUSE |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 498 | int get_mouseinput(int *mouse_x, int *mouse_y, int shortcut); |
David Lawrence Ramsey | 14bf803 | 2004-05-22 20:19:15 +0000 | [diff] [blame] | 499 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 500 | size_t xplustabs(void); |
David Lawrence Ramsey | 5ffbec5 | 2003-09-16 01:16:49 +0000 | [diff] [blame] | 501 | size_t actual_x(const char *str, size_t xplus); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 502 | size_t strnlenpt(const char *buf, size_t size); |
| 503 | size_t strlenpt(const char *buf); |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 504 | void blank_titlebar(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 505 | void blank_edit(void); |
| 506 | void blank_statusbar(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 507 | void check_statblank(void); |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 508 | void blank_bottombars(void); |
| 509 | char *display_string(const char *buf, size_t start_col, size_t len); |
David Lawrence Ramsey | 5ffbec5 | 2003-09-16 01:16:49 +0000 | [diff] [blame] | 510 | void nanoget_repaint(const char *buf, const char *inputbuf, size_t x); |
Chris Allegretta | f717f98 | 2003-02-13 22:25:01 +0000 | [diff] [blame] | 511 | int nanogetstr(int allowtabs, const char *buf, const char *def, |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 512 | #ifndef NANO_SMALL |
| 513 | historyheadtype *history_list, |
| 514 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 515 | const shortcut *s |
| 516 | #ifndef DISABLE_TABCOMP |
| 517 | , int *list |
| 518 | #endif |
Chris Allegretta | 65f075d | 2003-02-13 03:03:49 +0000 | [diff] [blame] | 519 | ); |
Chris Allegretta | f717f98 | 2003-02-13 22:25:01 +0000 | [diff] [blame] | 520 | void titlebar(const char *path); |
David Lawrence Ramsey | d7fd200 | 2004-05-18 01:20:36 +0000 | [diff] [blame] | 521 | void set_modified(void); |
| 522 | void statusbar(const char *msg, ...); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 523 | void bottombars(const shortcut *s); |
David Lawrence Ramsey | fa39404 | 2004-05-23 21:11:14 +0000 | [diff] [blame] | 524 | void onekey(const char *keystroke, const char *desc, size_t len); |
David Lawrence Ramsey | 1f28b8f | 2002-09-27 14:21:59 +0000 | [diff] [blame] | 525 | #ifndef NDEBUG |
| 526 | int check_linenumbers(const filestruct *fileptr); |
| 527 | #endif |
David Lawrence Ramsey | 2dd7ed1 | 2003-09-29 05:15:24 +0000 | [diff] [blame] | 528 | size_t get_page_start(size_t column); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 529 | void reset_cursor(void); |
David Lawrence Ramsey | 07d3feb | 2004-04-16 05:15:11 +0000 | [diff] [blame] | 530 | void edit_add(const filestruct *fileptr, const char *converted, int |
| 531 | yval, size_t start); |
David Lawrence Ramsey | 5ffbec5 | 2003-09-16 01:16:49 +0000 | [diff] [blame] | 532 | void update_line(const filestruct *fileptr, size_t index); |
David Lawrence Ramsey | 2ed225f | 2004-05-28 20:44:09 +0000 | [diff] [blame^] | 533 | int need_horizontal_update(int old_placewewant); |
| 534 | int need_vertical_update(int old_placewewant); |
| 535 | void edit_scroll(updown direction, int nlines); |
| 536 | void edit_redraw(const filestruct *old_current); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 537 | void edit_refresh(void); |
David Lawrence Ramsey | 1356a0a | 2003-09-10 20:31:02 +0000 | [diff] [blame] | 538 | void edit_update(filestruct *fileptr, topmidnone location); |
David Lawrence Ramsey | 6aec4b8 | 2004-03-15 20:26:30 +0000 | [diff] [blame] | 539 | int statusq(int allowtabs, const shortcut *s, const char *def, |
Chris Allegretta | 5beed50 | 2003-01-05 20:41:21 +0000 | [diff] [blame] | 540 | #ifndef NANO_SMALL |
| 541 | historyheadtype *history_list, |
| 542 | #endif |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 543 | const char *msg, ...); |
David Lawrence Ramsey | f427694 | 2003-12-24 03:33:09 +0000 | [diff] [blame] | 544 | int do_yesno(int all, const char *msg); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 545 | int total_refresh(void); |
| 546 | void display_main_list(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 547 | int do_cursorpos(int constant); |
| 548 | int do_cursorpos_void(void); |
Chris Allegretta | 4640fe3 | 2003-02-10 03:10:03 +0000 | [diff] [blame] | 549 | int line_len(const char *ptr); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 550 | int do_help(void); |
David Lawrence Ramsey | ad40fdb | 2002-09-06 20:35:28 +0000 | [diff] [blame] | 551 | void do_replace_highlight(int highlight_flag, const char *word); |
Chris Allegretta | 6df90f5 | 2002-07-19 01:08:59 +0000 | [diff] [blame] | 552 | #ifdef DEBUG |
| 553 | void dump_buffer(const filestruct *inptr); |
| 554 | void dump_buffer_reverse(void); |
| 555 | #endif |
Chris Allegretta | 8a0de3b | 2000-11-24 20:45:14 +0000 | [diff] [blame] | 556 | #ifdef NANO_EXTRA |
Chris Allegretta | 34318ed | 2001-01-31 23:22:36 +0000 | [diff] [blame] | 557 | void do_credits(void); |
Chris Allegretta | 8a0de3b | 2000-11-24 20:45:14 +0000 | [diff] [blame] | 558 | #endif |