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)  

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

Go to the source code of this file.


#define CopyBits(target, source)   attributes->target = CAST_BITS(source,target)
#define CopyBool(target, source)   attributes->target = CAST_BOOL(source)
#define MATCH_BOOLEAN(pattern, type)
#define MATCH_INTEGER(pattern, type, maxval)
#define MATCH_STRING(pattern, type)
#define MATCH_LIST(pattern, type, table)
#define SKIP_ITEM(pattern)
#define SET_STRING(string)
#define SET_INTEGER(value)
#define SET_BOOLEAN(value)
#define SET_ATTRIB(attr)


static t_bool skip_scope (struct t_scope *scope)
static void set_attrib (int type, const char *scope, const char *line, void *data)
static void set_default_attributes (struct t_attribute *attributes, struct t_attribute *scope, t_bool global)
static void set_default_state (struct t_attribute_state *state)
void read_attributes_file (t_bool global_file)
int add_scope (const char *scope)
void assign_attributes_to_groups (void)
void build_news_headers_array (struct t_attribute *scope, t_bool header_to_display)
void write_attributes_file (const char *file)


int attrib_file_offset

Macro Definition Documentation

◆ CopyBits

#define CopyBits (   target,
)    attributes->target = CAST_BITS(source,target)

Definition at line 73 of file attrib.c.

◆ CopyBool

#define CopyBool (   target,
)    attributes->target = CAST_BOOL(source)

Definition at line 74 of file attrib.c.


