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)  

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

Go to the source code of this file.

Macros

#define DEC(Char)   (((Char) - ' ') & 077)
 

Enumerations

enum  state { INITIAL , MIDDLE , OFF , END }
 
enum  action {
  VIEW , SAVE , SAVE_TAGGED , PIPE_RAW ,
  PIPE
}
 
enum  match { NO , MATCH , NOTMATCH }
 

Functions

static FILE * open_save_filename (const char *path, t_bool mbox)
 
static char * build_tree (int depth, int maxlen, int i)
 
static char * generate_savepath (t_part *part)
 
static int build_part_list (t_openartinfo *art)
 
static int get_tagged (int n)
 
static int match_content_type (t_part *part, char *type)
 
static t_bool check_save_mime_type (t_part *part, const char *mime_types)
 
static t_bool decode_save_one (t_part *part, FILE *rawfp, t_bool postproc)
 
static t_bool expand_save_filename (char *outpath, size_t outpath_len, const char *path)
 
static t_bool tag_part (int n)
 
static t_function attachment_left (void)
 
static t_function attachment_right (void)
 
static t_partlfind_part (int n)
 
static void build_attachment_line (int i)
 
static void draw_attachment_arrow (void)
 
static void free_part_list (t_partl *list)
 
static void generate_filename (char *buf, int buflen, const char *suffix)
 
static void pipe_part (const char *savepath)
 
static void post_process_uud (void)
 
static void post_process_sh (void)
 
static void process_part (t_part *part, t_openartinfo *art, FILE *outfile, const char *savepath, enum action what)
 
static void process_parts (t_part *part, t_openartinfo *art, enum action what)
 
static void show_attachment_page (void)
 
static void start_viewer (t_part *part, const char *path)
 
static void tag_pattern (void)
 
static void untag_all_parts (void)
 
static void untag_part (int n)
 
static void uudecode_line (const char *buf, FILE *fp)
 
static void view_file (const char *path, const char *file)
 
static void sum_file (const char *path, const char *file)
 
int check_start_save_any_news (int function, t_bool catchup)
 
t_bool save_and_process_art (t_openartinfo *artinfo, struct t_article *artptr, t_bool is_mailbox, const char *inpath, int max, t_bool post_process)
 
t_bool create_path (const char *path)
 
t_bool post_process_files (t_function proc_type_func, t_bool auto_delete)
 
void print_art_separator_line (FILE *fp, t_bool is_mailbox)
 
void decode_save_mime (t_openartinfo *art, t_bool postproc)
 
void attachment_page (t_openartinfo *art)
 
t_partget_part (int n)
 

Variables

static int num_of_tagged_parts
 
static int info_len
 
static t_menu attmenu = { 0, 0, 0, show_attachment_page, draw_attachment_arrow, build_attachment_line }
 
static t_partlpart_list
 

Macro Definition Documentation

◆ DEC

#define DEC (   Char)    (((Char) - ' ') & 077)

Definition at line 1120 of file save.c.

Enumeration Type Documentation

◆ action

enum action
Enumerator
VIEW 
SAVE 
SAVE_TAGGED 
PIPE_RAW 
PIPE 

Definition at line 64 of file save.c.

◆ match

enum match
Enumerator
NO 
MATCH 
NOTMATCH 

Definition at line 1384 of file save.c.

◆ state

enum state
Enumerator
INITIAL 
MIDDLE 
OFF 
END 

Definition at line 56 of file save.c.

Function Documentation

◆ attachment_left()

static t_function attachment_left ( void  )
static

Definition at line 1787 of file save.c.

References GLOBAL_QUIT.

Referenced by attachment_page().

◆ attachment_page()

void attachment_page ( t_openartinfo art)

Definition at line 1598 of file save.c.

References _, art, attachment_keys, attachment_left(), ATTACHMENT_LEVEL, ATTACHMENT_PIPE, attachment_right(), ATTACHMENT_SAVE, ATTACHMENT_SELECT, ATTACHMENT_TAG, ATTACHMENT_TAG_PATTERN, ATTACHMENT_TOGGLE_TAGGED, ATTACHMENT_UNTAG, attmenu, bool_not, bug_report(), build_part_list(), clear_note_area(), t_menu::curr, currmenu, DIGIT_1, DIGIT_2, DIGIT_3, DIGIT_4, DIGIT_5, DIGIT_6, DIGIT_7, DIGIT_8, DIGIT_9, do_shell_escape(), end_of_list(), t_menu::first, forever, free_part_list(), func, func_to_key(), generic_search(), get_part(), GLOBAL_BUGREPORT, GLOBAL_FIRST_PAGE, GLOBAL_HELP, GLOBAL_LAST_PAGE, GLOBAL_LINE_DOWN, GLOBAL_LINE_UP, GLOBAL_PAGE_DOWN, GLOBAL_PAGE_UP, GLOBAL_PIPE, GLOBAL_QUIT, GLOBAL_REDRAW_SCREEN, GLOBAL_SCROLL_DOWN, GLOBAL_SCROLL_UP, GLOBAL_SEARCH_REPEAT, GLOBAL_SEARCH_SUBJECT_BACKWARD, GLOBAL_SEARCH_SUBJECT_FORWARD, GLOBAL_SHELL_ESCAPE, GLOBAL_TOGGLE_HELP_DISPLAY, GLOBAL_TOGGLE_INFO_LAST_LINE, handle_keypad(), t_config::info_in_last_line, info_message(), last_search, t_menu::max, MAXKEYLEN, move_down(), move_to_item(), move_up(), my_retouch, num_of_tagged_parts, page_down(), page_up(), part_list, PIPE, PIPE_RAW, printascii(), process_parts(), prompt_item_num(), SAVE, SAVE_TAGGED, scroll_down(), scroll_up(), set_xclick_off(), show_attachment_page(), show_help_page(), tag_part(), tag_pattern(), tinrc, toggle_mini_help(), top_of_list(), txt_attachment_menu_com, txt_attachment_select, txt_attachment_tagged, txt_attachment_untagged, txt_attachments_tagged, txt_bad_command, txt_no_prev_search, untag_all_parts(), and VIEW.

