tin  2.4.2
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.4.2.tar.xz  ("inofficial" 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.

Macros

#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(integer)
 
#define SET_ATTRIB(attr)
 

Functions

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)
 

Variables

int attrib_file_offset
 

Macro Definition Documentation

◆ MATCH_BOOLEAN

#define MATCH_BOOLEAN (   pattern,
  type 
)
Value:
if (match_boolean(line, pattern, &flag)) { \
num = (flag != FALSE); \
set_attrib(type, scope, line, &num); \
found = TRUE; \
break; \
}
char * type
Definition: makecfg.c:54
#define FALSE
Definition: bool.h:67
#define TRUE
Definition: bool.h:71
t_bool match_boolean(char *line, const char *pat, t_bool *dst)
Definition: config.c:1497

Definition at line 253 of file attrib.c.

Referenced by read_attributes_file().

◆ MATCH_INTEGER

#define MATCH_INTEGER (   pattern,
  type,
  maxval 
)
Value:
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:1558
char * type
Definition: makecfg.c:54
#define TRUE
Definition: bool.h:71

Definition at line 260 of file attrib.c.

Referenced by read_attributes_file().

◆ MATCH_LIST

#define MATCH_LIST (   pattern,
  type,
  table 
)
Value:
if (match_list(line, pattern, table, &num)) { \
set_attrib(type, scope, line, &num); \
found = TRUE; \
break; \
}
static struct t_hashnode * table[HASHNODE_TABLE_SIZE]
Definition: hashstr.c:58
char * type
Definition: makecfg.c:54
t_bool match_list(char *line, constext *pat, constext *const *table, int *dst)
Definition: config.c:1601
#define TRUE
Definition: bool.h:71

Definition at line 272 of file attrib.c.

Referenced by read_attributes_file().

◆ MATCH_STRING

#define MATCH_STRING (   pattern,
  type 
)
Value:
if (match_string(line, pattern, buf, sizeof(buf) - strlen(pattern))) { \
set_attrib(type, scope, line, buf); \
found = TRUE; \
break; \
}
t_bool match_string(char *line, const char *pat, char *dst, size_t dstlen)
Definition: config.c:1628
char * type
Definition: makecfg.c:54
#define TRUE
Definition: bool.h:71
static char buf[16]
Definition: langinfo.c:52

Definition at line 266 of file attrib.c.

Referenced by read_attributes_file().

◆ SET_ATTRIB

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

Definition at line 931 of file attrib.c.

Referenced by assign_attributes_to_groups().

◆ SET_INTEGER

#define SET_INTEGER (   integer)
Value:
curr_scope->attribute->integer = *((int *) data); \
curr_scope->state->integer = TRUE; \
break
struct t_attribute * attribute
Definition: tin.h:1714
#define TRUE
Definition: bool.h:71
static struct t_scope * curr_scope
Definition: options_menu.c:123

Definition at line 640 of file attrib.c.

Referenced by set_attrib().

◆ SET_STRING

#define SET_STRING (   string)
Value:
curr_scope->attribute->string = my_strdup((char *) data); \
curr_scope->state->string = TRUE; \
break
#define FreeIfNeeded(p)
Definition: tin.h:2192
struct t_attribute * attribute
Definition: tin.h:1714
#define TRUE
Definition: bool.h:71
static struct t_scope * curr_scope
Definition: options_menu.c:123
char * my_strdup(const char *str)
Definition: string.c:130

Definition at line 635 of file attrib.c.

Referenced by set_attrib().

◆ SKIP_ITEM

#define SKIP_ITEM (   pattern)
Value:
if (!strncmp(line, pattern, strlen(pattern))) { \
found = TRUE; \
break; \
}
#define TRUE
Definition: bool.h:71

Definition at line 279 of file attrib.c.

Referenced by read_attributes_file().

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 
)

◆ read_attributes_file()

◆ set_attrib()

◆ set_default_attributes()

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

Definition at line 75 of file attrib.c.

References t_config::add_posted_to_filter, t_attribute::add_posted_to_filter, t_config::advertising, t_attribute::advertising, t_config::alternative_handling, t_attribute::alternative_handling, t_config::ask_for_metamail, t_attribute::ask_for_metamail, t_config::auto_cc_bcc, t_attribute::auto_cc_bcc, t_config::auto_list_thread, t_attribute::auto_list_thread, t_config::auto_save, t_attribute::auto_save, t_attribute::auto_select, t_config::batch_save, t_attribute::batch_save, t_config::date_format, t_attribute::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_config::editor_format, t_attribute::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_catchup_on_exit, t_config::group_format, t_attribute::group_format, t_attribute::headers_to_display, t_attribute::headers_to_not_display, t_config::mail_8bit_header, t_attribute::mail_8bit_header, t_config::mail_address, t_config::mail_mime_encoding, t_attribute::mail_mime_encoding, t_config::maildir, t_attribute::maildir, t_attribute::mailing_list, t_config::mark_ignore_tags, t_attribute::mark_ignore_tags, t_config::mark_saved_read, t_attribute::mark_saved_read, t_attribute::mime_forward, t_attribute::mime_types_to_save, my_strdup(), t_config::news_headers_to_display, t_attribute::news_headers_to_display, t_config::news_headers_to_not_display, t_attribute::news_headers_to_not_display, t_config::news_quote_format, t_attribute::news_quote_format, NULL, t_attribute::organization, t_config::pos_first_unread, t_attribute::pos_first_unread, t_config::post_8bit_header, t_attribute::post_8bit_header, t_config::post_mime_encoding, t_attribute::post_mime_encoding, t_config::post_process_type, t_attribute::post_process_type, t_config::post_process_view, t_attribute::post_process_view, t_config::print_header, t_attribute::print_header, t_config::process_only_unread, t_attribute::process_only_unread, t_config::prompt_followupto, t_attribute::prompt_followupto, t_attribute::quick_kill_case, t_attribute::quick_kill_expire, t_attribute::quick_kill_header, t_attribute::quick_kill_scope, t_attribute::quick_select_case, t_attribute::quick_select_expire, t_attribute::quick_select_header, t_attribute::quick_select_scope, t_config::quote_chars, t_attribute::quote_chars, t_config::savedir, t_attribute::savedir, t_attribute::savefile, t_config::show_author, t_attribute::show_author, t_config::show_only_unread_arts, t_attribute::show_only_unread_arts, t_config::show_signatures, t_attribute::show_signatures, t_config::sigdashes, t_attribute::sigdashes, t_config::sigfile, t_attribute::sigfile, t_config::signature_repost, t_attribute::signature_repost, t_config::sort_article_type, t_attribute::sort_article_type, t_config::sort_threads_type, t_attribute::sort_threads_type, t_config::start_editor_offset, t_attribute::start_editor_offset, t_config::tex2iso_conv, t_attribute::tex2iso_conv, t_config::thread_articles, t_attribute::thread_articles, t_config::thread_catchup_on_exit, t_attribute::thread_catchup_on_exit, t_config::thread_format, t_attribute::thread_format, t_config::thread_perc, t_attribute::thread_perc, tinrc, t_config::trim_article_body, t_attribute::trim_article_body, TRUE, t_config::verbatim_handling, t_attribute::verbatim_handling, t_config::wrap_on_next_unread, t_attribute::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)
static

Definition at line 167 of file attrib.c.

References FALSE.

Referenced by add_scope().

◆ write_attributes_file()

Variable Documentation

◆ attrib_file_offset

int attrib_file_offset

Definition at line 52 of file attrib.c.

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