tin  2.6.1
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.6.1.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

options_menu.c
Go to the documentation of this file.
1/*
2 * Project : tin - a Usenet reader
3 * Module : options_menu.c
4 * Author : Michael Bienia <michael@vorlon.ping.de>
5 * Created : 2004-09-05
6 * Updated : 2021-07-06
7 * Notes : Split from config.c
8 *
9 * Copyright (c) 2004-2022 Michael Bienia <michael@vorlon.ping.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 TINCFG_H
45# include "tincfg.h"
46#endif /* !TINCFG_H */
47#ifndef TCURSES_H
48# include "tcurses.h"
49#endif /* !TCURSES_H */
50
51
52#define option_lines_per_page (cLINES - INDEX_TOP - 3)
53
54#define UPDATE_BOOL_ATTRIBUTES(option) do { \
55 scopes[0].attribute->option = CAST_BOOL(tinrc.option); \
56 changed |= MISC_OPTS; \
57 } while (0)
58
59#define UPDATE_INT_ATTRIBUTES(option) do { \
60 scopes[0].attribute->option = CAST_BITS(tinrc.option, option); \
61 changed |= MISC_OPTS; \
62 } while (0)
63
64#define CAO(A, O) A ## O
65
66#define SET_BOOL_ATTRIBUTE(option) do { \
67 curr_scope->attribute->option = CAST_BOOL(CAO(tinrc.attrib_, option)); \
68 curr_scope->state->option = TRUE; \
69 changed |= MISC_OPTS; \
70 } while (0)
71
72#define SET_NUM_ATTRIBUTE(option) do { \
73 curr_scope->attribute->option = CAST_BITS(CAO(tinrc.attrib_, option), option); \
74 curr_scope->state->option = TRUE; \
75 changed |= MISC_OPTS; \
76 } while (0)
77
78#define SET_STRING_ATTRIBUTE(opt) do { \
79 if (!strlen(CAO(tinrc.attrib_, opt))) { \
80 reset_state(option); \
81 redraw_screen(option); \
82 } else { \
83 FreeIfNeeded(curr_scope->attribute->opt); \
84 curr_scope->state->opt = TRUE; \
85 curr_scope->attribute->opt = my_strdup(CAO(tinrc.attrib_, opt)); \
86 } \
87 changed |= MISC_OPTS; \
88 } while (0)
89
90static enum option_enum first_option_on_screen, last_option_on_screen, last_opt;
91
92/*
93 * local prototypes
94 */
95static enum option_enum get_first_opt(void);
96static enum option_enum move_cursor(enum option_enum cur_option, t_bool down);
97static enum option_enum next_option(enum option_enum option, t_bool incl_titles);
98static enum option_enum opt_scroll_down(enum option_enum option);
99static enum option_enum opt_scroll_up(enum option_enum option);
100static enum option_enum prev_option(enum option_enum option, t_bool incl_titles);
101static enum option_enum set_option_num(int num);
102static int add_new_scope(void);
103static int find_scope(const char *scope);
104static int get_option_num(enum option_enum option);
105static int move_scope(int curr_pos);
106static t_bool check_state(enum option_enum option);
107static t_bool delete_scope(int curr_pos);
108static t_bool option_is_title(enum option_enum option);
109static t_bool option_on_page(enum option_enum option);
110static t_bool rename_scope(struct t_scope *scope);
111static t_bool scope_is_empty(void);
112static t_function option_left(void);
113static t_function option_right(void);
114static t_function scope_left(void);
115static t_function scope_right(void);
116static void build_scope_line(int i);
117static void do_delete_scope(int curr_pos);
118static void do_move_scope(int from, int to);
119static void draw_scope_arrow(void);
120static void free_scopes_and_attributes(void);
121static void highlight_option(enum option_enum option);
122static void initialize_attributes(void);
123static void print_any_option(enum option_enum option);
124static void redraw_screen(enum option_enum option);
125static void repaint_option(enum option_enum option);
126static void reset_state(enum option_enum option);
127static void scope_page(enum context level);
128#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
129 static void set_art_mark_width(void);
130#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
131static void set_first_option_on_screen(enum option_enum last_option);
132static void set_last_opt(void);
133static void set_last_option_on_screen(enum option_enum first_option);
134static void show_config_page(void);
135static void show_scope_page(void);
136static void unhighlight_option(enum option_enum option);
137#ifdef USE_CURSES
138 static void do_scroll(int jump);
139#endif /* USE_CURSES */
140
142static struct t_scope *curr_scope = NULL;
143
144/*
145 * returns the row on the screen of an option
146 * note: option should be on this page
147 */
148int
150 enum option_enum option)
151{
152 int i = 0;
153 enum option_enum j = first_option_on_screen;
154
155 while (j < option) {
156 if (option_is_visible(j))
157 i++;
158 j++;
159 }
160
161 return INDEX_TOP + i;
162}
163
164
165/*
166 * returns the number of an option
167 */
168static int
170 enum option_enum option)
171{
172 enum option_enum i;
173 int result = 0;
174
175 for (i = 0; i < option && result < (int) last_opt; i = next_option(i, FALSE))
176 result++;
177
178 return result;
179}
180
181
182/*
183 * returns the option with the given number
184 */
185static enum option_enum
187 int num)
188{
189 enum option_enum result = 0;
190
191 while (num > 0 && result < last_opt) {
192 result = next_option(result, FALSE);
193 num--;
194 }
195 return result;
196}
197
198
199/*
200 * returns TRUE if an option is visible in the menu
201 */
202t_bool
204 enum option_enum option)
205{
206 switch (option) {
207#ifdef HAVE_COLOR
208 case OPT_COL_BACK:
209 case OPT_COL_FROM:
210 case OPT_COL_HEAD:
211 case OPT_COL_HELP:
212 case OPT_COL_INVERS_BG:
213 case OPT_COL_INVERS_FG:
214 case OPT_COL_MESSAGE:
215 case OPT_COL_MINIHELP:
216 case OPT_COL_NEWSHEADERS:
217 case OPT_COL_NORMAL:
218 case OPT_COL_QUOTE:
219 case OPT_COL_QUOTE2:
220 case OPT_COL_QUOTE3:
221 case OPT_COL_EXTQUOTE:
222 case OPT_COL_RESPONSE:
223 case OPT_COL_SIGNATURE:
224 case OPT_COL_SUBJECT:
225 case OPT_COL_TEXT:
226 case OPT_COL_TITLE:
227 case OPT_COL_URLS:
228 case OPT_QUOTE_REGEX:
229 case OPT_QUOTE_REGEX2:
230 case OPT_QUOTE_REGEX3:
231 case OPT_EXTQUOTE_HANDLING:
232 return curr_scope ? FALSE : tinrc.use_color;
233
234 case OPT_COL_MARKSTAR:
235 case OPT_COL_MARKDASH:
236 case OPT_COL_MARKSLASH:
237 case OPT_COL_MARKSTROKE:
238 return curr_scope ? FALSE : (tinrc.word_highlight && tinrc.use_color);
239
240 case OPT_COL_VERBATIM:
241 return curr_scope ? FALSE : (tinrc.verbatim_handling && tinrc.use_color);
242
243 case OPT_EXTQUOTE_REGEX:
244 return curr_scope ? FALSE : (tinrc.extquote_handling && tinrc.use_color);
245#endif /* HAVE_COLOR */
246
247 case OPT_WORD_H_DISPLAY_MARKS:
248 case OPT_SLASHES_REGEX:
249 case OPT_STARS_REGEX:
250 case OPT_STROKES_REGEX:
251 case OPT_UNDERSCORES_REGEX:
253
254 case OPT_MONO_MARKSTAR:
255 case OPT_MONO_MARKDASH:
256 case OPT_MONO_MARKSLASH:
257 case OPT_MONO_MARKSTROKE:
258#ifdef HAVE_COLOR
259 return curr_scope ? FALSE : (tinrc.word_highlight && !tinrc.use_color);
260#else
262#endif /* HAVE_COLOR */
263
264#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
265 case OPT_UTF8_GRAPHICS:
266 return curr_scope ? FALSE : IS_LOCAL_CHARSET("UTF-8");
267#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
268
269 case OPT_VERBATIM_BEGIN_REGEX:
270 case OPT_VERBATIM_END_REGEX:
272
273#ifndef USE_CURSES
274 case OPT_STRIP_BLANKS:
275#endif /* !USE_CURSES */
276 case OPT_GETART_LIMIT_OPTIONS:
277 return curr_scope ? FALSE : TRUE;
278
279#ifdef HAVE_COLOR
280 case OPT_COLOR_OPTIONS:
281 return curr_scope ? tinrc.use_color : TRUE;
282#endif /* HAVE_COLOR */
283
284 case OPT_DISPLAY_OPTIONS:
285 case OPT_FILTERING_OPTIONS:
286 case OPT_SAVING_OPTIONS:
287 case OPT_POSTING_OPTIONS:
288 case OPT_EXPERT_OPTIONS:
289 return TRUE;
290
291 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
292 case OPT_ATTRIB_ADVERTISING:
293 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
294 case OPT_ATTRIB_ASK_FOR_METAMAIL:
295 case OPT_ATTRIB_AUTO_CC_BCC:
296 case OPT_ATTRIB_AUTO_LIST_THREAD:
297 case OPT_ATTRIB_AUTO_SELECT:
298 case OPT_ATTRIB_BATCH_SAVE:
299 case OPT_ATTRIB_DATE_FORMAT:
300 case OPT_ATTRIB_DELETE_TMP_FILES:
301 case OPT_ATTRIB_EDITOR_FORMAT:
302 case OPT_ATTRIB_FCC:
303 case OPT_ATTRIB_FOLLOWUP_TO:
304 case OPT_ATTRIB_FROM:
305 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
306 case OPT_ATTRIB_GROUP_FORMAT:
307#ifdef HAVE_ISPELL
308 case OPT_ATTRIB_ISPELL:
309#endif /* HAVE_ISPELL */
310 case OPT_ATTRIB_MAILDIR:
311 case OPT_ATTRIB_MAIL_8BIT_HEADER:
312 case OPT_ATTRIB_MAIL_MIME_ENCODING:
313 case OPT_ATTRIB_MAILING_LIST:
314 case OPT_ATTRIB_MARK_IGNORE_TAGS:
315 case OPT_ATTRIB_MARK_SAVED_READ:
316 case OPT_ATTRIB_MIME_FORWARD:
317 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
318 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
319 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
320 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
321 case OPT_ATTRIB_ORGANIZATION:
322 case OPT_ATTRIB_POST_8BIT_HEADER:
323 case OPT_ATTRIB_POST_MIME_ENCODING:
324 case OPT_ATTRIB_POST_PROCESS_VIEW:
325 case OPT_ATTRIB_POS_FIRST_UNREAD:
326 case OPT_ATTRIB_QUICK_KILL_HEADER:
327 case OPT_ATTRIB_QUICK_KILL_SCOPE:
328 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
329 case OPT_ATTRIB_QUICK_KILL_CASE:
330 case OPT_ATTRIB_QUICK_SELECT_HEADER:
331 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
332 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
333 case OPT_ATTRIB_QUICK_SELECT_CASE:
334#ifndef DISABLE_PRINTING
335 case OPT_ATTRIB_PRINT_HEADER:
336#endif /* !DISABLE_PRINTING */
337 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
338 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
339 case OPT_ATTRIB_QUOTE_CHARS:
340 case OPT_ATTRIB_SAVEDIR:
341 case OPT_ATTRIB_SAVEFILE:
342 case OPT_ATTRIB_SHOW_AUTHOR:
343 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
344 case OPT_ATTRIB_SHOW_SIGNATURES:
345 case OPT_ATTRIB_SIGDASHES:
346 case OPT_ATTRIB_SIGFILE:
347 case OPT_ATTRIB_SIGNATURE_REPOST:
348 case OPT_ATTRIB_THREAD_ARTICLES:
349 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
350 case OPT_ATTRIB_THREAD_FORMAT:
351 case OPT_ATTRIB_THREAD_PERC:
352 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
353 case OPT_ATTRIB_TEX2ISO_CONV:
354 case OPT_ATTRIB_SORT_THREADS_TYPE:
355#ifdef CHARSET_CONVERSION
356 case OPT_ATTRIB_MM_NETWORK_CHARSET:
357 case OPT_ATTRIB_UNDECLARED_CHARSET:
358#endif /* CHARSET_CONVERSION */
359 case OPT_ATTRIB_VERBATIM_HANDLING:
360 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
361 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
362 case OPT_ATTRIB_POST_PROCESS_TYPE:
363 case OPT_ATTRIB_X_BODY:
364 case OPT_ATTRIB_X_COMMENT_TO:
365 case OPT_ATTRIB_X_HEADERS:
366 return curr_scope ? TRUE : FALSE;
367
368#ifdef HAVE_COLOR
369 case OPT_ATTRIB_EXTQUOTE_HANDLING:
370 return curr_scope ? tinrc.use_color : FALSE;
371#endif /* HAVE_COLOR */
372
373 default:
374 return curr_scope ? FALSE : TRUE;
375 }
376}
377
378
379/*
380 * returns TRUE if option is OPT_TITLE else FALSE
381 */
382static t_bool
384 enum option_enum option)
385{
386 return option_table[option].var_type == OPT_TITLE;
387}
388
389
390/*
391 * returns TRUE if option is on the current page else FALSE
392 */
393static t_bool
395 enum option_enum option)
396{
397 return ((option >= first_option_on_screen) && (option <= last_option_on_screen));
398}
399
400
401char *
403 char *dst,
404 size_t len,
405 t_bool editing,
406 enum option_enum option)
407{
408 char *buf;
409 size_t option_width = (size_t) MAX(35, cCOLS / 2 - 9);
410#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
411 wchar_t *wbuf, *wbuf2;
412
413 /* convert the option text to wchar_t */
414 wbuf = char2wchar_t(_(option_table[option].txt->opt));
415#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
416
417 if (!option_is_title(option)) {
418 char flag;
419 int num = get_option_num(option);
420
421 flag = (curr_scope && check_state(option)) ? '+' : ' ';
422#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
423 if (wbuf != NULL) {
424 wbuf2 = wstrunc(wbuf, (int) option_width);
425 if ((buf = wchar_t2char(wbuf2)) == NULL) {
426 /* conversion failed, truncate original string */
427 buf = strunc(_(option_table[option].txt->opt), (int) option_width);
428 snprintf(dst, len, "%s %c%3d %-*.*s: ", editing ? "->" : " ", flag, num, (int) option_width, (int) option_width, buf);
429 } else
430 snprintf(dst, len, "%s %c%3d %-*.*s: ", editing ? "->" : " ", flag, num,
431 (int) (strlen(buf) + option_width - (size_t) wcswidth(wbuf2, option_width + 1)),
432 (int) (strlen(buf) + option_width - (size_t) wcswidth(wbuf2, option_width + 1)), buf);
433 free(wbuf2);
434 } else
435#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
436 {
437 /* truncate original string */
438 buf = strunc(_(option_table[option].txt->opt), (int) option_width);
439 snprintf(dst, len, "%s %c%3d %-*.*s: ", editing ? "->" : " ", flag, num, (int) option_width, (int) option_width, buf);
440 }
441 } else {
442#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
443 if (wbuf != NULL) {
444 wbuf2 = wstrunc(wbuf, cCOLS - 3);
445 if ((buf = wchar_t2char(wbuf2)) == NULL) /* conversion failed, truncate original string */
446 buf = strunc(_(option_table[option].txt->opt), cCOLS - 3);
447 free(wbuf2);
448 } else
449#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
450 buf = strunc(_(option_table[option].txt->opt), cCOLS - 3); /* truncate original string */
451 snprintf(dst, len, " %s", buf);
452 }
453
454#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
455 FreeIfNeeded(wbuf);
456#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
458 return dst;
459}
460
461
462static void
464 enum option_enum option)
465{
466 constext **list;
467 char temp[LEN], *ptr, *ptr2;
468 int row = option_row(option);
469 size_t len = sizeof(temp) - 1;
470#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE) && defined(USE_CURSES)
471 char *buf;
472#endif /* MULTIBYTE_ABLE && !NO_LOCALE && USE_CURSES */
473
474 MoveCursor(row, 0);
475
476 ptr = fmt_option_prompt(temp, len, FALSE, option);
477 ptr += strlen(temp);
478 len -= strlen(temp);
479
480 switch (option_table[option].var_type) {
481 case OPT_ON_OFF:
482 /* %-3s to match the length of OFF */
483 snprintf(ptr, len, "%-3s", print_boolean(*OPT_ON_OFF_list[option_table[option].var_index]));
484 break;
485
486 case OPT_LIST:
487 list = option_table[option].opt_list;
488 ptr2 = my_strdup(list[*(option_table[option].variable) + ((strcasecmp(_(list[0]), _(txt_default)) == 0) ? 1 : 0)]);
489 strncpy(ptr, _(ptr2), len);
490 free(ptr2);
491 break;
492
493 case OPT_STRING:
494 strncpy(ptr, OPT_STRING_list[option_table[option].var_index], len);
495 break;
496
497 case OPT_NUM:
498 snprintf(ptr, len, "%d", *(option_table[option].variable));
499 break;
500
501 case OPT_CHAR:
502 snprintf(ptr, len, "%"T_CHAR_FMT, *OPT_CHAR_list[option_table[option].var_index]);
503 break;
504
505 default:
506 break;
507 }
508#ifdef USE_CURSES
509# if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
510 if ((buf = spart(temp, cCOLS - 1, FALSE)) != NULL) {
511 my_printf("%s", buf);
512 free(buf);
513 } else
514# endif /* MULTIBYTE_ABLE && !NO_LOCALE */
515 my_printf("%.*s", cCOLS - 1, temp);
516 {
517# if 1 /* portable enough? */
518 int x = getcurx(stdscr);
519# else
520 int y, x;
521
522 getyx(stdscr, y, x);
523# endif /* 1 */
524 if (x < cCOLS)
525 clrtoeol();
526 }
527#else
528 my_printf("%.*s", cCOLS - 1, temp);
529 /* draw_arrow_mark() will read this back for repainting */
531 strncpy(screen[row - INDEX_TOP].col, temp, (size_t) (cCOLS - 1));
532 else
533 snprintf(screen[row - INDEX_TOP].col, (size_t) cCOLS, "%-*s", cCOLS - 1, temp);
534#endif /* USE_CURSES */
535}
536
537
538static void
540 enum option_enum option)
541{
542 if (option_on_page(option))
543 print_any_option(option);
544}
545
546
547#ifdef USE_CURSES
548static void
549do_scroll(
550 int jump)
551{
552 scrollok(stdscr, TRUE);
555 ScrollScreen(jump);
556 SetScrollRegion(0, LINES - 1);
557 scrollok(stdscr, FALSE);
558}
559#endif /* USE_CURSES */
560
561
562/*
563 * returns the option after moving 'move' positions up or down
564 * updates also first_option_on_screen and last_option_on screen accordingly
565 */
566static enum option_enum
568 enum option_enum cur_option,
569 t_bool down)
570{
571 enum option_enum old_option = cur_option;
572
573 if (down) { /* move down */
574 do {
575 cur_option = next_option(cur_option, TRUE);
576 if (cur_option > last_option_on_screen) {
577 /* move the markers one option down */
578 last_option_on_screen = cur_option;
579 first_option_on_screen = next_option(first_option_on_screen, TRUE);
580#ifdef USE_CURSES
581 do_scroll(1);
582 print_any_option(cur_option);
583#else
585#endif /* USE_CURSES */
586 } else if (cur_option < first_option_on_screen) {
587 /* wrap around: set to begin of option list */
588 first_option_on_screen = cur_option;
589 set_last_option_on_screen(cur_option);
591 }
592 } while (option_is_title(cur_option) && old_option != cur_option);
593 } else { /* move up */
594 do {
595 cur_option = prev_option(cur_option, TRUE);
596 if (cur_option < first_option_on_screen) {
597 /* move the markers one option up */
598 first_option_on_screen = cur_option;
599 set_last_option_on_screen(cur_option);
600#ifdef USE_CURSES
601 do_scroll(-1);
602 print_any_option(cur_option);
603#else
605#endif /* USE_CURSES */
606 } else if (cur_option > last_option_on_screen) {
607 /* wrap around: set to end of option list */
608 last_option_on_screen = cur_option;
609 set_first_option_on_screen(cur_option);
611 }
612 } while (option_is_title(cur_option) && old_option != cur_option);
613 }
614 return cur_option;
615}
616
617
618/*
619 * scroll the screen one line down
620 * the selected option is only moved if it is scrolled off the screen
621 */
622static enum option_enum
624 enum option_enum option)
625{
626 if (last_option_on_screen < last_opt) {
627 first_option_on_screen = next_option(first_option_on_screen, TRUE);
628 set_last_option_on_screen(first_option_on_screen);
629#ifdef USE_CURSES
630 do_scroll(1);
631 print_any_option(last_option_on_screen);
632 stow_cursor();
633#else
635#endif /* USE_CURSES */
636 if (option < first_option_on_screen) {
637 option = first_option_on_screen;
638 if (option_is_title(option))
639 option = next_option(option, FALSE);
640#ifdef USE_CURSES
641 highlight_option(option);
642#endif /* USE_CURSES */
643 }
644#ifndef USE_CURSES
645 /* in the !USE_CURSES case we must always highlight the option */
646 highlight_option(option);
647#endif /* !USE_CURSES */
648 }
649 return option;
650}
651
652
653/*
654 * scroll the screen one line up
655 * the selected option is only moved if it is scrolled off the screen
656 */
657static enum option_enum
659 enum option_enum option)
660{
661 if (first_option_on_screen > 0) {
662 first_option_on_screen = prev_option(first_option_on_screen, TRUE);
663 set_last_option_on_screen(first_option_on_screen);
664#ifdef USE_CURSES
665 do_scroll(-1);
666 print_any_option(first_option_on_screen);
667 stow_cursor();
668#else
670#endif /* USE_CURSES */
671 if (option > last_option_on_screen) {
672 option = last_option_on_screen;
673 if (option_is_title(option))
674 option = prev_option(option, FALSE);
675#ifdef USE_CURSES
676 highlight_option(option);
677#endif /* USE_CURSES */
678 }
679#ifndef USE_CURSES
680 /* in the !USE_CURSES case we must always highlight the option */
681 highlight_option(option);
682#endif /* !USE_CURSES */
683 }
684 return option;
685}
686
687
688/*
689 * returns the next visible option
690 * if 'incl_titles' is TRUE titles are also returned else they are skipped
691 */
692static enum option_enum
694 enum option_enum option,
695 t_bool incl_titles)
696{
697 do {
698 option++;
699 if (option > last_opt)
700 option = 0;
701 } while (!(option_is_visible(option) && (incl_titles || !option_is_title(option))));
702
703 return option;
704}
705
706
707/*
708 * returns the previous visible option
709 * if 'incl_titles' is TRUE titles are also returned else they are skipped
710 */
711static enum option_enum
713 enum option_enum option,
714 t_bool incl_titles)
715{
716 do {
717 if (option == 0)
718 option = last_opt;
719 else
720 option--;
721 } while (!(option_is_visible(option) && (incl_titles || !option_is_title(option))));
722
723 return option;
724}
725
726
727/*
728 * set first_option_on_screen in such way that 'last_option' will be
729 * the last option on the screen
730 */
731static void
733 enum option_enum last_option)
734{
735 int i;
736
737 first_option_on_screen = last_option;
738 for (i = 1; i < option_lines_per_page && first_option_on_screen > 0; i++)
739 first_option_on_screen = prev_option(first_option_on_screen, TRUE);
740
741 /*
742 * make sure that the first page is used completely
743 */
744 if (first_option_on_screen == 0)
746}
747
748
749/*
750 * set last_option_on_screen in such way that 'first_option' will be
751 * the first option on the screen
752 */
753static void
755 enum option_enum first_option)
756{
757 int i;
758
759 last_option_on_screen = first_option;
760 /*
761 * on last page, there need not be option_lines_per_page options
762 */
763 for (i = 1; i < option_lines_per_page && last_option_on_screen < last_opt; i++)
764 last_option_on_screen = next_option(last_option_on_screen, TRUE);
765}
766
767
768static void
770 enum option_enum option)
771{
772 refresh_config_page(option); /* to keep refresh_config_page():last_option up-to-date */
774 info_message("%s", _(option_table[option].txt->opt));
775}
776
777
778static void
780 enum option_enum option)
781{
782 /* Astonishing hack */
783 t_menu *savemenu = currmenu;
784 t_menu cfgmenu = { 0, 1, 0, NULL, NULL, NULL };
785
786 currmenu = &cfgmenu;
787 currmenu->curr = option_row(option) - INDEX_TOP;
788 erase_arrow();
789 currmenu = savemenu;
791}
792
793
794/*
795 * Refresh the config page which holds the actual option. If act_option is
796 * smaller zero fall back on the last given option (first option if there was
797 * no last option) and refresh the screen.
798 */
799void
801 enum option_enum act_option)
802{
803 static enum option_enum last_option = 0;
804 /* t_bool force_redraw = FALSE; */
805
806 if (act_option == SIGNAL_HANDLER) { /* called by signal handler */
807 /* force_redraw = TRUE; */
808 act_option = last_option;
809 set_last_option_on_screen(first_option_on_screen); /* terminal size may have changed */
810 if (!option_on_page(last_option)) {
811 last_option_on_screen = last_option;
812 set_first_option_on_screen(last_option);
813 }
814 redraw_screen(last_option);
815 }
816 last_option = act_option;
817}
818
819
820static void
822 enum option_enum option)
823{
825 highlight_option(option);
826}
827
828
829/*
830 * show_menu_help
831 */
832void
834 const char *help_message)
835{
836 MoveCursor(cLINES - 2, 0);
837 CleartoEOLN();
838 center_line(cLINES - 2, FALSE, _(help_message));
839}
840
841
842/*
843 * display current configuration page
844 */
845static void
847 void)
848{
849 enum option_enum i;
850
852 mark_offset = 0;
853
854 ClearScreen();
856
857 for (i = first_option_on_screen; i <= last_option_on_screen; i++) {
858 while (!option_is_visible(i))
859 i++;
860 if (i > last_opt)
861 break;
863 }
864
866 my_flush();
867 stow_cursor();
868}
869
870
871/*
872 * Check if score_kill is <= score_limit_kill and if score_select >= score_limit_select
873 */
874void
876 void)
877{
880
883}
884
885
886static t_function
888 void)
889{
890 return GLOBAL_QUIT;
891}
892
893
894static t_function
896 void)
897{
898 return CONFIG_SELECT;
899}
900
901
902/*
903 * set last_opt to the last visible option
904 */
905static void
907 void)
908{
909 enum option_enum i;
910
911 for (i = 0; i <= LAST_OPT; i++) {
912 if (option_is_visible(i))
913 last_opt = i;
914 }
915}
916
917
918/*
919 * returns the first visible option
920 */
921static enum option_enum
923 void)
924{
925 enum option_enum i;
926
927 for (i = 0; i <= last_opt; i++) {
929 break;
930 }
931 return i;
932}
933
934
935/*
936 * options menu so that the user can dynamically change parameters
937 */
938void
940 const char *grpname,
941 enum context level)
942{
943 char key[MAXKEYLEN];
944 enum option_enum option, old_option;
945 enum {
946 NOT_CHANGED = 0,
947 MISC_OPTS = 1 << 0,
948 DISPLAY_OPTS = 1 << 1,
949 SCORE_OPTS = 1 << 2,
950 SHOW_AUTHOR = 1 << 3,
951 SHOW_ONLY_UNREAD = 1 << 4,
952 SORT_OPTS = 1 << 5,
953 THREAD_ARTS = 1 << 6,
954 THREAD_SCORE = 1 << 7
955 } changed = NOT_CHANGED;
956 int i, scope_idx = 0;
957 t_bool change_option = FALSE;
959#ifdef CHARSET_CONVERSION
960 t_bool is_7bit;
961#endif /* CHARSET_CONVERSION */
962 unsigned old_show_author = 0, old_show_unread = 0, old_thread_arts = 0;
963
964 if (curr_scope)
966 if (grpname && curr_group) {
967 /*
968 * These things can be toggled by the user,
969 * keep a copy of the current value to restore
970 * the state if necessary
971 */
972 old_show_author = curr_group->attribute->show_author;
973 old_show_unread = curr_group->attribute->show_only_unread_arts;
974 old_thread_arts = curr_group->attribute->thread_articles;
975 }
976 set_last_opt();
977 option = get_first_opt();
978 first_option_on_screen = 0;
980
981 redraw_screen(option);
983
984 forever {
986 case GLOBAL_QUIT:
987 if (grpname) {
988 if (curr_scope && scope_is_empty()) {
989 /*
990 * Called via TAB from Config 'M'enu and all attributes
991 * have default values -> delete scope
992 */
993 do_delete_scope(scope_idx);
994 curr_scope = NULL;
995 }
996 if (changed) {
997 /*
998 * At least one option or attribute has changed,
999 * write config files
1000 */
1003 }
1004 }
1005 /* FALLTHROUGH */
1006 case CONFIG_NO_SAVE:
1007 if (grpname && curr_scope) {
1008 /*
1009 * Called via TAB from Config 'M'enu,
1010 * delete scope if all attributes have default values
1011 */
1012 if (scope_is_empty())
1013 do_delete_scope(scope_idx);
1014 curr_scope = NULL;
1015 }
1017 if (grpname && curr_group) {
1018 /*
1019 * These things can be toggled by the user,
1020 * restore the cached state if no changes were made
1021 */
1022 if (!(changed & SHOW_AUTHOR))
1023 curr_group->attribute->show_author = CAST_BITS(old_show_author, show_author);
1024 if (!(changed & SHOW_ONLY_UNREAD))
1026 if (!(changed & THREAD_ARTS))
1027 curr_group->attribute->thread_articles = CAST_BITS(old_thread_arts, thread_articles);
1028
1029 if (changed) {
1030 t_bool filtered = FALSE;
1031 t_bool old_keep_in_base = TRUE;
1032
1033 /*
1034 * recook if an article is open
1035 */
1036 if (changed & DISPLAY_OPTS) {
1037 if (pgart.raw)
1039 }
1040 /*
1041 * Clear art->keep_in_base if switching to !show_only_unread_arts
1042 */
1043 if ((changed & SHOW_ONLY_UNREAD) && !curr_group->attribute->show_only_unread_arts) {
1044 for_each_art(i)
1045 arts[i].keep_in_base = FALSE;
1046 }
1047
1048 if (changed & SCORE_OPTS) {
1051 filtered = filter_articles(curr_group);
1052 }
1053 /*
1054 * If the sorting/threading strategy of threads or filter options have
1055 * changed, fix things so that resorting will occur
1056 *
1057 * If show_only_unread_arts or the scoring of a thread has changed,
1058 * resort base[] (find_base() is called inside make_threads() too, so
1059 * do this only if make_threads() was not called before)
1060 *
1061 * If we were called from page level, keep the current article in
1062 * base[]. This prevents that find_base() removes the current article
1063 * after switching to show_only_unread.
1064 */
1065 if (level == cPage) {
1066 old_keep_in_base = arts[this_resp].keep_in_base;
1068 }
1069 if (changed & (THREAD_ARTS | SORT_OPTS))
1071 else if (filtered)
1073 else if (changed & (SHOW_ONLY_UNREAD | THREAD_SCORE))
1075
1076 if (level == cPage)
1077 arts[this_resp].keep_in_base = CAST_BOOL(old_keep_in_base);
1078 }
1079 }
1081 return;
1082
1083 case GLOBAL_BUGREPORT:
1084 bug_report();
1085 redraw_screen(option);
1086 break;
1087
1088 case GLOBAL_HELP:
1089 if (curr_scope)
1091 else
1093 redraw_screen(option);
1094 break;
1095
1096 case GLOBAL_LINE_UP:
1097 unhighlight_option(option);
1098 option = move_cursor(option, FALSE);
1099 highlight_option(option);
1100 break;
1101
1102 case GLOBAL_LINE_DOWN:
1103 unhighlight_option(option);
1104 option = move_cursor(option, TRUE);
1105 highlight_option(option);
1106 break;
1107
1108 case GLOBAL_FIRST_PAGE:
1109 unhighlight_option(option);
1110 option = get_first_opt();
1111 first_option_on_screen = 0;
1113 redraw_screen(option);
1114 /* highlight_option(option); is already done by redraw_screen() */
1115 break;
1116
1117 case GLOBAL_LAST_PAGE:
1118 unhighlight_option(option);
1119 option = last_opt;
1120 last_option_on_screen = last_opt;
1122 redraw_screen(option);
1123 /* highlight_option(option); is already done by redraw_screen() */
1124 break;
1125
1126 case GLOBAL_PAGE_UP:
1127 unhighlight_option(option);
1128 if (option != first_option_on_screen && !(option_is_title(first_option_on_screen) && option == next_option(first_option_on_screen, FALSE))) {
1129 option = first_option_on_screen;
1130 if (option_is_title(option))
1131 option = next_option(option, FALSE);
1132 highlight_option(option);
1133 break;
1134 } else if (tinrc.scroll_lines == -2 && first_option_on_screen != 0) {
1135 i = option_lines_per_page / 2;
1136
1137 for (; i > 0; i--) {
1138 last_option_on_screen = prev_option(last_option_on_screen, TRUE);
1139 if (last_option_on_screen == last_opt) /* end on wrap around */
1140 break;
1141 }
1142 } else
1143 last_option_on_screen = prev_option(first_option_on_screen, TRUE);
1144
1145 set_first_option_on_screen(last_option_on_screen);
1146 if (last_option_on_screen == last_opt)
1147 option = last_option_on_screen;
1148 else
1149 option = first_option_on_screen;
1150 if (option_is_title(option))
1151 option = next_option(option, FALSE);
1152 redraw_screen(option);
1153 /* highlight_option(option); is already done by redraw_screen() */
1154 break;
1155
1156 case GLOBAL_PAGE_DOWN:
1157 unhighlight_option(option);
1158 if (option == last_opt) {
1159 /* wrap around */
1160 first_option_on_screen = 0;
1161 option = 0;
1162 } else {
1163 enum option_enum old_first = first_option_on_screen;
1164
1165 if (tinrc.scroll_lines == -2) {
1166 i = option_lines_per_page / 2;
1167
1168 for (; i > 0; i--) {
1169 first_option_on_screen = next_option(first_option_on_screen, TRUE);
1170 if (first_option_on_screen == 0) /* end on wrap_around */
1171 break;
1172 }
1173 } else
1174 first_option_on_screen = next_option(last_option_on_screen, TRUE);
1175
1176 if (first_option_on_screen == 0) {
1177 first_option_on_screen = old_first;
1178 option = last_opt;
1179 highlight_option(option);
1180 break;
1181 } else
1182 option = first_option_on_screen;
1183 }
1184
1185 set_last_option_on_screen(first_option_on_screen);
1186 if (option_is_title(option))
1187 option = next_option(option, FALSE);
1188 redraw_screen(option);
1189 /* highlight_option(option); is already done by redraw_screen() */
1190 break;
1191
1192 case GLOBAL_SCROLL_UP:
1193 option = opt_scroll_up(option);
1194 break;
1195
1196 case GLOBAL_SCROLL_DOWN:
1197 option = opt_scroll_down(option);
1198 break;
1199
1200 case DIGIT_1:
1201 case DIGIT_2:
1202 case DIGIT_3:
1203 case DIGIT_4:
1204 case DIGIT_5:
1205 case DIGIT_6:
1206 case DIGIT_7:
1207 case DIGIT_8:
1208 case DIGIT_9:
1209 unhighlight_option(option);
1211 if (!option_on_page(option)) {
1212 first_option_on_screen = option;
1214 redraw_screen(option);
1215 } else
1216 highlight_option(option);
1217 break;
1218
1219#ifndef NO_SHELL_ESCAPE
1221 shell_escape();
1222 redraw_screen(option);
1223 break;
1224#endif /* !NO_SHELL_ESCAPE */
1225
1231 else {
1232 old_option = option;
1234 if (option != old_option) {
1235 unhighlight_option(old_option);
1236 if (!option_on_page(option)) {
1237 first_option_on_screen = option;
1239 redraw_screen(option);
1240 } else
1241 highlight_option(option);
1242 }
1243 }
1244 break;
1245
1246 case CONFIG_SCOPE_MENU:
1247 if (!curr_scope) {
1248 scope_page(level);
1249 set_last_opt();
1250 option = get_first_opt();
1251 first_option_on_screen = 0;
1253 redraw_screen(option);
1254 }
1255 break;
1256
1258 if (curr_scope) {
1259 if (curr_scope->global)
1261 else if (check_state(option)) {
1262 reset_state(option);
1263 changed |= MISC_OPTS;
1264 redraw_screen(option);
1265 }
1266 }
1267 break;
1268
1269 case CONFIG_SELECT:
1272 else
1273 change_option = TRUE;
1274 break;
1275
1277 if (grpname) {
1278 if (curr_scope) {
1279 if (scope_is_empty()) {
1280 do_delete_scope(scope_idx);
1281 scope_idx = 0;
1282 }
1283 curr_scope = NULL;
1284 } else {
1285 if (!(scope_idx = find_scope(grpname)))
1286 scope_idx = add_scope(grpname);
1287 if (scope_idx) {
1288 curr_scope = &scopes[scope_idx];
1290 }
1291 }
1292 set_last_opt();
1293 option = get_first_opt();
1294 first_option_on_screen = 0;
1296 redraw_screen(option);
1297 }
1298 break;
1299
1301 my_retouch();
1303 set_last_option_on_screen(first_option_on_screen);
1304 redraw_screen(option);
1305 break;
1306
1307 case GLOBAL_VERSION:
1309 break;
1310
1311 default:
1313 break;
1314 } /* switch (ch) */
1315
1316 if (change_option) {
1317 switch (option_table[option].var_type) {
1318 case OPT_ON_OFF:
1319 switch (option) {
1320 case OPT_ABBREVIATE_GROUPNAME:
1321 case OPT_AUTO_RECONNECT:
1322 case OPT_CACHE_OVERVIEW_FILES:
1323 case OPT_CATCHUP_READ_GROUPS:
1324 case OPT_FORCE_SCREEN_REDRAW:
1325 case OPT_KEEP_DEAD_ARTICLES:
1326 case OPT_SHOW_ONLY_UNREAD_GROUPS:
1327 case OPT_STRIP_NEWSRC:
1328#if defined(HAVE_ICONV_OPEN_TRANSLIT) && defined(CHARSET_CONVERSION)
1329 case OPT_TRANSLIT:
1330#endif /* HAVE_ICONV_OPEN_TRANSLIT && CHARSET_CONVERSION */
1331 case OPT_UNLINK_ARTICLE:
1332#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
1333 case OPT_UTF8_GRAPHICS:
1334#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
1335 case OPT_URL_HIGHLIGHT:
1336#ifdef HAVE_KEYPAD
1337 case OPT_USE_KEYPAD:
1338#endif /* HAVE_KEYPAD */
1339 case OPT_USE_MOUSE:
1340 if (prompt_option_on_off(option))
1341 changed |= MISC_OPTS;
1342 break;
1343
1344 case OPT_ADD_POSTED_TO_FILTER:
1345 if (prompt_option_on_off(option))
1346 UPDATE_BOOL_ATTRIBUTES(add_posted_to_filter);
1347 break;
1348
1349 case OPT_ADVERTISING:
1350 if (prompt_option_on_off(option))
1351 UPDATE_BOOL_ATTRIBUTES(advertising);
1352 break;
1353
1354 case OPT_ALTERNATIVE_HANDLING:
1355 if (prompt_option_on_off(option))
1356 UPDATE_BOOL_ATTRIBUTES(alternative_handling);
1357 break;
1358
1359 case OPT_ASK_FOR_METAMAIL:
1360 if (prompt_option_on_off(option))
1361 UPDATE_BOOL_ATTRIBUTES(ask_for_metamail);
1362 break;
1363
1364 case OPT_AUTO_LIST_THREAD:
1365 if (prompt_option_on_off(option))
1366 UPDATE_BOOL_ATTRIBUTES(auto_list_thread);
1367 break;
1368
1369 case OPT_BATCH_SAVE:
1370 if (prompt_option_on_off(option))
1371 UPDATE_BOOL_ATTRIBUTES(batch_save);
1372 break;
1373
1374#ifdef HAVE_COLOR
1375 case OPT_EXTQUOTE_HANDLING:
1376 /*
1377 * option toggles visibility of other
1378 * options -> needs redraw_screen()
1379 */
1380 if (prompt_option_on_off(option)) {
1381 UPDATE_BOOL_ATTRIBUTES(extquote_handling);
1382 set_last_option_on_screen(first_option_on_screen);
1383 redraw_screen(option);
1384 changed |= DISPLAY_OPTS;
1385 }
1386 break;
1387#endif /* HAVE_COLOR */
1388
1389 case OPT_GROUP_CATCHUP_ON_EXIT:
1390 if (prompt_option_on_off(option))
1391 UPDATE_BOOL_ATTRIBUTES(group_catchup_on_exit);
1392 break;
1393
1394 case OPT_MARK_IGNORE_TAGS:
1395 if (prompt_option_on_off(option))
1396 UPDATE_BOOL_ATTRIBUTES(mark_ignore_tags);
1397 break;
1398
1399 case OPT_MARK_SAVED_READ:
1400 if (prompt_option_on_off(option))
1401 UPDATE_BOOL_ATTRIBUTES(mark_saved_read);
1402 break;
1403
1404 case OPT_POST_PROCESS_VIEW:
1405 if (prompt_option_on_off(option))
1406 UPDATE_BOOL_ATTRIBUTES(post_process_view);
1407 break;
1408
1409 case OPT_POS_FIRST_UNREAD:
1410 if (prompt_option_on_off(option))
1411 UPDATE_BOOL_ATTRIBUTES(pos_first_unread);
1412 break;
1413
1414#ifndef DISABLE_PRINTING
1415 case OPT_PRINT_HEADER:
1416 if (prompt_option_on_off(option))
1417 UPDATE_BOOL_ATTRIBUTES(print_header);
1418 break;
1419#endif /* !DISABLE_PRINTING */
1420
1421 case OPT_PROCESS_ONLY_UNREAD:
1422 if (prompt_option_on_off(option))
1423 UPDATE_BOOL_ATTRIBUTES(process_only_unread);
1424 break;
1425
1426 case OPT_PROMPT_FOLLOWUPTO:
1427 if (prompt_option_on_off(option))
1428 UPDATE_BOOL_ATTRIBUTES(prompt_followupto);
1429 break;
1430
1431 case OPT_SHOW_SIGNATURES:
1432 if (prompt_option_on_off(option))
1433 UPDATE_BOOL_ATTRIBUTES(show_signatures);
1434 break;
1435
1436 case OPT_SIGDASHES:
1437 if (prompt_option_on_off(option))
1438 UPDATE_BOOL_ATTRIBUTES(sigdashes);
1439 break;
1440
1441 case OPT_SIGNATURE_REPOST:
1442 if (prompt_option_on_off(option))
1443 UPDATE_BOOL_ATTRIBUTES(signature_repost);
1444 break;
1445
1446#ifndef USE_CURSES
1447 case OPT_STRIP_BLANKS:
1448 if (prompt_option_on_off(option)) {
1449 redraw_screen(option);
1450 changed |= MISC_OPTS;
1451 }
1452 break;
1453#endif /* !USE_CURSES */
1454
1455 case OPT_TEX2ISO_CONV:
1456 if (prompt_option_on_off(option))
1457 UPDATE_BOOL_ATTRIBUTES(tex2iso_conv);
1458 break;
1459
1460 case OPT_THREAD_CATCHUP_ON_EXIT:
1461 if (prompt_option_on_off(option))
1462 UPDATE_BOOL_ATTRIBUTES(thread_catchup_on_exit);
1463 break;
1464
1465 case OPT_WRAP_ON_NEXT_UNREAD:
1466 if (prompt_option_on_off(option))
1467 UPDATE_BOOL_ATTRIBUTES(wrap_on_next_unread);
1468 break;
1469
1470 case OPT_VERBATIM_HANDLING:
1471 /*
1472 * option toggles visibility of other
1473 * options -> needs redraw_screen()
1474 */
1475 if (prompt_option_on_off(option)) {
1476 UPDATE_BOOL_ATTRIBUTES(verbatim_handling);
1477 set_last_option_on_screen(first_option_on_screen);
1478 redraw_screen(option);
1479 }
1480 break;
1481
1482 /* show mini help menu */
1483 case OPT_BEGINNER_LEVEL:
1484 if (prompt_option_on_off(option)) {
1486 changed |= MISC_OPTS;
1487 }
1488 break;
1489
1490 /* show all arts or just new/unread arts */
1491 case OPT_SHOW_ONLY_UNREAD_ARTS:
1492 if (prompt_option_on_off(option)) {
1493 UPDATE_BOOL_ATTRIBUTES(show_only_unread_arts);
1494 changed |= SHOW_ONLY_UNREAD;
1495 }
1496 break;
1497
1498 /* draw -> / highlighted bar */
1499 case OPT_DRAW_ARROW:
1500 if (prompt_option_on_off(option)) {
1501 unhighlight_option(option);
1504 repaint_option(OPT_INVERSE_OKAY);
1506 }
1507 changed |= MISC_OPTS;
1508 }
1509 break;
1510
1511 /* draw inversed screen header lines */
1512 /* draw inversed group/article/option line if draw_arrow is OFF */
1513 case OPT_INVERSE_OKAY:
1514 if (prompt_option_on_off(option)) {
1515 unhighlight_option(option);
1517 tinrc.draw_arrow = TRUE; /* we don't want to navigate blindly */
1518 repaint_option(OPT_DRAW_ARROW);
1519 }
1521 changed |= MISC_OPTS;
1522 }
1523 break;
1524
1525 case OPT_MAIL_8BIT_HEADER:
1526 if (prompt_option_on_off(option)) {
1529 print_any_option(OPT_MAIL_8BIT_HEADER);
1530 }
1531 UPDATE_BOOL_ATTRIBUTES(mail_8bit_header);
1532 }
1533 break;
1534
1535 case OPT_POST_8BIT_HEADER:
1536 if (prompt_option_on_off(option)) {
1537 /* if post_mime_encoding != 8bit, post_8bit_header is disabled */
1540 print_any_option(OPT_POST_8BIT_HEADER);
1541 }
1542 UPDATE_BOOL_ATTRIBUTES(post_8bit_header);
1543 }
1544 break;
1545
1546 /* show newsgroup description text next to newsgroups */
1547 case OPT_SHOW_DESCRIPTION:
1548 if (prompt_option_on_off(option)) {
1550 if (show_description) /* force reread of newgroups file */
1552 changed |= MISC_OPTS;
1553 }
1554 break;
1555
1556#ifdef HAVE_COLOR
1557 /* use ANSI color */
1558 case OPT_USE_COLOR:
1559 if (prompt_option_on_off(option)) {
1560# ifdef USE_CURSES
1561 if (!has_colors())
1562 use_color = FALSE;
1563 else
1564# endif /* USE_CURSES */
1565 use_color = tinrc.use_color;
1566 set_last_option_on_screen(first_option_on_screen);
1567 redraw_screen(option);
1568 changed |= MISC_OPTS;
1569 }
1570 break;
1571#endif /* HAVE_COLOR */
1572
1573#ifdef XFACE_ABLE
1574 /* use slrnface */
1575 case OPT_USE_SLRNFACE:
1576 if (prompt_option_on_off(option)) {
1577 if (!tinrc.use_slrnface)
1578 slrnface_stop();
1579 else
1580 slrnface_start();
1581 changed |= MISC_OPTS;
1582 }
1583 break;
1584#endif /* XFACE_ABLE */
1585
1586 /* word_highlight */
1587 case OPT_WORD_HIGHLIGHT:
1588 if (prompt_option_on_off(option)) {
1590 set_last_option_on_screen(first_option_on_screen);
1591 redraw_screen(option);
1592 changed |= MISC_OPTS;
1593 }
1594 break;
1595
1596#if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && defined(HAVE_UNICODE_UBIDI_H) && !defined(NO_LOCALE)
1597 case OPT_RENDER_BIDI:
1598 if (prompt_option_on_off(option))
1599 changed |= MISC_OPTS;
1600 break;
1601#endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && HAVE_UNICODE_UBIDI_H && !NO_LOCALE */
1602
1603 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
1604 if (prompt_option_on_off(option))
1605 SET_BOOL_ATTRIBUTE(add_posted_to_filter);
1606 break;
1607
1608 case OPT_ATTRIB_ADVERTISING:
1609 if (prompt_option_on_off(option))
1610 SET_BOOL_ATTRIBUTE(advertising);
1611 break;
1612
1613 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
1614 if (prompt_option_on_off(option))
1615 SET_BOOL_ATTRIBUTE(alternative_handling);
1616 break;
1617
1618 case OPT_ATTRIB_ASK_FOR_METAMAIL:
1619 if (prompt_option_on_off(option))
1620 SET_BOOL_ATTRIBUTE(ask_for_metamail);
1621 break;
1622
1623 case OPT_ATTRIB_AUTO_LIST_THREAD:
1624 if (prompt_option_on_off(option))
1625 SET_BOOL_ATTRIBUTE(auto_list_thread);
1626 break;
1627
1628 case OPT_ATTRIB_AUTO_SELECT:
1629 if (prompt_option_on_off(option))
1630 SET_BOOL_ATTRIBUTE(auto_select);
1631 break;
1632
1633 case OPT_ATTRIB_BATCH_SAVE:
1634 if (prompt_option_on_off(option))
1635 SET_BOOL_ATTRIBUTE(batch_save);
1636 break;
1637
1638 case OPT_ATTRIB_DELETE_TMP_FILES:
1639 if (prompt_option_on_off(option))
1640 SET_BOOL_ATTRIBUTE(delete_tmp_files);
1641 break;
1642
1643#ifdef HAVE_COLOR
1644 case OPT_ATTRIB_EXTQUOTE_HANDLING:
1645 if (prompt_option_on_off(option))
1646 SET_BOOL_ATTRIBUTE(extquote_handling);
1647 break;
1648#endif /* HAVE_COLOR */
1649
1650 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
1651 if (prompt_option_on_off(option))
1652 SET_BOOL_ATTRIBUTE(group_catchup_on_exit);
1653 break;
1654
1655 case OPT_ATTRIB_MAIL_8BIT_HEADER:
1656 if (prompt_option_on_off(option))
1657 SET_BOOL_ATTRIBUTE(mail_8bit_header);
1658 break;
1659
1660 case OPT_ATTRIB_MARK_IGNORE_TAGS:
1661 if (prompt_option_on_off(option))
1662 SET_BOOL_ATTRIBUTE(mark_ignore_tags);
1663 break;
1664
1665 case OPT_ATTRIB_MARK_SAVED_READ:
1666 if (prompt_option_on_off(option))
1667 SET_BOOL_ATTRIBUTE(mark_saved_read);
1668 break;
1669
1670 case OPT_ATTRIB_MIME_FORWARD:
1671 if (prompt_option_on_off(option))
1672 SET_BOOL_ATTRIBUTE(mime_forward);
1673 break;
1674
1675 case OPT_ATTRIB_POST_8BIT_HEADER:
1676 if (prompt_option_on_off(option))
1677 SET_BOOL_ATTRIBUTE(post_8bit_header);
1678 break;
1679
1680 case OPT_ATTRIB_POST_PROCESS_VIEW:
1681 if (prompt_option_on_off(option))
1682 SET_BOOL_ATTRIBUTE(post_process_view);
1683 break;
1684
1685 case OPT_ATTRIB_POS_FIRST_UNREAD:
1686 if (prompt_option_on_off(option))
1687 SET_BOOL_ATTRIBUTE(pos_first_unread);
1688 break;
1689
1690#ifndef DISABLE_PRINTING
1691 case OPT_ATTRIB_PRINT_HEADER:
1692 if (prompt_option_on_off(option))
1693 SET_BOOL_ATTRIBUTE(print_header);
1694 break;
1695#endif /* !DISABLE_PRINTING */
1696
1697 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
1698 if (prompt_option_on_off(option))
1699 SET_BOOL_ATTRIBUTE(process_only_unread);
1700 break;
1701
1702 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
1703 if (prompt_option_on_off(option))
1704 SET_BOOL_ATTRIBUTE(prompt_followupto);
1705 break;
1706
1707 case OPT_ATTRIB_QUICK_KILL_CASE:
1708 if (prompt_option_on_off(option))
1709 SET_BOOL_ATTRIBUTE(quick_kill_case);
1710 break;
1711
1712 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
1713 if (prompt_option_on_off(option))
1714 SET_BOOL_ATTRIBUTE(quick_kill_expire);
1715 break;
1716
1717 case OPT_ATTRIB_QUICK_SELECT_CASE:
1718 if (prompt_option_on_off(option))
1719 SET_BOOL_ATTRIBUTE(quick_select_case);
1720 break;
1721
1722 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
1723 if (prompt_option_on_off(option))
1724 SET_BOOL_ATTRIBUTE(quick_select_expire);
1725 break;
1726
1727 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
1728 if (prompt_option_on_off(option)) {
1729 SET_BOOL_ATTRIBUTE(show_only_unread_arts);
1730 changed |= SHOW_ONLY_UNREAD;
1731 }
1732 break;
1733
1734 case OPT_ATTRIB_SHOW_SIGNATURES:
1735 if (prompt_option_on_off(option))
1736 SET_BOOL_ATTRIBUTE(show_signatures);
1737 break;
1738
1739 case OPT_ATTRIB_SIGDASHES:
1740 if (prompt_option_on_off(option))
1741 SET_BOOL_ATTRIBUTE(sigdashes);
1742 break;
1743
1744 case OPT_ATTRIB_SIGNATURE_REPOST:
1745 if (prompt_option_on_off(option))
1746 SET_BOOL_ATTRIBUTE(signature_repost);
1747 break;
1748
1749 case OPT_ATTRIB_TEX2ISO_CONV:
1750 if (prompt_option_on_off(option))
1751 SET_BOOL_ATTRIBUTE(tex2iso_conv);
1752 break;
1753
1754 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
1755 if (prompt_option_on_off(option))
1756 SET_BOOL_ATTRIBUTE(thread_catchup_on_exit);
1757 break;
1758
1759 case OPT_ATTRIB_VERBATIM_HANDLING:
1760 if (prompt_option_on_off(option))
1761 SET_BOOL_ATTRIBUTE(verbatim_handling);
1762 break;
1763
1764 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
1765 if (prompt_option_on_off(option))
1766 SET_BOOL_ATTRIBUTE(wrap_on_next_unread);
1767 break;
1768
1769 case OPT_ATTRIB_X_COMMENT_TO:
1770 if (prompt_option_on_off(option))
1771 SET_BOOL_ATTRIBUTE(x_comment_to);
1772 break;
1773
1774 default:
1775 break;
1776 } /* switch (option) */
1777 break;
1778
1779 case OPT_LIST:
1780 switch (option) {
1781#ifdef USE_CANLOCK
1782 case OPT_CANCEL_LOCK_ALGO:
1783#endif /* USE_CANLOCK */
1784#ifdef HAVE_COLOR
1785 case OPT_COL_FROM:
1786 case OPT_COL_HEAD:
1787 case OPT_COL_HELP:
1788 case OPT_COL_INVERS_BG:
1789 case OPT_COL_INVERS_FG:
1790 case OPT_COL_MESSAGE:
1791 case OPT_COL_MINIHELP:
1792 case OPT_COL_NEWSHEADERS:
1793 case OPT_COL_QUOTE:
1794 case OPT_COL_QUOTE2:
1795 case OPT_COL_QUOTE3:
1796 case OPT_COL_EXTQUOTE:
1797 case OPT_COL_RESPONSE:
1798 case OPT_COL_SIGNATURE:
1799 case OPT_COL_SUBJECT:
1800 case OPT_COL_TEXT:
1801 case OPT_COL_TITLE:
1802 case OPT_COL_MARKSTAR:
1803 case OPT_COL_MARKDASH:
1804 case OPT_COL_MARKSLASH:
1805 case OPT_COL_MARKSTROKE:
1806 case OPT_COL_URLS:
1807 case OPT_COL_VERBATIM:
1808#endif /* HAVE_COLOR */
1809 case OPT_CONFIRM_CHOICE:
1810 case OPT_GOTO_NEXT_UNREAD:
1811 case OPT_HIDE_UUE:
1812 case OPT_INTERACTIVE_MAILER:
1813 case OPT_KILL_LEVEL:
1814 case OPT_MAILBOX_FORMAT:
1815 case OPT_MONO_MARKDASH:
1816 case OPT_MONO_MARKSLASH:
1817 case OPT_MONO_MARKSTAR:
1818 case OPT_MONO_MARKSTROKE:
1819#ifdef HAVE_UNICODE_NORMALIZATION
1820 case OPT_NORMALIZATION_FORM:
1821#endif /* HAVE_UNICODE_NORMALIZATION */
1822 case OPT_QUOTE_STYLE:
1823 case OPT_STRIP_BOGUS:
1824 case OPT_WILDCARD:
1825 case OPT_WORD_H_DISPLAY_MARKS:
1826#ifdef USE_HEAPSORT
1827 case OPT_SORT_FUNCTION:
1828#endif /* USE_HEAPSORT */
1829 if (prompt_option_list(option))
1830 changed |= MISC_OPTS;
1831 break;
1832
1833#ifdef HAVE_COLOR
1834 case OPT_COL_BACK:
1835 case OPT_COL_NORMAL:
1836 if (prompt_option_list(option)) {
1837 redraw_screen(option);
1838 changed |= MISC_OPTS;
1839 }
1840 break;
1841#endif /* HAVE_COLOR */
1842
1843 case OPT_AUTO_CC_BCC:
1844 if (prompt_option_list(option))
1845 UPDATE_INT_ATTRIBUTES(auto_cc_bcc);
1846 break;
1847
1848 case OPT_THREAD_ARTICLES:
1849 if (prompt_option_list(option)) {
1850 UPDATE_INT_ATTRIBUTES(thread_articles);
1851 changed |= THREAD_ARTS;
1852 }
1853 break;
1854
1855 case OPT_SORT_ARTICLE_TYPE:
1856 if (prompt_option_list(option)) {
1857 UPDATE_INT_ATTRIBUTES(sort_article_type);
1858 changed |= SORT_OPTS;
1859 }
1860 break;
1861
1862 case OPT_SORT_THREADS_TYPE:
1863 if (prompt_option_list(option)) {
1864 UPDATE_INT_ATTRIBUTES(sort_threads_type);
1865 changed |= SORT_OPTS;
1866 }
1867 break;
1868
1869 case OPT_THREAD_SCORE:
1870 if (prompt_option_list(option))
1871 changed |= THREAD_SCORE;
1872 break;
1873
1874 case OPT_TRIM_ARTICLE_BODY:
1875 if (prompt_option_list(option))
1876 UPDATE_INT_ATTRIBUTES(trim_article_body);
1877 break;
1878
1879 case OPT_POST_PROCESS_TYPE:
1880 if (prompt_option_list(option))
1881 UPDATE_INT_ATTRIBUTES(post_process_type);
1882 break;
1883
1884 case OPT_SHOW_AUTHOR:
1885 if (prompt_option_list(option)) {
1886 UPDATE_INT_ATTRIBUTES(show_author);
1887 changed |= SHOW_AUTHOR;
1888 }
1889 break;
1890
1891 case OPT_MAIL_MIME_ENCODING:
1892 if (prompt_option_list(option)) {
1893#ifdef CHARSET_CONVERSION
1894 /*
1895 * check if we have selected a !7bit encoding but a 7bit network charset
1896 * or a !8bit encoding but a 8bit network charset, update encoding if needed
1897 */
1898 is_7bit = FALSE;
1899 for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
1900 if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
1901 is_7bit = TRUE;
1902 break;
1903 }
1904 }
1905 if (is_7bit) {
1908 repaint_option(OPT_MAIL_MIME_ENCODING);
1909 }
1910 } else {
1913 repaint_option(OPT_MAIL_MIME_ENCODING);
1914 }
1915 }
1916#endif /* CHARSET_CONVERSION */
1917 UPDATE_INT_ATTRIBUTES(mail_mime_encoding);
1918 /* do not use 8 bit headers if mime encoding is not 8bit */
1921 repaint_option(OPT_MAIL_8BIT_HEADER);
1922 UPDATE_BOOL_ATTRIBUTES(mail_8bit_header);
1923 }
1924 }
1925 break;
1926
1927 case OPT_POST_MIME_ENCODING:
1928 if (prompt_option_list(option)) {
1929#ifdef CHARSET_CONVERSION
1930 /*
1931 * check if we have selected a !7bit encoding but a 7bit network charset
1932 * or a !8bit encoding but a 8bit network charset, update encoding if needed
1933 */
1934 is_7bit = FALSE;
1935 for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
1936 if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
1937 is_7bit = TRUE;
1938 break;
1939 }
1940 }
1941 if (is_7bit) {
1944 repaint_option(OPT_POST_MIME_ENCODING);
1945 }
1946 } else {
1949 repaint_option(OPT_POST_MIME_ENCODING);
1950 }
1951 }
1952#endif /* CHARSET_CONVERSION */
1953 UPDATE_INT_ATTRIBUTES(post_mime_encoding);
1954 /* do not use 8 bit headers if mime encoding is not 8bit */
1957 repaint_option(OPT_POST_8BIT_HEADER);
1958 UPDATE_BOOL_ATTRIBUTES(post_8bit_header);
1959 }
1960 }
1961 break;
1962
1963#ifdef CHARSET_CONVERSION
1964 case OPT_MM_NETWORK_CHARSET:
1965 if (prompt_option_list(option)) {
1966 /*
1967 * check if we have selected a 7bit charset but a !7bit encoding
1968 * or a 8bit charset but a !8bit encoding, update encoding if needed
1969 *
1970 * if (mail|post)_mime_encoding != 8bit, disable (mail|post)_8bit_header
1971 */
1972 is_7bit = FALSE;
1973 UPDATE_INT_ATTRIBUTES(mm_network_charset);
1974 for (i = 0; txt_mime_7bit_charsets[i] != NULL; i++) {
1975 if (!strcasecmp(txt_mime_charsets[tinrc.mm_network_charset], txt_mime_7bit_charsets[i])) {
1976 is_7bit = TRUE;
1977 break;
1978 }
1979 }
1980 if (is_7bit) {
1984 repaint_option(OPT_MAIL_MIME_ENCODING);
1985 repaint_option(OPT_MAIL_8BIT_HEADER);
1986 UPDATE_INT_ATTRIBUTES(mail_mime_encoding);
1987 UPDATE_BOOL_ATTRIBUTES(mail_8bit_header);
1988 }
1992 repaint_option(OPT_POST_MIME_ENCODING);
1993 repaint_option(OPT_POST_8BIT_HEADER);
1994 UPDATE_INT_ATTRIBUTES(post_mime_encoding);
1995 UPDATE_BOOL_ATTRIBUTES(post_8bit_header);
1996 }
1997 } else {
2000 repaint_option(OPT_MAIL_MIME_ENCODING);
2001 UPDATE_INT_ATTRIBUTES(mail_mime_encoding);
2002 }
2005 repaint_option(OPT_POST_MIME_ENCODING);
2006 UPDATE_INT_ATTRIBUTES(post_mime_encoding);
2007 }
2008 }
2009 }
2010 break;
2011#endif /* CHARSET_CONVERSION */
2012
2013 case OPT_ATTRIB_AUTO_CC_BCC:
2014 if (prompt_option_list(option))
2015 SET_NUM_ATTRIBUTE(auto_cc_bcc);
2016 break;
2017
2018 case OPT_ATTRIB_MAIL_MIME_ENCODING:
2019 if (prompt_option_list(option))
2020 SET_NUM_ATTRIBUTE(mail_mime_encoding);
2021 break;
2022
2023#ifdef CHARSET_CONVERSION
2024 case OPT_ATTRIB_MM_NETWORK_CHARSET:
2025 if (prompt_option_list(option))
2026 SET_NUM_ATTRIBUTE(mm_network_charset);
2027 break;
2028#endif /* CHARSET_CONVERSION */
2029
2030 case OPT_ATTRIB_POST_MIME_ENCODING:
2031 if (prompt_option_list(option))
2032 SET_NUM_ATTRIBUTE(post_mime_encoding);
2033 break;
2034
2035 case OPT_ATTRIB_POST_PROCESS_TYPE:
2036 if (prompt_option_list(option))
2037 SET_NUM_ATTRIBUTE(post_process_type);
2038 break;
2039
2040 case OPT_ATTRIB_QUICK_KILL_HEADER:
2041 if (prompt_option_list(option))
2042 SET_NUM_ATTRIBUTE(quick_kill_header);
2043 break;
2044
2045 case OPT_ATTRIB_QUICK_SELECT_HEADER:
2046 if (prompt_option_list(option))
2047 SET_NUM_ATTRIBUTE(quick_select_header);
2048 break;
2049
2050 case OPT_ATTRIB_SHOW_AUTHOR:
2051 if (prompt_option_list(option)) {
2052 SET_NUM_ATTRIBUTE(show_author);
2053 changed |= SHOW_AUTHOR;
2054 }
2055 break;
2056
2057 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
2058 if (prompt_option_list(option)) {
2059 SET_NUM_ATTRIBUTE(sort_article_type);
2060 changed |= SORT_OPTS;
2061 }
2062 break;
2063
2064 case OPT_ATTRIB_SORT_THREADS_TYPE:
2065 if (prompt_option_list(option)) {
2066 SET_NUM_ATTRIBUTE(sort_threads_type);
2067 changed |= SORT_OPTS;
2068 }
2069 break;
2070
2071 case OPT_ATTRIB_THREAD_ARTICLES:
2072 if (prompt_option_list(option)) {
2073 SET_NUM_ATTRIBUTE(thread_articles);
2074 changed |= THREAD_ARTS;
2075 }
2076 break;
2077
2078 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
2079 if (prompt_option_list(option))
2080 SET_NUM_ATTRIBUTE(trim_article_body);
2081 break;
2082
2083 default:
2084 break;
2085 } /* switch (option) */
2086 break;
2087
2088 case OPT_STRING:
2089 switch (option) {
2090 case OPT_INEWS_PROG:
2091 case OPT_MAILDIR:
2092 case OPT_MAILER_FORMAT:
2093 case OPT_MAIL_ADDRESS:
2094 case OPT_MAIL_QUOTE_FORMAT:
2095 case OPT_METAMAIL_PROG:
2096 case OPT_NEWS_QUOTE_FORMAT:
2097 case OPT_SAVEDIR:
2098 case OPT_SIGFILE:
2099#ifndef DISABLE_PRINTING
2100 case OPT_PRINTER:
2101#endif /* !DISABLE_PRINTING */
2102 case OPT_QUOTE_CHARS:
2103 case OPT_SPAMTRAP_WARNING_ADDRESSES:
2104 case OPT_URL_HANDLER:
2105 case OPT_XPOST_QUOTE_FORMAT:
2106 if (prompt_option_string(option))
2107 changed |= MISC_OPTS;
2108 break;
2109
2110 case OPT_EDITOR_FORMAT:
2111 if (prompt_option_string(option)) {
2112 if (!strlen(tinrc.editor_format))
2114 changed |= MISC_OPTS;
2115 }
2116 break;
2117
2118 case OPT_GROUP_FORMAT:
2119 if (prompt_option_string(option)) {
2120 if (!strlen(tinrc.group_format))
2122 changed |= MISC_OPTS;
2123 }
2124 break;
2125
2126 case OPT_ATTRIB_GROUP_FORMAT:
2127 if (prompt_option_string(option))
2128 SET_STRING_ATTRIBUTE(group_format);
2129 break;
2130
2131#ifndef CHARSET_CONVERSION
2132 case OPT_MM_CHARSET:
2133 if (prompt_option_string(option)) {
2134 /*
2135 * No charset conversion available, assume local charset
2136 * to be network charset.
2137 */
2139 changed |= MISC_OPTS;
2140 }
2141 break;
2142#else
2143# ifdef NO_LOCALE
2144 case OPT_MM_LOCAL_CHARSET:
2145 if (prompt_option_string(option))
2146 /* no locales -> can't guess local charset */
2147 changed |= MISC_OPTS;
2148 break;
2149
2150# endif /* NO_LOCALE */
2151#endif /* !CHARSET_CONVERSION */
2152
2153 case OPT_NEWS_HEADERS_TO_DISPLAY:
2154 if (prompt_option_string(option)) {
2156 changed |= MISC_OPTS;
2157 }
2158 break;
2159
2160 case OPT_NEWS_HEADERS_TO_NOT_DISPLAY:
2161 if (prompt_option_string(option)) {
2163 changed |= MISC_OPTS;
2164 }
2165 break;
2166
2167 case OPT_POSTED_ARTICLES_FILE:
2168 if (prompt_option_string(option)) /* no expansion here, will be done in post_loop() */
2169 changed |= MISC_OPTS;
2170 break;
2171
2172#ifdef HAVE_COLOR
2173 case OPT_QUOTE_REGEX:
2174 if (prompt_option_string(option)) {
2175 FreeIfNeeded(quote_regex.re);
2176 FreeIfNeeded(quote_regex.extra);
2177 if (!strlen(tinrc.quote_regex))
2178 STRCPY(tinrc.quote_regex, DEFAULT_QUOTE_REGEX);
2179 compile_regex(tinrc.quote_regex, &quote_regex, PCRE_CASELESS);
2180 changed |= DISPLAY_OPTS;
2181 }
2182 break;
2183
2184 case OPT_QUOTE_REGEX2:
2185 if (prompt_option_string(option)) {
2186 FreeIfNeeded(quote_regex2.re);
2187 FreeIfNeeded(quote_regex2.extra);
2188 if (!strlen(tinrc.quote_regex2))
2189 STRCPY(tinrc.quote_regex2, DEFAULT_QUOTE_REGEX2);
2190 compile_regex(tinrc.quote_regex2, &quote_regex2, PCRE_CASELESS);
2191 changed |= DISPLAY_OPTS;
2192 }
2193 break;
2194
2195 case OPT_QUOTE_REGEX3:
2196 if (prompt_option_string(option)) {
2197 FreeIfNeeded(quote_regex3.re);
2198 FreeIfNeeded(quote_regex3.extra);
2199 if (!strlen(tinrc.quote_regex3))
2200 STRCPY(tinrc.quote_regex3, DEFAULT_QUOTE_REGEX3);
2201 compile_regex(tinrc.quote_regex3, &quote_regex3, PCRE_CASELESS);
2202 changed |= DISPLAY_OPTS;
2203 }
2204 break;
2205
2206 case OPT_EXTQUOTE_REGEX:
2207 if (prompt_option_string(option)) {
2208 FreeIfNeeded(extquote_regex.re);
2209 FreeIfNeeded(extquote_regex.extra);
2210 if (!strlen(tinrc.extquote_regex))
2211 STRCPY(tinrc.extquote_regex, DEFAULT_EXTQUOTE_REGEX);
2212 compile_regex(tinrc.extquote_regex, &extquote_regex, PCRE_CASELESS);
2213 changed |= DISPLAY_OPTS;
2214 }
2215 break;
2216#endif /* HAVE_COLOR */
2217
2218 case OPT_SELECT_FORMAT:
2219 if (prompt_option_string(option)) {
2220 if (!strlen(tinrc.select_format))
2222 changed |= MISC_OPTS;
2223 }
2224 break;
2225
2226 case OPT_SLASHES_REGEX:
2227 if (prompt_option_string(option)) {
2230 if (!strlen(tinrc.slashes_regex))
2233 changed |= DISPLAY_OPTS;
2234 }
2235 break;
2236
2237 case OPT_STARS_REGEX:
2238 if (prompt_option_string(option)) {
2241 if (!strlen(tinrc.stars_regex))
2243 compile_regex(tinrc.stars_regex, &stars_regex, PCRE_CASELESS);
2244 changed |= DISPLAY_OPTS;
2245 }
2246 break;
2247
2248 case OPT_STROKES_REGEX:
2249 if (prompt_option_string(option)) {
2252 if (!strlen(tinrc.strokes_regex))
2255 changed |= DISPLAY_OPTS;
2256 }
2257 break;
2258
2259 case OPT_UNDERSCORES_REGEX:
2260 if (prompt_option_string(option)) {
2263 if (!strlen(tinrc.underscores_regex))
2266 changed |= DISPLAY_OPTS;
2267 }
2268 break;
2269
2270 case OPT_STRIP_RE_REGEX:
2271 if (prompt_option_string(option)) {
2274 if (!strlen(tinrc.strip_re_regex))
2277 changed |= MISC_OPTS;
2278 }
2279 break;
2280
2281 case OPT_STRIP_WAS_REGEX:
2282 if (prompt_option_string(option)) {
2285 if (!strlen(tinrc.strip_was_regex)) {
2286#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
2287 if (IS_LOCAL_CHARSET("UTF-8") && utf8_pcre())
2289 else
2290#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
2292 }
2294 changed |= MISC_OPTS;
2295 }
2296 break;
2297
2298 case OPT_THREAD_FORMAT:
2299 if (prompt_option_string(option)) {
2300 if (!strlen(tinrc.thread_format))
2302 changed |= MISC_OPTS;
2303 }
2304 break;
2305
2306 case OPT_ATTRIB_THREAD_FORMAT:
2307 if (prompt_option_string(option))
2308 SET_STRING_ATTRIBUTE(thread_format);
2309 break;
2310
2311 case OPT_VERBATIM_BEGIN_REGEX:
2312 if (prompt_option_string(option)) {
2315 if (!strlen(tinrc.verbatim_begin_regex))
2318 changed |= DISPLAY_OPTS;
2319 }
2320 break;
2321
2322 case OPT_VERBATIM_END_REGEX:
2323 if (prompt_option_string(option)) {
2326 if (!strlen(tinrc.verbatim_end_regex))
2329 changed |= DISPLAY_OPTS;
2330 }
2331 break;
2332
2333 case OPT_DATE_FORMAT:
2334 if (prompt_option_string(option)) {
2335 if (!strlen(tinrc.date_format))
2337 changed |= MISC_OPTS;
2338 }
2339 break;
2340
2341 case OPT_ATTRIB_DATE_FORMAT:
2342 if (prompt_option_string(option))
2343 SET_STRING_ATTRIBUTE(date_format);
2344 break;
2345
2346 case OPT_ATTRIB_EDITOR_FORMAT:
2347 if (prompt_option_string(option))
2348 SET_STRING_ATTRIBUTE(editor_format);
2349 break;
2350
2351 case OPT_ATTRIB_FCC:
2352 if (prompt_option_string(option))
2354 break;
2355
2356 case OPT_ATTRIB_FOLLOWUP_TO:
2357 if (prompt_option_string(option))
2358 SET_STRING_ATTRIBUTE(followup_to);
2359 break;
2360
2361 case OPT_ATTRIB_FROM:
2362 if (prompt_option_string(option))
2364 break;
2365
2366#ifdef HAVE_ISPELL
2367 case OPT_ATTRIB_ISPELL:
2368 if (prompt_option_string(option))
2369 SET_STRING_ATTRIBUTE(ispell);
2370 break;
2371#endif /* HAVE_ISPELL */
2372
2373 case OPT_ATTRIB_MAILDIR:
2374 if (prompt_option_string(option))
2375 SET_STRING_ATTRIBUTE(maildir);
2376 break;
2377
2378 case OPT_ATTRIB_MAILING_LIST:
2379 if (prompt_option_string(option))
2380 SET_STRING_ATTRIBUTE(mailing_list);
2381 break;
2382
2383 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
2384 if (prompt_option_string(option))
2385 SET_STRING_ATTRIBUTE(mime_types_to_save);
2386 break;
2387
2388 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
2389 if (prompt_option_string(option)) {
2390 SET_STRING_ATTRIBUTE(news_headers_to_display);
2392 changed |= DISPLAY_OPTS;
2393 }
2394 break;
2395
2396 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
2397 if (prompt_option_string(option)) {
2398 SET_STRING_ATTRIBUTE(news_headers_to_not_display);
2400 changed |= DISPLAY_OPTS;
2401 }
2402 break;
2403
2404 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
2405 if (prompt_option_string(option))
2406 SET_STRING_ATTRIBUTE(news_quote_format);
2407 break;
2408
2409 case OPT_ATTRIB_ORGANIZATION:
2410 if (prompt_option_string(option))
2411 SET_STRING_ATTRIBUTE(organization);
2412 break;
2413
2414 case OPT_ATTRIB_QUICK_KILL_SCOPE:
2415 if (prompt_option_string(option))
2416 SET_STRING_ATTRIBUTE(quick_kill_scope);
2417 break;
2418
2419 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
2420 if (prompt_option_string(option))
2421 SET_STRING_ATTRIBUTE(quick_select_scope);
2422 break;
2423
2424 case OPT_ATTRIB_QUOTE_CHARS:
2425 if (prompt_option_string(option))
2426 SET_STRING_ATTRIBUTE(quote_chars);
2427 break;
2428
2429 case OPT_ATTRIB_SAVEDIR:
2430 if (prompt_option_string(option))
2431 SET_STRING_ATTRIBUTE(savedir);
2432 break;
2433
2434 case OPT_ATTRIB_SAVEFILE:
2435 if (prompt_option_string(option))
2436 SET_STRING_ATTRIBUTE(savefile);
2437 break;
2438
2439 case OPT_ATTRIB_SIGFILE:
2440 if (prompt_option_string(option))
2442 break;
2443
2444#ifdef CHARSET_CONVERSION
2445 case OPT_ATTRIB_UNDECLARED_CHARSET:
2446 if (prompt_option_string(option))
2447 SET_STRING_ATTRIBUTE(undeclared_charset);
2448 break;
2449
2450#endif /* CHARSET_CONVERSION */
2451 case OPT_ATTRIB_X_BODY:
2452 if (prompt_option_string(option))
2453 SET_STRING_ATTRIBUTE(x_body);
2454 break;
2455
2456 case OPT_ATTRIB_X_HEADERS:
2457 if (prompt_option_string(option))
2458 SET_STRING_ATTRIBUTE(x_headers);
2459 break;
2460
2461 default:
2462 break;
2463 } /* switch (option) */
2464
2465 break;
2466
2467 case OPT_NUM:
2468 switch (option) {
2469 case OPT_GETART_LIMIT:
2470 case OPT_SCROLL_LINES:
2471 if (prompt_option_num(option))
2472 changed |= MISC_OPTS;
2473 break;
2474
2475#if defined(HAVE_ALARM) && defined(SIGALRM)
2476 case OPT_NNTP_READ_TIMEOUT_SECS:
2477 if (prompt_option_num(option)) {
2478 if (tinrc.nntp_read_timeout_secs < 0)
2479 tinrc.nntp_read_timeout_secs = 0;
2480 changed |= MISC_OPTS;
2481 }
2482 break;
2483#endif /* HAVE_ALARM && SIGALRM */
2484
2485 case OPT_REREAD_ACTIVE_FILE_SECS:
2486 if (prompt_option_num(option)) {
2489 changed |= MISC_OPTS;
2490 }
2491 break;
2492
2493 case OPT_RECENT_TIME:
2494 if (prompt_option_num(option)) {
2495 if (tinrc.recent_time < 0)
2496 tinrc.recent_time = 0;
2497 changed |= MISC_OPTS;
2498 }
2499 break;
2500
2501 case OPT_FILTER_DAYS:
2502 if (prompt_option_num(option)) {
2503 if (tinrc.filter_days <= 0)
2504 tinrc.filter_days = 1;
2505 changed |= MISC_OPTS;
2506 }
2507 break;
2508
2509 case OPT_SCORE_LIMIT_KILL:
2510 case OPT_SCORE_KILL:
2511 case OPT_SCORE_LIMIT_SELECT:
2512 case OPT_SCORE_SELECT:
2513 if (prompt_option_num(option)) {
2515 redraw_screen(option);
2516 changed |= SCORE_OPTS;
2517 }
2518 break;
2519
2520 case OPT_THREAD_PERC:
2521 if (prompt_option_num(option)) {
2522 if (tinrc.thread_perc < 0 || tinrc.thread_perc > 100)
2524 UPDATE_INT_ATTRIBUTES(thread_perc);
2525 }
2526 break;
2527
2528 case OPT_WRAP_COLUMN:
2529 if (prompt_option_num(option))
2530 changed |= DISPLAY_OPTS;
2531 break;
2532
2533 case OPT_ATTRIB_THREAD_PERC:
2534 if (prompt_option_num(option))
2535 SET_NUM_ATTRIBUTE(thread_perc);
2536 break;
2537
2538 default:
2539 break;
2540 } /* switch (option) */
2541 break;
2542
2543 case OPT_CHAR:
2544 switch (option) {
2545 /*
2546 * TODO: do DASH_TO_SPACE/SPACE_TO_DASH conversion here?
2547 */
2548 case OPT_ART_MARKED_DELETED:
2549 case OPT_ART_MARKED_INRANGE:
2550 case OPT_ART_MARKED_RETURN:
2551 case OPT_ART_MARKED_SELECTED:
2552 case OPT_ART_MARKED_RECENT:
2553 case OPT_ART_MARKED_UNREAD:
2554 case OPT_ART_MARKED_READ:
2555 case OPT_ART_MARKED_KILLED:
2556 case OPT_ART_MARKED_READ_SELECTED:
2557 if (prompt_option_char(option)) {
2558#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
2559 set_art_mark_width();
2560#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
2561 changed |= MISC_OPTS;
2562 }
2563 break;
2564
2565 default:
2566 break;
2567 } /* switch (option) */
2568 break;
2569
2570 default:
2571 break;
2572 } /* switch (option_table[option].var_type) */
2573 change_option = FALSE;
2575 repaint_option(option);
2576 highlight_option(option);
2577 } /* if (change_option) */
2578 } /* forever */
2579 /* NOTREACHED */
2580 return;
2581}
2582
2583
2584#if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
2585static void
2586set_art_mark_width(
2587 void)
2588{
2589 art_mark_width = 1;
2590
2595 if (wcwidth(tinrc.art_marked_return) > art_mark_width)
2599 if (wcwidth(tinrc.art_marked_recent) > art_mark_width)
2601 if (wcwidth(tinrc.art_marked_unread) > art_mark_width)
2603 if (wcwidth(tinrc.art_marked_read) > art_mark_width)
2605 if (wcwidth(tinrc.art_marked_killed) > art_mark_width)
2609}
2610#endif /* MULTIBYTE_ABLE && !NO_LOCALE */
2611
2612
2613/*
2614 * scopes and attributes menu
2615 */
2616
2617static t_function
2619 void)
2620{
2621 return GLOBAL_QUIT;
2622}
2623
2624
2625static t_function
2627 void)
2628{
2629 return SCOPE_SELECT;
2630}
2631
2632
2633static void
2635 void)
2636{
2637 int i;
2638
2641 mark_offset = 0;
2642
2643 if (scopemenu.curr < 0)
2644 scopemenu.curr = 0;
2645
2646 scopemenu.max = num_scope - 1;
2647
2648 ClearScreen();
2651
2652 for (i = scopemenu.first; i < scopemenu.first + NOTESLINES && i < scopemenu.max; ++i)
2654
2656
2657 if (scopemenu.max <= 0) {
2659 return;
2660 }
2661
2663}
2664
2665
2666static void
2668 enum context level)
2669{
2670 char key[MAXKEYLEN];
2671 int i;
2672 t_bool changed = FALSE;
2674 t_menu *oldmenu = NULL;
2675
2676 if (currmenu)
2677 oldmenu = currmenu;
2678 scopemenu.curr = 0;
2682
2683 forever {
2684 switch ((func = handle_keypad(scope_left, scope_right, NULL, scope_keys))) {
2685 case GLOBAL_QUIT:
2686 if (changed)
2689 if (oldmenu)
2690 currmenu = oldmenu;
2691 return;
2692
2693 case DIGIT_1:
2694 case DIGIT_2:
2695 case DIGIT_3:
2696 case DIGIT_4:
2697 case DIGIT_5:
2698 case DIGIT_6:
2699 case DIGIT_7:
2700 case DIGIT_8:
2701 case DIGIT_9:
2702 if (scopemenu.max)
2704 break;
2705
2706#ifndef NO_SHELL_ESCAPE
2709 break;
2710#endif /* !NO_SHELL_ESCAPE */
2711
2712 case GLOBAL_HELP:
2715 break;
2716
2717 case GLOBAL_FIRST_PAGE:
2718 top_of_list();
2719 break;
2720
2721 case GLOBAL_LAST_PAGE:
2722 end_of_list();
2723 break;
2724
2726 my_retouch();
2729 break;
2730
2731 case GLOBAL_LINE_DOWN:
2732 move_down();
2733 break;
2734
2735 case GLOBAL_LINE_UP:
2736 move_up();
2737 break;
2738
2739 case GLOBAL_PAGE_DOWN:
2740 page_down();
2741 break;
2742
2743 case GLOBAL_PAGE_UP:
2744 page_up();
2745 break;
2746
2747 case GLOBAL_SCROLL_DOWN:
2748 scroll_down();
2749 break;
2750
2751 case GLOBAL_SCROLL_UP:
2752 scroll_up();
2753 break;
2754
2758 break;
2759
2760 case SCOPE_ADD:
2761 if ((i = add_new_scope())) {
2762 changed = TRUE;
2763 scopemenu.curr = i;
2765 }
2766 break;
2767
2768 case SCOPE_DELETE:
2769 if (scopemenu.max) {
2770 if (scopes[scopemenu.curr + 1].global)
2772 else if (delete_scope(scopemenu.curr + 1)) {
2773 changed = TRUE;
2775 }
2776 }
2777 break;
2778
2780 if (changed)
2783 break;
2787 changed = FALSE;
2788 scopemenu.curr = 0;
2790 break;
2791
2792 case SCOPE_MOVE:
2793 if (scopemenu.max > 1) {
2794 if (scopes[scopemenu.curr + 1].global)
2796 else if ((i = move_scope(scopemenu.curr + 1))) {
2797 changed = TRUE;
2798 scopemenu.curr = i - 1;
2800 }
2801 }
2802 break;
2803
2804 case SCOPE_RENAME:
2805 if (scopemenu.max) {
2806 if (scopes[scopemenu.curr + 1].global)
2808 else if (rename_scope(&scopes[scopemenu.curr + 1])) {
2809 changed = TRUE;
2811 }
2812 }
2813 break;
2814
2815 case SCOPE_SELECT:
2816 if (scopemenu.max) {
2818 config_page(NULL, level);
2819 if (!curr_scope->global && scope_is_empty())
2821 curr_scope = NULL;
2822 changed = TRUE;
2824 }
2825 break;
2826
2827 default:
2829 break;
2830 }
2831 }
2832}
2833
2834
2835static void
2837 void)
2838{
2840 if (scopemenu.curr == scopemenu.max - 1)
2842}
2843
2844
2845static void
2847 int i)
2848{
2849 char *sptr;
2850 int len = cCOLS - 11;
2851
2852#ifdef USE_CURSES
2853 /*
2854 * Allocate line buffer
2855 * make it the same size like in !USE_CURSES case to simplify some code
2856 */
2857 sptr = my_malloc(cCOLS + 2);
2858#else
2859 sptr = screen[INDEX2SNUM(i)].col;
2860#endif /* USE_CURSES */
2861
2862 snprintf(sptr, (size_t) cCOLS, " %c %s %-*.*s%s", (scopes[i + 1].global ? '!' : ' '), tin_ltoa(i + 1, 4), len, len, scopes[i + 1].scope, cCRLF);
2863
2864#ifndef USE_CURSES
2865 if (tinrc.strip_blanks)
2866 strcat(strip_line(sptr), cCRLF);
2867#endif /* !USE_CURSES */
2868
2869 WriteLine(INDEX2LNUM(i), sptr);
2870
2871#ifdef USE_CURSES
2872 free(sptr);
2873#endif /* USE_CURSES */
2874}
2875
2876
2877/*
2878 * add a new scope and return the index
2879 */
2880static int
2882 void)
2883{
2884 char buf[LEN];
2885 int new_pos = 0;
2886
2887 if (prompt_default_string(_(txt_scope_enter), buf, sizeof(buf), (char *) NULL, HIST_OTHER))
2888 new_pos = add_scope(buf);
2889
2890 return new_pos;
2891}
2892
2893
2894/*
2895 * returns TRUE if the given scope was deleted
2896 */
2897static t_bool
2899 int curr_pos)
2900{
2901 if (prompt_yn(_(txt_scope_delete), FALSE) == 1) {
2902 do_delete_scope(curr_pos);
2903 return TRUE;
2904 }
2905
2906 return FALSE;
2907}
2908
2909
2910static void
2912 int curr_pos)
2913{
2914 do_move_scope(curr_pos, num_scope - 1);
2916}
2917
2918
2919/*
2920 * returns TRUE if scope was renamed
2921 */
2922static t_bool
2924 struct t_scope *scope)
2925{
2926 char buf[LEN];
2927
2928 if (prompt_default_string(_(txt_scope_rename), buf, sizeof(buf), scope->scope, HIST_OTHER)) {
2929 if (buf[0] == '\0')
2930 return FALSE;
2931 FreeIfNeeded(scope->scope);
2932 scope->scope = my_strdup(buf);
2933 return TRUE;
2934 }
2935
2936 return FALSE;
2937}
2938
2939
2940/*
2941 * look if an entry with the given scope exists and return the index
2942 */
2943static int
2945 const char *scope)
2946{
2947 int i;
2948
2949 if (!scope || !*scope)
2950 return 0;
2951
2952 for (i = 1; i < num_scope; i++) {
2953 if (!scopes[i].global && strcasecmp(scope, scopes[i].scope) == 0)
2954 return i;
2955 }
2956
2957 return 0;
2958}
2959
2960
2961/*
2962 * returns the new position of the moved scope or 0 if repositioning
2963 * is not possible
2964 */
2965static int
2967 int curr_pos)
2968{
2969 char *p;
2970 int new_pos;
2971
2972 clear_message();
2973 if ((p = tin_getline(_(txt_scope_new_position), 1, NULL, 0, FALSE, HIST_OTHER)) != NULL)
2974 new_pos = atoi(p);
2975 else
2976 new_pos = curr_pos;
2977 clear_message();
2978
2979 if (new_pos == curr_pos || new_pos == 0)
2980 return 0;
2981
2982 if (new_pos >= num_scope)
2983 new_pos = num_scope - 1;
2984
2985 if (scopes[new_pos].global) {
2987 return 0;
2988 }
2989
2990 do_move_scope(curr_pos, new_pos);
2991
2992 return new_pos;
2993}
2994
2995
2996/*
2997 * repositions a scope into scopes[]
2998 */
2999static void
3001 int from,
3002 int to)
3003{
3004 struct t_scope tmp;
3005
3006 if (from == to)
3007 return;
3008
3009 tmp = scopes[from];
3010
3011 if (from > to) {
3012 while (from-- > to)
3013 scopes[from + 1] = scopes[from];
3014 } else {
3015 while (from++ < to)
3016 scopes[from - 1] = scopes[from];
3017 }
3018 scopes[to] = tmp;
3019}
3020
3021
3022/*
3023 * free all group->attribute arrays and all scopes which are
3024 * not marked as global
3025 */
3026static void
3028 void)
3029{
3030 int i;
3031
3032 for_each_group(i) {
3033 if (active[i].attribute && !active[i].attribute->global) {
3034 free(active[i].attribute);
3035 active[i].attribute = (struct t_attribute *) 0;
3036 }
3037 }
3038
3039 while (num_scope > 1 && !scopes[num_scope - 1].global)
3041}
3042
3043
3044/*
3045 * returns TRUE if no attribute in curr_scope has state == TRUE
3046 */
3047static t_bool
3049 void)
3050{
3051 enum option_enum i;
3052
3053 for (i = 0; i <= last_opt; i++) {
3054 if (option_is_visible(i) && !option_is_title(i) && check_state(i))
3055 return FALSE;
3056 }
3057
3058 return TRUE;
3059}
3060
3061
3062/*
3063 * returns the state of the given attribute
3064 */
3065static t_bool
3067 enum option_enum option)
3068{
3069 switch (option) {
3070 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
3072 case OPT_ATTRIB_ADVERTISING:
3073 return curr_scope->state->advertising;
3074 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
3076 case OPT_ATTRIB_ASK_FOR_METAMAIL:
3078 case OPT_ATTRIB_AUTO_CC_BCC:
3079 return curr_scope->state->auto_cc_bcc;
3080 case OPT_ATTRIB_AUTO_LIST_THREAD:
3082 case OPT_ATTRIB_AUTO_SELECT:
3083 return curr_scope->state->auto_select;
3084 case OPT_ATTRIB_BATCH_SAVE:
3085 return curr_scope->state->batch_save;
3086 case OPT_ATTRIB_DATE_FORMAT:
3087 return curr_scope->state->date_format;
3088 case OPT_ATTRIB_DELETE_TMP_FILES:
3090 case OPT_ATTRIB_EDITOR_FORMAT:
3092#ifdef HAVE_COLOR
3093 case OPT_ATTRIB_EXTQUOTE_HANDLING:
3094 return curr_scope->state->extquote_handling;
3095#endif /* HAVE_COLOR */
3096 case OPT_ATTRIB_FCC:
3097 return curr_scope->state->fcc;
3098 case OPT_ATTRIB_FOLLOWUP_TO:
3099 return curr_scope->state->followup_to;
3100 case OPT_ATTRIB_FROM:
3101 return curr_scope->state->from;
3102 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
3104 case OPT_ATTRIB_GROUP_FORMAT:
3105 return curr_scope->state->group_format;
3106#ifdef HAVE_ISPELL
3107 case OPT_ATTRIB_ISPELL:
3108 return curr_scope->state->ispell;
3109#endif /* HAVE_ISPELL */
3110 case OPT_ATTRIB_MAILDIR:
3111 return curr_scope->state->maildir;
3112 case OPT_ATTRIB_MAIL_8BIT_HEADER:
3114 case OPT_ATTRIB_MAIL_MIME_ENCODING:
3116 case OPT_ATTRIB_MAILING_LIST:
3117 return curr_scope->state->mailing_list;
3118 case OPT_ATTRIB_MARK_IGNORE_TAGS:
3120 case OPT_ATTRIB_MARK_SAVED_READ:
3122 case OPT_ATTRIB_MIME_FORWARD:
3123 return curr_scope->state->mime_forward;
3124 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
3126 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
3128 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
3130 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
3132 case OPT_ATTRIB_ORGANIZATION:
3133 return curr_scope->state->organization;
3134 case OPT_ATTRIB_POST_8BIT_HEADER:
3136 case OPT_ATTRIB_POST_MIME_ENCODING:
3138 case OPT_ATTRIB_POST_PROCESS_VIEW:
3140 case OPT_ATTRIB_POS_FIRST_UNREAD:
3142#ifndef DISABLE_PRINTING
3143 case OPT_ATTRIB_PRINT_HEADER:
3144 return curr_scope->state->print_header;
3145#endif /* !DISABLE_PRINTING */
3146 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
3148 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
3150 case OPT_ATTRIB_QUICK_KILL_SCOPE:
3152 case OPT_ATTRIB_QUICK_KILL_HEADER:
3154 case OPT_ATTRIB_QUICK_KILL_CASE:
3156 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
3158 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
3160 case OPT_ATTRIB_QUICK_SELECT_HEADER:
3162 case OPT_ATTRIB_QUICK_SELECT_CASE:
3164 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
3166 case OPT_ATTRIB_QUOTE_CHARS:
3167 return curr_scope->state->quote_chars;
3168 case OPT_ATTRIB_SAVEDIR:
3169 return curr_scope->state->savedir;
3170 case OPT_ATTRIB_SAVEFILE:
3171 return curr_scope->state->savefile;
3172 case OPT_ATTRIB_SHOW_AUTHOR:
3173 return curr_scope->state->show_author;
3174 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
3176 case OPT_ATTRIB_SHOW_SIGNATURES:
3178 case OPT_ATTRIB_SIGDASHES:
3179 return curr_scope->state->sigdashes;
3180 case OPT_ATTRIB_SIGFILE:
3181 return curr_scope->state->sigfile;
3182 case OPT_ATTRIB_SIGNATURE_REPOST:
3184 case OPT_ATTRIB_THREAD_ARTICLES:
3186 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
3188 case OPT_ATTRIB_THREAD_FORMAT:
3190 case OPT_ATTRIB_THREAD_PERC:
3191 return curr_scope->state->thread_perc;
3192 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
3194 case OPT_ATTRIB_TEX2ISO_CONV:
3195 return curr_scope->state->tex2iso_conv;
3196 case OPT_ATTRIB_SORT_THREADS_TYPE:
3198#ifdef CHARSET_CONVERSION
3199 case OPT_ATTRIB_MM_NETWORK_CHARSET:
3200 return curr_scope->state->mm_network_charset;
3201 case OPT_ATTRIB_UNDECLARED_CHARSET:
3202 return curr_scope->state->undeclared_charset;
3203#endif /* CHARSET_CONVERSION */
3204 case OPT_ATTRIB_VERBATIM_HANDLING:
3206 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
3208 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
3210 case OPT_ATTRIB_POST_PROCESS_TYPE:
3212 case OPT_ATTRIB_X_BODY:
3213 return curr_scope->state->x_body;
3214 case OPT_ATTRIB_X_COMMENT_TO:
3215 return curr_scope->state->x_comment_to;
3216 case OPT_ATTRIB_X_HEADERS:
3217 return curr_scope->state->x_headers;
3218
3219 default:
3220 return FALSE;
3221 }
3222}
3223
3224
3225/*
3226 * set the state of the given attribute to FALSE and the corresponding
3227 * tinrc.attrib_* to a default value
3228 */
3229static void
3231 enum option_enum option)
3232{
3233 struct t_scope *default_scope = &scopes[0];
3234
3235 switch (option) {
3236 case OPT_ATTRIB_ADD_POSTED_TO_FILTER:
3239 break;
3240 case OPT_ATTRIB_ADVERTISING:
3243 break;
3244 case OPT_ATTRIB_ALTERNATIVE_HANDLING:
3247 break;
3248 case OPT_ATTRIB_ASK_FOR_METAMAIL:
3251 break;
3252 case OPT_ATTRIB_AUTO_CC_BCC:
3255 break;
3256 case OPT_ATTRIB_AUTO_LIST_THREAD:
3259 break;
3260 case OPT_ATTRIB_AUTO_SELECT:
3263 break;
3264 case OPT_ATTRIB_BATCH_SAVE:
3266 tinrc.attrib_batch_save = default_scope->attribute->batch_save;
3267 break;
3268 case OPT_ATTRIB_DATE_FORMAT:
3272 break;
3273 case OPT_ATTRIB_DELETE_TMP_FILES:
3276 break;
3277 case OPT_ATTRIB_EDITOR_FORMAT:
3281 break;
3282#ifdef HAVE_COLOR
3283 case OPT_ATTRIB_EXTQUOTE_HANDLING:
3284 curr_scope->state->extquote_handling = FALSE;
3285 tinrc.attrib_extquote_handling = default_scope->attribute->extquote_handling;
3286 break;
3287#endif /* HAVE_COLOR */
3288 case OPT_ATTRIB_FCC:
3291 snprintf(tinrc.attrib_fcc, sizeof(tinrc.attrib_fcc), "%s", BlankIfNull(default_scope->attribute->fcc));
3292 break;
3293 case OPT_ATTRIB_FOLLOWUP_TO:
3297 break;
3298 case OPT_ATTRIB_FROM:
3301 snprintf(tinrc.attrib_from, sizeof(tinrc.attrib_from), "%s", BlankIfNull(default_scope->attribute->from));
3302 break;
3303 case OPT_ATTRIB_GROUP_CATCHUP_ON_EXIT:
3306 break;
3307 case OPT_ATTRIB_GROUP_FORMAT:
3311 break;
3312#ifdef HAVE_ISPELL
3313 case OPT_ATTRIB_ISPELL:
3315 curr_scope->state->ispell = FALSE;
3316 snprintf(tinrc.attrib_ispell, sizeof(tinrc.attrib_ispell), "%s", BlankIfNull(default_scope->attribute->ispell));
3317 break;
3318#endif /* HAVE_ISPELL */
3319 case OPT_ATTRIB_MAILDIR:
3323 break;
3324 case OPT_ATTRIB_MAIL_8BIT_HEADER:
3327 break;
3328 case OPT_ATTRIB_MAIL_MIME_ENCODING:
3331 break;
3332 case OPT_ATTRIB_MAILING_LIST:
3336 break;
3337 case OPT_ATTRIB_MARK_IGNORE_TAGS:
3340 break;
3341 case OPT_ATTRIB_MARK_SAVED_READ:
3344 break;
3345 case OPT_ATTRIB_MIME_FORWARD:
3348 break;
3349 case OPT_ATTRIB_MIME_TYPES_TO_SAVE:
3353 break;
3354 case OPT_ATTRIB_NEWS_HEADERS_TO_DISPLAY:
3359 break;
3360 case OPT_ATTRIB_NEWS_HEADERS_TO_NOT_DISPLAY:
3365 break;
3366 case OPT_ATTRIB_QUICK_KILL_SCOPE:
3370 break;
3371 case OPT_ATTRIB_QUICK_KILL_HEADER:
3374 break;
3375 case OPT_ATTRIB_QUICK_KILL_CASE:
3378 break;
3379 case OPT_ATTRIB_QUICK_KILL_EXPIRE:
3382 break;
3383 case OPT_ATTRIB_QUICK_SELECT_SCOPE:
3387 break;
3388 case OPT_ATTRIB_QUICK_SELECT_HEADER:
3391 break;
3392 case OPT_ATTRIB_QUICK_SELECT_CASE:
3395 break;
3396 case OPT_ATTRIB_QUICK_SELECT_EXPIRE:
3399 break;
3400 case OPT_ATTRIB_NEWS_QUOTE_FORMAT:
3404 break;
3405 case OPT_ATTRIB_ORGANIZATION:
3409 break;
3410 case OPT_ATTRIB_POST_8BIT_HEADER:
3413 break;
3414 case OPT_ATTRIB_POST_MIME_ENCODING:
3417 break;
3418 case OPT_ATTRIB_POST_PROCESS_VIEW:
3421 break;
3422 case OPT_ATTRIB_POS_FIRST_UNREAD:
3425 break;
3426#ifndef DISABLE_PRINTING
3427 case OPT_ATTRIB_PRINT_HEADER:
3430 break;
3431#endif /* !DISABLE_PRINTING */
3432 case OPT_ATTRIB_PROCESS_ONLY_UNREAD:
3435 break;
3436 case OPT_ATTRIB_PROMPT_FOLLOWUPTO:
3439 break;
3440 case OPT_ATTRIB_QUOTE_CHARS:
3444 break;
3445 case OPT_ATTRIB_SAVEDIR:
3449 break;
3450 case OPT_ATTRIB_SAVEFILE:
3454 break;
3455 case OPT_ATTRIB_SHOW_AUTHOR:
3458 break;
3459 case OPT_ATTRIB_SHOW_ONLY_UNREAD_ARTS:
3462 break;
3463 case OPT_ATTRIB_SHOW_SIGNATURES:
3466 break;
3467 case OPT_ATTRIB_SIGDASHES:
3469 tinrc.attrib_sigdashes = default_scope->attribute->sigdashes;
3470 break;
3471 case OPT_ATTRIB_SIGFILE:
3475 break;
3476 case OPT_ATTRIB_SIGNATURE_REPOST:
3479 break;
3480 case OPT_ATTRIB_THREAD_ARTICLES:
3483 break;
3484 case OPT_ATTRIB_THREAD_CATCHUP_ON_EXIT:
3487 break;
3488 case OPT_ATTRIB_THREAD_FORMAT:
3492 break;
3493 case OPT_ATTRIB_THREAD_PERC:
3496 break;
3497 case OPT_ATTRIB_TRIM_ARTICLE_BODY:
3500 break;
3501 case OPT_ATTRIB_TEX2ISO_CONV:
3504 break;
3505 case OPT_ATTRIB_SORT_THREADS_TYPE:
3508 break;
3509#ifdef CHARSET_CONVERSION
3510 case OPT_ATTRIB_MM_NETWORK_CHARSET:
3511 curr_scope->state->mm_network_charset = FALSE;
3512 tinrc.attrib_mm_network_charset = default_scope->attribute->mm_network_charset;
3513 break;
3514 case OPT_ATTRIB_UNDECLARED_CHARSET:
3515 FreeAndNull(curr_scope->attribute->undeclared_charset);
3516 curr_scope->state->undeclared_charset = FALSE;
3517 snprintf(tinrc.attrib_undeclared_charset, sizeof(tinrc.attrib_undeclared_charset), "%s", BlankIfNull(default_scope->attribute->undeclared_charset));
3518 break;
3519#endif /* CHARSET_CONVERSION */
3520 case OPT_ATTRIB_VERBATIM_HANDLING:
3523 break;
3524 case OPT_ATTRIB_WRAP_ON_NEXT_UNREAD:
3527 break;
3528 case OPT_ATTRIB_SORT_ARTICLE_TYPE:
3531 break;
3532 case OPT_ATTRIB_POST_PROCESS_TYPE:
3535 break;
3536 case OPT_ATTRIB_X_BODY:
3539 snprintf(tinrc.attrib_x_body, sizeof(tinrc.attrib_x_body), "%s", BlankIfNull(default_scope->attribute->x_body));
3540 break;
3541 case OPT_ATTRIB_X_COMMENT_TO:
3544 break;
3545 case OPT_ATTRIB_X_HEADERS:
3549 break;
3550
3551 default:
3552 break;
3553 }
3554}
3555
3556
3557#define INITIALIZE_STRING_ATTRIBUTE(option) do { \
3558 if (curr_scope->state->option) \
3559 snprintf(CAO(tinrc.attrib_, option), sizeof(CAO(tinrc.attrib_, option)), "%s", curr_scope->attribute->option); \
3560 else \
3561 snprintf(CAO(tinrc.attrib_, option), sizeof(CAO(tinrc.attrib_, option)), "%s", BlankIfNull(default_scope->attribute->option)); \
3562 } while (0)
3563#define INITIALIZE_NUM_ATTRIBUTE(option) do { \
3564 if (curr_scope->state->option) \
3565 CAO(tinrc.attrib_, option) = curr_scope->attribute->option; \
3566 else \
3567 CAO(tinrc.attrib_, option) = default_scope->attribute->option; \
3568 } while (0)
3569
3570static void
3572 void)
3573{
3574 struct t_scope *default_scope = &scopes[0];
3575
3576 INITIALIZE_NUM_ATTRIBUTE(add_posted_to_filter);
3577 INITIALIZE_NUM_ATTRIBUTE(advertising);
3578 INITIALIZE_NUM_ATTRIBUTE(alternative_handling);
3579 INITIALIZE_NUM_ATTRIBUTE(ask_for_metamail);
3580 INITIALIZE_NUM_ATTRIBUTE(auto_cc_bcc);
3581 INITIALIZE_NUM_ATTRIBUTE(auto_list_thread);
3582 INITIALIZE_NUM_ATTRIBUTE(auto_select);
3583 INITIALIZE_NUM_ATTRIBUTE(batch_save);
3584 INITIALIZE_NUM_ATTRIBUTE(delete_tmp_files);
3585#ifdef HAVE_COLOR
3586 INITIALIZE_NUM_ATTRIBUTE(extquote_handling);
3587#endif /* HAVE_COLOR */
3588 INITIALIZE_NUM_ATTRIBUTE(group_catchup_on_exit);
3589 INITIALIZE_NUM_ATTRIBUTE(mail_8bit_header);
3590 INITIALIZE_NUM_ATTRIBUTE(mail_mime_encoding);
3591 INITIALIZE_NUM_ATTRIBUTE(mark_ignore_tags);
3592 INITIALIZE_NUM_ATTRIBUTE(mark_saved_read);
3593 INITIALIZE_NUM_ATTRIBUTE(mime_forward);
3594 INITIALIZE_NUM_ATTRIBUTE(pos_first_unread);
3595 INITIALIZE_NUM_ATTRIBUTE(post_8bit_header);
3596 INITIALIZE_NUM_ATTRIBUTE(post_mime_encoding);
3597 INITIALIZE_NUM_ATTRIBUTE(post_process_view);
3598#ifndef DISABLE_PRINTING
3599 INITIALIZE_NUM_ATTRIBUTE(print_header);
3600#endif /* !DISABLE_PRINTING */
3601 INITIALIZE_NUM_ATTRIBUTE(process_only_unread);
3602 INITIALIZE_NUM_ATTRIBUTE(prompt_followupto);
3603 INITIALIZE_NUM_ATTRIBUTE(quick_kill_header);
3604 INITIALIZE_NUM_ATTRIBUTE(quick_kill_case);
3605 INITIALIZE_NUM_ATTRIBUTE(quick_kill_expire);
3606 INITIALIZE_NUM_ATTRIBUTE(quick_select_header);
3607 INITIALIZE_NUM_ATTRIBUTE(quick_select_case);
3608 INITIALIZE_NUM_ATTRIBUTE(quick_select_expire);
3609 INITIALIZE_NUM_ATTRIBUTE(show_author);
3610 INITIALIZE_NUM_ATTRIBUTE(show_only_unread_arts);
3611 INITIALIZE_NUM_ATTRIBUTE(show_signatures);
3612 INITIALIZE_NUM_ATTRIBUTE(sigdashes);
3613 INITIALIZE_NUM_ATTRIBUTE(signature_repost);
3614 INITIALIZE_NUM_ATTRIBUTE(thread_articles);
3615 INITIALIZE_NUM_ATTRIBUTE(thread_catchup_on_exit);
3616 INITIALIZE_NUM_ATTRIBUTE(thread_perc);
3617 INITIALIZE_NUM_ATTRIBUTE(trim_article_body);
3618 INITIALIZE_NUM_ATTRIBUTE(tex2iso_conv);
3619 INITIALIZE_NUM_ATTRIBUTE(verbatim_handling);
3620 INITIALIZE_NUM_ATTRIBUTE(wrap_on_next_unread);
3621 INITIALIZE_NUM_ATTRIBUTE(sort_article_type);
3622 INITIALIZE_NUM_ATTRIBUTE(sort_threads_type);
3623 INITIALIZE_NUM_ATTRIBUTE(post_process_type);
3624 INITIALIZE_NUM_ATTRIBUTE(x_comment_to);
3625 INITIALIZE_STRING_ATTRIBUTE(date_format);
3626 INITIALIZE_STRING_ATTRIBUTE(editor_format);
3628 INITIALIZE_STRING_ATTRIBUTE(followup_to);
3630 INITIALIZE_STRING_ATTRIBUTE(group_format);
3631#ifdef HAVE_ISPELL
3633#endif /* HAVE_ISPELL */
3635 INITIALIZE_STRING_ATTRIBUTE(mailing_list);
3636 INITIALIZE_STRING_ATTRIBUTE(mime_types_to_save);
3637 INITIALIZE_STRING_ATTRIBUTE(news_headers_to_display);
3638 INITIALIZE_STRING_ATTRIBUTE(news_headers_to_not_display);
3639 INITIALIZE_STRING_ATTRIBUTE(news_quote_format);
3640 INITIALIZE_STRING_ATTRIBUTE(organization);
3641 INITIALIZE_STRING_ATTRIBUTE(quick_kill_scope);
3642 INITIALIZE_STRING_ATTRIBUTE(quick_select_scope);
3643 INITIALIZE_STRING_ATTRIBUTE(quote_chars);
3647 INITIALIZE_STRING_ATTRIBUTE(thread_format);
3648#ifdef CHARSET_CONVERSION
3649 INITIALIZE_NUM_ATTRIBUTE(mm_network_charset);
3650 INITIALIZE_STRING_ATTRIBUTE(undeclared_charset);
3651#endif /* CHARSET_CONVERSION */
3653 INITIALIZE_STRING_ATTRIBUTE(x_headers);
3654}
unsigned t_bool
Definition: bool.h:77
#define TRUE
Definition: bool.h:74
#define FALSE
Definition: bool.h:70
int this_resp
Definition: page.c:71
@ HIST_OTHER
Definition: extern.h:1558
t_function last_search
Definition: init.c:117
constext txt_bad_command[]
Definition: lang.c:112
constext txt_no_scopes[]
Definition: lang.c:698
constext txt_end_of_scopes[]
Definition: lang.c:171
constext txt_scope_operation_not_allowed[]
Definition: lang.c:839
char local_attributes_file[PATH_LEN]
Definition: init.c:83
struct t_option option_table[]
struct t_scope * scopes
Definition: memory.c:67
int NOTESLINES
Definition: signal.c:111
constext txt_scopes_menu[]
Definition: lang.c:842
t_bool * OPT_ON_OFF_list[]
t_bool show_description
Definition: init.c:153
t_openartinfo pgart
Definition: page.c:63
constext txt_scopes_menu_com[]
Definition: lang.c:843
constext * txt_mime_7bit_charsets[]
Definition: lang.c:1561
struct regex_cache verbatim_begin_regex
struct regex_cache strip_re_regex
struct t_article * arts
Definition: memory.c:69
constext txt_scope_delete[]
Definition: lang.c:835
int art_mark_width
Definition: init.c:118
t_bool word_highlight
Definition: init.c:155
constext txt_scope_select[]
Definition: lang.c:841
constext txt_scope_new_position[]
Definition: lang.c:837
char filter_file[PATH_LEN]
Definition: init.c:89
struct regex_cache stars_regex
char cvers[LEN]
Definition: init.c:70
constext txt_select_config_file_option[]
Definition: lang.c:850
int signal_context
Definition: signal.c:105
int mark_offset
Definition: screen.c:48
int num_scope
Definition: memory.c:59
struct regex_cache verbatim_end_regex
constext txt_scope_new_position_is_global[]
Definition: lang.c:838
t_menu * currmenu
Definition: init.c:166
struct regex_cache slashes_regex
constext txt_no_prev_search[]
Definition: lang.c:694
int cCOLS
Definition: curses.c:53
int cLINES
Definition: curses.c:52
int attrib_file_offset
Definition: attrib.c:55
char * OPT_CHAR_list[]
char local_config_file[PATH_LEN]
Definition: init.c:84
constext txt_enter_option_num[]
Definition: lang.c:179
struct regex_cache strokes_regex
Definition: init.c:185
struct t_group * curr_group
Definition: group.c:55
struct t_config tinrc
Definition: init.c:192
struct t_screen * screen
Definition: screen.c:51
constext txt_options_menu_com[]
Definition: lang.c:723
constext txt_default[]
Definition: lang.c:161
constext txt_scope_rename[]
Definition: lang.c:840
char * OPT_STRING_list[]
struct t_group * active
Definition: memory.c:66
struct regex_cache strip_was_regex
constext txt_attrib_menu_com[]
Definition: lang.c:93
constext txt_options_menu[]
Definition: lang.c:722
constext txt_scope_enter[]
Definition: lang.c:836
struct regex_cache underscores_regex
#define MAXKEYLEN
Definition: keymap.h:136
t_function handle_keypad(t_function(*left_action)(void), t_function(*right_action)(void), t_function(*mouse_action)(t_function(*left_action)(void), t_function(*right_action)(void)), const struct keylist keys)
Definition: global.c:355
struct keylist scope_keys
Definition: keymap.c:88
struct keylist option_menu_keys
Definition: keymap.c:69
@ GLOBAL_SCROLL_UP
Definition: keymap.h:214
@ SCOPE_DELETE
Definition: keymap.h:336
@ DIGIT_7
Definition: keymap.h:157
@ GLOBAL_SHELL_ESCAPE
Definition: keymap.h:223
@ SCOPE_ADD
Definition: keymap.h:335
@ DIGIT_3
Definition: keymap.h:153
@ GLOBAL_PAGE_UP
Definition: keymap.h:201
@ DIGIT_6
Definition: keymap.h:156
@ GLOBAL_SEARCH_SUBJECT_FORWARD
Definition: keymap.h:220
@ CONFIG_RESET_ATTRIB
Definition: keymap.h:171
@ GLOBAL_LINE_DOWN
Definition: keymap.h:194
@ GLOBAL_SCROLL_DOWN
Definition: keymap.h:213
@ GLOBAL_HELP
Definition: keymap.h:191
@ SCOPE_MOVE
Definition: keymap.h:338
@ SCOPE_SELECT
Definition: keymap.h:340
@ DIGIT_2
Definition: keymap.h:152
@ GLOBAL_SEARCH_SUBJECT_BACKWARD
Definition: keymap.h:219
@ SCOPE_RENAME
Definition: keymap.h:339
@ GLOBAL_TOGGLE_HELP_DISPLAY
Definition: keymap.h:228
@ GLOBAL_VERSION
Definition: keymap.h:231
@ DIGIT_9
Definition: keymap.h:159
@ GLOBAL_PAGE_DOWN
Definition: keymap.h:200
@ CONFIG_SELECT
Definition: keymap.h:173
@ GLOBAL_SEARCH_REPEAT
Definition: keymap.h:216
@ GLOBAL_QUIT
Definition: keymap.h:210
@ GLOBAL_FIRST_PAGE
Definition: keymap.h:190
@ GLOBAL_REDRAW_SCREEN
Definition: keymap.h:212
@ DIGIT_8
Definition: keymap.h:158
@ GLOBAL_LAST_PAGE
Definition: keymap.h:192
@ DIGIT_1
Definition: keymap.h:151
@ GLOBAL_LINE_UP
Definition: keymap.h:195
@ DIGIT_4
Definition: keymap.h:154
@ CONFIG_TOGGLE_ATTRIB
Definition: keymap.h:175
@ DIGIT_5
Definition: keymap.h:155
@ CONFIG_SCOPE_MENU
Definition: keymap.h:172
@ SCOPE_EDIT_ATTRIBUTES_FILE
Definition: keymap.h:337
@ CONFIG_NO_SAVE
Definition: keymap.h:174
@ GLOBAL_BUGREPORT
Definition: keymap.h:187
char func_to_key(t_function func, const struct keylist keys)
Definition: keymap.c:125
enum defined_functions t_function
Definition: keymap.h:375
#define PrintFuncKey(buf, func, keys)
Definition: keymap.h:445
static char buf[16]
Definition: langinfo.c:50
static void repaint_option(enum option_enum option)
Definition: options_menu.c:539
static t_bool option_on_page(enum option_enum option)
Definition: options_menu.c:394
static void do_delete_scope(int curr_pos)
#define SET_BOOL_ATTRIBUTE(option)
Definition: options_menu.c:66
static enum option_enum next_option(enum option_enum option, t_bool incl_titles)
Definition: options_menu.c:693
#define SET_STRING_ATTRIBUTE(opt)
Definition: options_menu.c:78
static void do_move_scope(int from, int to)
void check_score_defaults(void)
Definition: options_menu.c:875
static void reset_state(enum option_enum option)
static int move_scope(int curr_pos)
static void print_any_option(enum option_enum option)
Definition: options_menu.c:463
static void redraw_screen(enum option_enum option)
Definition: options_menu.c:821
static enum option_enum opt_scroll_up(enum option_enum option)
Definition: options_menu.c:658
static void initialize_attributes(void)
static enum option_enum get_first_opt(void)
Definition: options_menu.c:922
void refresh_config_page(enum option_enum act_option)
Definition: options_menu.c:800
static void show_config_page(void)
Definition: options_menu.c:846
#define UPDATE_BOOL_ATTRIBUTES(option)
Definition: options_menu.c:54
static t_bool option_is_title(enum option_enum option)
Definition: options_menu.c:383
static enum option_enum first_option_on_screen last_option_on_screen last_opt
Definition: options_menu.c:90
static void highlight_option(enum option_enum option)
Definition: options_menu.c:769
static t_function option_left(void)
Definition: options_menu.c:887
static void show_scope_page(void)
void config_page(const char *grpname, enum context level)
Definition: options_menu.c:939
static enum option_enum set_option_num(int num)
Definition: options_menu.c:186
static void draw_scope_arrow(void)
static t_menu scopemenu
Definition: options_menu.c:141
static t_function scope_left(void)
static void scope_page(enum context level)
static enum option_enum move_cursor(enum option_enum cur_option, t_bool down)
Definition: options_menu.c:567
#define INITIALIZE_STRING_ATTRIBUTE(option)
static void set_last_option_on_screen(enum option_enum first_option)
Definition: options_menu.c:754
static int find_scope(const char *scope)
static struct t_scope * curr_scope
Definition: options_menu.c:142
#define INITIALIZE_NUM_ATTRIBUTE(option)
static enum option_enum opt_scroll_down(enum option_enum option)
Definition: options_menu.c:623
static enum option_enum prev_option(enum option_enum option, t_bool incl_titles)
Definition: options_menu.c:712
static t_bool rename_scope(struct t_scope *scope)
char * fmt_option_prompt(char *dst, size_t len, t_bool editing, enum option_enum option)
Definition: options_menu.c:402
static void set_last_opt(void)
Definition: options_menu.c:906
#define option_lines_per_page
Definition: options_menu.c:52
void show_menu_help(const char *help_message)
Definition: options_menu.c:833
static t_bool delete_scope(int curr_pos)
static int add_new_scope(void)
static t_function scope_right(void)
static t_bool check_state(enum option_enum option)
static int get_option_num(enum option_enum option)
Definition: options_menu.c:169
static t_function option_right(void)
Definition: options_menu.c:895
int option_row(enum option_enum option)
Definition: options_menu.c:149
static t_bool scope_is_empty(void)
#define UPDATE_INT_ATTRIBUTES(option)
Definition: options_menu.c:59
static void unhighlight_option(enum option_enum option)
Definition: options_menu.c:779
static void build_scope_line(int i)
static void set_first_option_on_screen(enum option_enum last_option)
Definition: options_menu.c:732
t_bool option_is_visible(enum option_enum option)
Definition: options_menu.c:203
#define SET_NUM_ATTRIBUTE(option)
Definition: options_menu.c:72
static void free_scopes_and_attributes(void)
void scroll_down(void)
Definition: global.c:252
void page_up(void)
Definition: global.c:130
void prompt_item_num(int ch, const char *prompt)
Definition: global.c:200
void draw_arrow_mark(int line)
Definition: screen.c:352
void center_line(int line, t_bool inverse, const char *str)
Definition: screen.c:298
void show_mini_help(int level)
Definition: help.c:798
void make_threads(struct t_group *group, t_bool rethread)
Definition: art.c:1229
t_bool filter_articles(struct t_group *group)
Definition: filter.c:1843
void find_base(struct t_group *group)
Definition: art.c:123
t_bool prompt_option_num(enum option_enum option)
Definition: prompt.c:494
t_bool read_filter_file(const char *file)
Definition: filter.c:308
void show_help_page(const int level, const char *title)
Definition: help.c:734
int atoi(const char *s)
void build_news_headers_array(struct t_attribute *scope, t_bool header_to_display)
Definition: attrib.c:1147
void read_attributes_file(t_bool global_file)
Definition: attrib.c:293
char * tin_getline(const char *prompt, int number_only, const char *str, int max_chars, t_bool passwd, int which_hist)
Definition: getline.c:85
int add_scope(const char *scope)
Definition: attrib.c:948
char * strip_line(char *line)
Definition: misc.c:3644
void ClearScreen(void)
Definition: curses.c:410
void do_shell_escape(void)
Definition: misc.c:547
void scroll_up(void)
Definition: global.c:278
void info_message(const char *fmt,...)
Definition: screen.c:102
void write_config_file(char *file)
Definition: config.c:932
void ScrollScreen(int lines_to_scroll)
Definition: curses.c:509
t_bool prompt_option_char(enum option_enum option)
Definition: prompt.c:526
void shell_escape(void)
Definition: misc.c:496
void erase_arrow(void)
Definition: screen.c:404
enum option_enum search_config(t_bool forward, t_bool repeat, enum option_enum current, enum option_enum last)
Definition: search.c:140
void toggle_mini_help(int level)
Definition: help.c:1078
char * my_strdup(const char *str)
Definition: string.c:139
void SetScrollRegion(int topline, int bottomline)
Definition: curses.c:490
t_bool invoke_editor(const char *filename, int lineno, struct t_group *group)
Definition: misc.c:377
void MoveCursor(int row, int col)
Definition: curses.c:441
t_bool prompt_default_string(const char *prompt, char *buf, int buf_len, char *default_prompt, int which_hist)
Definition: prompt.c:108
void read_descriptions(t_bool verb)
Definition: mail.c:441
void write_attributes_file(const char *file)
Definition: attrib.c:1177
void page_down(void)
Definition: global.c:155
void move_up(void)
Definition: global.c:81
void set_xclick_off(void)
Definition: curses.c:703
void clear_note_area(void)
Definition: group.c:1051
t_bool prompt_option_list(enum option_enum option)
Definition: prompt.c:443
void move_down(void)
Definition: global.c:110
void resize_article(t_bool wrap_lines, t_openartinfo *artinfo)
Definition: page.c:2152
void clear_message(void)
Definition: screen.c:283
const char * print_boolean(t_bool value)
Definition: config.c:1702
t_bool prompt_option_on_off(enum option_enum option)
Definition: prompt.c:426
void set_first_screen_item(void)
Definition: global.c:61
void end_of_list(void)
Definition: global.c:191
void unfilter_articles(struct t_group *group)
Definition: filter.c:1818
void stow_cursor(void)
Definition: screen.c:59
t_bool compile_regex(const char *regex, struct regex_cache *cache, int options)
Definition: regex.c:111
int prompt_num(int ch, const char *prompt)
Definition: prompt.c:65
void assign_attributes_to_groups(void)
Definition: attrib.c:977
int strcasecmp(const char *p, const char *q)
Definition: string.c:475
void top_of_list(void)
Definition: global.c:182
void set_noteslines(int num_lines)
Definition: signal.c:642
int prompt_yn(const char *prompt, t_bool default_answer)
Definition: prompt.c:165
char * strunc(const char *message, int len)
Definition: string.c:1076
t_bool prompt_option_string(enum option_enum option)
Definition: prompt.c:468
void CleartoEOLN(void)
Definition: curses.c:458
void free_scope(int num)
Definition: memory.c:425
char * tin_ltoa(t_artnum value, int digits)
Definition: string.c:80
void bug_report(void)
Definition: global.c:430
static char sigfile[255]
Definition: sigfile.c:49
void(* func)(SIG_ARGS)
Definition: signal.c:176
FILE * raw
Definition: rfc2046.h:188
pcre_extra * extra
Definition: tin.h:1963
pcre * re
Definition: tin.h:1962
t_bool keep_in_base
Definition: tin.h:1558
unsigned mailing_list
Definition: tin.h:1733
unsigned post_mime_encoding
Definition: tin.h:1744
unsigned from
Definition: tin.h:1724
unsigned group_format
Definition: tin.h:1726
unsigned auto_select
Definition: tin.h:1717
unsigned quote_chars
Definition: tin.h:1760
unsigned quick_select_header
Definition: tin.h:1758
unsigned wrap_on_next_unread
Definition: tin.h:1785
unsigned news_headers_to_display
Definition: tin.h:1738
unsigned quick_kill_header
Definition: tin.h:1754
unsigned mime_forward
Definition: tin.h:1736
unsigned x_body
Definition: tin.h:1786
unsigned auto_cc_bcc
Definition: tin.h:1715
unsigned verbatim_handling
Definition: tin.h:1781
unsigned thread_perc
Definition: tin.h:1775
unsigned post_process_type
Definition: tin.h:1746
unsigned news_headers_to_not_display
Definition: tin.h:1739
unsigned tex2iso_conv
Definition: tin.h:1771
unsigned thread_catchup_on_exit
Definition: tin.h:1773
unsigned mail_mime_encoding
Definition: tin.h:1731
unsigned delete_tmp_files
Definition: tin.h:1720
unsigned quick_select_scope
Definition: tin.h:1759
unsigned post_8bit_header
Definition: tin.h:1743
unsigned quick_kill_scope
Definition: tin.h:1755
unsigned savedir
Definition: tin.h:1761
unsigned organization
Definition: tin.h:1741
unsigned prompt_followupto
Definition: tin.h:1751
unsigned show_signatures
Definition: tin.h:1765
unsigned x_headers
Definition: tin.h:1788
unsigned fcc
Definition: tin.h:1722
unsigned x_comment_to
Definition: tin.h:1787
unsigned mark_saved_read
Definition: tin.h:1735
unsigned trim_article_body
Definition: tin.h:1776
unsigned mail_8bit_header
Definition: tin.h:1730
unsigned quick_select_case
Definition: tin.h:1756
unsigned news_quote_format
Definition: tin.h:1740
unsigned sort_threads_type
Definition: tin.h:1770
unsigned date_format
Definition: tin.h:1719
unsigned batch_save
Definition: tin.h:1718
unsigned signature_repost
Definition: tin.h:1768
unsigned quick_select_expire
Definition: tin.h:1757
unsigned group_catchup_on_exit
Definition: tin.h:1725
unsigned maildir
Definition: tin.h:1732
unsigned ask_for_metamail
Definition: tin.h:1714
unsigned mark_ignore_tags
Definition: tin.h:1734
unsigned process_only_unread
Definition: tin.h:1750
unsigned editor_format
Definition: tin.h:1721
unsigned savefile
Definition: tin.h:1762
unsigned sigdashes
Definition: tin.h:1766
unsigned print_header
Definition: tin.h:1748
unsigned quick_kill_expire
Definition: tin.h:1753
unsigned alternative_handling
Definition: tin.h:1713
unsigned post_process_view
Definition: tin.h:1745
unsigned pos_first_unread
Definition: tin.h:1742
unsigned mime_types_to_save
Definition: tin.h:1737
unsigned quick_kill_case
Definition: tin.h:1752
unsigned show_only_unread_arts
Definition: tin.h:1764
unsigned show_author
Definition: tin.h:1763
unsigned thread_format
Definition: tin.h:1774
unsigned add_posted_to_filter
Definition: tin.h:1711
unsigned thread_articles
Definition: tin.h:1772
unsigned auto_list_thread
Definition: tin.h:1716
unsigned advertising
Definition: tin.h:1712
unsigned sort_article_type
Definition: tin.h:1769
unsigned sigfile
Definition: tin.h:1767
unsigned followup_to
Definition: tin.h:1723
char * news_headers_to_display
Definition: tin.h:1627
unsigned quick_select_expire
Definition: tin.h:1649
unsigned thread_perc
Definition: tin.h:1679
unsigned batch_save
Definition: tin.h:1658
unsigned quick_kill_header
Definition: tin.h:1645
char * mime_types_to_save
Definition: tin.h:1634
char * group_format
Definition: tin.h:1617
unsigned thread_articles
Definition: tin.h:1677
unsigned quick_kill_expire
Definition: tin.h:1646
char * maildir
Definition: tin.h:1613
unsigned group_catchup_on_exit
Definition: tin.h:1660
unsigned auto_list_thread
Definition: tin.h:1656
char * mailing_list
Definition: tin.h:1626
unsigned auto_select
Definition: tin.h:1657
char * quick_kill_scope
Definition: tin.h:1624
unsigned quick_kill_case
Definition: tin.h:1647
char * date_format
Definition: tin.h:1619
unsigned post_process_view
Definition: tin.h:1668
char * x_body
Definition: tin.h:1630
unsigned print_header
Definition: tin.h:1670
unsigned delete_tmp_files
Definition: tin.h:1659
unsigned mark_saved_read
Definition: tin.h:1664
char * sigfile
Definition: tin.h:1616
char * fcc
Definition: tin.h:1622
unsigned post_mime_encoding
Definition: tin.h:1667
unsigned process_only_unread
Definition: tin.h:1672
unsigned sort_threads_type
Definition: tin.h:1698
unsigned show_signatures
Definition: tin.h:1681
unsigned advertising
Definition: tin.h:1652
char * savedir
Definition: tin.h:1614
char * from
Definition: tin.h:1631
char * news_quote_format
Definition: tin.h:1632
unsigned alternative_handling
Definition: tin.h:1653
char * editor_format
Definition: tin.h:1620
unsigned global
Definition: tin.h:1644
unsigned add_posted_to_filter
Definition: tin.h:1651
unsigned mark_ignore_tags
Definition: tin.h:1663
char * savefile
Definition: tin.h:1615
char * quick_select_scope
Definition: tin.h:1625
unsigned quick_select_header
Definition: tin.h:1648
unsigned quick_select_case
Definition: tin.h:1650
char * thread_format
Definition: tin.h:1618
unsigned post_process_type
Definition: tin.h:1700
unsigned verbatim_handling
Definition: tin.h:1689
unsigned signature_repost
Definition: tin.h:1676
char * quote_chars
Definition: tin.h:1633
unsigned x_comment_to
Definition: tin.h:1701
unsigned sigdashes
Definition: tin.h:1675
unsigned trim_article_body
Definition: tin.h:1682
unsigned post_8bit_header
Definition: tin.h:1666
char * x_headers
Definition: tin.h:1629
unsigned mail_mime_encoding
Definition: tin.h:1662
unsigned auto_cc_bcc
Definition: tin.h:1655
unsigned mime_forward
Definition: tin.h:1703
char * followup_to
Definition: tin.h:1623
unsigned prompt_followupto
Definition: tin.h:1673
unsigned show_author
Definition: tin.h:1680
unsigned sort_article_type
Definition: tin.h:1694
unsigned tex2iso_conv
Definition: tin.h:1702
unsigned pos_first_unread
Definition: tin.h:1665
char * organization
Definition: tin.h:1621
unsigned mail_8bit_header
Definition: tin.h:1661
unsigned ask_for_metamail
Definition: tin.h:1654
unsigned show_only_unread_arts
Definition: tin.h:1674
unsigned thread_catchup_on_exit
Definition: tin.h:1678
unsigned wrap_on_next_unread
Definition: tin.h:1693
char * news_headers_to_not_display
Definition: tin.h:1628
char strip_was_regex[LEN]
Definition: tinrc.h:135
char attrib_fcc[PATH_LEN]
Definition: tinrc.h:297
int attrib_sort_threads_type
Definition: tinrc.h:337
char attrib_maildir[PATH_LEN]
Definition: tinrc.h:298
t_bool attrib_mime_forward
Definition: tinrc.h:349
char underscores_regex[LEN]
Definition: tinrc.h:131
t_bool strip_blanks
Definition: tinrc.h:249
char attrib_savedir[PATH_LEN]
Definition: tinrc.h:309
char art_marked_return
Definition: tinrc.h:72
char strip_re_regex[LEN]
Definition: tinrc.h:134
t_bool inverse_okay
Definition: tinrc.h:227
int mail_mime_encoding
Definition: tinrc.h:152
char group_format[LEN]
Definition: tinrc.h:283
t_bool draw_arrow
Definition: tinrc.h:223
t_bool attrib_ask_for_metamail
Definition: tinrc.h:372
int attrib_auto_cc_bcc
Definition: tinrc.h:322
char attrib_organization[LEN]
Definition: tinrc.h:301
t_bool word_highlight
Definition: tinrc.h:205
t_bool show_description
Definition: tinrc.h:242
char attrib_followup_to[LEN]
Definition: tinrc.h:302
int filter_days
Definition: tinrc.h:142
char art_marked_selected
Definition: tinrc.h:73
int scroll_lines
Definition: tinrc.h:156
t_bool attrib_show_signatures
Definition: tinrc.h:361
char attrib_editor_format[PATH_LEN]
Definition: tinrc.h:296
char attrib_x_headers[HEADER_LEN]
Definition: tinrc.h:312
t_bool attrib_quick_kill_expire
Definition: tinrc.h:374
t_bool post_8bit_header
Definition: tinrc.h:234
t_bool mail_8bit_header
Definition: tinrc.h:230
char attrib_quick_select_scope[LEN]
Definition: tinrc.h:317
t_bool verbatim_handling
Definition: tinrc.h:258
t_bool attrib_group_catchup_on_exit
Definition: tinrc.h:347
int score_limit_kill
Definition: tinrc.h:168
char strokes_regex[LEN]
Definition: tinrc.h:132
char attrib_x_body[LEN]
Definition: tinrc.h:311
t_bool attrib_process_only_unread
Definition: tinrc.h:358
char verbatim_end_regex[LEN]
Definition: tinrc.h:137
int attrib_mail_mime_encoding
Definition: tinrc.h:325
char art_marked_recent
Definition: tinrc.h:74
t_bool attrib_mail_8bit_header
Definition: tinrc.h:348
t_bool attrib_mark_saved_read
Definition: tinrc.h:351
t_bool attrib_quick_select_case
Definition: tinrc.h:375
t_bool attrib_post_process_view
Definition: tinrc.h:354
int attrib_thread_perc
Definition: tinrc.h:339
t_bool attrib_wrap_on_next_unread
Definition: tinrc.h:371
char attrib_quote_chars[LEN]
Definition: tinrc.h:307
t_bool attrib_pos_first_unread
Definition: tinrc.h:352
int attrib_trim_article_body
Definition: tinrc.h:321
t_bool attrib_show_only_unread_arts
Definition: tinrc.h:360
char art_marked_unread
Definition: tinrc.h:75
char thread_format[LEN]
Definition: tinrc.h:284
int attrib_post_mime_encoding
Definition: tinrc.h:333
int attrib_post_process_type
Definition: tinrc.h:334
t_bool attrib_print_header
Definition: tinrc.h:356
t_bool attrib_mark_ignore_tags
Definition: tinrc.h:350
t_bool attrib_verbatim_handling
Definition: tinrc.h:366
t_bool attrib_prompt_followupto
Definition: tinrc.h:359
int score_kill
Definition: tinrc.h:170
char art_marked_read
Definition: tinrc.h:76
char attrib_news_quote_format[LEN]
Definition: tinrc.h:306
char art_marked_killed
Definition: tinrc.h:77
t_bool attrib_tex2iso_conv
Definition: tinrc.h:364
char verbatim_begin_regex[LEN]
Definition: tinrc.h:136
char attrib_news_headers_to_not_display[LEN]
Definition: tinrc.h:305
char select_format[LEN]
Definition: tinrc.h:282
int attrib_quick_select_header
Definition: tinrc.h:324
char attrib_thread_format[LEN]
Definition: tinrc.h:319
char attrib_quick_kill_scope[LEN]
Definition: tinrc.h:316
char art_marked_deleted
Definition: tinrc.h:70
char attrib_mime_types_to_save[LEN]
Definition: tinrc.h:303
char art_marked_inrange
Definition: tinrc.h:71
char mm_charset[LEN]
Definition: tinrc.h:111
t_bool attrib_advertising
Definition: tinrc.h:341
char attrib_news_headers_to_display[LEN]
Definition: tinrc.h:304
t_bool attrib_sigdashes
Definition: tinrc.h:362
char mm_local_charset[LEN]
Definition: tinrc.h:115
t_bool attrib_auto_list_thread
Definition: tinrc.h:343
t_bool attrib_quick_select_expire
Definition: tinrc.h:376
t_bool attrib_delete_tmp_files
Definition: tinrc.h:346
char slashes_regex[LEN]
Definition: tinrc.h:129
int attrib_quick_kill_header
Definition: tinrc.h:323
char attrib_mailing_list[HEADER_LEN]
Definition: tinrc.h:300
t_bool attrib_quick_kill_case
Definition: tinrc.h:373
char art_marked_read_selected
Definition: tinrc.h:78
t_bool attrib_auto_select
Definition: tinrc.h:344
char attrib_sigfile[PATH_LEN]
Definition: tinrc.h:308
t_bool attrib_alternative_handling
Definition: tinrc.h:342
int score_limit_select
Definition: tinrc.h:169
int reread_active_file_secs
Definition: tinrc.h:155
t_bool attrib_batch_save
Definition: tinrc.h:345
t_bool attrib_signature_repost
Definition: tinrc.h:363
char date_format[LEN]
Definition: tinrc.h:285
char editor_format[PATH_LEN]
Definition: tinrc.h:80
char attrib_savefile[PATH_LEN]
Definition: tinrc.h:310
t_bool attrib_thread_catchup_on_exit
Definition: tinrc.h:365
int post_mime_encoding
Definition: tinrc.h:153
t_bool attrib_post_8bit_header
Definition: tinrc.h:353
char attrib_from[HEADER_LEN]
Definition: tinrc.h:299
int attrib_show_author
Definition: tinrc.h:335
t_bool attrib_add_posted_to_filter
Definition: tinrc.h:340
char attrib_group_format[LEN]
Definition: tinrc.h:318
char attrib_date_format[LEN]
Definition: tinrc.h:320
int recent_time
Definition: tinrc.h:148
char stars_regex[LEN]
Definition: tinrc.h:130
t_bool attrib_x_comment_to
Definition: tinrc.h:370
int attrib_thread_articles
Definition: tinrc.h:338
int attrib_sort_article_type
Definition: tinrc.h:336
int thread_perc
Definition: tinrc.h:165
int score_select
Definition: tinrc.h:171
struct t_attribute * attribute
Definition: tin.h:1834
Definition: tin.h:2055
int curr
Definition: tin.h:2056
int first
Definition: tin.h:2058
int max
Definition: tin.h:2057
constext ** opt_list
Definition: tin.h:2036
int var_type
Definition: tin.h:2033
Definition: tin.h:1794
struct t_attribute * attribute
Definition: tin.h:1796
unsigned global
Definition: tin.h:1798
char * scope
Definition: tin.h:1795
struct t_attribute_state * state
Definition: tin.h:1797
char * col
Definition: tin.h:1974
#define my_flush()
Definition: tcurses.h:177
#define cCRLF
Definition: tcurses.h:156
#define WriteLine(row, buffer)
Definition: tcurses.h:180
#define my_retouch()
Definition: tcurses.h:179
#define my_printf
Definition: tcurses.h:175
#define LEN
Definition: tin.h:860
#define DEFAULT_SELECT_FORMAT
Definition: tin.h:1398
#define DEFAULT_VERBATIM_BEGIN_REGEX
Definition: tin.h:692
context
Definition: tin.h:107
@ cConfig
Definition: tin.h:107
@ cPage
Definition: tin.h:107
@ cScope
Definition: tin.h:107
@ cAttrib
Definition: tin.h:107
#define TIN_EDITOR_FMT
Definition: tin.h:2168
#define IS_LOCAL_CHARSET(c)
Definition: tin.h:782
#define SCOPE_LEVEL
Definition: tin.h:1117
#define for_each_group(x)
Definition: tin.h:2259
#define STRCPY(dst, src)
Definition: tin.h:820
#define for_each_art(x)
Definition: tin.h:2260
#define ATTRIB_LEVEL
Definition: tin.h:1119
#define CAST_BOOL(value)
Definition: tin.h:1588
#define INDEX2LNUM(i)
Definition: tin.h:1020
#define my_malloc(size)
Definition: tin.h:2245
#define DEFAULT_STARS_REGEX
Definition: tin.h:668
#define DEFAULT_DATE_FORMAT
Definition: tin.h:1401
#define DEFAULT_UNDERSCORES_REGEX
Definition: tin.h:669
#define FreeIfNeeded(p)
Definition: tin.h:2252
#define INDEX2SNUM(i)
Definition: tin.h:1022
#define _(Text)
Definition: tin.h:94
#define forever
Definition: tin.h:816
#define THREAD_PERC_DEFAULT
Definition: tin.h:1148
#define DEFAULT_THREAD_FORMAT
Definition: tin.h:1400
#define DEFAULT_GROUP_FORMAT
Definition: tin.h:1399
#define DEFAULT_VERBATIM_END_REGEX
Definition: tin.h:693
#define snprintf
Definition: tin.h:2464
#define DEFAULT_STRIP_WAS_REGEX
Definition: tin.h:676
#define CONFIG_LEVEL
Definition: tin.h:1118
#define FreeAndNull(p)
Definition: tin.h:2253
#define DEFAULT_STRIP_RE_REGEX
Definition: tin.h:674
const char constext
Definition: tin.h:2018
#define INDEX_TOP
Definition: tin.h:1019
#define DEFAULT_U8_STRIP_WAS_REGEX
Definition: tin.h:677
#define CAST_BITS(value, bits)
Definition: tin.h:1589
#define T_CHAR_FMT
Definition: tin.h:884
#define DEFAULT_EXTQUOTE_REGEX
Definition: tin.h:696
#define DEFAULT_SLASHES_REGEX
Definition: tin.h:667
#define DEFAULT_STROKES_REGEX
Definition: tin.h:670
@ MIME_ENCODING_QP
Definition: tin.h:991
@ MIME_ENCODING_8BIT
Definition: tin.h:989
@ MIME_ENCODING_7BIT
Definition: tin.h:992
#define MAX(a, b)
Definition: tin.h:808
#define BlankIfNull(p)
Definition: tin.h:2255