#define MATCH_BOOLEAN (   pattern,
if (match_boolean(line, pattern, &flag)) { \
num = (flag != FALSE); \
set_attrib(type, scope, line, &num); \
found = TRUE; \
break; \
#define TRUE
Definition: bool.h:74
#define FALSE
Definition: bool.h:70
t_bool match_boolean(char *line, const char *pat, t_bool *dst)
Definition: config.c:1525

Definition at line 255 of file attrib.c.


#define MATCH_INTEGER (   pattern,
if (match_integer(line, pattern, &num, maxval)) { \
set_attrib(type, scope, line, &num); \
found = TRUE; \
break; \
t_bool match_integer(char *line, const char *pat, int *dst, int maxval)
Definition: config.c:1586

Definition at line 262 of file attrib.c.


#define MATCH_LIST (   pattern,
if (match_list(line, pattern, table, &num)) { \
set_attrib(type, scope, line, &num); \
found = TRUE; \
break; \
static struct t_hashnode * table[222199]
Definition: hashstr.c:56
t_bool match_list(char *line, constext *pat, constext *const *table, int *dst)
Definition: config.c:1629

Definition at line 274 of file attrib.c.


#define MATCH_STRING (   pattern,
if (match_string(line, pattern, buf, sizeof(buf) - strlen(pattern))) { \
set_attrib(type, scope, line, buf); \
found = TRUE; \
break; \
static char buf[16]
Definition: langinfo.c:50
t_bool match_string(char *line, const char *pat, char *dst, size_t dstlen)
Definition: config.c:1656

Definition at line 268 of file attrib.c.


#define SET_ATTRIB (   attr)
do { \
if (curr_scope->state->attr) \
group->attribute->attr = curr_scope->attribute->attr; \
} while (0)
static struct t_scope * curr_scope
Definition: options_menu.c:142
struct t_attribute * attribute
Definition: tin.h:1796
struct t_attribute_state * state
Definition: tin.h:1797

Definition at line 967 of file attrib.c.


#define SET_BOOLEAN (   value)
curr_scope->attribute->value = CAST_BOOL(*((int *) data)); \
curr_scope->state->value = TRUE; \
#define CAST_BOOL(value)
Definition: tin.h:1588

Definition at line 682 of file attrib.c.


#define SET_INTEGER (   value)
curr_scope->attribute->value = CAST_BITS(*((int *) data), value); \
curr_scope->state->value = TRUE; \
#define CAST_BITS(value, bits)
Definition: tin.h:1589

Definition at line 677 of file attrib.c.


#define SET_STRING (   string)
curr_scope->attribute->string = my_strdup((char *) data); \
curr_scope->state->string = TRUE; \
char * my_strdup(const char *str)
Definition: string.c:139
#define FreeIfNeeded(p)
Definition: tin.h:2252

Definition at line 671 of file attrib.c.


#define SKIP_ITEM (   pattern)
if (!strncmp(line, pattern, strlen(pattern))) { \
found = TRUE; \
break; \

Definition at line 281 of file attrib.c.

Function Documentation

◆ add_scope()

◆ assign_attributes_to_groups()

◆ build_news_headers_array()

void build_news_headers_array ( struct t_attribute scope,
t_bool  header_to_display 

Definition at line 1147 of file attrib.c.

References FreeIfNeeded, my_malloc, t_scope::scope, and ulBuildArgv().

Referenced by config_page(), read_attributes_file(), reset_state(), and set_attrib().

◆ read_attributes_file()

◆ set_attrib()

◆ set_default_attributes()

static void set_default_attributes ( struct t_attribute attributes,
struct t_attribute scope,
t_bool  global 

Definition at line 81 of file attrib.c.

References t_config::add_posted_to_filter, t_config::advertising, t_config::alternative_handling, t_config::ask_for_metamail, t_config::auto_cc_bcc, t_config::auto_list_thread, t_attribute::auto_select, t_config::batch_save, CopyBits, CopyBool, t_attribute::date_format, 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, default_organization, t_attribute::delete_tmp_files, t_attribute::editor_format, t_config::editor_format, FALSE, t_attribute::fcc, t_attribute::followup_to, t_attribute::from, t_attribute::global, t_config::group_catchup_on_exit, t_attribute::group_format, t_config::group_format, t_attribute::headers_to_display, t_attribute::headers_to_not_display, t_config::mail_8bit_header, t_config::mail_address, t_config::mail_mime_encoding, t_attribute::maildir, t_config::maildir, t_attribute::mailing_list, t_config::mark_ignore_tags, t_config::mark_saved_read, t_attribute::mime_forward, t_attribute::mime_types_to_save, my_strdup(), t_attribute::news_headers_to_display, t_config::news_headers_to_display, t_attribute::news_headers_to_not_display, t_config::news_headers_to_not_display, t_attribute::news_quote_format, t_config::news_quote_format, t_attribute::organization, t_config::pos_first_unread, t_config::post_8bit_header, t_config::post_mime_encoding, t_config::post_process_type, t_config::post_process_view, t_config::print_header, t_config::process_only_unread, t_config::prompt_followupto, t_attribute::quick_kill_scope, t_attribute::quick_select_scope, t_attribute::quote_chars, t_config::quote_chars, t_attribute::savedir, t_config::savedir, t_attribute::savefile, t_config::show_author, t_config::show_only_unread_arts, t_config::show_signatures, t_config::sigdashes, t_attribute::sigfile, t_config::sigfile, t_config::signature_repost, t_config::sort_article_type, t_config::sort_threads_type, t_config::tex2iso_conv, t_config::thread_articles, t_config::thread_catchup_on_exit, t_attribute::thread_format, t_config::thread_format, t_config::thread_perc, tinrc, t_config::trim_article_body, TRUE, t_config::verbatim_handling, t_config::wrap_on_next_unread, t_attribute::x_body, t_attribute::x_comment_to, and t_attribute::x_headers.

Referenced by add_scope(), assign_attributes_to_groups(), and read_attributes_file().

◆ set_default_state()

static void set_default_state ( struct t_attribute_state state)

Definition at line 171 of file attrib.c.

References FALSE.

Referenced by add_scope().

◆ skip_scope()

static t_bool skip_scope ( struct t_scope scope)

Definition at line 1584 of file attrib.c.

References t_scope::scope.

Referenced by write_attributes_file().

◆ write_attributes_file()

Variable Documentation

◆ attrib_file_offset

int attrib_file_offset

Definition at line 55 of file attrib.c.

Referenced by read_attributes_file(), scope_page(), and write_attributes_file().