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)  

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

Go to the source code of this file.

Macros

#define DIGIT(x)   (isdigit((unsigned char) x) ? ((x) - '0') : (10 + my_tolower((unsigned char) x) - 'a'))
 
#define MBASE   36
 
#define FOLD_TO_UPPER(a)   (my_toupper((unsigned char) (a)))
 
#define SH_FORMAT(c)
 
#define SH_SINGLE   "\\\'"
 
#define SH_DOUBLE   "\\\'\"`$"
 
#define SH_META   "\\\'\"`$*%?()[]{}|<>^&;#~"
 
#define TRUNC_TAIL   "..."
 

Functions

char * tin_ltoa (t_artnum value, int digits)
 
char * my_strdup (const char *str)
 
char * tin_strtok (char *str, const char *delim)
 
void my_strncpy (char *p, const char *q, size_t n)
 
char * strcasestr (const char *haystack, const char *needle)
 
size_t mystrcat (char **t, const char *s)
 
int my_tolower (int c)
 
int my_toupper (int c)
 
void str_lwr (char *str)
 
char * strpbrk (const char *str1, const char *str2)
 
char * strstr (const char *text, const char *pattern)
 
long atol (const char *s)
 
long strtol (const char *str, char **ptr, int use_base)
 
int strcasecmp (const char *p, const char *q)
 
int strncasecmp (const char *p, const char *q, size_t n)
 
char * strsep (char **stringp, const char *delim)
 
char * str_trim (char *string)
 
char * eat_tab (char *s)
 
char * expand_tab (char *str, size_t tab_width)
 
int sh_format (char *dst, size_t len, const char *fmt,...)
 
char * my_strerror (int n)
 
char * my_strrstr (const char *str, const char *pat)
 
char * abbr_groupname (const char *grpname, size_t len)
 
int strwidth (const char *str)
 
char * strunc (const char *message, int len)
 
char * fmt_string (const char *fmt,...)
 
void parse_format_string (const char *fmtstr, struct t_fmt *fmt)
 

Macro Definition Documentation

◆ DIGIT

#define DIGIT (   x)    (isdigit((unsigned char) x) ? ((x) - '0') : (10 + my_tolower((unsigned char) x) - 'a'))

Definition at line 413 of file string.c.

◆ FOLD_TO_UPPER

#define FOLD_TO_UPPER (   a)    (my_toupper((unsigned char) (a)))

Definition at line 467 of file string.c.

◆ MBASE

#define MBASE   36

Definition at line 414 of file string.c.

◆ SH_DOUBLE

#define SH_DOUBLE   "\\\'\"`$"

Definition at line 672 of file string.c.

◆ SH_FORMAT

#define SH_FORMAT (   c)
Value:
if (++result >= (int) len) \
break; \
*dst++ = c

Definition at line 667 of file string.c.

◆ SH_META

#define SH_META   "\\\'\"`$*%?()[]{}|<>^&;#~"

Definition at line 673 of file string.c.

◆ SH_SINGLE

#define SH_SINGLE   "\\\'"

Definition at line 671 of file string.c.

◆ TRUNC_TAIL

#define TRUNC_TAIL   "..."

Definition at line 1067 of file string.c.

Function Documentation

◆ abbr_groupname()

char* abbr_groupname ( const char *  grpname,
size_t  len 
)

Definition at line 996 of file string.c.

References my_realloc, my_strdup(), and strunc().

Referenced by build_gline(), and draw_page_header().

◆ atol()

long atol ( const char *  s)

Definition at line 391 of file string.c.

Referenced by check_for_any_new_groups(), load_newnews_info(), and match_long().

◆ eat_tab()

char* eat_tab ( char *  s)

Definition at line 573 of file string.c.

Referenced by parse_headers(), post_response(), and read_overview().

◆ expand_tab()

char* expand_tab ( char *  str,
size_t  tab_width 
)

Definition at line 629 of file string.c.

References buf, LEN, my_malloc, and my_realloc.

Referenced by draw_page_header().

◆ fmt_string()

◆ my_strdup()

char* my_strdup ( const char *  str)

