blob: 67e5ea38fa62b9ea61cd7b322d1d0c713782afd4 [file] [log] [blame]
Chris Allegretta11b00112000-08-06 21:13:45 +00001/* $Id$ */
Chris Allegrettaa2ea1932000-06-06 05:53:49 +00002/**************************************************************************
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 Allegretta805c26d2000-09-06 13:39:17 +000025
26#ifdef HAVE_REGEX_H
Chris Allegretta9fc8d432000-07-07 01:49:52 +000027#include <regex.h>
Chris Allegretta805c26d2000-09-06 13:39:17 +000028#endif
29
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000030#include "nano.h"
31
32extern int center_x, center_y, editwinrows;
33extern int current_x, current_y, posible_max, totlines;
34extern int placewewant;
35extern int mark_beginx, samelinewrap;
36extern int totsize, temp_opt;
Chris Allegretta6d690a32000-08-03 22:51:21 +000037extern int fill, flags,tabsize;
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000038
39extern WINDOW *edit, *topwin, *bottomwin;
Chris Allegretta756f2202000-09-01 13:32:47 +000040extern char filename[PATH_MAX];
41extern char answer[132];
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000042extern char *hblank, *help_text;
43extern struct stat fileinfo;
44extern filestruct *current, *fileage, *edittop, *editbot, *filebot;
45extern filestruct *cutbuffer, *mark_beginbuf;
46extern shortcut *shortcut_list;
47extern shortcut main_list[MAIN_LIST_LEN], whereis_list[WHEREIS_LIST_LEN];
48extern shortcut replace_list[REPLACE_LIST_LEN], goto_list[GOTO_LIST_LEN];
49extern shortcut writefile_list[WRITEFILE_LIST_LEN], help_list[HELP_LIST_LEN];
50extern shortcut spell_list[SPELL_LIST_LEN];
Chris Allegretta805c26d2000-09-06 13:39:17 +000051
52#ifdef HAVE_REGEX_H
Chris Allegretta9fc8d432000-07-07 01:49:52 +000053extern int use_regexp, regexp_compiled;
54extern regex_t search_regexp;
55extern regmatch_t regmatches[10];
Chris Allegretta805c26d2000-09-06 13:39:17 +000056#endif
57
Chris Allegretta756f2202000-09-01 13:32:47 +000058extern toggle toggles[TOGGLE_LEN];
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000059
60/* Programs we want available */
61
62char *strcasestr(char *haystack, char *needle);
63char *strstrwrapper(char *haystack, char *needle);
64int search_init(int replacing);
65int renumber(filestruct * fileptr);
66int free_filestruct(filestruct * src);
67int xplustabs(void);
68int do_yesno(int all, int leavecursor, char *msg, ...);
69int actual_x(filestruct * fileptr, int xplus);
70int strlenpt(char *buf);
71int statusq(shortcut s[], int slen, char *def, char *msg, ...);
72int write_file(char *name, int tmpfile);
73int do_cut_text(void);
74int do_uncut_text(void);
75int no_help(void);
Chris Allegrettabceb1b22000-06-19 04:22:15 +000076int renumber_all(void);
77int open_file(char *filename, int insert, int quiet);
78int do_writeout(int exiting);
79int do_gotoline(long defline);
80/* Now in move.c */
81int do_up(void);
82int do_down(void);
83int do_left(void);
84int do_right(void);
85
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000086
87void shortcut_init(void);
88void lowercase(char *src);
89void blank_bottombars(void);
Robert Siemborski3f8c7a82000-06-07 04:24:02 +000090void check_wrap(filestruct * inptr, char ch);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000091void dump_buffer(filestruct * inptr);
92void align(char **strp);
Chris Allegrettaf1d33d32000-08-19 03:53:39 +000093void edit_refresh(void), edit_refresh_clearok(void);
Chris Allegretta234a34d2000-07-29 04:33:38 +000094void edit_update(filestruct * fileptr, int topmidbot);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +000095void update_cursor(void);
96void delete_node(filestruct * fileptr);
97void set_modified(void);
98void dump_buffer_reverse(filestruct * inptr);
99void reset_cursor(void);
100void check_statblank(void);
101void update_line(filestruct * fileptr, int index);
Robert Siemborskidd53ec22000-07-04 02:35:19 +0000102void fix_editbot(void);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000103void statusbar(char *msg, ...);
104void titlebar(void);
105void previous_line(void);
106void center_cursor(void);
107void bottombars(shortcut s[], int slen);
108void blank_statusbar_refresh(void);
109void *nmalloc (size_t howmuch);
110void wrap_reset(void);
111void display_main_list(void);
112void nano_small_msg(void);
Chris Allegrettabceb1b22000-06-19 04:22:15 +0000113void do_early_abort(void);
114void *nmalloc(size_t howmuch);
115void *nrealloc(void *ptr, size_t howmuch);
116void die(char *msg, ...);
117void new_file(void);
Robert Siemborski63b3d7e2000-07-04 22:15:39 +0000118void new_magicline(void);
Chris Allegretta7975ed82000-07-28 00:58:35 +0000119void splice_node(filestruct *begin, filestruct *new, filestruct *end);
Chris Allegretta29d90252000-07-28 01:48:43 +0000120void null_at(char *data, int index);
Chris Allegretta145a0452000-07-31 12:51:00 +0000121void page_up_center(void);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000122
123int do_writeout_void(void), do_exit(void), do_gotoline_void(void);
124int do_insertfile(void), do_search(void), page_up(void), page_down(void);
Chris Allegretta145a0452000-07-31 12:51:00 +0000125int do_cursorpos(void), do_spell(void);
Chris Allegrettaa2ea1932000-06-06 05:53:49 +0000126int do_up(void), do_down (void), do_right(void), do_left (void);
127int do_home(void), do_end(void), total_refresh(void), do_mark(void);
128int do_delete(void), do_backspace(void), do_tab(void), do_justify(void);
129int do_first_line(void), do_last_line(void);
130int do_replace(void), do_help(void), do_enter_void(void);
131
132filestruct *copy_node(filestruct * src);
133filestruct *copy_filestruct(filestruct * src);
134filestruct *make_new_node(filestruct * prevnode);