"Fossies" - the Fresh Open Source Software Archive 
Member "tin-2.6.2/src/help.c" (9 Dec 2022, 45228 Bytes) of package /linux/misc/tin-2.6.2.tar.xz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "help.c" see the
Fossies "Dox" file reference documentation and the latest
Fossies "Diffs" side-by-side code changes report:
2.6.1_vs_2.6.2.
1 /*
2 * Project : tin - a Usenet reader
3 * Module : help.c
4 * Author : I. Lea
5 * Created : 1991-04-01
6 * Updated : 2022-11-01
7 * Notes :
8 *
9 * Copyright (c) 1991-2023 Iain Lea <iain@bricbrac.de>
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 *
16 * 1. Redistributions of source code must retain the above copyright notice,
17 * this list of conditions and the following disclaimer.
18 *
19 * 2. Redistributions in binary form must reproduce the above copyright
20 * notice, this list of conditions and the following disclaimer in the
21 * documentation and/or other materials provided with the distribution.
22 *
23 * 3. Neither the name of the copyright holder nor the names of its
24 * contributors may be used to endorse or promote products derived from
25 * this software without specific prior written permission.
26 *
27 * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37 * POSSIBILITY OF SUCH DAMAGE.
38 */
39
40
41 #ifndef TIN_H
42 # include "tin.h"
43 #endif /* !TIN_H */
44 #ifndef TCURSES_H
45 # include "tcurses.h"
46 #endif /* !TCURSES_H */
47
48
49 typedef struct thp {
50 constext *helptext;
51 t_function func;
52 } t_help_page;
53
54 /*
55 * local prototypes
56 */
57 static void make_help_page(FILE *fp, const t_help_page *helppage, const struct keylist keys);
58
59
60 static constext txt_help_empty_line[] = "";
61
62 static t_help_page attachment_help_page[] = {
63 { txt_help_title_navi, NOT_ASSIGNED },
64 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
65 { txt_help_global_page_up, GLOBAL_PAGE_UP },
66 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
67 { txt_help_global_line_up, GLOBAL_LINE_UP },
68 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
69 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
70 { txt_help_empty_line, NOT_ASSIGNED },
71 { txt_help_attachment_first, GLOBAL_FIRST_PAGE },
72 { txt_help_attachment_last, GLOBAL_LAST_PAGE },
73 { txt_help_attachment_goto, NOT_ASSIGNED },
74 { txt_help_empty_line, NOT_ASSIGNED },
75 { txt_help_title_disp, NOT_ASSIGNED },
76 { txt_help_attachment_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
77 { txt_help_empty_line, NOT_ASSIGNED },
78 { txt_help_title_attachment_ops, NOT_ASSIGNED },
79 { txt_help_attachment_select, ATTACHMENT_SELECT },
80 #ifndef DONT_HAVE_PIPING
81 { txt_help_attachment_pipe, ATTACHMENT_PIPE },
82 { txt_help_attachment_pipe_raw, GLOBAL_PIPE },
83 #endif /* !DONT_HAVE_PIPING */
84 { txt_help_attachment_save, ATTACHMENT_SAVE },
85 { txt_help_attachment_tag, ATTACHMENT_TAG },
86 { txt_help_attachment_tag_pattern, ATTACHMENT_TAG_PATTERN },
87 { txt_help_attachment_toggle_tagged, ATTACHMENT_TOGGLE_TAGGED },
88 { txt_help_attachment_untag, ATTACHMENT_UNTAG },
89 { txt_help_empty_line, NOT_ASSIGNED },
90 { txt_help_attachment_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
91 { txt_help_attachment_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
92 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
93 { txt_help_empty_line, NOT_ASSIGNED },
94 { txt_help_title_misc, NOT_ASSIGNED },
95 { txt_help_select_quit, GLOBAL_QUIT },
96 { txt_help_global_help, GLOBAL_HELP },
97 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
98 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
99 #ifndef NO_SHELL_ESCAPE
100 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
101 #endif /* !NO_SHELL_ESCAPE */
102 { NULL, NOT_ASSIGNED }
103 };
104
105 static t_help_page attrib_help_page[] = {
106 { txt_help_title_navi, NOT_ASSIGNED },
107 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
108 { txt_help_global_page_up, GLOBAL_PAGE_UP },
109 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
110 { txt_help_global_line_up, GLOBAL_LINE_UP },
111 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
112 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
113 { txt_help_empty_line, NOT_ASSIGNED },
114 { txt_help_attrib_first_opt, GLOBAL_FIRST_PAGE },
115 { txt_help_attrib_last_opt, GLOBAL_LAST_PAGE },
116 { txt_help_attrib_goto_opt, NOT_ASSIGNED },
117 { txt_help_empty_line, NOT_ASSIGNED },
118 { txt_help_attrib_search_opt_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
119 { txt_help_attrib_search_opt_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
120 { txt_help_select_search_group_comment, NOT_ASSIGNED },
121 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
122 { txt_help_empty_line, NOT_ASSIGNED },
123 { txt_help_title_attrib_ops, NOT_ASSIGNED },
124 { txt_help_attrib_reset_attrib, CONFIG_RESET_ATTRIB },
125 { txt_help_attrib_select, CONFIG_SELECT },
126 { txt_help_attrib_toggle_attrib, CONFIG_TOGGLE_ATTRIB },
127 { txt_help_empty_line, NOT_ASSIGNED },
128 { txt_help_title_misc, NOT_ASSIGNED },
129 { txt_help_select_quit, GLOBAL_QUIT },
130 { txt_help_select_quit_no_write, CONFIG_NO_SAVE },
131 { txt_help_global_help, GLOBAL_HELP },
132 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
133 #ifndef NO_SHELL_ESCAPE
134 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
135 #endif /* !NO_SHELL_ESCAPE */
136 { txt_help_empty_line, NOT_ASSIGNED },
137 { txt_help_global_version, GLOBAL_VERSION },
138 { NULL, NOT_ASSIGNED }
139 };
140
141 static t_help_page config_help_page[] = {
142 { txt_help_title_navi, NOT_ASSIGNED },
143 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
144 { txt_help_global_page_up, GLOBAL_PAGE_UP },
145 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
146 { txt_help_global_line_up, GLOBAL_LINE_UP },
147 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
148 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
149 { txt_help_empty_line, NOT_ASSIGNED },
150 { txt_help_config_first_opt, GLOBAL_FIRST_PAGE },
151 { txt_help_config_last_opt, GLOBAL_LAST_PAGE },
152 { txt_help_config_goto_opt, NOT_ASSIGNED },
153 { txt_help_empty_line, NOT_ASSIGNED },
154 { txt_help_config_search_opt_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
155 { txt_help_config_search_opt_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
156 { txt_help_select_search_group_comment, NOT_ASSIGNED },
157 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
158 { txt_help_empty_line, NOT_ASSIGNED },
159 { txt_help_title_config_ops, NOT_ASSIGNED },
160 { txt_help_config_select, CONFIG_SELECT },
161 { txt_help_config_toggle_attrib, CONFIG_TOGGLE_ATTRIB },
162 { txt_help_config_scope_menu, CONFIG_SCOPE_MENU },
163 { txt_help_empty_line, NOT_ASSIGNED },
164 { txt_help_title_misc, NOT_ASSIGNED },
165 { txt_help_select_quit, GLOBAL_QUIT },
166 { txt_help_select_quit_no_write, CONFIG_NO_SAVE },
167 { txt_help_global_help, GLOBAL_HELP },
168 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
169 #ifndef NO_SHELL_ESCAPE
170 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
171 #endif /* !NO_SHELL_ESCAPE */
172 { txt_help_empty_line, NOT_ASSIGNED },
173 { txt_help_global_version, GLOBAL_VERSION },
174 { NULL, NOT_ASSIGNED }
175 };
176
177 static t_help_page scope_help_page[] = {
178 { txt_help_title_navi, NOT_ASSIGNED },
179 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
180 { txt_help_global_page_up, GLOBAL_PAGE_UP },
181 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
182 { txt_help_global_line_up, GLOBAL_LINE_UP },
183 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
184 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
185 { txt_help_empty_line, NOT_ASSIGNED },
186 { txt_help_scope_first_scope, GLOBAL_FIRST_PAGE },
187 { txt_help_scope_last_scope, GLOBAL_LAST_PAGE },
188 { txt_help_scope_goto_scope, NOT_ASSIGNED },
189 { txt_help_empty_line, NOT_ASSIGNED },
190 { txt_help_title_scope_ops, NOT_ASSIGNED },
191 { txt_help_scope_add, SCOPE_ADD },
192 { txt_help_scope_move, SCOPE_MOVE },
193 { txt_help_scope_rename, SCOPE_RENAME },
194 { txt_help_scope_del, SCOPE_DELETE },
195 { txt_help_scope_select, SCOPE_SELECT },
196 { txt_help_empty_line, NOT_ASSIGNED },
197 { txt_help_scope_edit_attrib_file, SCOPE_EDIT_ATTRIBUTES_FILE },
198 { txt_help_empty_line, NOT_ASSIGNED },
199 { txt_help_title_misc, NOT_ASSIGNED },
200 { txt_help_select_quit, GLOBAL_QUIT },
201 { txt_help_global_help, GLOBAL_HELP },
202 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
203 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
204 #ifndef NO_SHELL_ESCAPE
205 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
206 #endif /* !NO_SHELL_ESCAPE */
207 { NULL, NOT_ASSIGNED }
208 };
209
210 static t_help_page select_help_page[] = {
211 { txt_help_title_navi, NOT_ASSIGNED },
212 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
213 { txt_help_global_page_up, GLOBAL_PAGE_UP },
214 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
215 { txt_help_global_line_up, GLOBAL_LINE_UP },
216 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
217 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
218 { txt_help_empty_line, NOT_ASSIGNED },
219 { txt_help_select_first_group, GLOBAL_FIRST_PAGE },
220 { txt_help_select_last_group, GLOBAL_LAST_PAGE },
221 { txt_help_select_group_by_num, NOT_ASSIGNED },
222 { txt_help_select_goto_group, SELECT_GOTO },
223 { txt_help_select_next_unread_group, SELECT_NEXT_UNREAD_GROUP },
224 #ifdef NNTP_ABLE
225 { txt_help_select_lookup_group, GLOBAL_LOOKUP_MESSAGEID },
226 { txt_help_select_lookup_group_comment, NOT_ASSIGNED },
227 #endif /* NNTP_ABLE */
228 { txt_help_empty_line, NOT_ASSIGNED },
229 { txt_help_select_search_group_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
230 { txt_help_select_search_group_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
231 { txt_help_select_search_group_comment, NOT_ASSIGNED },
232 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
233 { txt_help_empty_line, NOT_ASSIGNED },
234 { txt_help_title_disp, NOT_ASSIGNED },
235 { txt_help_select_toggle_read_groups, SELECT_TOGGLE_READ_DISPLAY },
236 { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
237 { txt_help_select_toggle_descriptions, SELECT_TOGGLE_DESCRIPTIONS },
238 { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
239 #ifdef HAVE_COLOR
240 { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
241 #endif /* HAVE_COLOR */
242 { txt_help_empty_line, NOT_ASSIGNED },
243 { txt_help_select_sort_active, SELECT_SORT_ACTIVE },
244 { txt_help_select_yank_active, SELECT_YANK_ACTIVE },
245 { txt_help_select_sync_with_active, SELECT_SYNC_WITH_ACTIVE },
246 { txt_help_empty_line, NOT_ASSIGNED },
247 { txt_help_title_ops, NOT_ASSIGNED },
248 { txt_help_select_read_group, SELECT_ENTER_GROUP },
249 { txt_help_select_next_unread_group, SELECT_ENTER_NEXT_UNREAD_GROUP },
250 #ifndef NO_POSTING
251 { txt_help_global_post, GLOBAL_POST },
252 { txt_help_global_post_postponed, GLOBAL_POSTPONED },
253 #endif /* NO_POSTING */
254 { txt_help_empty_line, NOT_ASSIGNED },
255 { txt_help_select_group_range, GLOBAL_SET_RANGE },
256 { txt_help_empty_line, NOT_ASSIGNED },
257 { txt_help_select_catchup, CATCHUP },
258 { txt_help_select_catchup_next_unread, CATCHUP_NEXT_UNREAD },
259 { txt_help_select_mark_group_unread, SELECT_MARK_GROUP_UNREAD },
260 { txt_help_select_subscribe, SELECT_SUBSCRIBE },
261 { txt_help_select_unsubscribe, SELECT_UNSUBSCRIBE },
262 { txt_help_select_subscribe_pattern, SELECT_SUBSCRIBE_PATTERN },
263 { txt_help_select_unsubscribe_pattern, SELECT_UNSUBSCRIBE_PATTERN },
264 { txt_help_select_move_group, SELECT_MOVE_GROUP },
265 { txt_help_empty_line, NOT_ASSIGNED },
266 { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER},
267 { txt_help_empty_line, NOT_ASSIGNED },
268 { txt_help_title_misc, NOT_ASSIGNED },
269 { txt_help_select_quit, GLOBAL_QUIT },
270 { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
271 { txt_help_select_quit_no_write, SELECT_QUIT_NO_WRITE },
272 { txt_help_global_help, GLOBAL_HELP },
273 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
274 { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
275 { txt_help_global_esc, GLOBAL_ABORT },
276 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
277 #ifndef NO_SHELL_ESCAPE
278 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
279 #endif /* !NO_SHELL_ESCAPE */
280 { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
281 { txt_help_select_reset_newsrc, SELECT_RESET_NEWSRC },
282 { txt_help_empty_line, NOT_ASSIGNED },
283 { txt_help_global_version, GLOBAL_VERSION },
284 { txt_help_global_connection_info, GLOBAL_CONNECTION_INFO },
285 { txt_help_bug_report, GLOBAL_BUGREPORT },
286 { NULL, NOT_ASSIGNED }
287 };
288
289 static t_help_page group_help_page[] = {
290 { txt_help_title_navi, NOT_ASSIGNED },
291 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
292 { txt_help_global_page_up, GLOBAL_PAGE_UP },
293 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
294 { txt_help_global_line_up, GLOBAL_LINE_UP },
295 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
296 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
297 { txt_help_empty_line, NOT_ASSIGNED },
298 { txt_help_group_first_thread, GLOBAL_FIRST_PAGE },
299 { txt_help_group_last_thread, GLOBAL_LAST_PAGE },
300 { txt_help_group_thread_by_num, NOT_ASSIGNED },
301 { txt_help_select_goto_group, GROUP_GOTO },
302 { txt_help_group_next, GROUP_NEXT_GROUP },
303 { txt_help_group_prev, GROUP_PREVIOUS_GROUP },
304 { txt_help_article_next_unread, GROUP_NEXT_UNREAD_ARTICLE },
305 { txt_help_article_prev_unread, GROUP_PREVIOUS_UNREAD_ARTICLE },
306 { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
307 { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
308 { txt_help_group_list_thread, GROUP_LIST_THREAD },
309 { txt_help_empty_line, NOT_ASSIGNED },
310 { txt_help_global_search_subj_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
311 { txt_help_global_search_subj_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
312 { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
313 { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
314 { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
315 { txt_help_global_search_body_comment, NOT_ASSIGNED },
316 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
317 { txt_help_empty_line, NOT_ASSIGNED },
318 { txt_help_title_disp, NOT_ASSIGNED },
319 { txt_help_group_toggle_read_articles, GROUP_TOGGLE_READ_UNREAD },
320 { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
321 { txt_help_select_toggle_descriptions, SELECT_TOGGLE_DESCRIPTIONS },
322 { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
323 #ifdef HAVE_COLOR
324 { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
325 #endif /* HAVE_COLOR */
326 { txt_help_empty_line, NOT_ASSIGNED },
327 { txt_help_global_toggle_subj_display, GROUP_TOGGLE_SUBJECT_DISPLAY},
328 { txt_help_group_toggle_threading, GROUP_TOGGLE_THREADING },
329 { txt_help_group_mark_unsel_art_read, GROUP_MARK_UNSELECTED_ARTICLES_READ },
330 { txt_help_group_toggle_getart_limit, GROUP_TOGGLE_GET_ARTICLES_LIMIT },
331 { txt_help_empty_line, NOT_ASSIGNED },
332 { txt_help_title_ops, NOT_ASSIGNED },
333 { txt_help_thread_read_article, GROUP_READ_BASENOTE },
334 { txt_help_article_next_unread, GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP },
335 #ifndef NO_POSTING
336 { txt_help_global_post, GLOBAL_POST },
337 { txt_help_global_post_postponed, GLOBAL_POSTPONED },
338 { txt_help_article_repost, GROUP_REPOST },
339 { txt_help_article_cancel, GROUP_CANCEL },
340 #endif /* NO_POSTING */
341 { txt_help_empty_line, NOT_ASSIGNED },
342 { txt_help_global_article_range, GLOBAL_SET_RANGE },
343 { txt_help_empty_line, NOT_ASSIGNED },
344 { txt_help_global_mail, GROUP_MAIL },
345 { txt_help_global_save, GROUP_SAVE },
346 { txt_help_global_auto_save, GROUP_AUTOSAVE },
347 #ifndef DONT_HAVE_PIPING
348 { txt_help_global_pipe, GLOBAL_PIPE },
349 #endif /* !DONT_HAVE_PIPING */
350 #ifndef DISABLE_PRINTING
351 { txt_help_global_print, GLOBAL_PRINT },
352 #endif /* !DISABLE_PRINTING */
353 { txt_help_empty_line, NOT_ASSIGNED },
354 { txt_help_global_tag, GROUP_TAG },
355 { txt_help_tag_parts, GROUP_TAG_PARTS },
356 { txt_help_group_untag_thread, GROUP_UNTAG },
357 { txt_help_empty_line, NOT_ASSIGNED },
358 { txt_help_group_mark_thread_read, GROUP_MARK_THREAD_READ },
359 { txt_help_group_catchup, CATCHUP },
360 { txt_help_group_catchup_next, CATCHUP_NEXT_UNREAD },
361 { txt_help_group_mark_article_unread, MARK_ARTICLE_UNREAD },
362 { txt_help_group_mark_thread_unread, MARK_THREAD_UNREAD },
363 { txt_help_mark_feed_read, MARK_FEED_READ },
364 { txt_help_mark_feed_unread, MARK_FEED_UNREAD },
365 { txt_help_empty_line, NOT_ASSIGNED },
366 { txt_help_group_select_all, GROUP_DO_AUTOSELECT },
367 { txt_help_group_select_thread, GROUP_SELECT_THREAD },
368 { txt_help_group_select_thread_pattern, GROUP_SELECT_PATTERN },
369 { txt_help_group_select_thread_if_unread_selected, GROUP_SELECT_THREAD_IF_UNREAD_SELECTED },
370 { txt_help_group_toggle_thread_selection, GROUP_TOGGLE_SELECT_THREAD },
371 { txt_help_group_reverse_thread_selection, GROUP_REVERSE_SELECTIONS },
372 { txt_help_group_undo_thread_selection, GROUP_UNDO_SELECTIONS },
373 { txt_help_empty_line, NOT_ASSIGNED },
374 { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
375 { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
376 { txt_help_article_quick_select, GLOBAL_QUICK_FILTER_SELECT },
377 { txt_help_article_quick_kill, GLOBAL_QUICK_FILTER_KILL },
378 { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER},
379 { txt_help_empty_line, NOT_ASSIGNED },
380 { txt_help_title_misc, NOT_ASSIGNED },
381 { txt_help_global_previous_menu, GLOBAL_QUIT },
382 { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
383 { txt_help_global_help, GLOBAL_HELP },
384 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
385 { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
386 { txt_help_global_esc, GLOBAL_ABORT },
387 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
388 #ifndef NO_SHELL_ESCAPE
389 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
390 #endif /* !NO_SHELL_ESCAPE */
391 { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
392 { txt_help_empty_line, NOT_ASSIGNED },
393 { txt_help_global_version, GLOBAL_VERSION },
394 { txt_help_global_connection_info, GLOBAL_CONNECTION_INFO },
395 { txt_help_bug_report, GLOBAL_BUGREPORT },
396 { NULL, NOT_ASSIGNED }
397 };
398
399 static t_help_page thread_help_page[] = {
400 { txt_help_title_navi, NOT_ASSIGNED },
401 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
402 { txt_help_global_page_up, GLOBAL_PAGE_UP },
403 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
404 { txt_help_global_line_up, GLOBAL_LINE_UP },
405 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
406 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
407 { txt_help_empty_line, NOT_ASSIGNED },
408 { txt_help_thread_first_article, GLOBAL_FIRST_PAGE },
409 { txt_help_thread_last_article, GLOBAL_LAST_PAGE },
410 { txt_help_thread_article_by_num, NOT_ASSIGNED },
411 { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
412 { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
413 { txt_help_empty_line, NOT_ASSIGNED },
414 { txt_help_global_search_subj_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
415 { txt_help_global_search_subj_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
416 { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
417 { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
418 { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
419 { txt_help_global_search_body_comment, NOT_ASSIGNED },
420 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
421 { txt_help_empty_line, NOT_ASSIGNED },
422 { txt_help_title_disp, NOT_ASSIGNED },
423 { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
424 { txt_help_global_toggle_subj_display, THREAD_TOGGLE_SUBJECT_DISPLAY},
425 { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
426 #ifdef HAVE_COLOR
427 { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
428 #endif /* HAVE_COLOR */
429 { txt_help_empty_line, NOT_ASSIGNED },
430 { txt_help_title_ops, NOT_ASSIGNED },
431 { txt_help_thread_read_article, THREAD_READ_ARTICLE },
432 { txt_help_article_next_unread, THREAD_READ_NEXT_ARTICLE_OR_THREAD },
433 #ifndef NO_POSTING
434 { txt_help_global_post, GLOBAL_POST },
435 { txt_help_global_post_postponed, GLOBAL_POSTPONED },
436 { txt_help_article_cancel, THREAD_CANCEL },
437 #endif /* NO_POSTING */
438 { txt_help_empty_line, NOT_ASSIGNED },
439 { txt_help_global_article_range, GLOBAL_SET_RANGE },
440 { txt_help_empty_line, NOT_ASSIGNED },
441 { txt_help_global_mail, THREAD_MAIL },
442 { txt_help_global_save, THREAD_SAVE },
443 { txt_help_global_auto_save, THREAD_AUTOSAVE },
444 #ifndef DONT_HAVE_PIPING
445 { txt_help_global_pipe, GLOBAL_PIPE },
446 #endif /* !DONT_HAVE_PIPING */
447 #ifndef DISABLE_PRINTING
448 { txt_help_global_print, GLOBAL_PRINT },
449 #endif /* !DISABLE_PRINTING */
450 { txt_help_empty_line, NOT_ASSIGNED },
451 { txt_help_global_tag, THREAD_TAG },
452 { txt_help_tag_parts, THREAD_TAG_PARTS },
453 { txt_help_group_untag_thread, THREAD_UNTAG },
454 { txt_help_empty_line, NOT_ASSIGNED },
455 { txt_help_thread_mark_article_read, THREAD_MARK_ARTICLE_READ },
456 { txt_help_thread_catchup, CATCHUP },
457 { txt_help_thread_catchup_next_unread, CATCHUP_NEXT_UNREAD },
458 { txt_help_thread_mark_article_unread, MARK_ARTICLE_UNREAD },
459 { txt_help_thread_mark_thread_unread, MARK_THREAD_UNREAD },
460 { txt_help_mark_feed_read, MARK_FEED_READ },
461 { txt_help_mark_feed_unread, MARK_FEED_UNREAD },
462 { txt_help_empty_line, NOT_ASSIGNED },
463 { txt_help_group_select_thread, THREAD_SELECT_ARTICLE },
464 { txt_help_group_toggle_thread_selection, THREAD_TOGGLE_ARTICLE_SELECTION },
465 { txt_help_group_reverse_thread_selection, THREAD_REVERSE_SELECTIONS },
466 { txt_help_group_undo_thread_selection, THREAD_UNDO_SELECTIONS },
467 { txt_help_empty_line, NOT_ASSIGNED },
468 { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
469 { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
470 { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER },
471 { txt_help_empty_line, NOT_ASSIGNED },
472 { txt_help_title_misc, NOT_ASSIGNED },
473 { txt_help_global_previous_menu, GLOBAL_QUIT },
474 { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
475 { txt_help_global_help, GLOBAL_HELP },
476 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
477 { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
478 { txt_help_global_esc, GLOBAL_ABORT },
479 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
480 #ifndef NO_SHELL_ESCAPE
481 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
482 #endif /* !NO_SHELL_ESCAPE */
483 { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
484 { txt_help_empty_line, NOT_ASSIGNED },
485 { txt_help_global_version, GLOBAL_VERSION },
486 { txt_help_global_connection_info, GLOBAL_CONNECTION_INFO },
487 { txt_help_bug_report, GLOBAL_BUGREPORT },
488 { NULL, NOT_ASSIGNED }
489 };
490
491 static t_help_page page_help_page[] = {
492 { txt_help_title_navi, NOT_ASSIGNED },
493 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
494 { txt_help_global_page_up, GLOBAL_PAGE_UP },
495 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
496 { txt_help_global_line_up, GLOBAL_LINE_UP },
497 { txt_help_article_first_page, GLOBAL_FIRST_PAGE },
498 { txt_help_article_last_page, GLOBAL_LAST_PAGE },
499 { txt_help_empty_line, NOT_ASSIGNED },
500 { txt_help_article_by_num, NOT_ASSIGNED },
501 { txt_help_article_next_thread, PAGE_NEXT_THREAD },
502 { txt_help_article_next_unread, PAGE_NEXT_UNREAD },
503 { txt_help_article_next, PAGE_NEXT_ARTICLE },
504 { txt_help_article_next_unread, PAGE_NEXT_UNREAD_ARTICLE },
505 { txt_help_article_prev, PAGE_PREVIOUS_ARTICLE },
506 { txt_help_article_prev_unread, PAGE_PREVIOUS_UNREAD_ARTICLE },
507 { txt_help_article_first_in_thread, PAGE_TOP_THREAD },
508 { txt_help_article_last_in_thread, PAGE_BOTTOM_THREAD },
509 { txt_help_global_last_art, GLOBAL_LAST_VIEWED },
510 { txt_help_group_list_thread, PAGE_LIST_THREAD },
511 { txt_help_article_parent, PAGE_GOTO_PARENT },
512 { txt_help_global_lookup_art, GLOBAL_LOOKUP_MESSAGEID },
513 { txt_help_article_quit_to_select_level, PAGE_GROUP_SELECT },
514 { txt_help_article_skip_quote, PAGE_SKIP_INCLUDED_TEXT },
515 { txt_help_empty_line, NOT_ASSIGNED },
516 { txt_help_article_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
517 { txt_help_article_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
518 { txt_help_global_search_auth_forwards, GLOBAL_SEARCH_AUTHOR_FORWARD },
519 { txt_help_global_search_auth_backwards, GLOBAL_SEARCH_AUTHOR_BACKWARD },
520 { txt_help_global_search_body, GLOBAL_SEARCH_BODY },
521 { txt_help_global_search_body_comment, NOT_ASSIGNED },
522 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
523 { txt_help_empty_line, NOT_ASSIGNED },
524 { txt_help_title_disp, NOT_ASSIGNED },
525 { txt_help_global_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
526 { txt_help_article_toggle_rot13, PAGE_TOGGLE_ROT13 },
527 { txt_help_global_toggle_inverse_video, GLOBAL_TOGGLE_INVERSE_VIDEO },
528 { txt_help_article_show_raw, PAGE_TOGGLE_RAW },
529 { txt_help_article_toggle_headers, PAGE_TOGGLE_HEADERS },
530 #ifdef HAVE_COLOR
531 { txt_help_global_toggle_color, GLOBAL_TOGGLE_COLOR },
532 #endif /* HAVE_COLOR */
533 { txt_help_article_toggle_highlight, PAGE_TOGGLE_HIGHLIGHTING },
534 { txt_help_article_toggle_tex2iso, PAGE_TOGGLE_TEX2ISO },
535 { txt_help_article_toggle_tabwidth, PAGE_TOGGLE_TABS },
536 { txt_help_article_toggle_uue, PAGE_TOGGLE_UUE },
537 { txt_help_article_toggle_formfeed, PAGE_REVEAL },
538 { txt_help_empty_line, NOT_ASSIGNED },
539 { txt_help_title_ops, NOT_ASSIGNED },
540 #ifndef NO_POSTING
541 { txt_help_global_post, GLOBAL_POST },
542 { txt_help_global_post_postponed, GLOBAL_POSTPONED },
543 { txt_help_article_followup, PAGE_FOLLOWUP_QUOTE },
544 { txt_help_article_followup_no_quote, PAGE_FOLLOWUP },
545 { txt_help_article_followup_with_header, PAGE_FOLLOWUP_QUOTE_HEADERS },
546 { txt_help_article_repost, PAGE_REPOST },
547 { txt_help_article_cancel, PAGE_CANCEL },
548 #endif /* NO_POSTING */
549 { txt_help_article_reply, PAGE_REPLY_QUOTE },
550 { txt_help_article_reply_no_quote, PAGE_REPLY },
551 { txt_help_article_reply_with_header, PAGE_REPLY_QUOTE_HEADERS },
552 { txt_help_article_edit, PAGE_EDIT_ARTICLE },
553 { txt_help_empty_line, NOT_ASSIGNED },
554 { txt_help_global_mail, PAGE_MAIL },
555 { txt_help_global_save, PAGE_SAVE },
556 { txt_help_global_auto_save, PAGE_AUTOSAVE },
557 #ifndef DONT_HAVE_PIPING
558 { txt_help_global_pipe, GLOBAL_PIPE },
559 #endif /* !DONT_HAVE_PIPING */
560 #ifndef DISABLE_PRINTING
561 { txt_help_global_print, GLOBAL_PRINT },
562 #endif /* !DISABLE_PRINTING */
563 { txt_help_article_view_attachments, PAGE_VIEW_ATTACHMENTS },
564 { txt_help_empty_line, NOT_ASSIGNED },
565 { txt_help_global_tag, PAGE_TAG },
566 { txt_help_empty_line, NOT_ASSIGNED },
567 { txt_help_article_mark_thread_read, PAGE_MARK_THREAD_READ },
568 { txt_help_thread_catchup, CATCHUP },
569 { txt_help_thread_catchup_next_unread, CATCHUP_NEXT_UNREAD },
570 { txt_help_group_mark_article_unread, MARK_ARTICLE_UNREAD },
571 { txt_help_thread_mark_thread_unread, MARK_THREAD_UNREAD },
572 { txt_help_empty_line, NOT_ASSIGNED },
573 { txt_help_article_autoselect, GLOBAL_MENU_FILTER_SELECT },
574 { txt_help_article_autokill, GLOBAL_MENU_FILTER_KILL },
575 { txt_help_article_quick_select, GLOBAL_QUICK_FILTER_SELECT },
576 { txt_help_article_quick_kill, GLOBAL_QUICK_FILTER_KILL },
577 { txt_help_global_edit_filter, GLOBAL_EDIT_FILTER },
578 { txt_help_empty_line, NOT_ASSIGNED },
579 { txt_help_title_misc, NOT_ASSIGNED },
580 { txt_help_article_browse_urls, PAGE_VIEW_URL },
581 { txt_help_global_previous_menu, GLOBAL_QUIT },
582 { txt_help_global_quit_tin, GLOBAL_QUIT_TIN },
583 { txt_help_global_help, GLOBAL_HELP },
584 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
585 { txt_help_global_option_menu, GLOBAL_OPTION_MENU },
586 { txt_help_global_esc, GLOBAL_ABORT },
587 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
588 #ifndef NO_SHELL_ESCAPE
589 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
590 #endif /* !NO_SHELL_ESCAPE */
591 { txt_help_global_posting_history, GLOBAL_DISPLAY_POST_HISTORY },
592 #ifdef HAVE_PGP_GPG
593 { txt_help_empty_line, NOT_ASSIGNED },
594 { txt_help_article_pgp, PAGE_PGP_CHECK_ARTICLE },
595 #endif /* HAVE_PGP_GPG */
596 { txt_help_empty_line, NOT_ASSIGNED },
597 { txt_help_global_connection_info, GLOBAL_CONNECTION_INFO },
598 { txt_help_global_version, GLOBAL_VERSION },
599 { NULL, NOT_ASSIGNED }
600 };
601
602 static t_help_page post_hist_help_page[] = {
603 { txt_help_title_navi, NOT_ASSIGNED },
604 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
605 { txt_help_global_page_up, GLOBAL_PAGE_UP },
606 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
607 { txt_help_global_line_up, GLOBAL_LINE_UP },
608 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
609 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
610 { txt_help_empty_line, NOT_ASSIGNED },
611 { txt_help_thread_first_article, GLOBAL_FIRST_PAGE },
612 { txt_help_thread_last_article, GLOBAL_LAST_PAGE },
613 { txt_help_thread_article_by_num, NOT_ASSIGNED },
614 { txt_help_empty_line, NOT_ASSIGNED },
615 { txt_help_post_hist_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
616 { txt_help_post_hist_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
617 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
618 { txt_help_empty_line, NOT_ASSIGNED },
619 { txt_help_title_post_hist_ops, NOT_ASSIGNED },
620 { txt_help_post_hist_select, POSTED_SELECT },
621 { txt_help_empty_line, NOT_ASSIGNED },
622 { txt_help_title_disp, NOT_ASSIGNED },
623 { txt_help_post_hist_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
624 { txt_help_empty_line, NOT_ASSIGNED },
625 { txt_help_title_misc, NOT_ASSIGNED },
626 { txt_help_select_quit, GLOBAL_QUIT },
627 { txt_help_global_help, GLOBAL_HELP },
628 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
629 { txt_help_global_esc, GLOBAL_ABORT },
630 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
631 #ifndef NO_SHELL_ESCAPE
632 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
633 #endif /* !NO_SHELL_ESCAPE */
634 { NULL, NOT_ASSIGNED }
635 };
636
637 static t_help_page url_help_page[] = {
638 { txt_help_title_navi, NOT_ASSIGNED },
639 { txt_help_global_page_down, GLOBAL_PAGE_DOWN },
640 { txt_help_global_page_up, GLOBAL_PAGE_UP },
641 { txt_help_global_line_down, GLOBAL_LINE_DOWN },
642 { txt_help_global_line_up, GLOBAL_LINE_UP },
643 { txt_help_global_scroll_down, GLOBAL_SCROLL_DOWN },
644 { txt_help_global_scroll_up, GLOBAL_SCROLL_UP },
645 { txt_help_empty_line, NOT_ASSIGNED },
646 { txt_help_url_first_url, GLOBAL_FIRST_PAGE },
647 { txt_help_url_last_url, GLOBAL_LAST_PAGE },
648 { txt_help_url_goto_url, NOT_ASSIGNED },
649 { txt_help_empty_line, NOT_ASSIGNED },
650 { txt_help_title_url_ops, NOT_ASSIGNED },
651 { txt_help_url_select, URL_SELECT },
652 { txt_help_empty_line, NOT_ASSIGNED },
653 { txt_help_url_search_forwards, GLOBAL_SEARCH_SUBJECT_FORWARD },
654 { txt_help_url_search_backwards, GLOBAL_SEARCH_SUBJECT_BACKWARD },
655 { txt_help_global_search_repeat, GLOBAL_SEARCH_REPEAT },
656 { txt_help_empty_line, NOT_ASSIGNED },
657 { txt_help_title_disp, NOT_ASSIGNED },
658 { txt_help_url_toggle_info_line, GLOBAL_TOGGLE_INFO_LAST_LINE },
659 { txt_help_empty_line, NOT_ASSIGNED },
660 { txt_help_title_misc, NOT_ASSIGNED },
661 { txt_help_select_quit, GLOBAL_QUIT },
662 { txt_help_global_help, GLOBAL_HELP },
663 { txt_help_global_toggle_mini_help, GLOBAL_TOGGLE_HELP_DISPLAY },
664 { txt_help_global_esc, GLOBAL_ABORT },
665 { txt_help_global_redraw_screen, GLOBAL_REDRAW_SCREEN },
666 #ifndef NO_SHELL_ESCAPE
667 { txt_help_global_shell_escape, GLOBAL_SHELL_ESCAPE },
668 #endif /* !NO_SHELL_ESCAPE */
669 { NULL, NOT_ASSIGNED }
670 };
671
672
673 static void
674 make_help_page(
675 FILE *fp,
676 const t_help_page *helppage,
677 const struct keylist keys)
678 {
679 char *buf;
680 char *last;
681 char key[MAXKEYLEN];
682 /*
683 * length is only needed to pass it to expand_ctrl_chars()
684 * we have no need for the value
685 */
686 size_t length;
687 size_t i;
688
689 if (!helppage)
690 return;
691
692 buf = my_malloc(LEN);
693 last = my_malloc(LEN);
694
695 last[0] = '\0';
696
697 while (helppage->helptext) {
698 if (helppage->func == NOT_ASSIGNED) {
699 /*
700 * as expand_ctrl_chars() may has shrunk buf
701 * make sure buf is large enough to contain the helpline
702 */
703 buf = my_realloc(buf, LEN);
704
705 if (!strlen(helppage->helptext)) /* avoid translation of empty strings */
706 strcpy(buf, "\n");
707 else
708 strncpy(buf, _(helppage->helptext), LEN);
709 buf[LEN - 1] = '\0';
710 expand_ctrl_chars(&buf, &length, 8);
711 fprintf(fp, "%s\n", buf);
712 } else {
713 for (i = 0; i < keys.used; i++) {
714 if (keys.list[i].function == helppage->func && keys.list[i].key) {
715 buf = my_realloc(buf, LEN);
716 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
717 snprintf(buf, LEN, "%s\t %s", printascii(key, (wint_t) keys.list[i].key), _(helppage->helptext));
718 #else
719 snprintf(buf, LEN, "%s\t %s", printascii(key, keys.list[i].key), _(helppage->helptext));
720 #endif /* MULTIBYTE_ABLE &&! NO_LOCALE*/
721 expand_ctrl_chars(&buf, &length, 8);
722 if (strcmp(last, buf)) {
723 fprintf(fp, "%s\n", buf);
724 strncpy(last, buf, LEN - 1);
725 }
726 }
727 }
728 }
729 helppage++;
730 }
731
732 free(buf);
733 free(last);
734 }
735
736
737 void
738 show_help_page(
739 const int level,
740 const char *title)
741 {
742 FILE *fp;
743
744 if (!(fp = tmpfile()))
745 return;
746
747 switch (level) {
748 case ATTACHMENT_LEVEL:
749 make_help_page(fp, attachment_help_page, attachment_keys);
750 break;
751
752 case ATTRIB_LEVEL:
753 make_help_page(fp, attrib_help_page, option_menu_keys);
754 break;
755
756 case CONFIG_LEVEL:
757 make_help_page(fp, config_help_page, option_menu_keys);
758 break;
759
760 case SCOPE_LEVEL:
761 make_help_page(fp, scope_help_page, scope_keys);
762 break;
763
764 case SELECT_LEVEL:
765 make_help_page(fp, select_help_page, select_keys);
766 break;
767
768 case GROUP_LEVEL:
769 make_help_page(fp, group_help_page, group_keys);
770 break;
771
772 case THREAD_LEVEL:
773 make_help_page(fp, thread_help_page, thread_keys);
774 break;
775
776 case PAGE_LEVEL:
777 make_help_page(fp, page_help_page, page_keys);
778 break;
779
780 case POSTED_LEVEL:
781 make_help_page(fp, post_hist_help_page, post_hist_keys);
782 break;
783
784 case URL_LEVEL:
785 make_help_page(fp, url_help_page, url_keys);
786 break;
787
788 case INFO_PAGER:
789 default: /* should not happen */
790 error_message(2, _(txt_error_unknown_dlevel));
791 fclose(fp);
792 return;
793 }
794
795 info_pager(fp, title, TRUE);
796 fclose(fp);
797 info_pager(NULL, NULL, TRUE); /* free mem */
798 }
799
800
801 void
802 show_mini_help(
803 int level)
804 {
805 char buf[LEN];
806 char key[20][MAXKEYLEN];
807 int line;
808 size_t bufs;
809
810 if (!tinrc.beginner_level)
811 return;
812
813 line = NOTESLINES + MINI_HELP_LINES - 2;
814 bufs = sizeof(buf) - 1;
815
816 #ifdef HAVE_COLOR
817 fcol(tinrc.col_minihelp);
818 #endif /* HAVE_COLOR */
819
820 switch (level) {
821 case ATTACHMENT_LEVEL:
822 snprintf(buf, bufs, _(txt_mini_attachment_1),
823 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, attachment_keys),
824 PrintFuncKey(key[1], GLOBAL_LINE_UP, attachment_keys),
825 PrintFuncKey(key[2], GLOBAL_HELP, attachment_keys),
826 PrintFuncKey(key[3], GLOBAL_QUIT, attachment_keys));
827 center_line(line, FALSE, buf);
828 #ifndef DONT_HAVE_PIPING
829 snprintf(buf, bufs, _(txt_mini_attachment_2),
830 PrintFuncKey(key[0], ATTACHMENT_SELECT, attachment_keys),
831 PrintFuncKey(key[5], ATTACHMENT_PIPE, attachment_keys),
832 PrintFuncKey(key[6], GLOBAL_PIPE, attachment_keys),
833 PrintFuncKey(key[1], ATTACHMENT_SAVE, attachment_keys),
834 PrintFuncKey(key[2], ATTACHMENT_TAG, attachment_keys),
835 PrintFuncKey(key[3], ATTACHMENT_TAG_PATTERN, attachment_keys),
836 PrintFuncKey(key[4], ATTACHMENT_UNTAG, attachment_keys));
837 #else
838 snprintf(buf, bufs, _(txt_mini_attachment_2),
839 PrintFuncKey(key[0], ATTACHMENT_SELECT, attachment_keys),
840 PrintFuncKey(key[1], ATTACHMENT_SAVE, attachment_keys),
841 PrintFuncKey(key[2], ATTACHMENT_TAG, attachment_keys),
842 PrintFuncKey(key[3], ATTACHMENT_TAG_PATTERN, attachment_keys),
843 PrintFuncKey(key[4], ATTACHMENT_UNTAG, attachment_keys));
844 #endif /* !DONT_HAVE_PIPING */
845 center_line(line + 1, FALSE, buf);
846 snprintf(buf, bufs, _(txt_mini_attachment_3),
847 PrintFuncKey(key[1], ATTACHMENT_TOGGLE_TAGGED, attachment_keys),
848 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, attachment_keys),
849 PrintFuncKey(key[3], GLOBAL_SEARCH_SUBJECT_BACKWARD, attachment_keys),
850 PrintFuncKey(key[4], GLOBAL_SEARCH_REPEAT, attachment_keys));
851 center_line(line + 2, FALSE, buf);
852 break;
853
854 case SCOPE_LEVEL:
855 snprintf(buf, bufs, _(txt_mini_scope_1),
856 PrintFuncKey(key[0], SCOPE_ADD, scope_keys),
857 PrintFuncKey(key[1], SCOPE_MOVE, scope_keys),
858 PrintFuncKey(key[2], SCOPE_RENAME, scope_keys),
859 PrintFuncKey(key[3], SCOPE_DELETE, scope_keys));
860 center_line(line, FALSE, buf);
861 snprintf(buf, bufs, _(txt_mini_scope_2),
862 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, scope_keys),
863 PrintFuncKey(key[1], GLOBAL_LINE_UP, scope_keys),
864 PrintFuncKey(key[2], GLOBAL_HELP, scope_keys),
865 PrintFuncKey(key[3], GLOBAL_QUIT, scope_keys));
866 center_line(line + 1, FALSE, buf);
867 break;
868
869 case SELECT_LEVEL:
870 snprintf(buf, bufs, _(txt_mini_select_1),
871 PrintFuncKey(key[0], SELECT_ENTER_NEXT_UNREAD_GROUP, select_keys),
872 PrintFuncKey(key[1], SELECT_GOTO, select_keys),
873 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, select_keys),
874 PrintFuncKey(key[3], CATCHUP, select_keys));
875 center_line(line, FALSE, buf);
876 snprintf(buf, bufs, _(txt_mini_select_2),
877 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, select_keys),
878 PrintFuncKey(key[1], GLOBAL_LINE_UP, select_keys),
879 PrintFuncKey(key[2], GLOBAL_HELP, select_keys),
880 PrintFuncKey(key[3], SELECT_MOVE_GROUP, select_keys),
881 PrintFuncKey(key[4], GLOBAL_QUIT, select_keys),
882 PrintFuncKey(key[5], SELECT_TOGGLE_READ_DISPLAY, select_keys));
883 center_line(line + 1, FALSE, buf);
884 snprintf(buf, bufs, _(txt_mini_select_3),
885 PrintFuncKey(key[0], SELECT_SUBSCRIBE, select_keys),
886 PrintFuncKey(key[1], SELECT_SUBSCRIBE_PATTERN, select_keys),
887 PrintFuncKey(key[2], SELECT_UNSUBSCRIBE, select_keys),
888 PrintFuncKey(key[3], SELECT_UNSUBSCRIBE_PATTERN, select_keys),
889 PrintFuncKey(key[4], SELECT_YANK_ACTIVE, select_keys));
890 center_line(line + 2, FALSE, buf);
891 break;
892
893 case GROUP_LEVEL:
894 snprintf(buf, bufs, _(txt_mini_group_1),
895 PrintFuncKey(key[0], GROUP_NEXT_UNREAD_ARTICLE_OR_GROUP, group_keys),
896 PrintFuncKey(key[1], GLOBAL_SEARCH_SUBJECT_FORWARD, group_keys),
897 PrintFuncKey(key[2], GLOBAL_MENU_FILTER_KILL, group_keys));
898 center_line(line, FALSE, buf);
899 snprintf(buf, bufs, _(txt_mini_group_2),
900 PrintFuncKey(key[0], GLOBAL_SEARCH_AUTHOR_FORWARD, group_keys),
901 PrintFuncKey(key[1], CATCHUP, group_keys),
902 PrintFuncKey(key[2], GLOBAL_LINE_DOWN, group_keys),
903 PrintFuncKey(key[3], GLOBAL_LINE_UP, group_keys),
904 PrintFuncKey(key[4], GROUP_MARK_THREAD_READ, group_keys),
905 PrintFuncKey(key[5], GROUP_LIST_THREAD, group_keys));
906 center_line(line + 1, FALSE, buf);
907
908 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
909 snprintf(buf, bufs, _(txt_mini_group_3),
910 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
911 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
912 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
913 PrintFuncKey(key[6], GROUP_TAG, group_keys),
914 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
915 #else
916 # ifdef DONT_HAVE_PIPING
917 snprintf(buf, bufs, _(txt_mini_group_3),
918 PrintFuncKey(key[1], GROUP_MAIL, group_keys),
919 PrintFuncKey(key[2], GLOBAL_PRINT, group_keys),
920 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
921 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
922 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
923 PrintFuncKey(key[6], GROUP_TAG, group_keys),
924 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
925 # else
926 # ifdef DISABLE_PRINTING
927 snprintf(buf, bufs, _(txt_mini_group_3),
928 PrintFuncKey(key[0], GLOBAL_PIPE, group_keys),
929 PrintFuncKey(key[1], GROUP_MAIL, group_keys),
930 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
931 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
932 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
933 PrintFuncKey(key[6], GROUP_TAG, group_keys),
934 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
935 # else
936 snprintf(buf, bufs, _(txt_mini_group_3),
937 PrintFuncKey(key[0], GLOBAL_PIPE, group_keys),
938 PrintFuncKey(key[1], GROUP_MAIL, group_keys),
939 PrintFuncKey(key[2], GLOBAL_PRINT, group_keys),
940 PrintFuncKey(key[3], GLOBAL_QUIT, group_keys),
941 PrintFuncKey(key[4], GROUP_TOGGLE_READ_UNREAD, group_keys),
942 PrintFuncKey(key[5], GROUP_SAVE, group_keys),
943 PrintFuncKey(key[6], GROUP_TAG, group_keys),
944 PrintFuncKey(key[7], GLOBAL_POST, group_keys));
945 # endif /* DISABLE_PRINTING */
946 # endif /* DONT_HAVE_PIPING */
947 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
948
949 center_line(line + 2, FALSE, buf);
950 break;
951
952 case THREAD_LEVEL:
953 snprintf(buf, bufs, _(txt_mini_thread_1),
954 PrintFuncKey(key[0], THREAD_READ_NEXT_ARTICLE_OR_THREAD, thread_keys),
955 PrintFuncKey(key[1], CATCHUP, thread_keys),
956 PrintFuncKey(key[2], THREAD_TOGGLE_SUBJECT_DISPLAY, thread_keys));
957 center_line(line, FALSE, buf);
958 snprintf(buf, bufs, _(txt_mini_thread_2),
959 PrintFuncKey(key[0], GLOBAL_HELP, thread_keys),
960 PrintFuncKey(key[1], GLOBAL_LINE_DOWN, thread_keys),
961 PrintFuncKey(key[2], GLOBAL_LINE_UP, thread_keys),
962 PrintFuncKey(key[3], GLOBAL_QUIT, thread_keys),
963 PrintFuncKey(key[4], THREAD_TAG, thread_keys),
964 PrintFuncKey(key[5], MARK_ARTICLE_UNREAD, thread_keys));
965 center_line(line + 1, FALSE, buf);
966 break;
967
968 case PAGE_LEVEL:
969 snprintf(buf, bufs, _(txt_mini_page_1),
970 PrintFuncKey(key[0], PAGE_NEXT_UNREAD, page_keys),
971 PrintFuncKey(key[1], GLOBAL_SEARCH_SUBJECT_FORWARD, page_keys),
972 PrintFuncKey(key[2], GLOBAL_MENU_FILTER_KILL, page_keys));
973 center_line(line, FALSE, buf);
974 snprintf(buf, bufs, _(txt_mini_page_2),
975 PrintFuncKey(key[0], GLOBAL_SEARCH_AUTHOR_FORWARD, page_keys),
976 PrintFuncKey(key[1], GLOBAL_SEARCH_BODY, page_keys),
977 PrintFuncKey(key[2], CATCHUP, page_keys),
978 PrintFuncKey(key[3], PAGE_FOLLOWUP_QUOTE, page_keys),
979 PrintFuncKey(key[4], PAGE_MARK_THREAD_READ, page_keys));
980 center_line(line + 1, FALSE, buf);
981
982 #if defined(DONT_HAVE_PIPING) && defined(DISABLE_PRINTING)
983 snprintf(buf, bufs, _(txt_mini_page_3),
984 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
985 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
986 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
987 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
988 PrintFuncKey(key[6], PAGE_TAG, page_keys),
989 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
990 #else
991 # ifdef DONT_HAVE_PIPING
992 snprintf(buf, bufs, _(txt_mini_page_3),
993 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
994 PrintFuncKey(key[2], GLOBAL_PRINT, page_keys),
995 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
996 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
997 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
998 PrintFuncKey(key[6], PAGE_TAG, page_keys),
999 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
1000 # else
1001 # ifdef DISABLE_PRINTING
1002 snprintf(buf, bufs, _(txt_mini_page_3),
1003 PrintFuncKey(key[0], GLOBAL_PIPE, page_keys),
1004 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
1005 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
1006 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
1007 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
1008 PrintFuncKey(key[6], PAGE_TAG, page_keys),
1009 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
1010 # else
1011 snprintf(buf, bufs, _(txt_mini_page_3),
1012 PrintFuncKey(key[0], GLOBAL_PIPE, page_keys),
1013 PrintFuncKey(key[1], PAGE_MAIL, page_keys),
1014 PrintFuncKey(key[2], GLOBAL_PRINT, page_keys),
1015 PrintFuncKey(key[3], GLOBAL_QUIT, page_keys),
1016 PrintFuncKey(key[4], PAGE_REPLY_QUOTE, page_keys),
1017 PrintFuncKey(key[5], PAGE_SAVE, page_keys),
1018 PrintFuncKey(key[6], PAGE_TAG, page_keys),
1019 PrintFuncKey(key[7], GLOBAL_POST, page_keys));
1020 # endif /* DISABLE_PRINTING */
1021 # endif /* DONT_HAVE_PIPING */
1022 #endif /* DONT_HAVE_PIPING && DISABLE_PRINTING */
1023
1024 center_line(line + 2, FALSE, buf);
1025 break;
1026
1027 case POSTED_LEVEL:
1028 snprintf(buf, bufs, _(txt_mini_post_hist_1),
1029 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, post_hist_keys),
1030 PrintFuncKey(key[1], GLOBAL_LINE_UP, post_hist_keys),
1031 PrintFuncKey(key[2], GLOBAL_HELP, post_hist_keys),
1032 PrintFuncKey(key[3], GLOBAL_QUIT, post_hist_keys));
1033 center_line(line, FALSE, buf);
1034 snprintf(buf, bufs, _(txt_mini_post_hist_2),
1035 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, post_hist_keys),
1036 PrintFuncKey(key[3], GLOBAL_SEARCH_SUBJECT_BACKWARD, post_hist_keys),
1037 PrintFuncKey(key[4], GLOBAL_SEARCH_REPEAT, post_hist_keys));
1038 center_line(line + 1, FALSE, buf);
1039 break;
1040
1041 case URL_LEVEL:
1042 snprintf(buf, bufs, _(txt_mini_url_1),
1043 PrintFuncKey(key[0], GLOBAL_LINE_DOWN, url_keys),
1044 PrintFuncKey(key[1], GLOBAL_LINE_UP, url_keys),
1045 PrintFuncKey(key[2], GLOBAL_HELP, url_keys),
1046 PrintFuncKey(key[3], GLOBAL_QUIT, url_keys));
1047 center_line(line, FALSE, buf);
1048 snprintf(buf, bufs, _(txt_mini_url_2),
1049 PrintFuncKey(key[2], GLOBAL_SEARCH_SUBJECT_FORWARD, url_keys),
1050 PrintFuncKey(key[3], GLOBAL_SEARCH_SUBJECT_BACKWARD, url_keys),
1051 PrintFuncKey(key[4], GLOBAL_SEARCH_REPEAT, url_keys));
1052 center_line(line + 1, FALSE, buf);
1053 break;
1054
1055 case INFO_PAGER:
1056 snprintf(buf, bufs, _(txt_mini_info_1),
1057 PrintFuncKey(key[0], GLOBAL_LINE_UP, info_keys),
1058 PrintFuncKey(key[1], GLOBAL_LINE_DOWN, info_keys),
1059 PrintFuncKey(key[2], GLOBAL_PAGE_UP, info_keys),
1060 PrintFuncKey(key[3], GLOBAL_PAGE_DOWN, info_keys),
1061 PrintFuncKey(key[4], GLOBAL_FIRST_PAGE, info_keys),
1062 PrintFuncKey(key[5], GLOBAL_LAST_PAGE, info_keys));
1063 center_line(line, FALSE, buf);
1064 snprintf(buf, bufs, _(txt_mini_info_2),
1065 PrintFuncKey(key[0], GLOBAL_SEARCH_SUBJECT_FORWARD, info_keys),
1066 PrintFuncKey(key[1], GLOBAL_SEARCH_SUBJECT_BACKWARD, info_keys),
1067 PrintFuncKey(key[2], GLOBAL_QUIT, info_keys));
1068 center_line(line + 1, FALSE, buf);
1069 break;
1070
1071 default: /* should not happen */
1072 error_message(2, _(txt_error_unknown_dlevel));
1073 break;
1074 }
1075 #ifdef HAVE_COLOR
1076 fcol(tinrc.col_normal);
1077 #endif /* HAVE_COLOR */
1078 }
1079
1080
1081 void
1082 toggle_mini_help(
1083 int level)
1084 {
1085 tinrc.beginner_level = bool_not(tinrc.beginner_level);
1086 set_noteslines(cLINES);
1087 show_mini_help(level);
1088 }