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 | * * |
| 5 | * Copyright (C) 1999 Chris Allegretta * |
| 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 * |
| 8 | * the Free Software Foundation; either version 1, or (at your option) * |
| 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 | |
| 22 | /* Externs */ |
| 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 | |
| 32 | extern int center_x, center_y, editwinrows; |
| 33 | extern int current_x, current_y, posible_max, totlines; |
| 34 | extern int placewewant; |
| 35 | extern int mark_beginx, samelinewrap; |
| 36 | extern int totsize, temp_opt; |
Chris Allegretta | 6d690a3 | 2000-08-03 22:51:21 +0000 | [diff] [blame] | 37 | extern int fill, flags,tabsize; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 38 | |
| 39 | extern WINDOW *edit, *topwin, *bottomwin; |
Chris Allegretta | 756f220 | 2000-09-01 13:32:47 +0000 | [diff] [blame] | 40 | extern char filename[PATH_MAX]; |
| 41 | extern char answer[132]; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 42 | extern char *hblank, *help_text; |
| 43 | extern struct stat fileinfo; |
| 44 | extern filestruct *current, *fileage, *edittop, *editbot, *filebot; |
| 45 | extern filestruct *cutbuffer, *mark_beginbuf; |
| 46 | extern shortcut *shortcut_list; |
| 47 | extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN]; |
| 48 | extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN]; |
| 49 | extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN]; |
| 50 | extern shortcut spell_list[SPELL_LIST_LEN]; |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 51 | |
| 52 | #ifdef HAVE_REGEX_H |
Chris Allegretta | 9fc8d43 | 2000-07-07 01:49:52 +0000 | [diff] [blame] | 53 | extern int use_regexp, regexp_compiled; |
| 54 | extern regex_t search_regexp; |
| 55 | extern regmatch_t regmatches[10]; |
Chris Allegretta | 805c26d | 2000-09-06 13:39:17 +0000 | [diff] [blame] | 56 | #endif |
| 57 | |
Chris Allegretta | 756f220 | 2000-09-01 13:32:47 +0000 | [diff] [blame] | 58 | extern toggle toggles[TOGGLE_LEN]; |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 59 | |
| 60 | /* Programs we want available */ |
| 61 | |
| 62 | char *strcasestr(char *haystack, char *needle); |
| 63 | char *strstrwrapper(char *haystack, char *needle); |
| 64 | int search_init(int replacing); |
| 65 | int renumber(filestruct * fileptr); |
| 66 | int free_filestruct(filestruct * src); |
| 67 | int xplustabs(void); |
| 68 | int do_yesno(int all, int leavecursor, char *msg, ...); |
| 69 | int actual_x(filestruct * fileptr, int xplus); |
| 70 | int strlenpt(char *buf); |
| 71 | int statusq(shortcut s[], int slen, char *def, char *msg, ...); |
| 72 | int write_file(char *name, int tmpfile); |
| 73 | int do_cut_text(void); |
| 74 | int do_uncut_text(void); |
| 75 | int no_help(void); |
Chris Allegretta | bceb1b2 | 2000-06-19 04:22:15 +0000 | [diff] [blame] | 76 | int renumber_all(void); |
| 77 | int open_file(char *filename, int insert, int quiet); |
| 78 | int do_writeout(int exiting); |
| 79 | int do_gotoline(long defline); |
| 80 | /* Now in move.c */ |
| 81 | int do_up(void); |
| 82 | int do_down(void); |
| 83 | int do_left(void); |
| 84 | int do_right(void); |
| 85 | |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 86 | |
| 87 | void shortcut_init(void); |
| 88 | void lowercase(char *src); |
| 89 | void blank_bottombars(void); |
Robert Siemborski | 3f8c7a8 | 2000-06-07 04:24:02 +0000 | [diff] [blame] | 90 | void check_wrap(filestruct * inptr, char ch); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 91 | void dump_buffer(filestruct * inptr); |
| 92 | void align(char **strp); |
Chris Allegretta | f1d33d3 | 2000-08-19 03:53:39 +0000 | [diff] [blame] | 93 | void edit_refresh(void), edit_refresh_clearok(void); |
Chris Allegretta | 234a34d | 2000-07-29 04:33:38 +0000 | [diff] [blame] | 94 | void edit_update(filestruct * fileptr, int topmidbot); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 95 | void update_cursor(void); |
| 96 | void delete_node(filestruct * fileptr); |
| 97 | void set_modified(void); |
| 98 | void dump_buffer_reverse(filestruct * inptr); |
| 99 | void reset_cursor(void); |
| 100 | void check_statblank(void); |
| 101 | void update_line(filestruct * fileptr, int index); |
Robert Siemborski | dd53ec2 | 2000-07-04 02:35:19 +0000 | [diff] [blame] | 102 | void fix_editbot(void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 103 | void statusbar(char *msg, ...); |
| 104 | void titlebar(void); |
| 105 | void previous_line(void); |
| 106 | void center_cursor(void); |
| 107 | void bottombars(shortcut s[], int slen); |
| 108 | void blank_statusbar_refresh(void); |
| 109 | void *nmalloc (size_t howmuch); |
| 110 | void wrap_reset(void); |
| 111 | void display_main_list(void); |
| 112 | void nano_small_msg(void); |
Chris Allegretta | bceb1b2 | 2000-06-19 04:22:15 +0000 | [diff] [blame] | 113 | void do_early_abort(void); |
| 114 | void *nmalloc(size_t howmuch); |
| 115 | void *nrealloc(void *ptr, size_t howmuch); |
| 116 | void die(char *msg, ...); |
| 117 | void new_file(void); |
Robert Siemborski | 63b3d7e | 2000-07-04 22:15:39 +0000 | [diff] [blame] | 118 | void new_magicline(void); |
Chris Allegretta | 7975ed8 | 2000-07-28 00:58:35 +0000 | [diff] [blame] | 119 | void splice_node(filestruct *begin, filestruct *new, filestruct *end); |
Chris Allegretta | 29d9025 | 2000-07-28 01:48:43 +0000 | [diff] [blame] | 120 | void null_at(char *data, int index); |
Chris Allegretta | 145a045 | 2000-07-31 12:51:00 +0000 | [diff] [blame] | 121 | void page_up_center(void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 122 | |
| 123 | int do_writeout_void(void), do_exit(void), do_gotoline_void(void); |
| 124 | int do_insertfile(void), do_search(void), page_up(void), page_down(void); |
Chris Allegretta | 145a045 | 2000-07-31 12:51:00 +0000 | [diff] [blame] | 125 | int do_cursorpos(void), do_spell(void); |
Chris Allegretta | a2ea193 | 2000-06-06 05:53:49 +0000 | [diff] [blame] | 126 | int do_up(void), do_down (void), do_right(void), do_left (void); |
| 127 | int do_home(void), do_end(void), total_refresh(void), do_mark(void); |
| 128 | int do_delete(void), do_backspace(void), do_tab(void), do_justify(void); |
| 129 | int do_first_line(void), do_last_line(void); |
| 130 | int do_replace(void), do_help(void), do_enter_void(void); |
| 131 | |
| 132 | filestruct *copy_node(filestruct * src); |
| 133 | filestruct *copy_filestruct(filestruct * src); |
| 134 | filestruct *make_new_node(filestruct * prevnode); |