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)  

art.c File Reference
#include "tin.h"
#include "tcurses.h"
#include "newsrc.h"
#include "stpwatch.h"
Include dependency graph for art.c:

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
 

Macro Definition Documentation

◆ SortBy

#define SortBy (   func)    tin_sort(arts, (size_t) top_art, sizeof(struct t_article), func);

Definition at line 58 of file art.c.

Function Documentation

◆ artnum_comp()

static int artnum_comp ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2837 of file art.c.

References t_article::artnum.

Referenced by eval_sort_arts_func(), and write_overview().

◆ base_comp()

static int base_comp ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 172 of file art.c.

Referenced by setup_hard_base().

◆ date_comp_asc()

static int date_comp_asc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2940 of file art.c.

References t_article::date.

Referenced by eval_sort_arts_func().

◆ date_comp_desc()

static int date_comp_desc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2964 of file art.c.

References t_article::date.

Referenced by eval_sort_arts_func().

◆ do_update()

◆ eval_sort_arts_func()

◆ find_artnum()

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().

◆ find_base()

◆ find_first_unread()

static t_artnum find_first_unread ( struct t_group group)
static

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().

◆ find_nov_file()

◆ from_comp_asc()

static int from_comp_asc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2899 of file art.c.

References t_article::date, t_article::from, and strcasecmp().

Referenced by eval_sort_arts_func().

◆ from_comp_desc()

static int from_comp_desc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2915 of file art.c.

References t_article::date, t_article::from, and strcasecmp().

Referenced by eval_sort_arts_func().

◆ get_last_posting_date()

static time_t get_last_posting_date ( long  n)
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().

◆ global_get_multipart_info()

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().

◆ global_get_multiparts()

int global_get_multiparts ( int  aindex,
MultiPartInfo **  malloc_and_setme_info,
t_bool  tagging 
)

◆ global_look_for_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().

◆ global_look_for_multipart_info()

static int global_look_for_multipart_info ( int  aindex,
MultiPartInfo setme,
char  start,
char  stop,
int *  offset 
)
static

◆ index_group()

◆ last_date_comp_base_asc()

static int last_date_comp_base_asc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 3118 of file art.c.

References get_last_posting_date().

Referenced by sort_base().

◆ last_date_comp_base_desc()

static int last_date_comp_base_desc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 3100 of file art.c.

References get_last_posting_date().

Referenced by sort_base().

◆ lines_comp_asc()

static int lines_comp_asc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 3030 of file art.c.

References t_article::date, and t_article::line_count.

Referenced by eval_sort_arts_func().

◆ lines_comp_desc()

static int lines_comp_desc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 3048 of file art.c.

References t_article::date, and t_article::line_count.

Referenced by eval_sort_arts_func().

◆ make_threads()

◆ open_art_header()

static FILE * open_art_header ( char *  groupname,
t_artnum  art,
t_artnum next 
)
static

◆ open_xover_fp()

static FILE * open_xover_fp ( struct t_group group,
const char *  mode,
t_artnum  min,
t_artnum  max,
t_bool  local 
)
static

◆ parse_headers()

◆ print_date()

static char * print_date ( time_t  secs)
static

Definition at line 3243 of file art.c.

References t_article::date, and snprintf.

Referenced by write_overview().

◆ print_from()

static char * print_from ( struct t_group group,
struct t_article article,
int  charset 
)
static

◆ read_art_headers()

◆ read_overview()

◆ score_comp_asc()

static int score_comp_asc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2991 of file art.c.

References t_article::date, and t_article::score.

Referenced by eval_sort_arts_func().

◆ score_comp_base()

static int score_comp_base ( t_comptype  p1,
t_comptype  p2 
)
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().

◆ score_comp_desc()

static int score_comp_desc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 3009 of file art.c.

References t_article::date, and t_article::score.

Referenced by eval_sort_arts_func().

◆ set_article()

void set_article ( struct t_article art)

◆ setup_hard_base()

◆ show_art_msg()

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().

◆ sort_arts()

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().

◆ sort_base()

◆ subj_comp_asc()

static int subj_comp_asc ( t_comptype  p1,
t_comptype  p2 
)
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().

◆ subj_comp_desc()

static int subj_comp_desc ( t_comptype  p1,
t_comptype  p2 
)
static

Definition at line 2880 of file art.c.

References t_article::date, strcasecmp(), and t_article::subject.

Referenced by eval_sort_arts_func().

◆ thread_by_multipart()

◆ thread_by_percentage()

static void thread_by_percentage ( unsigned int  percentage)
static

◆ thread_by_subject()

◆ valid_artnum()

static int valid_artnum ( t_artnum  art)
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().

◆ write_overview()

Variable Documentation

◆ top_art