"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.6.1/include/proto.h" (22 Dec 2021, 33805 Bytes) of package /linux/misc/tin-2.6.1.tar.xz:


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.6.0_vs_2.6.1.

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