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