1 /* session.h -- Functions found in session.c.
2 $Id: session.h,v 1.10 2008/03/04 09:44:57 gray Exp $
4 Copyright (C) 1993, 1998, 1999, 2001, 2002, 2004, 2007
5 Free Software Foundation, Inc.
7 This program is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 Originally written by Brian Fox (bfox@ai.mit.edu). */
28 /* All commands that can be invoked from within info_session () receive
29 arguments in the same way. This simple define declares the header
30 of a function named NAME, with associated documentation DOC. The
31 documentation string is groveled out of the source files by the
32 utility program `makedoc', which is also responsible for making
33 the documentation/function-pointer maps. */
34 #define DECLARE_INFO_COMMAND(name, doc) \
35 void name (WINDOW *window, int count, unsigned char key)
37 /* Variables found in session.h. */
38 extern VFunction *info_last_executed_command;
40 /* Variable controlling the garbage collection of files briefly visited
41 during searches. Such files are normally gc'ed, unless they were
42 compressed to begin with. If this variable is non-zero, it says
43 to gc even those file buffer contents which had to be uncompressed. */
44 extern int gc_compressed_files;
46 /* When non-zero, tiling takes place automatically when info_split_window
48 extern int auto_tiling_p;
50 /* Variable controlling the behaviour of default scrolling when you are
51 already at the bottom of a node. */
52 extern int info_scroll_behaviour;
53 extern char *info_scroll_choices[];
55 /* Values for info_scroll_behaviour. */
56 #define IS_Continuous 0 /* Try to get first menu item, or failing that, the
57 "Next:" pointer, or failing that, the "Up:" and
59 #define IS_NextOnly 1 /* Try to get "Next:" menu item. */
60 #define IS_PageOnly 2 /* Simply give up at the bottom of a node. */
62 extern int cursor_movement_scrolls_p;
64 /* Values for scroll_last_node */
65 #define SLN_Stop 0 /* Stop at the last node */
66 #define SLN_Scroll 1 /* Do usual scrolling */
67 #define SLN_Top 2 /* Go to the top node */
69 extern char *scroll_last_node_choices[];
70 /* Controls what to do when a scrolling command is issued at the end of the
72 extern int scroll_last_node;
74 /* Utility functions found in session.c */
75 extern void info_dispatch_on_key (unsigned char key, Keymap map);
76 extern unsigned char info_get_input_char (void);
77 extern unsigned char info_get_another_input_char (void);
78 extern unsigned char info_input_pending_p (void);
79 extern void remember_window_and_node (WINDOW *window, NODE *node);
80 extern void set_remembered_pagetop_and_point (WINDOW *window);
81 extern void set_window_pagetop (WINDOW *window, int desired_top);
82 extern void info_set_node_of_window (int remember, WINDOW *window,
84 extern void initialize_keyseq (void);
85 extern void add_char_to_keyseq (char character);
86 extern void info_gather_typeahead (void);
87 extern FILE_BUFFER *file_buffer_of_window (WINDOW *window);
88 extern long info_search_in_node (char *string, NODE *node,
89 long int start, WINDOW *window, int dir, int case_sensitive);
90 extern long info_target_search_node (NODE *node, char *string,
92 extern void info_select_reference (WINDOW *window, REFERENCE *entry);
93 extern int info_any_buffered_input_p (void);
94 extern void print_node (NODE *node);
95 extern void dump_node_to_file (NODE *node, char *filename,
97 extern void dump_nodes_to_file (char *filename, char **nodenames,
98 char *output_filename, int dump_subnodes);
99 extern char *program_name_from_file_name (char *file_name);
101 /* Do the physical deletion of WINDOW, and forget this window and
103 extern void info_delete_window_internal (WINDOW *window);
105 /* Tell Info that input is coming from the file FILENAME. */
106 extern void info_set_input_from_file (char *filename);
108 #define return_if_control_g(val) \
110 info_gather_typeahead (); \
111 if (info_input_pending_p () == Control ('g')) \
115 /* The names of the functions that run an info session. */
117 /* Starting an info session. */
118 extern void begin_multiple_window_info_session (char *filename,
120 extern void begin_info_session (NODE *initial_node);
121 extern void begin_info_session_with_error (NODE *initial_node,
122 const char *format, void *arg1, void *arg2);
123 extern void info_session (void);
124 extern void initialize_info_session (NODE *node, int clear_screen);
125 extern void info_read_and_dispatch (void);
126 extern void info_intuit_options_node (WINDOW *window,
127 NODE *initial_node, char *program);
129 /* Moving the point within a node. */
130 extern void info_next_line (WINDOW *window, int count, unsigned char key);
131 extern void info_prev_line (WINDOW *window, int count, unsigned char key);
132 extern void info_end_of_line (WINDOW *window, int count, unsigned char key);
133 extern void info_beginning_of_line (WINDOW *window, int count, unsigned char key);
134 extern void info_forward_char (WINDOW *window, int count, unsigned char key);
135 extern void info_backward_char (WINDOW *window, int count, unsigned char key);
136 extern void info_forward_word (WINDOW *window, int count, unsigned char key);
137 extern void info_backward_word (WINDOW *window, int count, unsigned char key);
138 extern void info_beginning_of_node (WINDOW *window, int count, unsigned char key);
139 extern void info_end_of_node (WINDOW *window, int count, unsigned char key);
140 extern void info_move_to_prev_xref (WINDOW *window, int count, unsigned char key);
141 extern void info_move_to_next_xref (WINDOW *window, int count, unsigned char key);
143 /* Scrolling text within a window. */
144 extern void info_scroll_forward (WINDOW *window, int count, unsigned char key);
145 extern void info_scroll_backward (WINDOW *window, int count, unsigned char key);
146 extern void info_redraw_display (WINDOW *window, int count, unsigned char key);
147 extern void info_toggle_wrap (WINDOW *window, int count, unsigned char key);
148 extern void info_toggle_regexp (WINDOW *window, int count, unsigned char key);
149 extern void info_move_to_window_line (WINDOW *window, int count,
151 extern void info_up_line (WINDOW *window, int count, unsigned char key);
152 extern void info_down_line (WINDOW *window, int count, unsigned char key);
153 extern void info_scroll_half_screen_down (WINDOW *window, int count,
155 extern void info_scroll_half_screen_up (WINDOW *window, int count,
157 extern void info_scroll_forward_set_window (WINDOW *window, int count,
159 extern void info_scroll_forward_page_only (WINDOW *window, int count,
161 extern void info_scroll_forward_page_only_set_window (WINDOW *window, int count,
163 extern void info_scroll_backward_set_window (WINDOW *window, int count,
165 extern void info_scroll_backward_page_only (WINDOW *window, int count,
167 extern void info_scroll_backward_page_only_set_window (WINDOW *window, int count,
169 extern void info_scroll_other_window_backward (WINDOW *window, int count,
172 /* Manipulating multiple windows. */
173 extern void info_split_window (WINDOW *window, int count, unsigned char key);
174 extern void info_delete_window (WINDOW *window, int count, unsigned char key);
175 extern void info_keep_one_window (WINDOW *window, int count, unsigned char key);
176 extern void info_grow_window (WINDOW *window, int count, unsigned char key);
177 extern void info_scroll_other_window (WINDOW *window, int count,
179 extern void info_tile_windows (WINDOW *window, int count, unsigned char key);
180 extern void info_next_window (WINDOW *window, int count, unsigned char key);
181 extern void info_prev_window (WINDOW *window, int count, unsigned char key);
183 /* Selecting nodes. */
184 extern void info_next_node (WINDOW *window, int count, unsigned char key);
185 extern void info_prev_node (WINDOW *window, int count, unsigned char key);
186 extern void info_up_node (WINDOW *window, int count, unsigned char key);
187 extern void info_last_node (WINDOW *window, int count, unsigned char key);
188 extern void info_first_node (WINDOW *window, int count, unsigned char key);
189 extern void info_history_node (WINDOW *window, int count, unsigned char key);
190 extern void info_goto_node (WINDOW *window, int count, unsigned char key);
191 extern void info_goto_invocation_node (WINDOW *window, int count,
193 extern void info_top_node (WINDOW *window, int count, unsigned char key);
194 extern void info_dir_node (WINDOW *window, int count, unsigned char key);
195 extern void info_global_next_node (WINDOW *window, int count, unsigned char key);
196 extern void info_global_prev_node (WINDOW *window, int count, unsigned char key);
197 extern void info_kill_node (WINDOW *window, int count, unsigned char key);
198 extern void info_view_file (WINDOW *window, int count, unsigned char key);
199 extern void info_menu_sequence (WINDOW *window, int count, unsigned char key);
200 extern NODE *info_follow_menus (NODE *initial_node, char **menus,
201 const char **errstr, char **errarg1, char **errarg2);
202 extern void info_man (WINDOW *window, int count, unsigned char key);
203 extern void list_visited_nodes (WINDOW *window, int count, unsigned char key);
204 extern void select_visited_node (WINDOW *window, int count, unsigned char key);
206 /* Selecting cross references. */
207 extern void info_menu_digit (WINDOW *window, int count, unsigned char key);
208 extern void info_menu_item (WINDOW *window, int count, unsigned char key);
209 extern void info_xref_item (WINDOW *window, int count, unsigned char key);
210 extern void info_find_menu (WINDOW *window, int count, unsigned char key);
211 extern void info_select_reference_this_line (WINDOW *window, int count,
213 extern void info_last_menu_item (WINDOW *window, int count, unsigned char key);
214 extern void info_visit_menu (WINDOW *window, int count, unsigned char key);
216 /* Hacking numeric arguments. */
217 extern int info_explicit_arg, info_numeric_arg, info_numeric_arg_sign;
219 extern void info_add_digit_to_numeric_arg (WINDOW *window, int count,
221 extern void info_universal_argument (WINDOW *window, int count,
223 extern void info_initialize_numeric_arg (void);
224 extern void info_numeric_arg_digit_loop (WINDOW *window, int count,
227 /* Searching commands. */
228 extern void info_search (WINDOW *window, int count, unsigned char key);
229 extern void isearch_forward (WINDOW *window, int count, unsigned char key);
230 extern void isearch_backward (WINDOW *window, int count, unsigned char key);
231 extern void info_search_case_sensitively (WINDOW *window, int count,
233 extern void info_search_backward (WINDOW *window, int count, unsigned char key);
234 extern void info_search_next (WINDOW *window, int count, unsigned char key);
235 extern void info_search_previous (WINDOW *window, int count, unsigned char key);
237 /* Dumping and printing nodes. */
238 extern void info_print_node (WINDOW *window, int count, unsigned char key);
241 extern void info_show_footnotes (WINDOW *window, int count, unsigned char key);
243 /* Miscellaneous commands. */
244 extern void info_abort_key (WINDOW *window, int count, unsigned char key);
245 extern void info_quit (WINDOW *window, int count, unsigned char key);
246 extern void info_do_lowercase_version (WINDOW *window, int count,
249 #endif /* not SESSION_H */