"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.1/include/proto.h" (12 Oct 2016, 33164 Bytes) of package /linux/misc/tin-2.4.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "proto.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.4.0_vs_2.4.1.

    1 /*
    2  *  Project   : tin - a Usenet reader
    3  *  Module    : proto.h
    4  *  Author    : Urs Janssen <urs@tin.org>
    5  *  Created   :
    6  *  Updated   : 2016-07-29
    7  *  Notes     :
    8  *
    9  * Copyright (c) 1997-2017 Urs Janssen <urs@tin.org>
   10  * All rights reserved.
   11  *
   12  * Redistribution and use in source and binary forms, with or without
   13  * modification, are permitted provided that the following conditions
   14  * are met:
   15  * 1. Redistributions of source code must retain the above copyright
   16  *    notice, this list of conditions and the following disclaimer.
   17  * 2. Redistributions in binary form must reproduce the above copyright
   18  *    notice, this list of conditions and the following disclaimer in the
   19  *    documentation and/or other materials provided with the distribution.
   20  * 3. The name of the author may not be used to endorse or promote
   21  *    products derived from this software without specific prior written
   22  *    permission.
   23  *
   24  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
   25  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   26  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   27  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
   28  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
   29  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
   30  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   31  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
   32  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   33  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   34  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   35  */
   36 
   37 
   38 #ifndef PROTO_H
   39 #   define PROTO_H 1
   40 
   41 #ifndef KEYMAP_H
   42 #   include "keymap.h"
   43 #endif /* !KEYMAP_H */
   44 #ifndef OPTIONS_MENU_H
   45 #   include "options_menu.h"
   46 #endif /* !OPTIONS_MENU_H */
   47 
   48 /* This fixes ambiguities on platforms that don't distinguish extern case */
   49 #ifdef CASE_PROBLEM
   50 #   define Raw tin_raw
   51 #   define EndWin tin_EndWin
   52 #endif /* CASE_PROBLEM */
   53 
   54 /* active.c */
   55 extern char group_flag(char ch);
   56 extern int find_newnews_index(const char *cur_newnews_host);
   57 extern int read_news_active_file(void);
   58 extern t_bool match_group_list(const char *group, const char *group_list);
   59 extern t_bool parse_active_line(char *line, t_artnum *max, t_artnum *min, char *moderated);
   60 extern t_bool process_bogus(char *name);
   61 extern t_bool need_reread_active_file(void);
   62 extern t_bool resync_active_file(void);
   63 extern void create_save_active_file(void);
   64 extern void load_newnews_info(char *info);
   65 
   66 /* art.c */
   67 extern int find_artnum(t_artnum art);
   68 extern int global_get_multipart_info(int aindex, MultiPartInfo *setme);
   69 extern t_bool index_group(struct t_group *group);
   70 extern void do_update(t_bool catchup);
   71 extern void find_base(struct t_group *group);
   72 extern void make_threads(struct t_group *group, t_bool rethread);
   73 extern void set_article(struct t_article *art);
   74 extern void show_art_msg(const char *group);
   75 extern void sort_arts(unsigned /* int */ sort_art_type);
   76 
   77 /* attrib.c */
   78 extern int add_scope(const char *scope);
   79 extern void assign_attributes_to_groups(void);
   80 extern void build_news_headers_array(struct t_attribute *scope, t_bool header_to_display);
   81 extern void read_attributes_file(t_bool global_file);
   82 extern void write_attributes_file(const char *file);
   83 
   84 /* auth.c */
   85 #ifdef NNTP_ABLE
   86     extern t_bool authenticate(char *server, char *user, t_bool startup);
   87 #endif /* NNTP_ABLE */
   88 
   89 /* charset.c */
   90 extern char *convert_to_printable(char *buf, t_bool keep_tab);
   91 extern t_bool is_art_tex_encoded(FILE *fp);
   92 extern void convert_iso2asc(char *iso, char **asc_buffer, size_t *max_line_len, int t);
   93 extern void convert_tex2iso(char *from, char *to);
   94 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
   95     extern wchar_t *wconvert_to_printable(wchar_t *wbuf, t_bool keep_tab);
   96 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
   97 
   98 /* color.c */
   99 extern void draw_pager_line(const char *str, int flags, t_bool raw_data);
  100 #ifdef HAVE_COLOR
  101     extern void bcol(int color);
  102     extern void fcol(int color);
  103 #   ifdef USE_CURSES
  104         extern void free_color_pair_arrays(void);
  105 #   endif /* USE_CURSES */
  106 #endif /* HAVE_COLOR */
  107 
  108 /* config.c */
  109 extern char **ulBuildArgv(char *cmd, int *new_argc);
  110 extern char *quote_space_to_dash(char *str);
  111 extern const char *print_boolean(t_bool value);
  112 extern t_bool match_boolean(char *line, const char *pat, t_bool *dst);
  113 extern t_bool match_integer(char *line, const char *pat, int *dst, int maxval);
  114 extern t_bool match_list(char *line, constext *pat, constext *const *table, int *dst);
  115 extern t_bool match_long(char *line, const char *pat, long *dst);
  116 extern t_bool match_string(char *line, const char *pat, char *dst, size_t dstlen);
  117 extern t_bool read_config_file(char *file, t_bool global_file);
  118 extern void quote_dash_to_space(char *str);
  119 extern void read_server_config(void);
  120 extern void write_config_file(char *file);
  121 
  122 /* cook.c */
  123 extern const char *get_filename(t_param *ptr);
  124 extern t_bool cook_article(t_bool wrap_lines, t_openartinfo *artinfo, int hide_uue, t_bool show_all_headers);
  125 extern t_bool expand_ctrl_chars(char **line, size_t *length, size_t lcook_width);
  126 
  127 /* curses.c */
  128 extern OUTC_RETTYPE outchar(OUTC_ARGS);
  129 extern int InitScreen(void);
  130 extern int RawState(void);
  131 extern int ReadCh(void);
  132 extern int get_arrow_key(int prech);
  133 #if defined(M_UNIX) && !defined(USE_CURSES)
  134     extern int get_termcaps(void);
  135 #endif /* M_UNIX && !USE_CURSES */
  136 extern void EndInverse(void);
  137 extern void EndWin(void);
  138 extern void InitWin(void);
  139 extern void Raw(int state);
  140 extern void StartInverse(void);
  141 extern void cursoroff(void);
  142 extern void cursoron(void);
  143 extern void highlight_string(int row, int col, int size);
  144 extern void set_keypad_off(void);
  145 extern void set_keypad_on(void);
  146 extern void set_xclick_off(void);
  147 extern void set_xclick_on(void);
  148 extern void setup_screen(void);
  149 extern void word_highlight_string(int row, int col, int size, int color);
  150 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE) && !defined(USE_CURSES)
  151     extern wint_t ReadWch(void);
  152 #endif /* MULTIBYTE_ABLE && !NO_LOCALE && !USE_CURSES */
  153 #ifndef USE_CURSES
  154     extern void ClearScreen(void);
  155     extern void CleartoEOLN(void);
  156     extern void CleartoEOS(void);
  157     extern void MoveCursor(int row, int col);
  158     extern void ScrollScreen(int lines_to_scroll);
  159     extern void SetScrollRegion(int topline, int bottomline);
  160 #   ifdef HAVE_COLOR
  161         extern void reset_screen_attr(void);
  162 #   endif /* HAVE_COLOR */
  163 #endif /* USE_CURSES */
  164 #if 0
  165     extern void ToggleInverse(void);
  166 #endif /* 0 */
  167 
  168 /* debug.c */
  169 #ifdef DEBUG
  170     extern void debug_delete_files(void);
  171     extern void debug_print_file(const char *fname, const char *fmt, ...);
  172     extern void debug_print_active(void);
  173     extern void debug_print_arts(void);
  174     extern void debug_print_bitmap(struct t_group *group, struct t_article *art);
  175     extern void debug_print_comment(const char *comment);
  176     extern void debug_print_filters(void);
  177     extern void debug_print_header(struct t_article *s);
  178     extern void debug_print_malloc(int is_malloc, const char *xfile, int line, size_t size);
  179 #   ifdef DEBUG
  180     extern const char *logtime(void);
  181 #   endif /* DEBUG */
  182 #endif /* DEBUG */
  183 
  184 /* envarg.c */
  185 extern void envargs(int *Pargc, char ***Pargv, const char *envstr);
  186 
  187 /* feed.c */
  188 extern int feed_articles(int function, int level, t_function type, struct t_group *group, int respnum);
  189 
  190 /* filter.c */
  191 extern t_bool filter_articles(struct t_group *group);
  192 extern t_bool filter_menu(t_function type, struct t_group *group, struct t_article *art);
  193 extern t_bool quick_filter(t_function type, struct t_group *group, struct t_article *art);
  194 extern t_bool quick_filter_select_posted_art(struct t_group *group, const char *subj, const char *a_message_id);
  195 extern t_bool read_filter_file(const char *file);
  196 extern void free_filter_array(struct t_filters *ptr);
  197 #if defined(SIGWINCH) || defined(SIGTSTP)
  198     extern void refresh_filter_menu(void);
  199 #endif /* SIGWINCH || SIGTSTP */
  200 extern void unfilter_articles(struct t_group *group);
  201 extern void write_filter_file(const char *filename);
  202 
  203 /* getline.c */
  204 extern char *tin_getline(const char *prompt, int number_only, const char *str, int max_chars, t_bool passwd, int which_hist);
  205 extern void gl_redraw(void);
  206 
  207 /* global.c */
  208 extern void bug_report(void);
  209 extern void move_up(void);
  210 extern void move_down(void);
  211 extern void page_up(void);
  212 extern void page_down(void);
  213 extern void top_of_list(void);
  214 extern void end_of_list(void);
  215 extern void move_to_item(int n);
  216 extern void prompt_item_num(int ch, const char *prompt);
  217 extern void scroll_down(void);
  218 extern void scroll_up(void);
  219 extern void set_first_screen_item(void);
  220 
  221 /* group.c */
  222 extern int group_page(struct t_group *group);
  223 extern t_bool group_mark_postprocess(int function, t_function feed_type, int respnum);
  224 extern void clear_note_area(void);
  225 extern void mark_screen(int screen_row, int screen_col, const char *value);
  226 extern void pos_first_unread_thread(void);
  227 extern void show_group_page(void);
  228 
  229 /* hashstr.c */
  230 extern char *hash_str(const char *s);
  231 extern void hash_init(void);
  232 extern void hash_reclaim(void);
  233 
  234 /* help.c */
  235 extern void show_help_page(const int level, const char *title);
  236 extern void show_mini_help(int level);
  237 extern void toggle_mini_help(int level);
  238 
  239 /* header.c */
  240 extern const char *get_domain_name(void);
  241 extern const char *get_fqdn(const char *host);
  242 extern const char *get_host_name(void);
  243 #ifndef FORGERY
  244     extern char *build_sender(void);
  245 #endif /* !FORGERY */
  246 
  247 /* heapsort.c */
  248 #ifndef HAVE_HEAPSORT
  249     extern int heapsort(void *, size_t, size_t, t_compfunc);
  250 #endif /* !HAVE_HEAPSORT */
  251 
  252 /* inews.c */
  253 extern t_bool submit_news_file(char *name, struct t_group *group, char *a_message_id);
  254 extern void get_from_name(char *from_name, struct t_group *thisgrp);
  255 extern void get_user_info(char *user_name, char *full_name);
  256 
  257 /* init.c */
  258 extern void init_selfinfo(void);
  259 extern void postinit_regexp(void);
  260 #ifdef HAVE_COLOR
  261     extern void postinit_colors(int last_color);
  262 #endif /* HAVE_COLOR */
  263 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  264     extern t_bool utf8_pcre(void);
  265 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
  266 
  267 /* joinpath.c */
  268 extern void joinpath(char *result, size_t result_size, const char *dir, const char *file);
  269 
  270 /* keymap.c */
  271 extern t_bool read_keymap_file(void);
  272 extern void free_keymaps(void);
  273 extern void setup_default_keys(void);
  274 
  275 /* langinfo.c */
  276 #ifndef NO_LOCALE
  277     extern const char *tin_nl_langinfo(nl_item item);
  278 #endif /* !NO_LOCALE */
  279 
  280 /* list.c */
  281 extern char *random_organization(char *in_org);
  282 extern int find_group_index(const char *group, t_bool ignore_case);
  283 extern struct t_group *group_add(const char *group);
  284 extern struct t_group *group_find(const char *group_name, t_bool ignore_case);
  285 extern unsigned long hash_groupname(const char *group);
  286 extern void group_rehash(t_bool yanked_out);
  287 extern void init_group_hash(void);
  288 
  289 /* lock.c */
  290 extern int fd_lock(int fd, t_bool block);
  291 extern int fd_unlock(int fd);
  292 extern t_bool dot_lock(const char *filename);
  293 extern t_bool dot_unlock(const char *filename);
  294 #if 0 /* unused */
  295     extern int test_fd_lock(int fd);
  296 #endif /* 0 */
  297 
  298 /* mail.c */
  299 extern t_bool art_edit(struct t_group *group, struct t_article *article);
  300 extern void find_art_max_min(const char *group_path, t_artnum *art_max, t_artnum *art_min);
  301 extern void print_active_head(const char *active_file);
  302 extern void print_group_line(FILE *fp, const char *group_name, t_artnum art_max, t_artnum art_min, const char *base_dir);
  303 extern void read_descriptions(t_bool verb);
  304 extern void grp_del_mail_arts(struct t_group *group);
  305 extern void grp_del_mail_art(struct t_article *article);
  306 #ifdef HAVE_MH_MAIL_HANDLING
  307     extern void read_mail_active_file(void);
  308     extern void write_mail_active_file(void);
  309 #endif /* HAVE_MH_MAIL_HANDLING */
  310 
  311 /* main.c */
  312 extern int main(int argc, char *argv[]);
  313 extern int read_cmd_line_groups(void);
  314 extern void giveup(void);
  315 
  316 /* memory.c */
  317 extern void expand_active(void);
  318 extern void expand_art(void);
  319 extern void expand_base(void);
  320 extern void expand_newnews(void);
  321 extern void expand_save(void);
  322 extern void expand_scope(void);
  323 extern void init_alloc(void);
  324 extern void free_all_arrays(void);
  325 extern void free_art_array(void);
  326 extern void free_save_array(void);
  327 extern void free_scope(int num);
  328 extern void *my_malloc1(const char *file, int line, size_t size);
  329 extern void *my_calloc1(const char *file, int line, size_t nmemb, size_t size);
  330 extern void *my_realloc1(const char *file, int line, void *p, size_t size);
  331 #ifndef USE_CURSES
  332     extern void init_screen_array(t_bool allocate);
  333 #endif /* !USE_CURSES */
  334 
  335 /* mimetypes.c */
  336 extern void lookup_mimetype(const char *ext, t_part *part);
  337 extern t_bool lookup_extension(char *extension, size_t ext_len, const char *major, const char *minor);
  338 
  339 /* misc.c */
  340 extern char *buffer_to_ascii(char *c);
  341 extern char *escape_shell_meta(const char *source, int quote_area);
  342 extern char *get_tmpfilename(const char *filename);
  343 extern char *idna_decode(char *in);
  344 extern char *quote_wild(char *str);
  345 extern char *quote_wild_whitespace(char *str);
  346 extern char *strip_line(char *line);
  347 extern const char *eat_re(char *s, t_bool eat_was);
  348 extern const char *get_val(const char *env, const char *def);
  349 extern const char *gnksa_strerror(int errcode);
  350 extern int gnksa_check_from(char *from);
  351 extern int gnksa_split_from(const char *from, char *address, char *realname, int *addrtype);
  352 extern int get_initials(struct t_article *art, char *s, int maxsize);
  353 extern int gnksa_do_check_from(const char *from, char *address, char *realname);
  354 extern int my_mkdir(char *path, mode_t mode);
  355 extern int parse_from(const char *from, char *address, char *realname);
  356 extern int strfmailer(const char *mail_prog, char *subject, char *to, const char *filename, char *dest, size_t maxsize, const char *format);
  357 extern int strfpath(const char *format, char *str, size_t maxsize, struct t_group *group, t_bool expand_all);
  358 extern int strfquote(const char *group, int respnum, char *s, size_t maxsize, char *format);
  359 extern int tin_version_info(FILE *fp);
  360 extern int tin_gettime(struct t_tintime *tt);
  361 extern long file_mtime(const char *file);
  362 extern long file_size(const char *file);
  363 extern t_bool backup_file(const char *filename, const char *backupname);
  364 extern t_bool copy_fp(FILE *fp_ip, FILE *fp_op);
  365 extern t_bool invoke_cmd(const char *nam);
  366 extern t_bool invoke_editor(const char *filename, int lineno, struct t_group *group);
  367 extern t_bool mail_check(void);
  368 extern void append_file(char *old_filename, char *new_filename);
  369 extern void asfail(const char *file, int line, const char *cond);
  370 extern void base_name(const char *fullpath, char *file);
  371 extern void cleanup_tmp_files(void);
  372 extern void copy_body(FILE *fp_ip, FILE *fp_op, char *prefix, char *initl, t_bool raw_data);
  373 extern void create_index_lock_file(char *the_lock_file);
  374 extern void dir_name(const char *fullpath, char *dir);
  375 extern void draw_mark_selected(int i);
  376 extern void draw_percent_mark(long cur_num, long max_num);
  377 extern void get_author(t_bool thread, struct t_article *art, char *str, size_t len);
  378 extern void get_cwd(char *buf);
  379 extern void make_base_group_path(const char *base_dir, const char *group_name, char *group_path, size_t group_path_len);
  380 extern void make_group_path(const char *name, char *path);
  381 extern void process_charsets(char **line, size_t *max_line_len, const char *network_charset, const char *local_charset, t_bool conv_tex2iso);
  382 extern void read_input_history_file(void);
  383 extern void rename_file(const char *old_filename, const char *new_filename);
  384 extern void show_inverse_video_status(void);
  385 extern void strip_name(const char *from, char *address);
  386 extern void tin_done(int ret, const char *fmt, ...);
  387 extern void toggle_inverse_video(void);
  388 #if defined(CHARSET_CONVERSION) || (defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE))
  389     extern char *utf8_valid(char *line);
  390 #endif /* CHARSET_CONVERSION || (MULTIBYTE_ABLE && !NO_LOCALE) */
  391 #if defined(NO_LOCALE) || !defined(MULTIBYTE_ABLE)
  392     extern int my_isprint(int c);
  393 #endif /* NO_LOCALE || !MULTIBYTE_ABLE */
  394 #ifdef CHARSET_CONVERSION
  395     extern t_bool buffer_to_network(char *line, int mmnwcharset);
  396 #endif /* CHARSET_CONVERSION */
  397 #ifdef HAVE_COLOR
  398     extern t_bool toggle_color(void);
  399     extern void show_color_status(void);
  400 #endif /* HAVE_COLOR */
  401 #ifdef HAVE_ISPELL
  402     extern t_bool invoke_ispell(const char *nam, struct t_group *group);
  403 #endif /* HAVE_ISPELL */
  404 #ifndef M_UNIX
  405     extern void make_post_process_cmd(char *cmd, char *dir, char *file);
  406 #endif /* !M_UNIX */
  407 #ifndef NO_SHELL_ESCAPE
  408     extern void shell_escape(void);
  409     extern void do_shell_escape(void);
  410 #endif /* !NO_SHELL_ESCAPE */
  411 
  412 /* newsrc.c */
  413 extern int group_get_art_info(char *tin_spooldir, char *groupname, int grouptype, t_artnum *art_count, t_artnum *art_max, t_artnum *art_min);
  414 extern signed long int read_newsrc(char *newsrc_file, t_bool allgroups);
  415 extern signed long int write_newsrc(void);
  416 extern t_bool pos_group_in_newsrc(struct t_group *group, int pos);
  417 extern void art_mark(struct t_group *group, struct t_article *art, int flag);
  418 extern void backup_newsrc(void);
  419 extern void catchup_newsrc_file(void);
  420 extern void delete_group(char *group);
  421 extern void expand_bitmap(struct t_group *group, t_artnum min);
  422 extern void grp_mark_read(struct t_group *group, struct t_article *art);
  423 extern void grp_mark_unread(struct t_group *group);
  424 extern void parse_unread_arts(struct t_group *group, t_artnum min);
  425 extern void reset_newsrc(void);
  426 extern void subscribe(struct t_group *group, int sub_state, t_bool get_info);
  427 extern void thd_mark_read(struct t_group *group, long thread);
  428 extern void thd_mark_unread(struct t_group *group, long thread);
  429 extern void set_default_bitmap(struct t_group *group);
  430 
  431 /* nntplib.c */
  432 extern FILE *get_nntp_fp(FILE *fp);
  433 /* extern FILE *get_nntp_wr_fp(FILE *fp); */
  434 extern char *getserverbyfile(const char *file);
  435 extern int nntp_open(void);
  436 extern void nntp_close(void);
  437 #ifdef NNTP_ABLE
  438     extern FILE *nntp_command(const char *, int, char *, size_t);
  439     extern char *get_server(char *string, int size);
  440     extern int get_respcode(char *, size_t);
  441     extern int get_only_respcode(char *, size_t);
  442     extern int new_nntp_command(const char *command, int success, char *message, size_t mlen);
  443     extern void put_server(const char *string);
  444     extern void u_put_server(const char *string);
  445 #endif /* NNTP_ABLE */
  446 
  447 /* nrctbl.c */
  448 extern t_bool get_newsrcname(char *newsrc_name, size_t newsrc_name_len, const char *nntpserver_name);
  449 #ifdef NNTP_ABLE
  450     extern void get_nntpserver(char *nntpserver_name, size_t nntpserver_name_len, char *nick_name);
  451 #endif /* NNTP_ABLE */
  452 
  453 /* options_menu.c */
  454 extern char *fmt_option_prompt(char *dst, size_t len, t_bool editing, enum option_enum option);
  455 extern void config_page(const char *grpname, enum context level);
  456 extern int option_row(enum option_enum option);
  457 extern t_bool option_is_visible(enum option_enum option);
  458 extern void check_score_defaults(void);
  459 extern void refresh_config_page(enum option_enum act_option);
  460 extern void show_menu_help(const char *help_message);
  461 
  462 /* page.c */
  463 extern int show_page(struct t_group *group, int start_respnum, int *threadnum);
  464 extern void display_info_page(int part);
  465 extern void draw_page(const char *group, int part);
  466 extern void info_pager(FILE *info_fh, const char *title, t_bool wrap_at_ends);
  467 extern void resize_article(t_bool wrap_lines, t_openartinfo *artinfo);
  468 extern void toggle_raw(struct t_group *group);
  469 
  470 /* parsdate.y */
  471 extern time_t parsedate(char *p, TIMEINFO *now);
  472 
  473 /* pgp.c */
  474 #ifdef HAVE_PGP_GPG
  475     extern t_bool pgp_check_article(t_openartinfo *artinfo);
  476     extern void init_pgp(void);
  477     extern void invoke_pgp_mail(const char *nam, char *mail_to);
  478     extern void invoke_pgp_news(char *artfile);
  479 #endif /* HAVE_PGP_GPG */
  480 
  481 /* plp_snprintf.c */
  482 #ifndef HAVE_SNPRINTF
  483     extern int plp_snprintf(char *, size_t, const char *, ...);
  484 #endif /* !HAVE_SNPRINTF */
  485 #ifndef HAVE_VSNPRINTF
  486     extern int plp_vsnprintf(char *, size_t, const char *, va_list);
  487 #endif /* !HAVE_VSNPRINTF */
  488 
  489 /* post.c */
  490 extern char *backup_article_name(const char *the_article);
  491 extern char *checknadd_headers(const char *infile, struct t_group *group);
  492 extern int count_postponed_articles(void);
  493 extern int mail_to_author(const char *group, int respnum, t_bool copy_text, t_bool with_headers, t_bool raw_data);
  494 extern int mail_to_someone(const char *address, t_bool confirm_to_mail, t_openartinfo *artinfo, const struct t_group *group);
  495 extern int post_response(const char *groupname, int respnum, t_bool copy_text, t_bool with_headers, t_bool raw_data);
  496 extern int repost_article(const char *groupname, int respnum, t_bool supersede, t_openartinfo *artinfo);
  497 extern t_bool cancel_article(struct t_group *group, struct t_article *art, int respnum);
  498 extern t_bool mail_bug_report(void);
  499 extern t_bool pickup_postponed_articles(t_bool ask, t_bool all);
  500 extern t_bool post_article(const char *groupname);
  501 extern t_bool reread_active_after_posting(void);
  502 extern t_bool user_posted_messages(void);
  503 extern void init_postinfo(void);
  504 extern void quick_post_article(t_bool postponed_only);
  505 #if defined(SIGWINCH) || defined(SIGTSTP)
  506     extern void refresh_post_screen(int context);
  507 #endif /* SIGWINCH || SIGTSTP */
  508 #ifdef USE_CANLOCK
  509     extern char *build_canlock(const char *messageid, const char *secret);
  510     extern char *get_secret(void);
  511 #endif /* USE_CANLOCK */
  512 
  513 /* prompt.c */
  514 extern char *prompt_string_default(const char *prompt, char *def, const char *failtext, int history);
  515 extern char *sized_message(char **result, const char *format, const char *subject);
  516 extern int prompt_num(int ch, const char *prompt);
  517 extern int prompt_yn(const char *prompt, t_bool default_answer);
  518 extern int prompt_msgid(void);
  519 extern t_bool prompt_default_string(const char *prompt, char *buf, int buf_len, char *default_prompt, int which_hist);
  520 extern t_bool prompt_menu_string(int line, const char *prompt, char *var);
  521 extern t_bool prompt_option_char(enum option_enum option);
  522 extern t_bool prompt_option_list(enum option_enum option);
  523 extern t_bool prompt_option_num(enum option_enum option);
  524 extern t_bool prompt_option_on_off(enum option_enum option);
  525 extern t_bool prompt_option_string(enum option_enum option);
  526 extern t_bool prompt_string(const char *prompt, char *buf, int which_hist);
  527 extern void prompt_continue(void);
  528 extern void prompt_slk_redraw(void);
  529 extern void prompt_yn_redraw(void);
  530 
  531 /* read.c */
  532 extern char *tin_fgets(FILE *fp, t_bool header);
  533 #ifdef NNTP_ABLE
  534     extern void drain_buffer(FILE *fp);
  535 #endif /* NNTP_ABLE */
  536 
  537 /* refs.c */
  538 extern char *get_references(struct t_msgid *refptr);
  539 extern struct t_msgid *find_msgid(const char *msgid);
  540 extern void build_references(struct t_group *group);
  541 extern void clear_art_ptrs(void);
  542 extern void collate_subjects(void);
  543 extern void free_msgids(void);
  544 extern void thread_by_reference(void);
  545 
  546 /* regex.c */
  547 extern t_bool compile_regex(const char *regex, struct regex_cache *cache, int options);
  548 extern t_bool match_regex(const char *string, char *pattern, struct regex_cache *cache, t_bool icase);
  549 extern void highlight_regexes(int row, struct regex_cache *regex, int color);
  550 
  551 /* rfc1524.c */
  552 extern t_mailcap *get_mailcap_entry(t_part *part, const char *path);
  553 extern void free_mailcap(t_mailcap *tmailcap);
  554 
  555 /* rfc2045.c */
  556 extern int read_decoded_base64_line(FILE *file, char **line, size_t *max_line_len, const int max_lines_to_read, char **rest);
  557 extern int read_decoded_qp_line(FILE *file, char **line, size_t *max_line_len, const int max_lines_to_read);
  558 extern void rfc1521_encode(char *line, FILE *f, int e);
  559 
  560 /* rfc2046.c */
  561 extern FILE *open_art_fp(struct t_group *group, t_artnum art);
  562 extern const char *get_param(t_param *list, const char *name);
  563 extern char *parse_header(char *buf, const char *pat, t_bool decode, t_bool structured, t_bool keep_tab);
  564 extern int art_open(t_bool wrap_lines, struct t_article *art, struct t_group *group, t_openartinfo *artinfo, t_bool show_progress_meter, const char *pmesg);
  565 extern int content_type(char *type);
  566 extern int parse_rfc822_headers(struct t_header *hdr, FILE *from, FILE *to);
  567 extern t_param *new_params(void);
  568 extern t_part *new_part(t_part *part);
  569 extern void art_close(t_openartinfo *artinfo);
  570 extern void free_and_init_header(struct t_header *hdr);
  571 extern void free_list(t_param *list);
  572 extern void free_parts(t_part *ptr);
  573 extern void unfold_header(char *line);
  574 
  575 /* rfc2047.c */
  576 extern char *rfc1522_decode(const char *s);
  577 extern char *rfc1522_encode(char *s, const char *charset, t_bool ismail);
  578 extern int mmdecode(const char *what, int encoding, int delimiter, char *where);
  579 extern void rfc15211522_encode(const char *filename, constext *mime_encoding, struct t_group *group, t_bool allow_8bit_header, t_bool ismail);
  580 extern void compose_mail_mime_forwarded(const char *filename, FILE *articlefp, t_bool include_text, struct t_group *group);
  581 extern void compose_mail_text_plain(const char *filename, struct t_group *group);
  582 
  583 /* save.c */
  584 extern int check_start_save_any_news(int function, t_bool catchup);
  585 extern t_bool create_path(const char *path);
  586 extern t_bool post_process_files(t_function proc_type_func, t_bool auto_delete);
  587 extern 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);
  588 extern t_part *get_part(int n);
  589 extern t_url *find_url(int n);
  590 extern void attachment_page(t_openartinfo *art);
  591 extern void decode_save_mime(t_openartinfo *art, t_bool postproc);
  592 extern void print_art_separator_line(FILE *fp, t_bool is_mailbox);
  593 
  594 /* screen.c */
  595 extern char *fmt_message(const char *fmt, va_list ap);
  596 extern void center_line(int line, t_bool inverse, const char *str);
  597 extern void clear_message(void);
  598 extern void draw_arrow_mark(int line);
  599 extern void erase_arrow(void);
  600 extern void error_message(unsigned int sdelay, const char *fmt, ...);
  601 extern void info_message(const char *fmt, ...);
  602 extern void perror_message(const char *fmt, ...);
  603 extern void ring_bell(void);
  604 extern void show_progress(const char *txt, t_artnum count, t_artnum total);
  605 extern void show_title(const char *title);
  606 extern void spin_cursor(void);
  607 extern void stow_cursor(void);
  608 extern void wait_message(unsigned int sdelay, const char *fmt, ...);
  609 
  610 /* search.c */
  611 extern enum option_enum search_config(t_bool forward, t_bool repeat, enum option_enum current, enum option_enum last);
  612 extern int get_search_vectors(int *start, int *end);
  613 extern int search(t_function func, int current_art, t_bool repeat);
  614 extern int search_active(t_bool forward, t_bool repeat);
  615 extern int search_article(t_bool forward, t_bool repeat, int start_line, int lines, t_lineinfo *line, int reveal_ctrl_l_lines, FILE *fp);
  616 extern int search_body(struct t_group *group, int current_art, t_bool repeat);
  617 extern int generic_search(t_bool forward, t_bool repeat, int current, int last, int level);
  618 extern void reset_srch_offsets(void);
  619 
  620 /* select.c */
  621 extern int add_my_group(const char *group, t_bool add, t_bool ignore_case);
  622 extern int choose_new_group(void);
  623 extern int skip_newgroups(void);
  624 extern void selection_page(int start_groupnum, int num_cmd_line_groups);
  625 extern void show_selection_page(void);
  626 extern void toggle_my_groups(const char *group);
  627 
  628 /* sigfile.c */
  629 extern void msg_write_signature(FILE *fp, t_bool include_dot_signature, struct t_group *thisgroup);
  630 
  631 /* signal.c */
  632 extern RETSIGTYPE(*sigdisp (int signum, RETSIGTYPE (*func)(SIG_ARGS))) (SIG_ARGS);
  633 extern t_bool set_win_size(int *num_lines, int *num_cols);
  634 extern void allow_resize(t_bool allow);
  635 extern void handle_resize(t_bool repaint);
  636 extern void set_noteslines(int num_lines);
  637 extern void set_signal_catcher(int flag);
  638 extern void set_signal_handlers(void);
  639 
  640 /* strftime.c */
  641 extern size_t my_strftime(char *s, size_t maxsize, const char *format, struct tm *timeptr);
  642 
  643 /* string.c */
  644 extern char *eat_tab(char *s);
  645 extern char *fmt_string(const char *fmt, ...);
  646 extern char *my_strdup(const char *str);
  647 extern char *str_trim(char *string);
  648 extern char *strunc(const char *message, int len);
  649 extern char *tin_ltoa(t_artnum value, int digits);
  650 extern char *tin_strtok(char *str, const char *delim);
  651 extern int sh_format(char *dst, size_t len, const char *fmt, ...);
  652 extern int strwidth(const char *str);
  653 extern size_t mystrcat(char **t, const char *s);
  654 extern void my_strncpy(char *p, const char *q, size_t n);
  655 extern void parse_format_string(const char *fmtstr, struct t_fmt *fmt);
  656 extern void str_lwr(char *str);
  657 #if !defined(HAVE_STRCASESTR) || defined(DECL_STRCASESTR)
  658     extern char *strcasestr(const char *haystack, const char *needle);
  659 #endif /* !HAVE_STRCASESTR || DECL_STRCASESTR */
  660 #if !defined(HAVE_STRSEP) || defined(DECL_SEP)
  661     extern char *strsep(char **stringp, const char *delim);
  662 #endif /* !HAVE_STRSEP || DECL_STRSEP */
  663 #ifndef HAVE_STRPBRK
  664     extern char *strpbrk(const char *str1, const char *str2);
  665 #endif /* !HAVE_STRPBRK */
  666 #ifndef HAVE_STRSTR
  667     extern char *strstr(const char *text, const char *pattern);
  668 #endif /* !HAVE_STRSTR */
  669 #ifndef HAVE_STRCASECMP
  670     extern int strcasecmp(const char *p, const char *q);
  671 #endif /* !HAVE STRCASECMP */
  672 #ifndef HAVE_STRNCASECMP
  673     extern int strncasecmp(const char *p, const char *q, size_t n);
  674 #endif /* !HAVE_STRNCASECMP */
  675 #ifndef HAVE_ATOI
  676     extern int atoi(const char *s);
  677 #endif /* !HAVE_ATOI */
  678 #ifndef HAVE_ATOL
  679     extern long atol(const char *s);
  680 #endif /* !HAVE_ATOL */
  681 #ifndef HAVE_STRTOL
  682     extern long strtol(const char *str, char **ptr, int use_base);
  683 #endif /* !HAVE STRTOL */
  684 #ifndef HAVE_STRERROR
  685     extern char *my_strerror(int n);
  686 #   define strerror(n) my_strerror(n)
  687 #endif /* !HAVE_STRERROR */
  688 #ifndef HAVE_STRRSTR
  689     extern char *my_strrstr(const char *str, const char *pat);
  690 #   define strrstr(s,p) my_strrstr(s,p)
  691 #endif /* !HAVE_STRRSTR */
  692 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  693     extern char *spart(const char *str, int columns, t_bool pad);
  694     extern char *wchar_t2char(const wchar_t *wstr);
  695     extern wchar_t *abbr_wcsgroupname(const wchar_t *grpname, int len);
  696     extern wchar_t *char2wchar_t(const char *str);
  697     extern wchar_t *wcspart(const wchar_t *wstr, int columns, t_bool pad);
  698     extern wchar_t *wexpand_tab(wchar_t *wstr, size_t tab_width);
  699     extern wchar_t *wstrunc(const wchar_t *wmessage, int len);
  700 #else
  701     extern char *abbr_groupname(const char *grpname, size_t len);
  702     extern char *expand_tab(char *str, size_t tab_width);
  703 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
  704 #if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && defined(HAVE_UNICODE_UBIDI_H) && !defined(NO_LOCALE)
  705     extern char *render_bidi(const char *str, t_bool *is_rtl);
  706 #endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && HAVE_UNICODE_UBIDI_H && !NO_LOCALE */
  707 #ifdef HAVE_UNICODE_NORMALIZATION
  708     extern char *normalize(const char *str);
  709 #endif /* HAVE_UNICODE_NORMALIZATION */
  710 #if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  711     extern UChar *char2UChar(const char *str);
  712     extern char *UChar2char(const UChar *ustr);
  713 #endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && !NO_LOCALE */
  714 
  715 /* tags.c */
  716 extern int line_is_tagged(int n);
  717 extern int tag_multipart(int base_index);
  718 extern t_bool arts_selected(void);
  719 extern t_bool set_range(int level, int min, int max, int curr);
  720 extern t_bool tag_article(int art);
  721 extern t_bool untag_all_articles(void);
  722 extern void do_auto_select_arts(void);
  723 extern void undo_auto_select_arts(void);
  724 extern void undo_selections(void);
  725 extern void untag_article(long art);
  726 
  727 /* tmpfile.c */
  728 #ifndef HAVE_TMPFILE
  729     extern FILE *tmpfile(void);
  730 #endif /* !HAVE_TMPFILE */
  731 
  732 /* my_tmpfile.c */
  733 extern int my_tmpfile(char *filename, size_t name_size, const char *base_dir);
  734 
  735 /* thread.c */
  736 extern int find_response(int i, int n);
  737 extern int get_score_of_thread(int n);
  738 extern int new_responses(int thread);
  739 extern int next_response(int n);
  740 extern int next_thread(int n);
  741 extern int next_unread(int n);
  742 extern int num_of_responses(int n);
  743 extern int prev_response(int n);
  744 extern int prev_unread(int n);
  745 extern int stat_thread(int n, struct t_art_stat *sbuf);
  746 extern int which_response(int n);
  747 extern int which_thread(int n);
  748 extern int thread_page(struct t_group *group, int respnum, int thread_depth, t_pagerinfo *page);
  749 extern t_bool thread_mark_postprocess(int function, t_function feed_type, int respnum);
  750 extern void fixup_thread(int respnum, t_bool redraw);
  751 
  752 /* version.c */
  753 extern enum rc_state check_upgrade(char *line, const char *skip, const char *version);
  754 extern void upgrade_prompt_quit(enum rc_state reason, const char *file);
  755 
  756 /* wildmat.c */
  757 extern t_bool wildmat(const char *text, char *p, t_bool icase);
  758 extern t_bool wildmatpos(const char *text, char *p, t_bool icase, int *srch_offsets, int srch_offsets_size);
  759 
  760 /* xface.c */
  761 #ifdef XFACE_ABLE
  762     extern void slrnface_stop(void);
  763     extern void slrnface_start(void);
  764     extern void slrnface_display_xface(char *face);
  765     extern void slrnface_clear_xface(void);
  766     extern void slrnface_suppress_xface(void);
  767     extern void slrnface_show_xface(void);
  768 #endif /* XFACE_ABLE */
  769 
  770 /* xref.c */
  771 extern t_bool overview_xref_support(void);
  772 extern void NSETRNG0(t_bitmap *bitmap, t_artnum low, t_artnum high);
  773 extern void NSETRNG1(t_bitmap *bitmap, t_artnum low, t_artnum high);
  774 extern void art_mark_xref_read(struct t_article *art);
  775 
  776 #endif /* !PROTO_H */