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

config.c File Reference
#include "tin.h"
#include "version.h"
#include "tcurses.h"
#include "tnntp.h"
Include dependency graph for config.c:

Go to the source code of this file.

Macros

#define DASH_TO_SPACE(mark)   ((char) (mark == '_' ? ' ' : mark))
 
#define SPACE_TO_DASH(mark)   ((char) (mark == ' ' ? '_' : mark))
 

Functions

static t_bool match_item (char *line, const char *pat, char *dst, size_t dstlen)
 
static t_bool rc_update (FILE *fp)
 
static t_bool rc_post_update (FILE *fp)
 
static void write_server_config (void)
 
t_bool read_config_file (char *file, t_bool global_file)
 
void write_config_file (char *file)
 
t_bool match_boolean (char *line, const char *pat, t_bool *dst)
 
t_bool match_integer (char *line, const char *pat, int *dst, int maxval)
 
t_bool match_long (char *line, const char *pat, long *dst)
 
t_bool match_list (char *line, constext *pat, constext *const *table, int *dst)
 
t_bool match_string (char *line, const char *pat, char *dst, size_t dstlen)
 
const char * print_boolean (t_bool value)
 
void quote_dash_to_space (char *str)
 
char * quote_space_to_dash (char *str)
 
char ** ulBuildArgv (char *cmd, int *new_argc)
 
void read_server_config (void)
 

Macro Definition Documentation

◆ DASH_TO_SPACE

#define DASH_TO_SPACE (   mark)    ((char) (mark == '_' ? ' ' : mark))

Definition at line 66 of file config.c.

◆ SPACE_TO_DASH

#define SPACE_TO_DASH (   mark)    ((char) (mark == ' ' ? '_' : mark))

Definition at line 67 of file config.c.

Function Documentation

◆ match_boolean()

t_bool match_boolean ( char *  line,
const char *  pat,
t_bool dst 
)

Definition at line 1512 of file config.c.

References FALSE, STRNCASECMPEQ, and TRUE.

Referenced by rc_post_update(), rc_update(), read_attributes_file(), read_config_file(), and read_site_config().

◆ match_integer()

t_bool match_integer ( char *  line,
const char *  pat,
int *  dst,
int  maxval 
)

◆ match_item()

static t_bool match_item ( char *  line,
const char *  pat,
char *  dst,
size_t  dstlen 
)
static

Definition at line 1662 of file config.c.

References FALSE, my_strdup(), strcasecmp(), and TRUE.

Referenced by match_list().

◆ match_list()

t_bool match_list ( char *  line,
constext pat,
constext *const *  table,
int *  dst 
)

Definition at line 1616 of file config.c.

References FALSE, LEN, match_item(), STRNCMPEQ, table, and TRUE.

Referenced by init_selfinfo(), read_config_file(), and read_site_config().

◆ match_long()

t_bool match_long ( char *  line,
const char *  pat,
long *  dst 
)

Definition at line 1597 of file config.c.

References atol(), FALSE, STRNCMPEQ, and TRUE.

Referenced by read_filter_file().

◆ match_string()

t_bool match_string ( char *  line,
const char *  pat,
char *  dst,
size_t  dstlen 
)

◆ print_boolean()

const char* print_boolean ( t_bool  value)

Definition at line 1689 of file config.c.

References FALSE, and txt_onoff.

Referenced by main(), print_any_option(), write_attributes_file(), and write_config_file().

◆ quote_dash_to_space()

void quote_dash_to_space ( char *  str)

Definition at line 1700 of file config.c.

Referenced by read_attributes_file(), and read_config_file().

◆ quote_space_to_dash()

char* quote_space_to_dash ( char *  str)

◆ rc_post_update()

static t_bool rc_post_update ( FILE *  fp)
static

◆ rc_update()

◆ read_config_file()

t_bool read_config_file ( char *  file,
t_bool  global_file 
)

Definition at line 74 of file config.c.

