tin
2.6.1
About: TIN is a threaded NNTP and spool based UseNet newsreader.
![]() ![]() |
Go to the source code of this file.
Macros | |
#define | SortBy(func) tin_sort(arts, (size_t) top_art, sizeof(struct t_article), func); |
Functions | |
static FILE * | open_art_header (char *groupname, t_artnum art, t_artnum *next) |
static FILE * | open_xover_fp (struct t_group *group, const char *mode, t_artnum min, t_artnum max, t_bool local) |
static char * | find_nov_file (struct t_group *group, int mode) |
static char * | print_date (time_t secs) |
static char * | print_from (struct t_group *group, struct t_article *article, int charset) |
static int | artnum_comp (t_comptype p1, t_comptype p2) |
static int | base_comp (t_comptype p1, t_comptype p2) |
static int | date_comp_asc (t_comptype p1, t_comptype p2) |
static int | date_comp_desc (t_comptype p1, t_comptype p2) |
static int | from_comp_asc (t_comptype p1, t_comptype p2) |
static int | from_comp_desc (t_comptype p1, t_comptype p2) |
static int | global_look_for_multipart_info (int aindex, MultiPartInfo *setme, char start, char stop, int *offset) |
static int | last_date_comp_base_asc (t_comptype p1, t_comptype p2) |
static int | last_date_comp_base_desc (t_comptype p1, t_comptype p2) |
static int | lines_comp_asc (t_comptype p1, t_comptype p2) |
static int | lines_comp_desc (t_comptype p1, t_comptype p2) |
static int | read_art_headers (struct t_group *group, int total, t_artnum top) |
static int | read_overview (struct t_group *group, t_artnum min, t_artnum max, t_artnum *top, t_bool local, t_bool *rebuild_cache) |
static int | score_comp_asc (t_comptype p1, t_comptype p2) |
static int | score_comp_desc (t_comptype p1, t_comptype p2) |
static int | score_comp_base (t_comptype p1, t_comptype p2) |
static int | subj_comp_asc (t_comptype p1, t_comptype p2) |
static int | subj_comp_desc (t_comptype p1, t_comptype p2) |
static int | valid_artnum (t_artnum art) |
static t_artnum | find_first_unread (struct t_group *group) |
static t_artnum | setup_hard_base (struct t_group *group) |
static t_bool | parse_headers (FILE *fp, struct t_article *h) |
static t_compfunc | eval_sort_arts_func (unsigned int sort_art_type) |
static time_t | get_last_posting_date (long n) |
static void | sort_base (unsigned int sort_threads_type) |
static void | thread_by_multipart (void) |
static void | thread_by_percentage (unsigned int percentage) |
static void | thread_by_subject (void) |
static void | write_overview (struct t_group *group) |
void | show_art_msg (const char *group) |
void | find_base (struct t_group *group) |
t_bool | index_group (struct t_group *group) |
int | global_get_multipart_info (int aindex, MultiPartInfo *setme) |
t_bool | global_look_for_multipart (int aindex, char start, char stop) |
int | global_get_multiparts (int aindex, MultiPartInfo **malloc_and_setme_info, t_bool tagging) |
void | make_threads (struct t_group *group, t_bool rethread) |
void | sort_arts (unsigned int sort_art_type) |
void | do_update (t_bool catchup) |
void | set_article (struct t_article *art) |
int | find_artnum (t_artnum art) |
Variables | |
int | top_art = 0 |
|
static |
Definition at line 2837 of file art.c.
References t_article::artnum.
Referenced by eval_sort_arts_func(), and write_overview().
|
static |
Definition at line 172 of file art.c.
Referenced by setup_hard_base().
|
static |
Definition at line 2940 of file art.c.
References t_article::date.
Referenced by eval_sort_arts_func().
|
static |
Definition at line 2964 of file art.c.
References t_article::date.
Referenced by eval_sort_arts_func().
void do_update | ( | t_bool | catchup | ) |
Definition at line 2779 of file art.c.
References _, active, art, art_mark(), ART_READ, arts, t_group::bogus, catchup, t_menu::curr, for_each_art, FreeAndNull, index_group(), t_menu::max, my_flush, my_group, my_printf, t_group::name, PLURAL, selmenu, t_group::subscribed, txt_catchup, txt_catchup_update_info, txt_caughtup, txt_group, txt_updated, txt_updating, verbose, and wait_message().
Referenced by update_index_files().
|
static |
Definition at line 1327 of file art.c.
References artnum_comp(), date_comp_asc(), date_comp_desc(), from_comp_asc(), from_comp_desc(), lines_comp_asc(), lines_comp_desc(), score_comp_asc(), score_comp_desc(), SORT_ARTICLES_BY_DATE_ASCEND, SORT_ARTICLES_BY_DATE_DESCEND, SORT_ARTICLES_BY_FROM_ASCEND, SORT_ARTICLES_BY_FROM_DESCEND, SORT_ARTICLES_BY_LINES_ASCEND, SORT_ARTICLES_BY_LINES_DESCEND, SORT_ARTICLES_BY_NOTHING, SORT_ARTICLES_BY_SCORE_ASCEND, SORT_ARTICLES_BY_SCORE_DESCEND, SORT_ARTICLES_BY_SUBJ_ASCEND, SORT_ARTICLES_BY_SUBJ_DESCEND, subj_comp_asc(), and subj_comp_desc().
Referenced by score_comp_base(), and sort_arts().
int find_artnum | ( | t_artnum | art | ) |
Definition at line 3223 of file art.c.
References art, t_article::artnum, arts, and for_each_art.
Referenced by find_new_pos(), show_page(), and thread_page().
void find_base | ( | struct t_group * | group | ) |
Definition at line 123 of file art.c.
References ART_EXPIRED, ART_READ, arts, t_group::attribute, base, debug, DEBUG_FILTER, expand_base(), for_each_art, grpmenu, t_config::kill_level, KILL_NOTHREAD, t_menu::max, max_base, t_attribute::show_only_unread_arts, sort_base(), SORT_THREADS_BY_NOTHING, t_attribute::sort_threads_type, t_article::thread, and tinrc.
Referenced by config_page(), do_auto_select_arts(), group_page(), make_threads(), toggle_read_unread(), and undo_auto_select_arts().
Definition at line 601 of file art.c.
References end, NBITS, t_group::newsrc, t_newsrc::xbitlen, t_newsrc::xbitmap, and t_newsrc::xmin.
Referenced by index_group(), and setup_hard_base().
|
static |
Definition at line 2597 of file art.c.
References buf, t_config::cache_overview_files, FALSE, GROUP_TYPE_MAIL, GROUP_TYPE_NEWS, GROUP_TYPE_SAVE, hash_groupname(), index_maildir, index_newsdir, index_savedir, joinpath(), local_newsgroups_file, make_base_group_path(), my_mkdir(), my_strdup(), my_strncpy(), t_group::name, NEWSGROUPS_FILE, nntp_server, novfilename, novrootdir, PATH_LEN, R_OK, read_news_via_nntp, S_IRWXU, S_ISDIR, snprintf, str_lwr(), tinrc, TRUE, t_group::type, and W_OK.
Referenced by open_xover_fp().
|
static |
Definition at line 2899 of file art.c.
References t_article::date, t_article::from, and strcasecmp().
Referenced by eval_sort_arts_func().
|
static |
Definition at line 2915 of file art.c.
References t_article::date, t_article::from, and strcasecmp().
Referenced by eval_sort_arts_func().
|
static |
Definition at line 3136 of file art.c.
References arts, t_article::date, and t_article::thread.
Referenced by last_date_comp_base_asc(), and last_date_comp_base_desc().
int global_get_multipart_info | ( | int | aindex, |
MultiPartInfo * | setme | ||
) |
Definition at line 976 of file art.c.
References global_look_for_multipart_info().
Referenced by global_get_multiparts(), and stat_thread().
int global_get_multiparts | ( | int | aindex, |
MultiPartInfo ** | malloc_and_setme_info, | ||
t_bool | tagging | ||
) |
Definition at line 1089 of file art.c.
References arts, assert, FALSE, global_get_multipart_info(), t_article::multipart_subj, my_malloc, MultiPartInfo::part_number, MultiPartInfo::subject, MultiPartInfo::subject_compare_len, top_art, and MultiPartInfo::total.
Referenced by tag_multipart(), and thread_by_multipart().
t_bool global_look_for_multipart | ( | int | aindex, |
char | start, | ||
char | stop | ||
) |
Definition at line 1049 of file art.c.
References arts, FALSE, t_article::multipart_subj, strtol(), and TRUE.
Referenced by tag_multipart(), and thread_by_multipart().
|
static |
Definition at line 999 of file art.c.
References arts, MultiPartInfo::arts_index, assert, offset, MultiPartInfo::part_number, strtol(), t_article::subject, MultiPartInfo::subject, MultiPartInfo::subject_compare_len, top_art, and MultiPartInfo::total.
Referenced by global_get_multipart_info().
Definition at line 396 of file art.c.
References _, t_cmdlineopts::args, ART_EXPIRED, art_mark(), ART_READ, ART_UNTHREADED, arts, t_group::attribute, base, batch_mode, BegStopWatch, build_references(), t_config::cache_overview_files, cArt, clear_message(), cmdline, CMDLINE_GETART_LIMIT, debug, DEBUG_NEWSRC, EndStopWatch, FALSE, filter_articles(), find_first_unread(), for_each_art, free_art_array(), free_msgids(), t_cmdlineopts::getart_limit, t_config::getart_limit, GROUP_TYPE_NEWS, grpmenu, hash_reclaim(), t_article::keep_in_base, make_threads(), t_menu::max, t_group::name, nntp_caps, t_capabilities::over_cmd, parse_unread_arts(), PrintStopWatch, read_art_headers(), read_overview(), setup_hard_base(), show_art_msg(), t_attribute::show_only_unread_arts, signal_context, T_ARTNUM_CONST, t_article::thread, tinrc, top_art, TRUE, t_group::type, valid_artnum(), verbose, wait_message(), write_overview(), and t_group::xmin.
Referenced by check_start_save_any_news(), do_update(), and group_page().
|
static |
Definition at line 3118 of file art.c.
References get_last_posting_date().
Referenced by sort_base().
|
static |
Definition at line 3100 of file art.c.
References get_last_posting_date().
Referenced by sort_base().
|
static |
Definition at line 3030 of file art.c.
References t_article::date, and t_article::line_count.
Referenced by eval_sort_arts_func().
|
static |
Definition at line 3048 of file art.c.
References t_article::date, and t_article::line_count.
Referenced by eval_sort_arts_func().
Definition at line 1229 of file art.c.
References _, ART_NORMAL, ART_UNTHREADED, t_msgid::article, arts, assert, t_group::attribute, batch_mode, clear_art_ptrs(), cmd_line, collate_subjects(), debug, DEBUG_MISC, DEBUG_REFS, error_message(), find_base(), for_each_art, info_message(), my_flush, my_fprintf, t_article::prev, t_article::refptr, t_attribute::sort_article_type, sort_arts(), T_ARTNUM_PFMT, t_article::thread, t_attribute::thread_articles, t_config::thread_articles, THREAD_BOTH, thread_by_multipart(), thread_by_percentage(), thread_by_reference(), thread_by_subject(), THREAD_MULTI, THREAD_NONE, THREAD_PERC, t_attribute::thread_perc, THREAD_REFS, THREAD_SUBJ, tinrc, txt_threading_arts, and txt_unthreading_arts.
Referenced by config_page(), group_page(), index_group(), show_page(), and thread_page().
Definition at line 624 of file art.c.
References art, atoartnum, t_capabilities::broken_listgroup, buf, CURR_GROUP, ERR_NCING, GROUP_TYPE_NEWS, nntp_caps, NNTP_STRLEN, OK_GROUP, OK_HEAD, OK_NOTEXT, read_news_via_nntp, snprintf, T_ARTNUM_PFMT, and TRUE.
Referenced by read_art_headers().
|
static |
Definition at line 3304 of file art.c.
References _, error_message(), find_nov_file(), GROUP_TYPE_NEWS, MAX, nntp_caps, NNTP_STRLEN, OK_XOVER, t_capabilities::over_cmd, R_OK, snprintf, T_ARTNUM_PFMT, txt_cannot_open, t_group::type, and W_OK.
Referenced by read_overview(), and write_overview().
Definition at line 1408 of file art.c.
References atoi(), buffer_to_ascii(), convert_to_printable(), t_article::date, debug, DEBUG_FILTER, eat_re(), eat_tab(), FALSE, t_article::from, t_article::gnksa_code, hash_str(), HEADER_LEN, IS_LOCAL_CHARSET, t_article::line_count, t_article::msgid, my_strdup(), my_toupper(), t_article::name, parse_from(), parse_header(), parsedate(), t_article::path, t_article::refs, rfc1522_decode(), t_article::subject, tin_errno, tin_fgets(), TRUE, unfold_header(), and t_article::xref.
Referenced by read_art_headers().
|
static |
Definition at line 3243 of file art.c.
References t_article::date, and snprintf.
Referenced by write_overview().
Definition at line 3267 of file art.c.
References t_group::attribute, FALSE, t_article::from, t_config::mm_local_charset, my_strdup(), t_article::name, PATH_LEN, t_attribute::post_8bit_header, rfc1522_encode(), snprintf, strpbrk(), tinrc, and unfold_header().
Referenced by write_overview().
Definition at line 723 of file art.c.
References _, art, ART_EXPIRED, ART_NORMAL, ART_NOTKILLED, ART_UNREAD, ART_UNTHREADED, t_article::artnum, arts, base, buf, cCOLS, t_article::date, debug, DEBUG_FILTER, DEBUG_MISC, errno, error_message(), expand_art(), FALSE, FreeAndNull, get_cwd(), GROUP_TYPE_NEWS, grpmenu, t_article::killed, LEN, make_base_group_path(), t_menu::max, max_art, MIN, MODULO_COUNT_NUM, t_group::name, open_art_header(), parse_headers(), PATH_LEN, t_article::prev, read_news_via_nntp, t_article::selected, set_article(), show_progress(), snprintf, t_group::spooldir, t_article::status, strerror, strwidth(), T_ARTNUM_CONST, T_ARTNUM_PFMT, t_article::tagged, t_article::thread, tin_errno, TIN_FCLOSE, top_art, txt_group, t_group::type, and valid_artnum().
Referenced by index_group().
|
static |
Definition at line 1829 of file art.c.
References _, art, t_article::artnum, arts, atoartnum, atoi(), buf, buffer_to_ascii(), CAPABILITIES, cCOLS, cNo, convert_to_printable(), cRedraw, debug, DEBUG_NNTP, eat_re(), eat_tab(), expand_art(), expensive_over_parse, FAKE_NNTP_FP, FALSE, filter_on_path(), fmt_string(), free_art_array(), free_msgids(), FreeIfNeeded, GROUP_TYPE_NEWS, handle_resize(), hash_str(), t_capabilities::hdr, t_capabilities::hdr_cmd, HEADER_LEN, t_capabilities::headers_range, IS_LOCAL_CHARSET, t_capabilities::list_headers, MAX, max_art, MIN, MODULO_COUNT_NUM, my_realloc, my_strdup(), t_group::name, t_overview_fmt::name, name, need_resize, nntp_caps, ofmt, OK_HDR, OK_HEAD, open_xover_fp(), t_capabilities::over_cmd, OVER_T_ERROR, OVER_T_FSTRING, OVER_T_INT, OVER_T_STRING, parse_from(), parse_header(), parsedate(), read_news_via_nntp, read_saved_news, rfc1522_decode(), set_article(), show_progress(), snprintf, strcasecmp(), strncasecmp(), strstr(), strwidth(), T_ARTNUM_CONST, T_ARTNUM_PFMT, tin_errno, TIN_FCLOSE, tin_fgets(), tin_strtok(), top_art, TRUE, txt_cannot_filter_on_path, txt_group, t_capabilities::type, t_group::type, t_overview_fmt::type, verbose, wait_message(), t_group::xmax, and xref_supported.
Referenced by index_group().
|
static |
Definition at line 2991 of file art.c.
References t_article::date, and t_article::score.
Referenced by eval_sort_arts_func().
|
static |
Definition at line 3069 of file art.c.
References arts, CURR_GROUP, eval_sort_arts_func(), get_score_of_thread(), and SORT_THREADS_BY_SCORE_ASCEND.
Referenced by sort_base().
|
static |
Definition at line 3009 of file art.c.
References t_article::date, and t_article::score.
Referenced by eval_sort_arts_func().
void set_article | ( | struct t_article * | art | ) |
Definition at line 3152 of file art.c.
References art, ART_EXPIRED, ART_NORMAL, ART_NOTKILLED, ART_UNREAD, and FALSE.
Referenced by quick_filter_select_posted_art(), read_art_headers(), and read_overview().
Definition at line 207 of file art.c.
References _, t_cmdlineopts::args, art, atoartnum, base, base_comp(), t_capabilities::broken_listgroup, buf, CAPABILITIES, CLOSEDIR, cmdline, CMDLINE_GETART_LIMIT, debug, DEBUG_NNTP, DIR_BUF, error_message(), expand_base(), expand_bitmap(), FALSE, find_first_unread(), t_cmdlineopts::getart_limit, t_config::getart_limit, GROUP_TYPE_NEWS, grpmenu, make_base_group_path(), MAX, t_menu::max, max_base, MIN, t_group::name, nntp_caps, NNTP_STRLEN, OK_GROUP, PATH_LEN, perror_message(), R_OK, read_news_via_nntp, read_saved_news, t_capabilities::reader, snprintf, t_group::spooldir, T_ARTNUM_PFMT, T_ARTNUM_SFMT, tin_errno, tin_fgets(), tin_sort, tinrc, TRUE, txt_cannot_open, txt_not_exist, t_capabilities::type, t_group::type, verbose, t_group::xmax, and t_group::xmin.
Referenced by index_group().
void show_art_msg | ( | const char * | group | ) |
Definition at line 110 of file art.c.
References _, cCOLS, strwidth(), txt_group, and wait_message().
Referenced by handle_resize(), and index_group().
void sort_arts | ( | unsigned int | sort_art_type | ) |
Definition at line 1372 of file art.c.
References eval_sort_arts_func(), and SortBy.
Referenced by make_threads().
|
static |
Definition at line 1383 of file art.c.
References base, grpmenu, last_date_comp_base_asc(), last_date_comp_base_desc(), t_menu::max, score_comp_base(), SORT_THREADS_BY_LAST_POSTING_DATE_ASCEND, SORT_THREADS_BY_LAST_POSTING_DATE_DESCEND, SORT_THREADS_BY_SCORE_ASCEND, SORT_THREADS_BY_SCORE_DESCEND, and tin_sort.
Referenced by find_base().
|
static |
Definition at line 2864 of file art.c.
References t_article::date, strcasecmp(), and t_article::subject.
Referenced by eval_sort_arts_func(), and thread_by_percentage().
|
static |
Definition at line 2880 of file art.c.
References t_article::date, strcasecmp(), and t_article::subject.
Referenced by eval_sort_arts_func().
|
static |
Definition at line 1165 of file art.c.
References _, arts, MultiPartInfo::arts_index, FALSE, for_each_art, FreeAndNull, global_get_multiparts(), global_look_for_multipart(), IGNORE_ART_THREAD, MODULO_COUNT_NUM, t_article::multipart_subj, t_article::prev, show_progress(), t_article::thread, and top_art.
Referenced by make_threads().
|
static |
Definition at line 904 of file art.c.
References ART_NORMAL, arts, base, for_each_art, t_article::prev, SortBy, subj_comp_asc(), t_article::subject, and t_article::thread.
Referenced by make_threads().
|
static |
Definition at line 851 of file art.c.
References t_hashnode::aptr, ART_NORMAL, t_msgid::article, arts, t_msgid::child, for_each_art, IGNORE_ART_THREAD, t_msgid::parent, t_article::prev, t_article::refptr, t_msgid::sibling, t_article::subject, t_article::thread, and t_msgid::txt.
Referenced by make_threads().
|
static |
Definition at line 3186 of file art.c.
References art, t_article::artnum, arts, forever, t_article::prev, and top_art.
Referenced by index_group(), and read_art_headers().
|
static |
Definition at line 2446 of file art.c.
References _, t_cmdlineopts::args, ART_EXPIRED, t_article::artnum, artnum_comp(), arts, t_group::attribute, batch_mode, BlankIfNull, t_config::cache_overview_files, cmdline, CMDLINE_GETART_LIMIT, t_article::date, FALSE, for_each_art, FreeIfNeeded, t_cmdlineopts::getart_limit, t_config::getart_limit, t_article::line_count, t_config::mm_local_charset, MODULO_COUNT_NUM, t_article::msgid, my_strdup(), t_group::name, no_write, open_xover_fp(), t_article::path, t_attribute::post_8bit_header, print_date(), print_from(), t_article::refs, rfc1522_encode(), S_IRGRP, S_IROTH, S_IRUSR, S_IWUSR, show_progress(), t_attribute::sort_article_type, SORT_ARTICLES_BY_NOTHING, SortBy, strcasecmp(), t_article::subject, T_ARTNUM_CONST, T_ARTNUM_PFMT, t_article::thread, tinrc, top_art, unfold_header(), verbose, wait_message(), t_group::xmin, and t_article::xref.
Referenced by index_group().
int top_art = 0 |
Definition at line 60 of file art.c.
Referenced by add_msgid(), build_references(), filter_articles(), global_get_multiparts(), global_look_for_multipart_info(), index_group(), read_art_headers(), read_overview(), search_group(), thread_by_multipart(), valid_artnum(), and write_overview().