Definition at line 139 of file string.c.

References my_malloc.

Referenced by _lookup_mimetype(), abbr_groupname(), active_add(), add_filter_comment(), add_filter_rule(), add_headers(), add_scope(), append_group_line(), art_open(), author_search(), body_search(), boundary_cmp(), build_gline(), build_url_list(), center_line(), check_article_to_be_posted(), check_for_spamtrap(), check_save_mime_type(), check_upgrade(), checknadd_headers(), cook_article(), copy_filter_comment(), create_path(), create_save_active_file(), dir_name(), do_read_newsrc_active_file(), envargs(), expand_mailcap_meta(), filter_menu(), find_group_index(), find_nov_file(), get_charset(), get_mailcap_entry(), get_param(), get_token(), getserverbyfile(), group_add(), group_add_to_hash(), hist_add(), idna_decode(), load_newnews_info(), mail_to_author(), mail_to_someone(), match_item(), msg_add_header(), msg_add_x_headers(), new_part(), new_uue(), nntp_open(), overview_xref_support(), parse_content_type(), parse_headers(), parse_mailcap_line(), parse_multipart_article(), parse_rfc822_headers(), pos_group_in_newsrc(), post_postponed_article(), post_response(), print_any_option(), print_from(), process_charsets(), process_keys(), process_part(), prompt_yn(), quick_filter_select_posted_art(), read_filter_file(), read_groups_descriptions(), read_input_history_file(), read_keymap_file(), read_overview(), rename_scope(), resync_active_file(), rfc1522_decode(), save_and_process_art(), save_restore_curr_group(), search_article(), set_attrib(), set_default_attributes(), set_rest(), strip_charset(), strunc(), subject_search(), ulBuildArgv(), update_posted_info_file(), upgrade_keymap_file(), view_file(), wildmat(), wildmatpos(), and write_overview().

◆ my_strerror()

char* my_strerror ( int  n)

Definition at line 775 of file string.c.

References snprintf, sys_errlist, and sys_nerr.

◆ my_strncpy()

◆ my_strrstr()

char* my_strrstr ( const char *  str,
const char *  pat 
)

Definition at line 795 of file string.c.

◆ my_tolower()

◆ my_toupper()

int my_toupper ( int  c)

Definition at line 275 of file string.c.

Referenced by get_full_name(), parse_headers(), prompt_yn(), and upgrade_keymap_file().

◆ mystrcat()

size_t mystrcat ( char **  t,
const char *  s 
)

Definition at line 241 of file string.c.

Referenced by rfc1522_do_encode().

◆ parse_format_string()

◆ sh_format()

int sh_format ( char *  dst,
size_t  len,
const char *  fmt,
  ... 
)

Definition at line 676 of file string.c.

References SH_DOUBLE, SH_FORMAT, SH_META, SH_SINGLE, and snprintf.

Referenced by invoke_editor(), post_process_sh(), strfmailer(), submit_news_file(), and sum_file().

◆ str_lwr()

void str_lwr ( char *  str)

◆ str_trim()

◆ strcasecmp()

◆ strcasestr()

char* strcasestr ( const char *  haystack,
const char *  needle 
)

Definition at line 215 of file string.c.

References my_tolower().

Referenced by cancel_article(), and check_for_spamtrap().

◆ strncasecmp()

◆ strpbrk()

◆ strsep()

char* strsep ( char **  stringp,
const char *  delim 
)

Definition at line 509 of file string.c.

References strpbrk().

Referenced by read_keymap_file(), and upgrade_keymap_file().

◆ strstr()

char* strstr ( const char *  text,
const char *  pattern 
)

◆ strtol()

long strtol ( const char *  str,
char **  ptr,
int  use_base 
)

Definition at line 416 of file string.c.

References DIGIT, and MBASE.

Referenced by global_look_for_multipart(), and global_look_for_multipart_info().

◆ strunc()

◆ strwidth()

◆ tin_ltoa()

◆ tin_strtok()

char* tin_strtok ( char *  str,
const char *  delim 
)

Definition at line 160 of file string.c.

References strpbrk().

Referenced by read_overview().