References _, t_config::abbreviate_groupname, t_config::add_posted_to_filter, t_config::advertising, t_config::alternative_handling, t_cmdlineopts::args, ART_MARK_DELETED, ART_MARK_KILLED, ART_MARK_READ, ART_MARK_READ_SELECTED, ART_MARK_RECENT, ART_MARK_RETURN, ART_MARK_SELECTED, ART_MARK_UNREAD, t_config::art_marked_deleted, t_config::art_marked_inrange, t_config::art_marked_killed, t_config::art_marked_read, t_config::art_marked_read_selected, t_config::art_marked_recent, t_config::art_marked_return, t_config::art_marked_selected, t_config::art_marked_unread, t_config::ask_for_metamail, AUTO_CC_BCC, t_config::auto_cc_bcc, t_config::auto_list_thread, t_config::auto_reconnect, t_config::auto_save, batch_mode, t_config::batch_save, t_config::beginner_level, BOGUS_SHOW, bool_not, buf, t_config::cache_overview_files, t_config::catchup_read_groups, check_score_defaults(), check_upgrade(), cmdline, CMDLINE_USE_COLOR, CONFIG_FILE, t_config::confirm_choice, DASH_TO_SPACE, t_config::date_format, DEFAULT_DATE_FORMAT, t_config::default_filter_kill_case, t_config::default_filter_kill_expire, t_config::default_filter_kill_global, t_config::default_filter_kill_header, t_config::default_filter_select_case, t_config::default_filter_select_expire, t_config::default_filter_select_global, t_config::default_filter_select_header, t_config::default_goto_group, DEFAULT_GROUP_FORMAT, t_config::default_mail_address, t_config::default_move_group, t_config::default_pattern, t_config::default_pipe_command, t_config::default_post_newsgroups, t_config::default_post_subject, t_config::default_range_group, t_config::default_range_select, t_config::default_range_thread, t_config::default_repost_group, t_config::default_save_file, t_config::default_save_mode, t_config::default_search_art, t_config::default_search_author, t_config::default_search_config, t_config::default_search_group, t_config::default_search_subject, DEFAULT_SELECT_FORMAT, t_config::default_select_pattern, t_config::default_shell_command, DEFAULT_THREAD_FORMAT, t_config::draw_arrow, t_config::editor_format, FALSE, t_version::file_version, t_config::filter_days, FILTER_LINES, t_config::force_screen_redraw, FreeAndNull, get_cwd(), t_config::getart_limit, t_config::goto_next_unread, t_config::group_catchup_on_exit, t_config::group_format, t_config::hide_uue, t_config::inews_prog, t_config::info_in_last_line, t_config::interactive_mailer, INTERACTIVE_NONE, t_config::inverse_okay, IS_LOCAL_CHARSET, t_config::keep_dead_articles, t_config::kill_level, KILL_NOTHREAD, LEN, load_newnews_info(), t_config::mail_8bit_header, t_config::mail_address, t_config::mail_mime_encoding, t_config::mail_quote_format, t_config::mailbox_format, t_config::maildir, t_config::mailer_format, t_config::mark_ignore_tags, MARK_INRANGE, t_config::mark_saved_read, match_boolean(), match_integer(), match_list(), match_string(), MAX_ATTR, MAX_BACKCOLOR, MAX_COLOR, MAX_MARK, t_config::metamail_prog, MIME_ENCODING_7BIT, MIME_ENCODING_8BIT, MIME_ENCODING_QP, t_config::mm_charset, t_config::mm_local_charset, t_config::mono_markdash, t_config::mono_markslash, t_config::mono_markstar, t_config::mono_markstroke, my_strncpy(), my_tolower(), t_config::news_headers_to_display, t_config::news_headers_to_not_display, t_config::news_quote_format, NUM_GOTO_NEXT_UNREAD, NUM_TRIM_ARTICLE_BODY, PATH_LEN, t_config::pos_first_unread, t_config::post_8bit_header, t_config::post_mime_encoding, POST_PROC_YES, t_config::post_process_type, t_config::post_process_view, t_config::posted_articles_file, t_config::print_header, t_config::printer, t_config::process_only_unread, t_config::prompt_followupto, t_config::quote_chars, QUOTE_COMPRESS, quote_dash_to_space(), QUOTE_EMPTY, QUOTE_SIGS, t_config::quote_style, RC_IGNORE, rc_post_update(), rc_update(), RC_UPGRADE, t_config::recent_time, t_config::reread_active_file_secs, t_config::savedir, t_config::score_kill, t_config::score_limit_kill, t_config::score_limit_select, t_config::score_select, t_config::scroll_lines, t_config::select_format, t_config::show_author, show_description, t_config::show_description, SHOW_FROM_BOTH, t_config::show_only_unread_arts, t_config::show_only_unread_groups, t_config::show_signatures, t_config::sigdashes, t_config::sigfile, t_config::signature_repost, t_config::slashes_regex, t_config::sort_article_type, SORT_ARTICLES_BY_LINES_ASCEND, SORT_THREADS_BY_LAST_POSTING_DATE_ASCEND, t_config::sort_threads_type, t_config::spamtrap_warning_addresses, t_config::stars_regex, t_config::start_editor_offset, t_version::state, strcasecmp(), STRCPY, t_config::strip_blanks, t_config::strip_bogus, t_config::strip_newsrc, t_config::strip_re_regex, t_config::strip_was_regex, t_config::strokes_regex, t_config::tex2iso_conv, t_config::thread_articles, t_config::thread_catchup_on_exit, t_config::thread_format, THREAD_MAX, t_config::thread_perc, t_config::thread_score, THREAD_SCORE_WEIGHT, TIN_EDITOR_FMT_ON, tinrc, TINRC_CONFIRM_MAX, TINRC_VERSION, t_config::trim_article_body, TRUE, txt_confirm_choices, txt_global, txt_mailbox_formats, txt_mime_7bit_charsets, txt_mime_encodings, txt_reading_config_file, t_config::underscores_regex, t_config::unlink_article, upgrade_prompt_quit(), t_config::url_handler, t_config::url_highlight, t_config::use_mouse, UUE_ALL, t_config::verbatim_begin_regex, t_config::verbatim_end_regex, t_config::verbatim_handling, verbose, wait_message(), t_config::wildcard, t_config::word_h_display_marks, word_highlight, t_config::word_highlight, t_config::wrap_column, t_config::wrap_on_next_unread, and t_config::xpost_quote_format.