Referenced by show_page().

◆ attachment_right()

static t_function attachment_right ( void  )
static

Definition at line 1795 of file save.c.

References ATTACHMENT_SELECT.

Referenced by attachment_page().

◆ build_attachment_line()

◆ build_part_list()

static int build_part_list ( t_openartinfo art)
static

◆ build_tree()

static char * build_tree ( int  depth,
int  maxlen,
int  i 
)
static

◆ check_save_mime_type()

static t_bool check_save_mime_type ( t_part part,
const char *  mime_types 
)
static

Definition at line 1460 of file save.c.

References FALSE, MATCH, match_content_type(), my_strdup(), and NO.

Referenced by decode_save_one().

◆ check_start_save_any_news()

◆ create_path()

t_bool create_path ( const char *  path)

◆ decode_save_mime()

void decode_save_mime ( t_openartinfo art,
t_bool  postproc 
)

◆ decode_save_one()

◆ draw_attachment_arrow()

◆ expand_save_filename()

static t_bool expand_save_filename ( char *  outpath,
size_t  outpath_len,
const char *  path 
)
static

◆ find_part()

static t_partl * find_part ( int  n)
static

Definition at line 1979 of file save.c.

References attmenu, t_menu::max, partlist::next, and part_list.

Referenced by build_tree(), get_part(), get_tagged(), tag_part(), tag_pattern(), and untag_part().

◆ free_part_list()

static void free_part_list ( t_partl list)
static

Definition at line 2183 of file save.c.

References partlist::next.

Referenced by attachment_page().

◆ generate_filename()

static void generate_filename ( char *  buf,
int  buflen,
const char *  suffix 
)
static

Definition at line 645 of file save.c.

References buf, SAVEFILE_PREFIX, snprintf, and suffix.

Referenced by generate_savepath(), and post_process_uud().

◆ generate_savepath()

◆ get_part()

t_part* get_part ( int  n)

◆ get_tagged()

static int get_tagged ( int  n)
static

Definition at line 2069 of file save.c.

References find_part(), and partlist::tagged.

Referenced by build_attachment_line().

◆ match_content_type()

static int match_content_type ( t_part part,
char *  type 
)
static

Definition at line 1398 of file save.c.

References content_type(), FALSE, MATCH, NO, NOTMATCH, part::subtype, TRUE, and part::type.

Referenced by check_save_mime_type().

◆ open_save_filename()

◆ pipe_part()

◆ post_process_files()

◆ post_process_sh()

static void post_process_sh ( void  )
static

◆ post_process_uud()

◆ print_art_separator_line()

void print_art_separator_line ( FILE *  fp,
t_bool  is_mailbox 
)

◆ process_part()

◆ process_parts()

◆ save_and_process_art()

◆ show_attachment_page()

◆ start_viewer()

◆ sum_file()

static void sum_file ( const char *  path,
const char *  file 
)
static

Definition at line 1051 of file save.c.

References _, buf, cCRLF, DEFAULT_SUM, file_size(), LEN, my_flush, my_printf, sh_format(), and txt_command_failed.

Referenced by post_process_uud().

◆ tag_part()

static t_bool tag_part ( int  n)
static

Definition at line 2080 of file save.c.

References FALSE, find_part(), num_of_tagged_parts, partlist::tagged, TRUE, and untag_part().

Referenced by attachment_page().

◆ tag_pattern()

◆ untag_all_parts()

static void untag_all_parts ( void  )
static

Definition at line 2119 of file save.c.

References partlist::next, num_of_tagged_parts, part_list, and partlist::tagged.

Referenced by attachment_page(), and tag_pattern().

◆ untag_part()

static void untag_part ( int  n)
static

Definition at line 2097 of file save.c.

References attmenu, find_part(), t_menu::max, partlist::next, num_of_tagged_parts, and partlist::tagged.

Referenced by tag_part().

◆ uudecode_line()

static void uudecode_line ( const char *  buf,
FILE *  fp 
)
static

Definition at line 1125 of file save.c.

References buf, and DEC.

Referenced by decode_save_one(), post_process_uud(), and process_part().

◆ view_file()

static void view_file ( const char *  path,
const char *  file 
)
static

Variable Documentation

◆ attmenu

◆ info_len

int info_len
static

Definition at line 112 of file save.c.

Referenced by build_attachment_line(), and show_attachment_page().

◆ num_of_tagged_parts

int num_of_tagged_parts
static

◆ part_list

t_partl* part_list
static

Definition at line 114 of file save.c.

Referenced by attachment_page(), build_part_list(), find_part(), process_parts(), and untag_all_parts().