tin  2.4.4
About: TIN is a threaded NNTP and spool based UseNet newsreader.
  Fossies Dox: tin-2.4.4.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

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

Go to the source code of this file.

Macros

#define CHUNK   50
 
#define STRIP_ALTERNATIVE(x)
 
#define MATCH_REGEX(x, y, z)   (pcre_exec(x.re, x.extra, y, z, 0, 0, NULL, 0) >= 0)
 
#define PUT_UUE(part, qualifier_text)
 
#define PUT_ATTACH(part, depth, name, charset)
 

Functions

static t_bool charset_unsupported (const char *charset)
 
static t_bool header_wanted (const char *line)
 
static t_partnew_uue (t_part **part, char *name)
 
static void process_text_body_part (t_bool wrap_lines, FILE *in, t_part *part, int hide_uue)
 
static void put_cooked (size_t buf_len, t_bool wrap_lines, int flags, const char *fmt,...)
 
t_bool expand_ctrl_chars (char **line, size_t *length, size_t lcook_width)
 
const char * get_filename (t_param *ptr)
 
t_bool cook_article (t_bool wrap_lines, t_openartinfo *artinfo, int hide_uue, t_bool show_all_headers)
 

Variables

static t_openartinfoart
 

Macro Definition Documentation

◆ CHUNK

#define CHUNK   50

Definition at line 51 of file cook.c.

◆ MATCH_REGEX

#define MATCH_REGEX (   x,
  y,
 
)    (pcre_exec(x.re, x.extra, y, z, 0, 0, NULL, 0) >= 0)

Definition at line 58 of file cook.c.

◆ PUT_ATTACH

#define PUT_ATTACH (   part,
  depth,
  name,
  charset 
)
Value:
put_cooked(LEN, wrap_lines, C_ATTACH, _(txt_attach), \
depth, "", \
charset ? _(txt_attach_charset) : "", BlankIfNull(charset), \
name ? _(txt_name) : "", BlankIfNull(name)); \
\
if (part->description) \
put_cooked(LEN, wrap_lines, C_ATTACH, \
depth, "", \
if (part->next != NULL || IS_PLAINTEXT(part)) \
put_cooked(1, wrap_lines, C_ATTACH, "\n")

Definition at line 377 of file cook.c.

◆ PUT_UUE

#define PUT_UUE (   part,
  qualifier_text 
)
Value:
put_cooked(LEN, wrap_lines, C_UUE, _(txt_uue), \
part->depth ? (part->depth - 1) * 4 : 0, "", \
qualifier_text, part->line_count, get_filename(part->params))

Definition at line 371 of file cook.c.

◆ STRIP_ALTERNATIVE

#define STRIP_ALTERNATIVE (   x)
Value:
(x)->hdr.ext->type == TYPE_MULTIPART && \
strcasecmp("alternative", (x)->hdr.ext->subtype) == 0)

Definition at line 53 of file cook.c.

Function Documentation

◆ charset_unsupported()

static t_bool charset_unsupported ( const char *  charset)
static

Definition at line 776 of file cook.c.

References FALSE, strncasecmp(), and TRUE.

Referenced by cook_article().

◆ cook_article()

◆ expand_ctrl_chars()

t_bool expand_ctrl_chars ( char **  line,
size_t *  length,
size_t  lcook_width 
)

Definition at line 87 of file cook.c.

References assert, buf, FALSE, IS_LOCAL_CHARSET, LEN, my_isprint(), my_malloc, my_realloc, and TRUE.

Referenced by cook_article(), make_help_page(), and process_text_body_part().

◆ get_filename()

const char* get_filename ( t_param ptr)

◆ header_wanted()

static t_bool header_wanted ( const char *  line)
static

◆ new_uue()

static t_part * new_uue ( t_part **  part,
char *  name 
)
static

◆ process_text_body_part()

◆ put_cooked()

static void put_cooked ( size_t  buf_len,
t_bool  wrap_lines,
int  flags,
const char *  fmt,
  ... 
)
static

Variable Documentation

◆ art

name
const char * name
Definition: signal.c:117
get_filename
const char * get_filename(t_param *ptr)
Definition: cook.c:353
strcasecmp
int strcasecmp(const char *p, const char *q)
Definition: string.c:468
_
#define _(Text)
Definition: tin.h:94
txt_attach_description
constext txt_attach_description[]
Definition: lang.c:82
TYPE_MULTIPART
#define TYPE_MULTIPART
Definition: rfc2046.h:48
content_encodings
constext * content_encodings[]
Definition: lang.c:1448
curr_group
struct t_group * curr_group
Definition: group.c:55
txt_uue
constext txt_uue[]
Definition: lang.c:902
txt_attach
constext txt_attach[]
Definition: lang.c:79
txt_attach_charset
constext txt_attach_charset[]
Definition: lang.c:80
part::next
struct part * next
Definition: rfc2046.h:107
part::line_count
int line_count
Definition: rfc2046.h:104
part
Definition: rfc2046.h:92
content_types
constext * content_types[]
Definition: lang.c:1453
IS_PLAINTEXT
#define IS_PLAINTEXT(x)
Definition: tin.h:1025
part::description
char * description
Definition: rfc2046.h:101
LEN
#define LEN
Definition: tin.h:854
part::type
unsigned type
Definition: rfc2046.h:94
BlankIfNull
#define BlankIfNull(p)
Definition: tin.h:2206
C_UUE
#define C_UUE
Definition: rfc2046.h:156
part::depth
int depth
Definition: rfc2046.h:105
t_attribute::alternative_handling
unsigned alternative_handling
Definition: tin.h:1605
t_group::attribute
struct t_attribute * attribute
Definition: tin.h:1790
txt_name
constext txt_name[]
Definition: lang.c:657
part::params
t_param * params
Definition: rfc2046.h:102
part::encoding
unsigned encoding
Definition: rfc2046.h:95
put_cooked
static void put_cooked(size_t buf_len, t_bool wrap_lines, int flags, const char *fmt,...)
Definition: cook.c:206
C_ATTACH
#define C_ATTACH
Definition: rfc2046.h:155
part::subtype
char * subtype
Definition: rfc2046.h:100