Referenced by main().

◆ read_server_config()

◆ ulBuildArgv()

char** ulBuildArgv ( char *  cmd,
int *  new_argc 
)

Definition at line 1745 of file config.c.

References buf, my_calloc, my_realloc, and my_strdup().

Referenced by build_news_headers_array(), and build_nglist().

◆ write_config_file()

void write_config_file ( char *  file)

Definition at line 913 of file config.c.

References _, t_config::abbreviate_groupname, t_config::add_posted_to_filter, t_config::advertising, t_config::alternative_handling, t_config::art_marked_deleted, t_config::art_marked_inrange, t_config::art_marked_killed, t_config::art_marked_read, t_config::art_marked_read_selected, t_config::art_marked_recent, t_config::art_marked_return, t_config::art_marked_selected, t_config::art_marked_unread, t_config::ask_for_metamail, t_config::auto_cc_bcc, t_config::auto_list_thread, t_config::auto_reconnect, t_config::auto_save, t_config::batch_save, t_config::beginner_level, t_config::cache_overview_files, t_config::catchup_read_groups, CONFIG_FILE, t_config::confirm_choice, t_config::date_format, t_config::default_filter_kill_case, t_config::default_filter_kill_expire, t_config::default_filter_kill_global, t_config::default_filter_kill_header, t_config::default_filter_select_case, t_config::default_filter_select_expire, t_config::default_filter_select_global, t_config::default_filter_select_header, t_config::default_goto_group, t_config::default_mail_address, t_config::default_move_group, t_config::default_pattern, t_config::default_pipe_command, t_config::default_post_newsgroups, t_config::default_post_subject, t_config::default_range_group, t_config::default_range_select, t_config::default_range_thread, t_config::default_repost_group, t_config::default_save_file, t_config::default_save_mode, t_config::default_search_art, t_config::default_search_author, t_config::default_search_config, t_config::default_search_group, t_config::default_search_subject, t_config::default_select_pattern, t_config::default_shell_command, t_config::draw_arrow, t_config::editor_format, error_message(), file_size(), t_config::filter_days, find_newnews_index(), t_config::force_screen_redraw, get_tmpfilename(), t_config::getart_limit, t_config::goto_next_unread, t_config::group_catchup_on_exit, t_config::group_format, t_config::hide_uue, t_config::inews_prog, t_config::info_in_last_line, t_config::interactive_mailer, t_config::inverse_okay, t_config::keep_dead_articles, t_config::kill_level, t_config::mail_8bit_header, t_config::mail_address, t_config::mail_mime_encoding, t_config::mail_quote_format, t_config::mailbox_format, t_config::maildir, t_config::mailer_format, t_config::mark_ignore_tags, t_config::mark_saved_read, t_config::metamail_prog, t_config::mm_charset, t_config::mm_local_charset, t_config::mono_markdash, t_config::mono_markslash, t_config::mono_markstar, t_config::mono_markstroke, my_strftime(), newnews, t_config::news_headers_to_display, t_config::news_headers_to_not_display, t_config::news_quote_format, nntp_server, no_write, num_newnews, t_config::pos_first_unread, t_config::post_8bit_header, post_article_and_exit, t_config::post_mime_encoding, post_postponed_and_exit, t_config::post_process_type, t_config::post_process_view, t_config::posted_articles_file, print_boolean(), t_config::print_header, t_config::printer, t_config::process_only_unread, PRODUCT, t_config::prompt_followupto, t_config::quote_chars, quote_space_to_dash(), t_config::quote_style, t_config::recent_time, RELEASEDATE, RELEASENAME, rename_file(), t_config::reread_active_file_secs, S_IRUSR, S_IWUSR, t_config::savedir, t_config::score_kill, t_config::score_limit_kill, t_config::score_limit_select, t_config::score_select, t_config::scroll_lines, t_config::select_format, t_config::show_author, t_config::show_description, t_config::show_only_unread_arts, t_config::show_only_unread_groups, t_config::show_signatures, t_config::sigdashes, t_config::sigfile, t_config::signature_repost, t_config::slashes_regex, t_config::sort_article_type, t_config::sort_threads_type, SPACE_TO_DASH, t_config::spamtrap_warning_addresses, t_config::stars_regex, t_config::start_editor_offset, t_config::strip_blanks, t_config::strip_bogus, t_config::strip_newsrc, t_config::strip_re_regex, t_config::strip_was_regex, t_config::strokes_regex, t_config::tex2iso_conv, t_config::thread_articles, t_config::thread_catchup_on_exit, t_config::thread_format, t_config::thread_perc, t_config::thread_score, tin_progname, tinrc, opttxt::tinrc, TINRC_VERSION, t_config::trim_article_body, txt_abbreviate_groupname, txt_add_posted_to_filter, txt_advertising, txt_alternative_handling, txt_art_marked_deleted, txt_art_marked_inrange, txt_art_marked_killed, txt_art_marked_read, txt_art_marked_read_selected, txt_art_marked_recent, txt_art_marked_return, txt_art_marked_selected, txt_art_marked_unread, txt_ask_for_metamail, txt_auto_cc_bcc, txt_auto_list_thread, txt_auto_reconnect, txt_auto_save, txt_batch_save, txt_beginner_level, txt_cache_overview_files, txt_catchup_read_groups, txt_confirm_choice, txt_date_format, txt_draw_arrow, txt_editor_format, txt_filesystem_full, txt_filesystem_full_backup, txt_filter_days, txt_force_screen_redraw, txt_getart_limit, txt_goto_next_unread, txt_group_catchup_on_exit, txt_group_format, txt_hide_uue, txt_inews_prog, txt_interactive_mailer, txt_inverse_okay, txt_keep_dead_articles, txt_kill_level, txt_mail_8bit_header, txt_mail_address, txt_mailbox_format, txt_mailbox_formats, txt_maildir, txt_mailer_format, txt_mark_ignore_tags, txt_mark_saved_read, txt_metamail_prog, txt_mime_encodings, txt_mm_charset, txt_mono_markdash, txt_mono_markslash, txt_mono_markstar, txt_mono_markstroke, txt_news_headers_to_display, txt_news_headers_to_not_display, txt_news_quote_format, txt_pos_first_unread, txt_post_8bit_header, txt_post_mime_encoding, txt_post_process_type, txt_post_process_view, txt_posted_articles_file, txt_print_header, txt_printer, txt_process_only_unread, txt_prompt_followupto, txt_quote_chars, txt_quote_style, txt_recent_time, txt_reread_active_file_secs, txt_savedir, txt_saving, txt_score_kill, txt_score_limit_kill, txt_score_limit_select, txt_score_select, txt_scroll_lines, txt_select_format, txt_show_author, txt_show_description, txt_show_only_unread_arts, txt_show_only_unread_groups, txt_show_signatures, txt_sigdashes, txt_sigfile, txt_signature_repost, txt_slashes_regex, txt_sort_article_type, txt_sort_threads_type, txt_spamtrap_warning_addresses, txt_stars_regex, txt_start_editor_offset, txt_strip_blanks, txt_strip_bogus, txt_strip_newsrc, txt_strip_re_regex, txt_strip_was_regex, txt_strokes_regex, txt_tex2iso_conv, txt_thread_articles, txt_thread_format, txt_thread_perc, txt_thread_score, txt_tinrc_defaults, txt_tinrc_filter, txt_tinrc_header, txt_tinrc_info_in_last_line, txt_tinrc_newnews, txt_trim_article_body, txt_underscores_regex, txt_unlink_article, txt_url_handler, txt_url_highlight, txt_use_mouse, txt_verbatim_begin_regex, txt_verbatim_end_regex, txt_verbatim_handling, txt_wildcard, txt_word_h_display_marks, txt_word_highlight, txt_wrap_column, txt_wrap_on_next_unread, t_config::underscores_regex, t_config::unlink_article, t_config::url_handler, t_config::url_highlight, t_config::use_mouse, t_config::verbatim_begin_regex, t_config::verbatim_end_regex, t_config::verbatim_handling, VERSION, wait_message(), t_config::wildcard, t_config::word_h_display_marks, t_config::word_highlight, t_config::wrap_column, t_config::wrap_on_next_unread, write_server_config(), and t_config::xpost_quote_format.

Referenced by config_page(), main(), select_done(), and select_quit().

◆ write_server_config()