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)  

init.c
Go to the documentation of this file.
1 /*
2  * Project : tin - a Usenet reader
3  * Module : init.c
4  * Author : I. Lea
5  * Created : 1991-04-01
6  * Updated : 2019-08-20
7  * Notes :
8  *
9  * Copyright (c) 1991-2020 Iain Lea <iain@bricbrac.de>
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  *
16  * 1. Redistributions of source code must retain the above copyright notice,
17  * this list of conditions and the following disclaimer.
18  *
19  * 2. Redistributions in binary form must reproduce the above copyright
20  * notice, this list of conditions and the following disclaimer in the
21  * documentation and/or other materials provided with the distribution.
22  *
23  * 3. Neither the name of the copyright holder nor the names of its
24  * contributors may be used to endorse or promote products derived from
25  * this software without specific prior written permission.
26  *
27  * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
31  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
32  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
33  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
34  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
35  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
36  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
37  * POSSIBILITY OF SUCH DAMAGE.
38  */
39 
40 
41 #ifndef TIN_H
42 # include "tin.h"
43 #endif /* !TIN_H */
44 #ifndef TNNTP_H
45 # include "tnntp.h"
46 #endif /* !TNNTP_H */
47 #ifndef included_trace_h
48 # include "trace.h"
49 #endif /* !included_trace_h */
50 #ifndef VERSION_H
51 # include "version.h"
52 #endif /* !VERSION_H */
53 #ifndef BUGREP_H
54 # include "bugrep.h"
55 #endif /* !BUGREP_H */
56 
57 /*
58  * local prototypes
59  */
60 static int read_site_config(void);
61 #ifdef HAVE_COLOR
62  static void preinit_colors(void);
63 #endif /* HAVE_COLOR */
64 
65 
67 char article_name[PATH_LEN]; /* ~/TIN_ARTICLE_NAME file */
68 char bug_nntpserver1[PATH_LEN]; /* welcome message of NNTP server used */
69 char bug_nntpserver2[PATH_LEN]; /* welcome message of NNTP server used */
70 char cvers[LEN];
71 char dead_article[PATH_LEN]; /* ~/dead.article file */
72 char dead_articles[PATH_LEN]; /* ~/dead.articles file */
73 char default_organization[PATH_LEN]; /* Organization: */
80 char index_newsdir[PATH_LEN]; /* directory for private overview data */
86 char local_newsgroups_file[PATH_LEN]; /* local copy of NNTP newsgroups file */
88 char lock_file[PATH_LEN]; /* contains name of index lock file */
90 char mail_news_user[LEN]; /* mail new news to this user address */
91 char mailbox[PATH_LEN]; /* system mailbox for each user */
92 char mailer[PATH_LEN]; /* mail program */
97 char page_header[LEN]; /* page header of pgm name and version */
99 char postponed_articles_file[PATH_LEN]; /* ~/.tin/postponed.articles file */
102 char spooldir[PATH_LEN]; /* directory where news is */
103 char overviewfmt_file[PATH_LEN]; /* full path to overview.fmt */
104 char subscriptions_file[PATH_LEN]; /* full path to subscriptions */
105 char *tin_progname; /* program name */
106 char txt_help_bug_report[LEN]; /* address to send bug reports to */
108 #ifdef HAVE_MH_MAIL_HANDLING
109  char mail_active_file[PATH_LEN];
110  char mailgroups_file[PATH_LEN];
111 #endif /* HAVE_MH_MAIL_HANDLING */
112 #ifndef NNTP_ONLY
113  char novfilename[NAME_LEN + 1]; /* file name of a single nov index file */
114  char novrootdir[PATH_LEN]; /* root directory of nov index files */
115 #endif /* !NNTP_ONLY */
116 
117 t_function last_search = GLOBAL_SEARCH_REPEAT; /* for repeated search */
120 int iso2asc_supported; /* Convert ISO-Latin1 to Ascii */
122 int xmouse, xrow, xcol; /* xterm button pressing information */
123 
124 pid_t process_id; /* Useful to have around for .suffixes */
125 
126 t_bool batch_mode; /* update index files only mode */
127 t_bool check_for_new_newsgroups; /* don't check for new newsgroups */
128 t_bool cmd_line; /* batch / interactive mode */
129 t_bool created_rcdir; /* checks if first time tin is started */
130 t_bool dangerous_signal_exit; /* no get_respcode() in nntp_command when dangerous signal exit */
131 t_bool disable_gnksa_domain_check; /* disable checking TLD in From: etc. */
132 t_bool disable_sender; /* disable generation of Sender: header */
133 #ifdef NO_POSTING
134  t_bool force_no_post = TRUE; /* force no posting mode */
135 #else
136  t_bool force_no_post = FALSE; /* don't force no posting mode */
137 #endif /* NO_POSTING */
138 #if defined(NNTP_ABLE) && defined(INET6)
139  t_bool force_ipv4 = FALSE;
140  t_bool force_ipv6 = FALSE;
141 #endif /* NNTP_ABLE && INET6 */
144 t_bool no_write = FALSE; /* do not write newsrc on quit (-X cmd-line flag) */
145 t_bool post_article_and_exit; /* quick post of an article then exit(elm like) */
146 t_bool post_postponed_and_exit; /* post postponed articles and exit */
147 t_bool range_active; /* Set if a range is defined */
149 t_bool read_local_newsgroups_file; /* read newsgroups file locally or via NNTP */
150 t_bool read_news_via_nntp = FALSE; /* read news locally or via NNTP */
151 t_bool read_saved_news = FALSE; /* tin -R read saved news from tin -S */
152 t_bool show_description = TRUE; /* current copy of tinrc flag */
153 int verbose = 0; /* batch or debug mode */
154 t_bool word_highlight; /* word highlighting on/off */
156 #ifdef HAVE_COLOR
157  t_bool use_color; /* enables/disables ansi-color support under linux-console and color-xterm */
158 #endif /* HAVE_COLOR */
159 #ifdef NNTP_ABLE
160  t_bool force_auth_on_conn_open = FALSE; /* authenticate on connection startup */
161  unsigned short nntp_tcp_port;
162 #endif /* NNTP_ABLE */
163 
164 /* Currently active menu parameters */
166 
167 /* History entries */
169 
170 #ifdef HAVE_SYS_UTSNAME_H
171  struct utsname system_info;
172 #endif /* HAVE_SYS_UTSNAME_H */
173 
174 struct regex_cache
179  shar_regex,
181 #ifdef HAVE_COLOR
182  , extquote_regex, quote_regex, quote_regex2, quote_regex3
183 #endif /* HAVE_COLOR */
184  = {
185  NULL,
186  NULL
187  };
188 
190 
191 struct t_config tinrc = {
192  ART_MARK_DELETED, /* art_marked_deleted */
193  MARK_INRANGE, /* art_marked_inrange */
194  ART_MARK_RETURN, /* art_marked_return */
195  ART_MARK_SELECTED, /* art_marked_selected */
196  ART_MARK_RECENT, /* art_marked_recent */
197  ART_MARK_UNREAD, /* art_marked_unread */
198  ART_MARK_READ, /* art_marked_read */
199  ART_MARK_KILLED, /* art_marked_killed */
200  ART_MARK_READ_SELECTED, /* art_marked_read_selected */
201  "", /* editor_format */
202  "", /* default_goto_group */
203  "", /* default_mail_address */
204  "", /* mailer_format */
205 #ifndef DONT_HAVE_PIPING
206  "", /* default_pipe_command */
207 #endif /* !DONT_HAVE_PIPING */
208  "", /* default_post_newsgroups */
209  "", /* default_post_subject */
210 #ifndef DISABLE_PRINTING
211  "", /* printer */
212 #endif /* !DISABLE_PRINTING */
213  "1-.", /* default_range_group */
214  "1-.", /* default_range_select */
215  "1-.", /* default_range_thread */
216  "", /* default_pattern */
217  "", /* default_repost_group */
218  "savefile.tin", /* default_save_file */
219  "", /* default_search_art */
220  "", /* default_search_author */
221  "", /* default_search_config */
222  "", /* default_search_group */
223  "", /* default_search_subject */
224  "", /* default_select_pattern */
225  "", /* default_shell_command */
226  "In article %M you wrote:", /* mail_quote_format */
227  "", /* maildir */
228 #ifdef SCO_UNIX
229  2, /* mailbox_format = MMDF */
230 #else
231  0, /* mailbox_format = MBOXO */
232 #endif /* SCO_UNIX */
233  "", /* mail_address */
234 #ifdef HAVE_METAMAIL
235  METAMAIL_CMD, /* metamail_prog */
236 #else
237  INTERNAL_CMD, /* metamail_prog */
238 #endif /* HAVE_METAMAIL */
239 #ifndef CHARSET_CONVERSION
240  "", /* mm_charset, defaults to $MM_CHARSET */
241 #else
242  -1, /* mm_network_charset, defaults to $MM_CHARSET */
243 #endif /* !CHARSET_CONVERSION */
244  "US-ASCII", /* mm_local_charset, display charset */
245 #ifdef HAVE_ICONV_OPEN_TRANSLIT
246  FALSE, /* translit */
247 #endif /* HAVE_ICONV_OPEN_TRANSLIT */
248  "Newsgroups Followup-To Summary Keywords X-Comment-To", /* news_headers_to_display */
249  "", /* news_headers_to_not_display */
250  "%F wrote:", /* news_quote_format */
251  DEFAULT_COMMENT, /* quote_chars */
252 #ifdef HAVE_COLOR
253  "", /* quote_regex */
254  "", /* quote_regex 2nd level */
255  "", /* quote_regex >= 3rd level */
256  "", /* extquote_regex */
257 #endif /* HAVE_COLOR */
258  "", /* slashes_regex */
259  "", /* stars_regex */
260  "", /* underscores_regex */
261  "", /* strokes_regex */
262  "", /* sigfile */
263  "", /* strip_re_regex */
264  "", /* strip_was_regex */
265  "", /* verbatim_begin_regex */
266  "", /* verbatim_end_regex */
267  "", /* savedir */
268  "", /* spamtrap_warning_addresses */
269  DEFAULT_URL_HANDLER, /* url_handler */
270  "In %G %F wrote:", /* xpost_quote_format */
271  DEFAULT_FILTER_DAYS, /* filter_days */
272  FILTER_SUBJ_CASE_SENSITIVE, /* default_filter_kill_header */
273  FILTER_SUBJ_CASE_SENSITIVE, /* default_filter_select_header */
274  0, /* default_move_group */
275  'a', /* default_save_mode */
276  0, /* getart_limit */
277  2, /* recent_time */
278  GOTO_NEXT_UNREAD_TAB, /* goto_next_unread */
279  UUE_NO, /* hide_uue */
280  KILL_UNREAD, /* kill_level */
281  MIME_ENCODING_QP, /* mail_mime_encoding */
282  MIME_ENCODING_8BIT, /* post_mime_encoding */
283  POST_PROC_NO, /* post_process_type */
284  REREAD_ACTIVE_FILE_SECS, /* reread_active_file_secs */
285  1, /* scroll_lines */
286  SHOW_FROM_NAME, /* show_author */
287  SORT_ARTICLES_BY_DATE_ASCEND, /* sort_article_type */
288  SORT_THREADS_BY_SCORE_DESCEND, /* sort_threads_type */
289 #ifdef USE_HEAPSORT
290  0, /* sort_function default qsort */
291 #endif /* USE_HEAPSORT */
292  BOGUS_SHOW, /* strip_bogus */
293  THREAD_BOTH, /* thread_articles */
294  THREAD_PERC_DEFAULT, /* thread_perc */
295  THREAD_SCORE_MAX, /* thread_score */
296  0, /* Default to wildmat, not regex */
297  -50, /* score_limit_kill */
298  50, /* score_limit_select */
299  -100, /* score_kill */
300  100, /* score_select */
301  0, /* trim_article_body */
302 #ifdef HAVE_COLOR
303  0, /* col_back (initialised later) */
304  0, /* col_from (initialised later) */
305  0, /* col_head (initialised later) */
306  0, /* col_help (initialised later) */
307  0, /* col_invers_bg (initialised later) */
308  0, /* col_invers_fg (initialised later) */
309  0, /* col_minihelp (initialised later) */
310  0, /* col_normal (initialised later) */
311  0, /* col_markdash (initialised later) */
312  0, /* col_markstar (initialised later) */
313  0, /* col_markslash (initialised later) */
314  0, /* col_markstroke (initialised later) */
315  0, /* col_message (initialised later) */
316  0, /* col_newsheaders (initialised later) */
317  0, /* col_quote (initialised later) */
318  0, /* col_quote2 (initialised later) */
319  0, /* col_quote3 (initialised later) */
320  0, /* col_extquote (initialised later) */
321  0, /* col_response (initialised later) */
322  0, /* col_signature (initialised later) */
323  0, /* col_urls (initialised later) */
324  0, /* col_verbatim (initialised later) */
325  0, /* col_subject (initialised later) */
326  0, /* col_text (initialised later) */
327  0, /* col_title (initialised later) */
328 #endif /* HAVE_COLOR */
329  2, /* word_h_display_marks */
330  2, /* mono_markdash */
331  6, /* mono_markstar */
332  5, /* mono_markslash */
333  3, /* mono_markstroke */
334  TRUE, /* word_highlight */
335  TRUE, /* url_highlight */
336  0, /* wrap_column */
337 #ifdef HAVE_COLOR
338  FALSE, /* use_color */
339 #endif /* HAVE_COLOR */
340  FALSE, /* abbreviate_groupname */
341  TRUE, /* add_posted_to_filter */
342  TRUE, /* advertising */
343  TRUE, /* alternative_handling */
344  0, /* auto_cc_bcc */
345  TRUE, /* auto_list_thread */
346  FALSE, /* auto_reconnect */
347  FALSE, /* auto_save */
348  TRUE, /* batch_save */
349  TRUE, /* beginner_level */
350  FALSE, /* cache_overview_files */
351  FALSE, /* catchup_read_groups */
352  4, /* confirm_choice */
353 #ifdef USE_INVERSE_HACK
354  TRUE, /* draw_arrow */
355 #else
356  FALSE, /* draw_arrow */
357 #endif /* USE_INVERSE_HACK */
358  FALSE, /* force_screen_redraw */
359  TRUE, /* group_catchup_on_exit */
360  FALSE, /* info_in_last_line */
361 #ifdef USE_INVERSE_HACK
362  FALSE, /* inverse_okay */
363 #else
364  TRUE, /* inverse_okay */
365 #endif /* USE_INVERSE_HACK */
366  TRUE, /* keep_dead_articles */
367  POSTED_FILE, /* posted_articles_file */
368  FALSE, /* mail_8bit_header */
369  FALSE, /* mark_ignore_tags */
370  TRUE, /* mark_saved_read */
371  TRUE, /* pos_first_unread */
372  FALSE, /* post_8bit_header */
373  TRUE, /* post_process_view */
374 #ifndef DISABLE_PRINTING
375  FALSE, /* print_header */
376 #endif /* !DISABLE_PRINTING */
377  FALSE, /* process_only_unread */
378  FALSE, /* prompt_followupto */
379  QUOTE_COMPRESS|QUOTE_EMPTY, /* quote_style */
380  TRUE, /* show_description */
381  TRUE, /* show_only_unread_arts */
382  FALSE, /* show_only_unread_groups */
383  TRUE, /* show_signatures */
384  TRUE, /* sigdashes */
385  TRUE, /* signature_repost */
386  TRUE, /* start_editor_offset */
387 #ifndef USE_CURSES
388  TRUE, /* strip_blanks */
389 #endif /* !USE_CURSES */
390  FALSE, /* strip_newsrc */
391  FALSE, /* tex2iso_conv */
392  TRUE, /* thread_catchup_on_exit */
393  TRUE, /* unlink_article */
394 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
395  FALSE, /* utf8_graphics */
396 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
397  TRUE, /* verbatim_handling */
398 #ifdef HAVE_COLOR
399  FALSE, /* extquote_handling */
400 #endif /* HAVE_COLOR */
401  "", /* inews_prog */
402 #ifdef USE_CANLOCK
403  1, /* cancel_lock_algo, sha1 */
404 #endif /* USE_CANLOCK */
405  INTERACTIVE_NONE, /* interactive_mailer */
406  FALSE, /* use_mouse */
407 #ifdef HAVE_KEYPAD
408  FALSE, /* use_keypad */
409 #endif /* HAVE_KEYPAD */
410  TRUE, /* wrap_on_next_unread */
411  FALSE, /* ask_for_metamail */
412  FALSE, /* default_filter_kill_case */
413  FALSE, /* default_filter_kill_expire */
414  TRUE, /* default_filter_kill_global */
415  FALSE, /* default_filter_select_case */
416  FALSE, /* default_filter_select_expire */
417 #ifdef XFACE_ABLE
418  FALSE, /* use_slrnface */
419 #endif /* XFACE_ABLE */
420  TRUE, /* default_filter_select_global */
421  DEFAULT_SELECT_FORMAT, /* select_format */
422  DEFAULT_GROUP_FORMAT, /* group_format */
423  DEFAULT_THREAD_FORMAT, /* thread_format */
424  DEFAULT_DATE_FORMAT, /* date_format */
425 #ifdef HAVE_UNICODE_NORMALIZATION
426  DEFAULT_NORMALIZE, /* normalization form */
427 #endif /* HAVE_UNICODE_NORMALIZATION */
428 #if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && defined(HAVE_UNICODE_UBIDI_H) && !defined(NO_LOCALE)
429  FALSE, /* render_bidi */
430 #endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && HAVE_UNICODE_UBIDI_H && !NO_LOCALE */
431 #ifdef CHARSET_CONVERSION
432  -1, /* attrib_mm_network_charset, defaults to $MM_CHARSET */
433  "", /* attrib_undeclared_charset */
434 #endif /* CHARSET_CONVERSION */
435  "", /* attrib_editor_format */
436  "", /* attrib_fcc */
437  "", /* attrib_maildir */
438  "", /* attrib_from */
439  "", /* attrib_mailing_list */
440  "", /* attrib_organization */
441  "", /* attrib_followup_to */
442  "", /* attrib_mime_types_to_save */
443  "", /* attrib_news_headers_to_display */
444  "", /* attrib_news_headers_to_not_display */
445  "", /* attrib_news_quote_format */
446  "", /* attrib_quote_chars */
447  "", /* attrib_sigfile */
448  "", /* attrib_savedir */
449  "", /* attrib_savefile */
450  "", /* attrib_x_body */
451  "", /* attrib_x_headers */
452 #ifdef HAVE_ISPELL
453  "", /* attrib_ispell */
454 #endif /* HAVE_ISPELL */
455  "", /* attrib_quick_kill_scope */
456  "", /* attrib_quick_select_scope */
457  "", /* attrib_group_format */
458  "", /* attrib_thread_format */
459  "", /* attrib_date_format */
460  0, /* attrib_trim_article_body */
461  0, /* attrib_auto_cc_bcc */
462  FILTER_SUBJ_CASE_SENSITIVE, /* attrib_quick_kill_header */
463  FILTER_SUBJ_CASE_SENSITIVE, /* attrib_quick_select_header */
464  MIME_ENCODING_QP, /* attrib_mail_mime_encoding */
465 #if defined(HAVE_ALARM) && defined(SIGALRM)
466  120, /* nntp_read_timeout_secs */
467 #endif /* HAVE_ALARM && SIGALRM */
468  MIME_ENCODING_8BIT, /* attrib_post_mime_encoding */
469  POST_PROC_NO, /* attrib_post_process_type */
470  SHOW_FROM_NAME, /* attrib_show_author */
471  SORT_ARTICLES_BY_DATE_ASCEND, /* attrib_sort_article_type */
472  SORT_THREADS_BY_SCORE_DESCEND, /* attrib_sort_threads_type */
473  THREAD_BOTH, /* attrib_thread_articles */
474  THREAD_PERC_DEFAULT, /* attrib_thread_perc */
475  TRUE, /* attrib_add_posted_to_filter */
476  TRUE, /* attrib_advertising */
477  TRUE, /* attrib_alternative_handling */
478  TRUE, /* attrib_auto_list_thread */
479  FALSE, /* attrib_auto_select */
480  FALSE, /* attrib_auto_save */
481  TRUE, /* attrib_batch_save */
482  TRUE, /* attrib_delete_tmp_files */
483  TRUE, /* attrib_group_catchup_on_exit */
484  FALSE, /* attrib_mail_8bit_header */
485  FALSE, /* attrib_mime_forward */
486  FALSE, /* attrib_mark_ignore_tags */
487  TRUE, /* attrib_mark_saved_read */
488  TRUE, /* attrib_pos_first_unread */
489  FALSE, /* attrib_post_8bit_header */
490  TRUE, /* attrib_post_process_view */
491 #ifndef DISABLE_PRINTING
492  FALSE, /* attrib_print_header */
493 #endif /* !DISABLE_PRINTING */
494  FALSE, /* attrib_process_only_unread */
495  FALSE, /* attrib_prompt_followupto */
496  TRUE, /* attrib_show_only_unread_arts */
497  TRUE, /* attrib_show_signatures */
498  TRUE, /* attrib_sigdashes */
499  TRUE, /* attrib_signature_repost */
500  TRUE, /* attrib_start_editor_offset */
501  FALSE, /* attrib_tex2iso_conv */
502  TRUE, /* attrib_thread_catchup_on_exit */
503  TRUE, /* attrib_verbatim_handling */
504 #ifdef HAVE_COLOR
505  FALSE, /* attrib_extquote_handling */
506 #endif /* HAVE_COLOR */
507  FALSE, /* attrib_x_comment_to */
508  TRUE, /* attrib_wrap_on_next_unread */
509  FALSE, /* attrib_ask_for_metamail */
510  FALSE, /* attrib_quick_kill_case */
511  FALSE, /* attrib_quick_kill_expire */
512  FALSE, /* attrib_quick_select_case */
513  FALSE /* attrib_quick_select_expire */
514 };
515 
517  NONE, /* type (NONE, CAPABILITIES, BROKEN) */
518  0, /* CAPABILITIES version */
519  FALSE, /* MODE-READER: "MODE READER" */
520  FALSE, /* READER: "ARTICLE", "BODY" */
521  FALSE, /* POST */
522  FALSE, /* LIST: "LIST ACTIVE" */
523  FALSE, /* LIST: "LIST ACTIVE.TIMES" */
524  FALSE, /* LIST: "LIST DISTRIB.PATS" */
525  FALSE, /* LIST: "LIST HEADERS" */
526  NULL, /* list of headers by range */
527  NULL, /* list of headers by id */
528  FALSE, /* LIST: "LIST NEWSGROUPS" */
529  FALSE, /* LIST: "LIST OVERVIEW.FMT" */
530  FALSE, /* LIST: "LIST MOTD" */
531  FALSE, /* LIST: "LIST SUBSCRIPTIONS" */
532  FALSE, /* LIST: "LIST DISTRIBUTIONS" */
533  FALSE, /* LIST: "LIST MODERATORS" */
534  FALSE, /* LIST: "LIST COUNTS" */
535  FALSE, /* XPAT */
536  FALSE, /* HDR: "HDR", "LIST HEADERS" */
537  NULL, /* [X]HDR */
538  FALSE, /* OVER: "OVER", "LIST OVERVIEW.FMT" */
539  FALSE, /* OVER: "OVER mid" */
540  NULL, /* [X]OVER */
541  FALSE, /* NEWNEWS */
542  NULL, /* IMPLEMENTATION */
543  FALSE, /* STARTTLS */
544  FALSE, /* AUTHINFO USER/PASS */
545  FALSE, /* AUTHINFO SASL */
546  FALSE, /* AUTHINFO available but not in current state */
547  SASL_NONE, /* SASL CRAM-MD5 DIGEST-MD5 PLAIN GSSAPI EXTERNAL OTP NTLM LOGIN */
548  FALSE, /* COMPRESS */
549  COMPRESS_NONE, /* COMPRESS_NONE, COMPRESS_DEFLATE */
550 #if 0
551  FALSE, /* STREAMING: "MODE STREAM", "CHECK", "TAKETHIS" */
552  FALSE /* IHAVE */
553 #endif /* 0 */
554 #ifndef BROKEN_LISTGROUP
555  FALSE /* LISTGROUP doesn't select group */
556 #else
557  TRUE
558 #endif /* !BROKEN_LISTGROUP */
559 };
560 
561 static char libdir[PATH_LEN]; /* directory where news config files are (ie. active) */
562 static mode_t real_umask;
563 
564 #ifdef HAVE_COLOR
565 
566 # define DFT_FORE -1
567 # define DFT_BACK -2
568 # define DFT_INIT -3
569 
570 static const struct {
571  int *colorp;
572  int color_dft; /* -2 back, -1 fore, >=0 normal */
573 } our_colors[] = {
574  { &tinrc.col_back, DFT_BACK },
575  { &tinrc.col_from, 2 },
576  { &tinrc.col_head, 2 },
577  { &tinrc.col_help, DFT_FORE },
578  { &tinrc.col_invers_bg, 4 },
579  { &tinrc.col_invers_fg, 7 },
580  { &tinrc.col_markdash, 13 },
581  { &tinrc.col_markstar, 11 },
582  { &tinrc.col_markslash, 14 },
583  { &tinrc.col_markstroke, 12 },
584  { &tinrc.col_message, 6 },
585  { &tinrc.col_minihelp, 3 },
586  { &tinrc.col_newsheaders, 9 },
587  { &tinrc.col_normal, DFT_FORE },
588  { &tinrc.col_quote, 2 },
589  { &tinrc.col_quote2, 3 },
590  { &tinrc.col_quote3, 4 },
591  { &tinrc.col_extquote, 5 },
592  { &tinrc.col_response, 2 },
593  { &tinrc.col_signature, 4 },
594  { &tinrc.col_urls, DFT_FORE },
595  { &tinrc.col_verbatim, 5 },
596  { &tinrc.col_subject, 6 },
597  { &tinrc.col_text, DFT_FORE },
598  { &tinrc.col_title, 4 },
599 };
600 
601 
602 static void
603 preinit_colors(
604  void)
605 {
606  size_t n;
607 
608  for (n = 0; n < ARRAY_SIZE(our_colors); n++)
609  *(our_colors[n].colorp) = DFT_INIT;
610 }
611 
612 
613 void
614 postinit_colors(
615  int last_color)
616 {
617  size_t n;
618 
619  for (n = 0; n < ARRAY_SIZE(our_colors); n++) {
620  if (*(our_colors[n].colorp) == DFT_INIT
621  || *(our_colors[n].colorp) >= last_color) {
622  switch (our_colors[n].color_dft) {
623  case DFT_FORE:
624  *(our_colors[n].colorp) = default_fcol;
625  break;
626 
627  case DFT_BACK:
628  *(our_colors[n].colorp) = default_bcol;
629  break;
630 
631  default:
632  *(our_colors[n].colorp) = our_colors[n].color_dft;
633  break;
634  }
635  }
636  TRACE(("postinit_colors [%d] = %d", n, *(our_colors[n].colorp)));
637  }
638 }
639 #endif /* HAVE_COLOR */
640 
641 
642 /*
643  * Get users home directory, userid, and a bunch of other stuff!
644  */
645 void
647  void)
648 {
649  FILE *fp;
650  char *ptr;
651  char tmp[PATH_LEN];
652  struct stat sb;
653  struct passwd *myentry;
654 #if defined(DOMAIN_NAME) || defined(HAVE_GETHOSTBYNAME)
655  const char *cptr;
656 #endif /* DOMAIN_NAME || HAVE_GETHOSTBYNAME */
657 
658  domain_name[0] = '\0';
659 
660 #ifdef HAVE_SYS_UTSNAME_H
661 # ifdef HAVE_UNAME
662  if (uname(&system_info) == -1)
663 # endif /* HAVE_UNAME */
664  {
665  strcpy(system_info.sysname, "unknown");
666  *system_info.machine = '\0';
667  *system_info.release = '\0';
668  *system_info.nodename = '\0';
669  }
670 #endif /* HAVE_SYS_UTSNAME_H */
671 
672 #ifdef DOMAIN_NAME
673  if ((cptr = get_domain_name()) != NULL)
675 #endif /* DOMAIN_NAME */
676 
677 #ifdef HAVE_GETHOSTBYNAME
678  if (domain_name[0] == '\0') {
679  cptr = get_fqdn(get_host_name());
680  if (cptr != NULL)
682  }
683 #endif /* HAVE_GETHOSTBYNAME */
684 
685  process_id = getpid();
686 
687  real_umask = umask(0);
688  (void) umask(real_umask);
689 
690  if ((myentry = getpwuid(getuid())) == NULL) {
692  free(tin_progname);
693  giveup();
694  }
695 
696  my_strncpy(userid, myentry->pw_name, sizeof(userid) - 1);
697 
698  if (((ptr = getenv("TIN_HOMEDIR")) != NULL) && strlen(ptr)) {
699  my_strncpy(homedir, ptr, sizeof(homedir) - 1);
700  } else if (((ptr = getenv("HOME")) != NULL) && strlen(ptr)) {
701  my_strncpy(homedir, ptr, sizeof(homedir) - 1);
702  } else if (strlen(myentry->pw_dir)) {
703  strncpy(homedir, myentry->pw_dir, sizeof(homedir) - 1);
704  } else
705  strncpy(homedir, TMPDIR, sizeof(homedir) - 1);
706 
710  disable_sender = FALSE; /* we set force_no_post=TRUE later on if we don't have a valid FQDN */
712  if (iso2asc_supported >= NUM_ISO_TABLES || iso2asc_supported < 0) /* TODO: issue a warning here? */
713  iso2asc_supported = -1;
714  list_active = FALSE;
721  batch_mode = FALSE;
723 
724 #ifdef HAVE_COLOR
725  preinit_colors();
726  use_color = FALSE;
727 #endif /* HAVE_COLOR */
728 
730 
731  index_maildir[0] = '\0';
732  index_newsdir[0] = '\0';
733  index_savedir[0] = '\0';
734  newsrc[0] = '\0';
735 
736  snprintf(page_header, sizeof(page_header), "%s %s release %s (\"%s\") %s",
738  (iso2asc_supported >= 0 ? "[ISO2ASC]" : ""));
740 
741  default_organization[0] = '\0';
742 
743  strncpy(bug_addr, BUG_REPORT_ADDRESS, sizeof(bug_addr) - 1);
744 
745  bug_nntpserver1[0] = '\0';
746  bug_nntpserver2[0] = '\0';
747 
748 #ifdef INEWSDIR
749  strncpy(inewsdir, INEWSDIR, sizeof(inewsdir) - 1);
750 #else
751  inewsdir[0] = '\0';
752 #endif /* INEWSDIR */
753 
754 #ifdef apollo
755  my_strncpy(default_organization, get_val("NEWSORG", ""), sizeof(default_organization) - 1);
756 #else
757  my_strncpy(default_organization, get_val("ORGANIZATION", ""), sizeof(default_organization) - 1);
758 #endif /* apollo */
759 
760 #ifndef NNTP_ONLY
761  my_strncpy(libdir, get_val("TIN_LIBDIR", NEWSLIBDIR), sizeof(libdir) - 1);
762  my_strncpy(novrootdir, get_val("TIN_NOVROOTDIR", NOVROOTDIR), sizeof(novrootdir) - 1);
763  my_strncpy(novfilename, get_val("TIN_NOVFILENAME", OVERVIEW_FILE), sizeof(novfilename) - 1);
764  my_strncpy(spooldir, get_val("TIN_SPOOLDIR", SPOOLDIR), sizeof(spooldir) - 1);
765 #endif /* !NNTP_ONLY */
766  /* clear news_active_file, active_time_file, newsgroups_file */
767  news_active_file[0] = '\0';
768  active_times_file[0] = '\0';
769  newsgroups_file[0] = '\0';
770  overviewfmt_file[0] = '\0';
771  subscriptions_file[0] = '\0';
772 
773  /*
774  * read the global site config file to override some default
775  * values given at compile time
776  */
777  (void) read_site_config();
778 
779  /*
780  * the site_config-file was the last chance to set the domainname
781  * if it's still unset fall into no posting mode.
782  */
783  if (domain_name[0] == '\0') {
786  }
787 
788  /*
789  * only set the following variables if they weren't set from within
790  * read_site_config()
791  *
792  * TODO: do we really want that read_site_config() overwrites
793  * values given in env-vars? ($MM_CHARSET, $TIN_ACTIVEFILE)
794  */
795  if (!*news_active_file) /* TODO: really prepend libdir here in case of $TIN_ACTIVEFILE is set? */
796  joinpath(news_active_file, sizeof(news_active_file), libdir, get_val("TIN_ACTIVEFILE", ACTIVE_FILE));
797  if (!*active_times_file)
799  if (!*newsgroups_file)
801  if (!*subscriptions_file)
803  if (!*overviewfmt_file)
805  if (!*default_organization) {
806  char buf[LEN];
807 
808  joinpath(tmp, sizeof(tmp), libdir, "organization");
809  if ((fp = fopen(tmp, "r")) != NULL) {
810  if (fgets(buf, (int) sizeof(buf), fp) != NULL) {
811  ptr = strrchr(buf, '\n');
812  if (ptr != NULL)
813  *ptr = '\0';
814  }
815  fclose(fp);
817  }
818  }
819 
820  /*
821  * Formerly get_mm_charset(), read_site_config() may set mm_charset
822  */
823 #ifndef CHARSET_CONVERSION
824  if (!*tinrc.mm_charset)
825  STRCPY(tinrc.mm_charset, get_val("MM_CHARSET", MM_CHARSET));
826 #else
827  if (tinrc.mm_network_charset < 0) {
828  size_t space = 255;
829 
830  ptr = my_malloc(space + 1);
831 
832  snprintf(ptr, space, "mm_network_charset=%s\n", get_val("MM_CHARSET", MM_CHARSET));
833  if (!match_list(ptr, "mm_network_charset=", txt_mime_charsets, &tinrc.mm_network_charset)) /* $MM_CHARSET may be set invalid, fallback */
834  snprintf(ptr, space, "mm_network_charset=%s\n", MM_CHARSET);
835 
836  free(ptr);
837  }
838 #endif /* !CHARSET_CONVERSION */
839 
840 #ifdef TIN_DEFAULTS_DIR
842  joinpath(global_config_file, sizeof(global_config_file), TIN_DEFAULTS_DIR, CONFIG_FILE);
843 #else
844  /* read_site_config() might have changed the value of libdir */
847 #endif /* TIN_DEFAULTS_DIR */
848 
849  joinpath(rcdir, sizeof(rcdir), homedir, RCDIR);
850  if (stat(rcdir, &sb) == -1) {
851  my_mkdir(rcdir, (mode_t) (S_IRWXU)); /* TODO: bail out? give error message? no_write = TRUE? */
853  }
856 #ifndef DISABLE_PRINTING
857  strcpy(tinrc.printer, DEFAULT_PRINTER);
858 #endif /* !DISABLE_PRINTING */
859  strcpy(tinrc.inews_prog, PATH_INEWS);
861 #ifdef APPEND_PID
862  snprintf(article_name + strlen(article_name), sizeof(article_name) - strlen(article_name), ".%ld", (long) process_id);
863 #endif /* APPEND_PID */
864  joinpath(dead_article, sizeof(dead_article), homedir, "dead.article");
865  joinpath(dead_articles, sizeof(dead_articles), homedir, "dead.articles");
868  joinpath(tinrc.sigfile, sizeof(tinrc.sigfile), homedir, ".Sig");
869  joinpath(default_signature, sizeof(default_signature), homedir, ".signature");
870 
871  if (!index_newsdir[0])
872  joinpath(index_newsdir, sizeof(index_newsdir), get_val("TIN_INDEX_NEWSDIR", rcdir), INDEX_NEWSDIR);
873  joinpath(index_maildir, sizeof(index_maildir), get_val("TIN_INDEX_MAILDIR", rcdir), INDEX_MAILDIR);
874  if (stat(index_maildir, &sb) == -1)
875  my_mkdir(index_maildir, (mode_t) S_IRWXU);
876  joinpath(index_savedir, sizeof(index_savedir), get_val("TIN_INDEX_SAVEDIR", rcdir), INDEX_SAVEDIR);
877  if (stat(index_savedir, &sb) == -1)
878  my_mkdir(index_savedir, (mode_t) S_IRWXU);
884 #ifdef HAVE_MH_MAIL_HANDLING
885  joinpath(mail_active_file, sizeof(mail_active_file), rcdir, ACTIVE_MAIL_FILE);
886 #endif /* HAVE_MH_MAIL_HANDLING */
887  ptr = getenv("MAIL");
888  if (ptr == NULL || (*ptr == '\0'))
890  else
891  STRCPY(mailbox, ptr);
892 #ifdef HAVE_MH_MAIL_HANDLING
893  joinpath(mailgroups_file, sizeof(mailgroups_file), rcdir, MAILGROUPS_FILE);
894 #endif /* HAVE_MH_MAIL_HANDLING */
897 #ifdef APPEND_PID
898  snprintf(newnewsrc + strlen(newnewsrc), sizeof(newnewsrc) - strlen(newnewsrc), ".%d", (int) process_id);
899 #endif /* APPEND_PID */
903 
904  snprintf(tmp, sizeof(tmp), INDEX_LOCK, userid);
905  joinpath(lock_file, sizeof(lock_file), TMPDIR, tmp);
906 
907 #ifdef NNTP_ABLE
908  nntp_tcp_port = (unsigned short) atoi(get_val("NNTPPORT", NNTP_TCP_PORT));
909 #endif /* NNTP_ABLE */
910 
911  if ((fp = fopen(posted_info_file, "a")) != NULL) {
912  if (!fstat(fileno(fp), &sb)) {
913  if (sb.st_size == 0) {
914  fprintf(fp, "%s", _(txt_posted_info_file));
915  fchmod(fileno(fp), (mode_t) (S_IRUSR|S_IWUSR));
916  }
917  }
918  fclose(fp);
919  }
920 
921  init_postinfo();
923 
924 #ifdef HAVE_PGP_GPG
925  init_pgp();
926 #endif /* HAVE_PGP_GPG */
927 }
928 
929 
930 /*
931  * read_site_config()
932  *
933  * This function permits the local administrator to override a few compile
934  * time defined parameters, especially the concerning the place of a local
935  * news spool. This has especially binary distributions of TIN in mind.
936  *
937  * Sven Paulus <sven@tin.org>, 26-Jan-'98
938  */
939 static int
941  void)
942 {
943  FILE *fp = (FILE *) 0;
944  char buf[LEN], filename[PATH_LEN];
945  static const char *tin_defaults[] = { TIN_DEFAULTS };
946  int i = 0;
947 
948  /*
949  * try to find tin.defaults in some different locations
950  */
951  while (tin_defaults[i] != NULL) {
952  joinpath(filename, sizeof(filename), tin_defaults[i++], "tin.defaults");
953  if ((fp = fopen(filename, "r")) != NULL)
954  break;
955  }
956 
957  if (!fp)
958  return -1;
959 
960  while (fgets(buf, (int) sizeof(buf), fp)) {
961  /* ignore comments */
962  if (*buf == '#' || *buf == ';' || *buf == ' ')
963  continue;
964 #ifndef NNTP_ONLY
965  if (match_string(buf, "spooldir=", spooldir, sizeof(spooldir)))
966  continue;
967  if (match_string(buf, "overviewdir=", novrootdir, sizeof(novrootdir)))
968  continue;
969  if (match_string(buf, "overviewfile=", novfilename, sizeof(novfilename)))
970  continue;
971 #endif /* !NNTP_ONLY */
972  if (match_string(buf, "activefile=", news_active_file, sizeof(news_active_file)))
973  continue;
974  if (match_string(buf, "activetimesfile=", active_times_file, sizeof(active_times_file)))
975  continue;
976  if (match_string(buf, "newsgroupsfile=", newsgroups_file, sizeof(newsgroups_file)))
977  continue;
978  if (match_string(buf, "newslibdir=", libdir, sizeof(libdir)))
979  continue;
980  if (match_string(buf, "subscriptionsfile=", subscriptions_file, sizeof(subscriptions_file)))
981  continue;
982  if (match_string(buf, "overviewfmtfile=", overviewfmt_file, sizeof(overviewfmt_file)))
983  continue;
984  if (match_string(buf, "domainname=", domain_name, sizeof(domain_name)))
985  continue;
986  if (match_string(buf, "inewsdir=", inewsdir, sizeof(inewsdir)))
987  continue;
988  if (match_string(buf, "bugaddress=", bug_addr, sizeof(bug_addr)))
989  continue;
990  if (match_string(buf, "organization=", default_organization, sizeof(default_organization)))
991  continue;
992 #ifndef CHARSET_CONVERSION
993  if (match_string(buf, "mm_charset=", tinrc.mm_charset, sizeof(tinrc.mm_charset)))
994  continue;
995 #else
996  if (match_list(buf, "mm_charset=", txt_mime_charsets, &tinrc.mm_network_charset))
997  continue;
998 #endif /* !CHARSET_CONVERSION */
999  if (match_list(buf, "post_mime_encoding=", txt_mime_encodings, &tinrc.post_mime_encoding))
1000  continue;
1001  if (match_list(buf, "mail_mime_encoding=", txt_mime_encodings, &tinrc.mail_mime_encoding))
1002  continue;
1003  if (match_boolean(buf, "disable_gnksa_domain_check=", &disable_gnksa_domain_check))
1004  continue;
1005  if (match_boolean(buf, "disable_sender=", &disable_sender))
1006  continue;
1007  }
1008 
1009  fclose(fp);
1010  return 0;
1011 }
1012 
1013 
1014 /*
1015  * set defaults if needed to avoid empty regexp
1016  */
1017 void
1019  void)
1020 {
1021  if (!strlen(tinrc.strip_re_regex))
1024 
1025  if (strlen(tinrc.strip_was_regex)) {
1026  /*
1027  * try to be clever, if we still use the initial default value
1028  * convert it to our needs
1029  *
1030  * TODO: a global solution
1031  */
1032 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
1033  if (IS_LOCAL_CHARSET("UTF-8") && utf8_pcre()) {
1036  } else {
1039  }
1040 #else
1043 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
1044  } else {
1045 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
1046  if (IS_LOCAL_CHARSET("UTF-8") && utf8_pcre())
1048  else
1049 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
1051  }
1053 
1054 #ifdef HAVE_COLOR
1055  if (!strlen(tinrc.extquote_regex))
1056  STRCPY(tinrc.extquote_regex, DEFAULT_EXTQUOTE_REGEX);
1057  compile_regex(tinrc.extquote_regex, &extquote_regex, PCRE_CASELESS);
1058  if (!strlen(tinrc.quote_regex))
1059  STRCPY(tinrc.quote_regex, DEFAULT_QUOTE_REGEX);
1060  compile_regex(tinrc.quote_regex, &quote_regex, PCRE_CASELESS);
1061  if (!strlen(tinrc.quote_regex2))
1062  STRCPY(tinrc.quote_regex2, DEFAULT_QUOTE_REGEX2);
1063  compile_regex(tinrc.quote_regex2, &quote_regex2, PCRE_CASELESS);
1064  if (!strlen(tinrc.quote_regex3))
1065  STRCPY(tinrc.quote_regex3, DEFAULT_QUOTE_REGEX3);
1066  compile_regex(tinrc.quote_regex3, &quote_regex3, PCRE_CASELESS);
1067 #endif /* HAVE_COLOR */
1068 
1069  if (!strlen(tinrc.slashes_regex))
1072  if (!strlen(tinrc.stars_regex))
1075  if (!strlen(tinrc.strokes_regex))
1078  if (!strlen(tinrc.underscores_regex))
1081 
1082  if (!strlen(tinrc.verbatim_begin_regex))
1085  if (!strlen(tinrc.verbatim_end_regex))
1088 
1091 
1095 
1097 }
1098 
1099 
1100 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
1101 t_bool
1102 utf8_pcre(
1103  void)
1104 {
1105  int i = 0;
1106 
1107 # if (defined(PCRE_MAJOR) && PCRE_MAJOR >= 4)
1108  (void) pcre_config(PCRE_CONFIG_UTF8, &i);
1109 # endif /* PCRE_MAJOR && PCRE_MAJOR >= 4 */
1110 
1111  return (i ? TRUE : FALSE);
1112 }
1113 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
UUBODY_REGEX
#define UUBODY_REGEX
Definition: tin.h:680
DEFAULT_STRIP_WAS_REGEX
#define DEFAULT_STRIP_WAS_REGEX
Definition: tin.h:670
TMPDIR
#define TMPDIR
Definition: tin.h:2121
POSTED_FILE
#define POSTED_FILE
Definition: tin.h:737
reread_active_for_posted_arts
t_bool reread_active_for_posted_arts
Definition: init.c:148
last_search
t_function last_search
Definition: init.c:117
stars_regex
struct regex_cache stars_regex
NUM_ISO_TABLES
#define NUM_ISO_TABLES
Definition: tin.h:987
local_newsgroups_file
char local_newsgroups_file[PATH_LEN]
Definition: init.c:86
subscriptions_file
char subscriptions_file[PATH_LEN]
Definition: init.c:104
POSTPONED_FILE
#define POSTPONED_FILE
Definition: tin.h:738
DEFAULT_STRIP_RE_REGEX
#define DEFAULT_STRIP_RE_REGEX
Definition: tin.h:668
_
#define _(Text)
Definition: tin.h:94
TIN_DEFAULTS
#define TIN_DEFAULTS
Definition: tin.h:2325
t_config::inews_prog
char inews_prog[PATH_LEN]
Definition: tinrc.h:252
system_status
int system_status
Definition: init.c:121
dangerous_signal_exit
t_bool dangerous_signal_exit
Definition: init.c:130
t_config::maildir
char maildir[PATH_LEN]
Definition: tinrc.h:94
posted_info_file
char posted_info_file[PATH_LEN]
Definition: init.c:98
currmenu
t_menu * currmenu
Definition: init.c:165
url_regex
struct regex_cache url_regex
t_config::strip_re_regex
char strip_re_regex[LEN]
Definition: tinrc.h:122
REREAD_ACTIVE_FILE_SECS
#define REREAD_ACTIVE_FILE_SECS
Definition: tin.h:601
txt_mime_encodings
constext * txt_mime_encodings[]
Definition: lang.c:1443
t_config::stars_regex
char stars_regex[LEN]
Definition: tinrc.h:118
t_config::printer
char printer[LEN]
Definition: tinrc.h:78
input_history
char * input_history[HIST_MAXNUM+1][HIST_SIZE+1]
Definition: init.c:168
disable_gnksa_domain_check
t_bool disable_gnksa_domain_check
Definition: init.c:131
index_savedir
char index_savedir[PATH_LEN]
Definition: init.c:81
verbatim_end_regex
struct regex_cache verbatim_end_regex
INDEX_MAILDIR
#define INDEX_MAILDIR
Definition: tin.h:620
domain_name
char domain_name[MAXHOSTNAMELEN+1]
Definition: init.c:75
t_config::verbatim_end_regex
char verbatim_end_regex[LEN]
Definition: tinrc.h:125
verbose
int verbose
Definition: init.c:153
init_postinfo
void init_postinfo(void)
Definition: post.c:274
rcdir
char rcdir[PATH_LEN]
Definition: init.c:100
read_news_via_nntp
t_bool read_news_via_nntp
Definition: init.c:150
news_active_file
char news_active_file[PATH_LEN]
Definition: init.c:94
PCRE_CONFIG_UTF8
#define PCRE_CONFIG_UTF8
Definition: pcre.h:169
list_active
t_bool list_active
Definition: init.c:142
MAILER_FORMAT
#define MAILER_FORMAT
Definition: tin.h:2120
S_IWUSR
#define S_IWUSR
Definition: tin.h:2137
THREAD_SCORE_MAX
#define THREAD_SCORE_MAX
Definition: tin.h:1149
match_boolean
t_bool match_boolean(char *line, const char *pat, t_bool *dst)
Definition: config.c:1506
underscores_regex
struct regex_cache underscores_regex
DEFAULT_DATE_FORMAT
#define DEFAULT_DATE_FORMAT
Definition: tin.h:1376
page_header
char page_header[LEN]
Definition: init.c:97
KILL_UNREAD
#define KILL_UNREAD
Definition: tin.h:1205
CONFIG_FILE
#define CONFIG_FILE
Definition: tin.h:629
trace.h
GOTO_NEXT_UNREAD_TAB
#define GOTO_NEXT_UNREAD_TAB
Definition: tin.h:964
post_article_and_exit
t_bool post_article_and_exit
Definition: init.c:145
RELEASEDATE
#define RELEASEDATE
Definition: version.h:48
hist_last
int hist_last[HIST_MAXNUM+1]
Definition: init.c:118
ART_MARK_RECENT
#define ART_MARK_RECENT
Definition: tin.h:885
xmouse
int xmouse
Definition: init.c:122
tin_progname
char * tin_progname
Definition: init.c:105
t_capabilities
Definition: nntplib.h:186
txt_help_bug
constext txt_help_bug[]
Definition: lang.c:401
RELEASENAME
#define RELEASENAME
Definition: version.h:49
TRACE
#define TRACE(p)
Definition: trace.h:65
disable_sender
t_bool disable_sender
Definition: init.c:132
no_write
t_bool no_write
Definition: init.c:144
t_config::verbatim_begin_regex
char verbatim_begin_regex[LEN]
Definition: tinrc.h:124
DEFAULT_THREAD_FORMAT
#define DEFAULT_THREAD_FORMAT
Definition: tin.h:1375
xref_supported
t_bool xref_supported
Definition: init.c:155
version.h
tin.h
bug_nntpserver1
char bug_nntpserver1[PATH_LEN]
Definition: init.c:68
local_input_history_file
char local_input_history_file[PATH_LEN]
Definition: init.c:85
newsgroups_file
char newsgroups_file[PATH_LEN]
Definition: init.c:95
mailbox
char mailbox[PATH_LEN]
Definition: init.c:91
MAIL_REGEX
#define MAIL_REGEX
Definition: tin.h:708
get_fqdn
const char * get_fqdn(const char *host)
MM_CHARSET
#define MM_CHARSET
Definition: tin.h:2436
bugrep.h
pcre_config
int pcre_config(int, void *)
Definition: pcre_config.c:62
xrow
int xrow
Definition: init.c:122
index_maildir
char index_maildir[PATH_LEN]
Definition: init.c:79
QUOTE_COMPRESS
#define QUOTE_COMPRESS
Definition: tin.h:1212
ART_MARK_UNREAD
#define ART_MARK_UNREAD
Definition: tin.h:876
PATH_LEN
#define PATH_LEN
Definition: tin.h:837
cvers
char cvers[LEN]
Definition: init.c:70
t_config::underscores_regex
char underscores_regex[LEN]
Definition: tinrc.h:119
dead_article
char dead_article[PATH_LEN]
Definition: init.c:71
force_reread_active_file
t_bool force_reread_active_file
Definition: active.c:62
FILTER_FILE
#define FILTER_FILE
Definition: tin.h:723
match_string
t_bool match_string(char *line, const char *pat, char *dst, size_t dstlen)
Definition: config.c:1637
COMPRESS_NONE
@ COMPRESS_NONE
Definition: nntplib.h:184
local_attributes_file
char local_attributes_file[PATH_LEN]
Definition: init.c:83
MIME_ENCODING_QP
@ MIME_ENCODING_QP
Definition: tin.h:980
FILTER_SUBJ_CASE_SENSITIVE
#define FILTER_SUBJ_CASE_SENSITIVE
Definition: tin.h:1353
OVERVIEW_FMT
#define OVERVIEW_FMT
Definition: tin.h:736
DEFAULT_U8_STRIP_WAS_REGEX
#define DEFAULT_U8_STRIP_WAS_REGEX
Definition: tin.h:671
xcol
int xcol
Definition: init.c:122
my_strncpy
void my_strncpy(char *p, const char *q, size_t n)
Definition: string.c:190
DEFAULT_SAVEDIR
#define DEFAULT_SAVEDIR
Definition: tin.h:632
MAXHOSTNAMELEN
#define MAXHOSTNAMELEN
Definition: tnntp.h:114
TIN_ARTICLE_NAME
#define TIN_ARTICLE_NAME
Definition: tin.h:2449
PRODUCT
#define PRODUCT
Definition: version.h:44
txt_help_bug_report
char txt_help_bug_report[LEN]
Definition: init.c:106
NEWSRCTABLE_FILE
#define NEWSRCTABLE_FILE
Definition: tin.h:729
t_cmdlineopts
Definition: tin.h:1466
DEFAULT_FILTER_DAYS
#define DEFAULT_FILTER_DAYS
Definition: tin.h:1304
dead_articles
char dead_articles[PATH_LEN]
Definition: init.c:72
DEFAULT_URL_HANDLER
#define DEFAULT_URL_HANDLER
Definition: tin.h:633
giveup
void giveup(void)
Definition: main.c:1049
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
DEFAULT_MAILER
#define DEFAULT_MAILER
Definition: tin.h:551
postinit_regexp
void postinit_regexp(void)
Definition: init.c:1018
NAME_LEN
#define NAME_LEN
Definition: tin.h:852
t_config::mm_charset
char mm_charset[LEN]
Definition: tinrc.h:99
PCRE_ANCHORED
#define PCRE_ANCHORED
Definition: pcre.h:102
txt_copyright_notice
constext txt_copyright_notice[]
Definition: lang.c:151
default_signature
char default_signature[PATH_LEN]
Definition: init.c:74
NONE
@ NONE
Definition: nntplib.h:171
uubegin_regex
struct regex_cache uubegin_regex
buf
static char buf[16]
Definition: langinfo.c:50
THREAD_PERC_DEFAULT
#define THREAD_PERC_DEFAULT
Definition: tin.h:1136
force_no_post
t_bool force_no_post
Definition: init.c:136
NEWS_REGEX
#define NEWS_REGEX
Definition: tin.h:713
global_config_file
char global_config_file[PATH_LEN]
Definition: init.c:77
ARRAY_SIZE
#define ARRAY_SIZE(array)
Definition: tin.h:2201
t_menu
Definition: tin.h:2005
VERSION
#define VERSION
Definition: version.h:46
batch_mode
t_bool batch_mode
Definition: init.c:126
get_host_name
const char * get_host_name(void)
Definition: header.c:52
INDEX_LOCK
#define INDEX_LOCK
Definition: tin.h:594
overviewfmt_file
char overviewfmt_file[PATH_LEN]
Definition: init.c:103
INDEX_SAVEDIR
#define INDEX_SAVEDIR
Definition: tin.h:622
created_rcdir
t_bool created_rcdir
Definition: init.c:129
word_highlight
t_bool word_highlight
Definition: init.c:154
OVERVIEW_FILE
#define OVERVIEW_FILE
Definition: tin.h:734
userid
char userid[PATH_LEN]
Definition: init.c:107
ART_MARK_DELETED
#define ART_MARK_DELETED
Definition: tin.h:897
my_mkdir
int my_mkdir(char *path, mode_t mode)
Definition: misc.c:708
range_active
t_bool range_active
Definition: init.c:147
novrootdir
char novrootdir[PATH_LEN]
Definition: init.c:114
DEFAULT_PRINTER
#define DEFAULT_PRINTER
Definition: tin.h:537
PCRE_CASELESS
#define PCRE_CASELESS
Definition: pcre.h:98
check_for_new_newsgroups
t_bool check_for_new_newsgroups
Definition: init.c:127
news_regex
struct regex_cache news_regex
mailer
char mailer[PATH_LEN]
Definition: init.c:92
strokes_regex
struct regex_cache strip_re_regex strip_was_regex uubegin_regex uubody_regex verbatim_begin_regex verbatim_end_regex url_regex mail_regex news_regex shar_regex slashes_regex stars_regex underscores_regex strokes_regex
Definition: init.c:184
LEN
#define LEN
Definition: tin.h:854
mail_news_user
char mail_news_user[LEN]
Definition: init.c:90
t_function
enum defined_functions t_function
Definition: keymap.h:373
get_domain_name
const char * get_domain_name(void)
ATTRIBUTES_FILE
#define ATTRIBUTES_FILE
Definition: tin.h:628
nntp_caps
struct t_capabilities nntp_caps
Definition: init.c:516
INDEX_NEWSDIR
#define INDEX_NEWSDIR
Definition: tin.h:621
shar_regex
struct regex_cache shar_regex
read_local_newsgroups_file
t_bool read_local_newsgroups_file
Definition: init.c:149
SUBSCRIPTIONS_FILE
#define SUBSCRIPTIONS_FILE
Definition: tin.h:739
ART_MARK_READ_SELECTED
#define ART_MARK_READ_SELECTED
Definition: tin.h:891
INPUT_HISTORY_FILE
#define INPUT_HISTORY_FILE
Definition: tin.h:724
NNTP_TCP_PORT
#define NNTP_TCP_PORT
Definition: nntplib.h:49
process_id
pid_t process_id
Definition: init.c:124
DEFAULT_VERBATIM_BEGIN_REGEX
#define DEFAULT_VERBATIM_BEGIN_REGEX
Definition: tin.h:686
NEWNEWSRC_FILE
#define NEWNEWSRC_FILE
Definition: tin.h:731
INTERNAL_CMD
#define INTERNAL_CMD
Definition: tin.h:571
QUOTE_EMPTY
#define QUOTE_EMPTY
Definition: tin.h:1214
DEFAULT_GROUP_FORMAT
#define DEFAULT_GROUP_FORMAT
Definition: tin.h:1374
SASL_NONE
@ SASL_NONE
Definition: nntplib.h:174
compile_regex
t_bool compile_regex(const char *regex, struct regex_cache *cache, int options)
Definition: regex.c:111
newsrc
char newsrc[PATH_LEN]
Definition: init.c:96
BUG_REPORT_ADDRESS
#define BUG_REPORT_ADDRESS
Definition: bugrep.h:44
NEWSRC_FILE
#define NEWSRC_FILE
Definition: tin.h:728
lock_file
char lock_file[PATH_LEN]
Definition: init.c:88
ART_MARK_READ
#define ART_MARK_READ
Definition: tin.h:888
bug_nntpserver2
char bug_nntpserver2[PATH_LEN]
Definition: init.c:69
DEFAULT_UNDERSCORES_REGEX
#define DEFAULT_UNDERSCORES_REGEX
Definition: tin.h:663
METAMAIL_CMD
#define METAMAIL_CMD
Definition: tin.h:569
SHOW_FROM_NAME
#define SHOW_FROM_NAME
Definition: tin.h:1143
ART_MARK_KILLED
#define ART_MARK_KILLED
Definition: tin.h:894
read_saved_news
t_bool read_saved_news
Definition: init.c:151
slashes_regex
struct regex_cache slashes_regex
ACTIVE_TIMES_FILE
#define ACTIVE_TIMES_FILE
Definition: tin.h:627
atoi
int atoi(const char *s)
t_config::savedir
char savedir[PATH_LEN]
Definition: tinrc.h:126
RCDIR
#define RCDIR
Definition: tin.h:619
show_description
t_bool show_description
Definition: init.c:152
article_name
char article_name[PATH_LEN]
Definition: init.c:67
DEFAULT_STARS_REGEX
#define DEFAULT_STARS_REGEX
Definition: tin.h:662
UUE_NO
#define UUE_NO
Definition: tin.h:1237
t_config
Definition: tinrc.h:55
URL_REGEX
#define URL_REGEX
Definition: tin.h:703
ENV_VAR_MAILER
#define ENV_VAR_MAILER
Definition: tin.h:2116
DEFAULT_EXTQUOTE_REGEX
#define DEFAULT_EXTQUOTE_REGEX
Definition: tin.h:690
default_organization
char default_organization[PATH_LEN]
Definition: init.c:73
DEFAULT_SLASHES_REGEX
#define DEFAULT_SLASHES_REGEX
Definition: tin.h:661
cmd_line
t_bool cmd_line
Definition: init.c:128
FALSE
#define FALSE
Definition: bool.h:70
init_selfinfo
void init_selfinfo(void)
Definition: init.c:646
STRCPY
#define STRCPY(dst, src)
Definition: tin.h:814
newnewsrc
char newnewsrc[PATH_LEN]
Definition: init.c:93
THREAD_BOTH
#define THREAD_BOTH
Definition: tin.h:1130
postponed_articles_file
char postponed_articles_file[PATH_LEN]
Definition: init.c:99
local_newsrctable_file
char local_newsrctable_file[PATH_LEN]
Definition: init.c:87
DEFAULT_MAILBOX
#define DEFAULT_MAILBOX
Definition: tin.h:554
t_config::mailer_format
char mailer_format[PATH_LEN]
Definition: tinrc.h:71
regex_cache
Definition: tin.h:1917
match_list
t_bool match_list(char *line, constext *pat, constext *const *table, int *dst)
Definition: config.c:1610
joinpath
void joinpath(char *result, size_t result_size, const char *dir, const char *file)
Definition: joinpath.c:50
ACTIVE_MAIL_FILE
#define ACTIVE_MAIL_FILE
Definition: tin.h:625
inewsdir
char inewsdir[PATH_LEN]
Definition: init.c:82
snprintf
#define snprintf
Definition: tin.h:2417
global_attributes_file
char global_attributes_file[PATH_LEN]
Definition: init.c:76
GLOBAL_SEARCH_REPEAT
@ GLOBAL_SEARCH_REPEAT
Definition: keymap.h:216
t_config::strokes_regex
char strokes_regex[LEN]
Definition: tinrc.h:120
index_newsdir
char index_newsdir[PATH_LEN]
Definition: init.c:80
post_postponed_and_exit
t_bool post_postponed_and_exit
Definition: init.c:146
DEFAULT_ISO2ASC
#define DEFAULT_ISO2ASC
Definition: tin.h:869
error_message
void error_message(unsigned int sdelay, const char *fmt,...)
Definition: screen.c:184
hist_pos
int hist_pos[HIST_MAXNUM+1]
Definition: init.c:119
verbatim_begin_regex
struct regex_cache verbatim_begin_regex
filter_file
char filter_file[PATH_LEN]
Definition: init.c:89
read_site_config
static int read_site_config(void)
Definition: init.c:940
ACTIVE_SAVE_FILE
#define ACTIVE_SAVE_FILE
Definition: tin.h:626
t_config::sigfile
char sigfile[PATH_LEN]
Definition: tinrc.h:121
SORT_ARTICLES_BY_DATE_ASCEND
#define SORT_ARTICLES_BY_DATE_ASCEND
Definition: tin.h:1179
ART_MARK_RETURN
#define ART_MARK_RETURN
Definition: tin.h:879
newsrc_active
t_bool newsrc_active
Definition: init.c:143
BOGUS_SHOW
#define BOGUS_SHOW
Definition: tin.h:1200
mail_regex
struct regex_cache mail_regex
S_IRUSR
#define S_IRUSR
Definition: tin.h:2136
UUBEGIN_REGEX
#define UUBEGIN_REGEX
Definition: tin.h:678
txt_error_no_domain_name
constext txt_error_no_domain_name[]
Definition: lang.c:251
HIST_SIZE
#define HIST_SIZE
Definition: extern.h:1562
tnntp.h
bug_addr
char bug_addr[LEN]
Definition: post.c:124
ART_MARK_SELECTED
#define ART_MARK_SELECTED
Definition: tin.h:882
tinrc
struct t_config tinrc
Definition: init.c:191
strip_was_regex
struct regex_cache strip_was_regex
HIST_MAXNUM
#define HIST_MAXNUM
Definition: extern.h:1560
IS_LOCAL_CHARSET
#define IS_LOCAL_CHARSET(c)
Definition: tin.h:776
iso2asc_supported
int iso2asc_supported
Definition: init.c:120
txt_posted_info_file
constext txt_posted_info_file[]
Definition: lang.c:728
local_config_file
char local_config_file[PATH_LEN]
Definition: init.c:84
t_bool
unsigned t_bool
Definition: bool.h:77
DEFAULT_VERBATIM_END_REGEX
#define DEFAULT_VERBATIM_END_REGEX
Definition: tin.h:687
SORT_THREADS_BY_SCORE_DESCEND
#define SORT_THREADS_BY_SCORE_DESCEND
Definition: tin.h:1190
INTERACTIVE_NONE
@ INTERACTIVE_NONE
Definition: tin.h:1157
ACTIVE_FILE
#define ACTIVE_FILE
Definition: tin.h:624
TRUE
#define TRUE
Definition: bool.h:74
homedir
char homedir[PATH_LEN]
Definition: init.c:78
MIME_ENCODING_8BIT
@ MIME_ENCODING_8BIT
Definition: tin.h:978
POST_PROC_NO
#define POST_PROC_NO
Definition: tin.h:1165
active_times_file
char active_times_file[PATH_LEN]
Definition: init.c:66
SHAR_REGEX
#define SHAR_REGEX
Definition: tin.h:683
t_config::mail_mime_encoding
int mail_mime_encoding
Definition: tinrc.h:140
save_active_file
char save_active_file[PATH_LEN]
Definition: init.c:101
S_IRWXU
#define S_IRWXU
Definition: tin.h:2135
get_val
const char * get_val(const char *env, const char *def)
Definition: misc.c:355
t_config::slashes_regex
char slashes_regex[LEN]
Definition: tinrc.h:117
spooldir
char spooldir[PATH_LEN]
Definition: init.c:102
DEFAULT_STROKES_REGEX
#define DEFAULT_STROKES_REGEX
Definition: tin.h:664
DEFAULT_COMMENT
#define DEFAULT_COMMENT
Definition: tin.h:873
cmdline
struct t_cmdlineopts cmdline
Definition: init.c:189
txt_error_passwd_missing
constext txt_error_passwd_missing[]
Definition: lang.c:259
strip_re_regex
struct regex_cache strip_re_regex
NEWSGROUPS_FILE
#define NEWSGROUPS_FILE
Definition: tin.h:740
libdir
static char libdir[PATH_LEN]
Definition: init.c:561
DEFAULT_MAILDIR
#define DEFAULT_MAILDIR
Definition: tin.h:631
MARK_INRANGE
#define MARK_INRANGE
Definition: tin.h:900
novfilename
char novfilename[NAME_LEN+1]
Definition: init.c:113
DEFAULT_SELECT_FORMAT
#define DEFAULT_SELECT_FORMAT
Definition: tin.h:1373
uubody_regex
struct regex_cache uubody_regex
real_umask
static mode_t real_umask
Definition: init.c:562
my_malloc
#define my_malloc(size)
Definition: tin.h:2196