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

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