"Fossies" - the Fresh Open Source Software Archive

Member "tin-2.4.3/include/proto.h" (23 Nov 2018, 33277 Bytes) of package /linux/misc/tin-2.4.3.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.4.2_vs_2.4.3.

    1 /*
    2  *  Project   : tin - a Usenet reader
    3  *  Module    : proto.h
    4  *  Author    : Urs Janssen <urs@tin.org>
    5  *  Created   :
    6  *  Updated   : 2018-02-13
    7  *  Notes     :
    8  *
    9  * Copyright (c) 1997-2019 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 filter_on_path(struct t_group *group);
  194 extern t_bool quick_filter(t_function type, struct t_group *group, struct t_article *art);
  195 extern t_bool quick_filter_select_posted_art(struct t_group *group, const char *subj, const char *a_message_id);
  196 extern t_bool read_filter_file(const char *file);
  197 extern void free_filter_array(struct t_filters *ptr);
  198 #if defined(SIGWINCH) || defined(SIGTSTP)
  199     extern void refresh_filter_menu(void);
  200 #endif /* SIGWINCH || SIGTSTP */
  201 extern void unfilter_articles(struct t_group *group);
  202 extern void write_filter_file(const char *filename);
  203 
  204 /* getline.c */
  205 extern char *tin_getline(const char *prompt, int number_only, const char *str, int max_chars, t_bool passwd, int which_hist);
  206 extern void gl_redraw(void);
  207 
  208 /* global.c */
  209 extern void bug_report(void);
  210 extern void move_up(void);
  211 extern void move_down(void);
  212 extern void page_up(void);
  213 extern void page_down(void);
  214 extern void top_of_list(void);
  215 extern void end_of_list(void);
  216 extern void move_to_item(int n);
  217 extern void prompt_item_num(int ch, const char *prompt);
  218 extern void scroll_down(void);
  219 extern void scroll_up(void);
  220 extern void set_first_screen_item(void);
  221 
  222 /* group.c */
  223 extern int group_page(struct t_group *group);
  224 extern t_bool group_mark_postprocess(int function, t_function feed_type, int respnum);
  225 extern void clear_note_area(void);
  226 extern void mark_screen(int screen_row, int screen_col, const char *value);
  227 extern void pos_first_unread_thread(void);
  228 extern void show_group_page(void);
  229 
  230 /* hashstr.c */
  231 extern char *hash_str(const char *s);
  232 extern void hash_init(void);
  233 extern void hash_reclaim(void);
  234 
  235 /* help.c */
  236 extern void show_help_page(const int level, const char *title);
  237 extern void show_mini_help(int level);
  238 extern void toggle_mini_help(int level);
  239 
  240 /* header.c */
  241 extern const char *get_domain_name(void);
  242 extern const char *get_fqdn(const char *host);
  243 extern const char *get_host_name(void);
  244 #ifndef FORGERY
  245     extern char *build_sender(void);
  246 #endif /* !FORGERY */
  247 
  248 /* heapsort.c */
  249 #ifndef HAVE_HEAPSORT
  250     extern int heapsort(void *, size_t, size_t, t_compfunc);
  251 #endif /* !HAVE_HEAPSORT */
  252 
  253 /* inews.c */
  254 extern t_bool submit_news_file(char *name, struct t_group *group, char *a_message_id);
  255 extern void get_from_name(char *from_name, struct t_group *thisgrp);
  256 extern void get_user_info(char *user_name, char *full_name);
  257 
  258 /* init.c */
  259 extern void init_selfinfo(void);
  260 extern void postinit_regexp(void);
  261 #ifdef HAVE_COLOR
  262     extern void postinit_colors(int last_color);
  263 #endif /* HAVE_COLOR */
  264 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  265     extern t_bool utf8_pcre(void);
  266 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
  267 
  268 /* joinpath.c */
  269 extern void joinpath(char *result, size_t result_size, const char *dir, const char *file);
  270 
  271 /* keymap.c */
  272 extern t_bool read_keymap_file(void);
  273 extern void free_keymaps(void);
  274 extern void setup_default_keys(void);
  275 
  276 /* langinfo.c */
  277 #ifndef NO_LOCALE
  278     extern const char *tin_nl_langinfo(nl_item item);
  279 #endif /* !NO_LOCALE */
  280 
  281 /* list.c */
  282 extern char *random_organization(char *in_org);
  283 extern int find_group_index(const char *group, t_bool ignore_case);
  284 extern struct t_group *group_add(const char *group);
  285 extern struct t_group *group_find(const char *group_name, t_bool ignore_case);
  286 extern unsigned long hash_groupname(const char *group);
  287 extern void group_rehash(t_bool yanked_out);
  288 extern void init_group_hash(void);
  289 
  290 /* lock.c */
  291 extern int fd_lock(int fd, t_bool block);
  292 extern int fd_unlock(int fd);
  293 extern t_bool dot_lock(const char *filename);
  294 extern t_bool dot_unlock(const char *filename);
  295 #if 0 /* unused */
  296     extern int test_fd_lock(int fd);
  297 #endif /* 0 */
  298 
  299 /* mail.c */
  300 extern t_bool art_edit(struct t_group *group, struct t_article *article);
  301 extern void find_art_max_min(const char *group_path, t_artnum *art_max, t_artnum *art_min);
  302 extern void print_active_head(const char *active_file);
  303 extern void print_group_line(FILE *fp, const char *group_name, t_artnum art_max, t_artnum art_min, const char *base_dir);
  304 extern void read_descriptions(t_bool verb);
  305 extern void grp_del_mail_arts(struct t_group *group);
  306 extern void grp_del_mail_art(struct t_article *article);
  307 #ifdef HAVE_MH_MAIL_HANDLING
  308     extern void read_mail_active_file(void);
  309     extern void write_mail_active_file(void);
  310 #endif /* HAVE_MH_MAIL_HANDLING */
  311 
  312 /* main.c */
  313 extern int main(int argc, char *argv[]);
  314 extern int read_cmd_line_groups(void);
  315 extern void giveup(void);
  316 
  317 /* memory.c */
  318 extern void expand_active(void);
  319 extern void expand_art(void);
  320 extern void expand_base(void);
  321 extern void expand_newnews(void);
  322 extern void expand_save(void);
  323 extern void expand_scope(void);
  324 extern void init_alloc(void);
  325 extern void free_all_arrays(void);
  326 extern void free_art_array(void);
  327 extern void free_save_array(void);
  328 extern void free_scope(int num);
  329 extern void *my_malloc1(const char *file, int line, size_t size);
  330 extern void *my_calloc1(const char *file, int line, size_t nmemb, size_t size);
  331 extern void *my_realloc1(const char *file, int line, void *p, size_t size);
  332 #ifndef USE_CURSES
  333     extern void init_screen_array(t_bool allocate);
  334 #endif /* !USE_CURSES */
  335 
  336 /* mimetypes.c */
  337 extern void lookup_mimetype(const char *ext, t_part *part);
  338 extern t_bool lookup_extension(char *extension, size_t ext_len, const char *major, const char *minor);
  339 
  340 /* misc.c */
  341 extern char *buffer_to_ascii(char *c);
  342 extern char *escape_shell_meta(const char *source, int quote_area);
  343 extern char *get_tmpfilename(const char *filename);
  344 extern char *idna_decode(char *in);
  345 extern char *quote_wild(char *str);
  346 extern char *quote_wild_whitespace(char *str);
  347 extern char *strip_line(char *line);
  348 extern const char *eat_re(char *s, t_bool eat_was);
  349 extern const char *get_val(const char *env, const char *def);
  350 extern const char *gnksa_strerror(int errcode);
  351 extern int gnksa_check_from(char *from);
  352 extern int gnksa_split_from(const char *from, char *address, char *realname, int *addrtype);
  353 extern int get_initials(struct t_article *art, char *s, int maxsize);
  354 extern int gnksa_do_check_from(const char *from, char *address, char *realname);
  355 extern int my_mkdir(char *path, mode_t mode);
  356 extern int parse_from(const char *from, char *address, char *realname);
  357 extern int strfmailer(const char *mail_prog, char *subject, char *to, const char *filename, char *dest, size_t maxsize, const char *format);
  358 extern int strfpath(const char *format, char *str, size_t maxsize, struct t_group *group, t_bool expand_all);
  359 extern int strfquote(const char *group, int respnum, char *s, size_t maxsize, char *format);
  360 extern int tin_version_info(FILE *fp);
  361 extern int tin_gettime(struct t_tintime *tt);
  362 extern long file_mtime(const char *file);
  363 extern long file_size(const char *file);
  364 extern t_bool backup_file(const char *filename, const char *backupname);
  365 extern t_bool copy_fp(FILE *fp_ip, FILE *fp_op);
  366 extern t_bool invoke_cmd(const char *nam);
  367 extern t_bool invoke_editor(const char *filename, int lineno, struct t_group *group);
  368 extern t_bool mail_check(void);
  369 extern void append_file(char *old_filename, char *new_filename);
  370 extern void asfail(const char *file, int line, const char *cond);
  371 extern void base_name(const char *fullpath, char *file);
  372 extern void cleanup_tmp_files(void);
  373 extern void copy_body(FILE *fp_ip, FILE *fp_op, char *prefix, char *initl, t_bool raw_data);
  374 extern void create_index_lock_file(char *the_lock_file);
  375 extern void dir_name(const char *fullpath, char *dir);
  376 extern void draw_mark_selected(int i);
  377 extern void draw_percent_mark(long cur_num, long max_num);
  378 extern void get_author(t_bool thread, struct t_article *art, char *str, size_t len);
  379 extern void get_cwd(char *buf);
  380 extern void make_base_group_path(const char *base_dir, const char *group_name, char *group_path, size_t group_path_len);
  381 extern void make_group_path(const char *name, char *path);
  382 extern void process_charsets(char **line, size_t *max_line_len, const char *network_charset, const char *local_charset, t_bool conv_tex2iso);
  383 extern void read_input_history_file(void);
  384 extern void rename_file(const char *old_filename, const char *new_filename);
  385 extern void show_inverse_video_status(void);
  386 extern void strip_name(const char *from, char *address);
  387 extern void tin_done(int ret, const char *fmt, ...);
  388 extern void toggle_inverse_video(void);
  389 #if defined(CHARSET_CONVERSION) || (defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE))
  390     extern char *utf8_valid(char *line);
  391 #endif /* CHARSET_CONVERSION || (MULTIBYTE_ABLE && !NO_LOCALE) */
  392 #if defined(NO_LOCALE) || !defined(MULTIBYTE_ABLE)
  393     extern int my_isprint(int c);
  394 #endif /* NO_LOCALE || !MULTIBYTE_ABLE */
  395 #ifdef CHARSET_CONVERSION
  396     extern t_bool buffer_to_network(char *line, int mmnwcharset);
  397 #endif /* CHARSET_CONVERSION */
  398 #ifdef HAVE_COLOR
  399     extern t_bool toggle_color(void);
  400     extern void show_color_status(void);
  401 #endif /* HAVE_COLOR */
  402 #ifdef HAVE_ISPELL
  403     extern t_bool invoke_ispell(const char *nam, struct t_group *group);
  404 #endif /* HAVE_ISPELL */
  405 #ifndef M_UNIX
  406     extern void make_post_process_cmd(char *cmd, char *dir, char *file);
  407 #endif /* !M_UNIX */
  408 #ifndef NO_SHELL_ESCAPE
  409     extern void shell_escape(void);
  410     extern void do_shell_escape(void);
  411 #endif /* !NO_SHELL_ESCAPE */
  412 
  413 /* newsrc.c */
  414 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);
  415 extern signed long int read_newsrc(char *newsrc_file, t_bool allgroups);
  416 extern signed long int write_newsrc(void);
  417 extern t_bool pos_group_in_newsrc(struct t_group *group, int pos);
  418 extern void art_mark(struct t_group *group, struct t_article *art, int flag);
  419 extern void backup_newsrc(void);
  420 extern void catchup_newsrc_file(void);
  421 extern void delete_group(char *group);
  422 extern void expand_bitmap(struct t_group *group, t_artnum min);
  423 extern void grp_mark_read(struct t_group *group, struct t_article *art);
  424 extern void grp_mark_unread(struct t_group *group);
  425 extern void parse_unread_arts(struct t_group *group, t_artnum min);
  426 extern void reset_newsrc(void);
  427 extern void subscribe(struct t_group *group, int sub_state, t_bool get_info);
  428 extern void thd_mark_read(struct t_group *group, long thread);
  429 extern void thd_mark_unread(struct t_group *group, long thread);
  430 extern void set_default_bitmap(struct t_group *group);
  431 
  432 /* nntplib.c */
  433 extern FILE *get_nntp_fp(FILE *fp);
  434 /* extern FILE *get_nntp_wr_fp(FILE *fp); */
  435 extern char *getserverbyfile(const char *file);
  436 extern int nntp_open(void);
  437 extern void nntp_close(void);
  438 #ifdef NNTP_ABLE
  439     extern FILE *nntp_command(const char *, int, char *, size_t);
  440     extern char *get_server(char *string, int size);
  441     extern int check_extensions(int);
  442     extern int get_respcode(char *, size_t);
  443     extern int get_only_respcode(char *, size_t);
  444     extern int new_nntp_command(const char *command, int success, char *message, size_t mlen);
  445     extern void put_server(const char *string);
  446     extern void u_put_server(const char *string);
  447 #endif /* NNTP_ABLE */
  448 
  449 /* nrctbl.c */
  450 extern t_bool get_newsrcname(char *newsrc_name, size_t newsrc_name_len, const char *nntpserver_name);
  451 #ifdef NNTP_ABLE
  452     extern void get_nntpserver(char *nntpserver_name, size_t nntpserver_name_len, char *nick_name);
  453 #endif /* NNTP_ABLE */
  454 
  455 /* options_menu.c */
  456 extern char *fmt_option_prompt(char *dst, size_t len, t_bool editing, enum option_enum option);
  457 extern void config_page(const char *grpname, enum context level);
  458 extern int option_row(enum option_enum option);
  459 extern t_bool option_is_visible(enum option_enum option);
  460 extern void check_score_defaults(void);
  461 extern void refresh_config_page(enum option_enum act_option);
  462 extern void show_menu_help(const char *help_message);
  463 
  464 /* page.c */
  465 extern int show_page(struct t_group *group, int start_respnum, int *threadnum);
  466 extern void display_info_page(int part);
  467 extern void draw_page(const char *group, int part);
  468 extern void info_pager(FILE *info_fh, const char *title, t_bool wrap_at_ends);
  469 extern void resize_article(t_bool wrap_lines, t_openartinfo *artinfo);
  470 extern void toggle_raw(struct t_group *group);
  471 
  472 /* parsdate.y */
  473 extern time_t parsedate(char *p, TIMEINFO *now);
  474 
  475 /* pgp.c */
  476 #ifdef HAVE_PGP_GPG
  477     extern t_bool pgp_check_article(t_openartinfo *artinfo);
  478     extern void init_pgp(void);
  479     extern void invoke_pgp_mail(const char *nam, char *mail_to);
  480     extern void invoke_pgp_news(char *artfile);
  481 #endif /* HAVE_PGP_GPG */
  482 
  483 /* plp_snprintf.c */
  484 #ifndef HAVE_SNPRINTF
  485     extern int plp_snprintf(char *, size_t, const char *, ...);
  486 #endif /* !HAVE_SNPRINTF */
  487 #ifndef HAVE_VSNPRINTF
  488     extern int plp_vsnprintf(char *, size_t, const char *, va_list);
  489 #endif /* !HAVE_VSNPRINTF */
  490 
  491 /* post.c */
  492 extern char *backup_article_name(const char *the_article);
  493 extern char *checknadd_headers(const char *infile, struct t_group *group);
  494 extern int count_postponed_articles(void);
  495 extern int mail_to_author(const char *group, int respnum, t_bool copy_text, t_bool with_headers, t_bool raw_data);
  496 extern int mail_to_someone(const char *address, t_bool confirm_to_mail, t_openartinfo *artinfo, const struct t_group *group);
  497 extern int post_response(const char *groupname, int respnum, t_bool copy_text, t_bool with_headers, t_bool raw_data);
  498 extern int repost_article(const char *groupname, int respnum, t_bool supersede, t_openartinfo *artinfo);
  499 extern t_bool cancel_article(struct t_group *group, struct t_article *art, int respnum);
  500 extern t_bool mail_bug_report(void);
  501 extern t_bool pickup_postponed_articles(t_bool ask, t_bool all);
  502 extern t_bool post_article(const char *groupname);
  503 extern t_bool reread_active_after_posting(void);
  504 extern t_bool user_posted_messages(void);
  505 extern void init_postinfo(void);
  506 extern void quick_post_article(t_bool postponed_only, int num_cmd_line_groups);
  507 #if defined(SIGWINCH) || defined(SIGTSTP)
  508     extern void refresh_post_screen(int context);
  509 #endif /* SIGWINCH || SIGTSTP */
  510 #ifdef USE_CANLOCK
  511     extern char *build_canlock(const char *messageid, const char *secret);
  512     extern char *get_secret(void);
  513 #endif /* USE_CANLOCK */
  514 
  515 /* prompt.c */
  516 extern char *prompt_string_default(const char *prompt, char *def, const char *failtext, int history);
  517 extern char *sized_message(char **result, const char *format, const char *subject);
  518 extern int prompt_num(int ch, const char *prompt);
  519 extern int prompt_yn(const char *prompt, t_bool default_answer);
  520 extern int prompt_msgid(void);
  521 extern t_bool prompt_default_string(const char *prompt, char *buf, int buf_len, char *default_prompt, int which_hist);
  522 extern t_bool prompt_menu_string(int line, const char *prompt, char *var);
  523 extern t_bool prompt_option_char(enum option_enum option);
  524 extern t_bool prompt_option_list(enum option_enum option);
  525 extern t_bool prompt_option_num(enum option_enum option);
  526 extern t_bool prompt_option_on_off(enum option_enum option);
  527 extern t_bool prompt_option_string(enum option_enum option);
  528 extern t_bool prompt_string(const char *prompt, char *buf, int which_hist);
  529 extern void prompt_continue(void);
  530 extern void prompt_slk_redraw(void);
  531 extern void prompt_yn_redraw(void);
  532 
  533 /* read.c */
  534 extern char *tin_fgets(FILE *fp, t_bool header);
  535 #ifdef NNTP_ABLE
  536     extern void drain_buffer(FILE *fp);
  537 #endif /* NNTP_ABLE */
  538 
  539 /* refs.c */
  540 extern char *get_references(struct t_msgid *refptr);
  541 extern struct t_msgid *find_msgid(const char *msgid);
  542 extern void build_references(struct t_group *group);
  543 extern void clear_art_ptrs(void);
  544 extern void collate_subjects(void);
  545 extern void free_msgids(void);
  546 extern void thread_by_reference(void);
  547 
  548 /* regex.c */
  549 extern t_bool compile_regex(const char *regex, struct regex_cache *cache, int options);
  550 extern t_bool match_regex(const char *string, char *pattern, struct regex_cache *cache, t_bool icase);
  551 extern void highlight_regexes(int row, struct regex_cache *regex, int color);
  552 
  553 /* rfc1524.c */
  554 extern t_mailcap *get_mailcap_entry(t_part *part, const char *path);
  555 extern void free_mailcap(t_mailcap *tmailcap);
  556 
  557 /* rfc2045.c */
  558 extern int read_decoded_base64_line(FILE *file, char **line, size_t *max_line_len, const int max_lines_to_read, char **rest);
  559 extern int read_decoded_qp_line(FILE *file, char **line, size_t *max_line_len, const int max_lines_to_read);
  560 extern void rfc1521_encode(char *line, FILE *f, int e);
  561 
  562 /* rfc2046.c */
  563 extern FILE *open_art_fp(struct t_group *group, t_artnum art);
  564 extern const char *get_param(t_param *list, const char *name);
  565 extern char *parse_header(char *buf, const char *pat, t_bool decode, t_bool structured, t_bool keep_tab);
  566 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);
  567 extern int content_type(char *type);
  568 extern int parse_rfc822_headers(struct t_header *hdr, FILE *from, FILE *to);
  569 extern t_param *new_params(void);
  570 extern t_part *new_part(t_part *part);
  571 extern void art_close(t_openartinfo *artinfo);
  572 extern void free_and_init_header(struct t_header *hdr);
  573 extern void free_list(t_param *list);
  574 extern void free_parts(t_part *ptr);
  575 extern void unfold_header(char *line);
  576 
  577 /* rfc2047.c */
  578 extern char *rfc1522_decode(const char *s);
  579 extern char *rfc1522_encode(char *s, const char *charset, t_bool ismail);
  580 extern int mmdecode(const char *what, int encoding, int delimiter, char *where);
  581 extern void rfc15211522_encode(const char *filename, constext *mime_encoding, struct t_group *group, t_bool allow_8bit_header, t_bool ismail);
  582 extern void compose_mail_mime_forwarded(const char *filename, FILE *articlefp, t_bool include_text, struct t_group *group);
  583 extern void compose_mail_text_plain(const char *filename, struct t_group *group);
  584 
  585 /* save.c */
  586 extern int check_start_save_any_news(int function, t_bool catchup);
  587 extern t_bool create_path(const char *path);
  588 extern t_bool post_process_files(t_function proc_type_func, t_bool auto_delete);
  589 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);
  590 extern t_part *get_part(int n);
  591 extern t_url *find_url(int n);
  592 extern void attachment_page(t_openartinfo *art);
  593 extern void decode_save_mime(t_openartinfo *art, t_bool postproc);
  594 extern void print_art_separator_line(FILE *fp, t_bool is_mailbox);
  595 
  596 /* screen.c */
  597 extern char *fmt_message(const char *fmt, va_list ap);
  598 extern void center_line(int line, t_bool inverse, const char *str);
  599 extern void clear_message(void);
  600 extern void draw_arrow_mark(int line);
  601 extern void erase_arrow(void);
  602 extern void error_message(unsigned int sdelay, const char *fmt, ...);
  603 extern void info_message(const char *fmt, ...);
  604 extern void perror_message(const char *fmt, ...);
  605 extern void ring_bell(void);
  606 extern void show_progress(const char *txt, t_artnum count, t_artnum total);
  607 extern void show_title(const char *title);
  608 extern void spin_cursor(void);
  609 extern void stow_cursor(void);
  610 extern void wait_message(unsigned int sdelay, const char *fmt, ...);
  611 
  612 /* search.c */
  613 extern enum option_enum search_config(t_bool forward, t_bool repeat, enum option_enum current, enum option_enum last);
  614 extern int get_search_vectors(int *start, int *end);
  615 extern int search(t_function func, int current_art, t_bool repeat);
  616 extern int search_active(t_bool forward, t_bool repeat);
  617 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);
  618 extern int search_body(struct t_group *group, int current_art, t_bool repeat);
  619 extern int generic_search(t_bool forward, t_bool repeat, int current, int last, int level);
  620 extern void reset_srch_offsets(void);
  621 
  622 /* select.c */
  623 extern int add_my_group(const char *group, t_bool add, t_bool ignore_case);
  624 extern int choose_new_group(void);
  625 extern int skip_newgroups(void);
  626 extern void selection_page(int start_groupnum, int num_cmd_line_groups);
  627 extern void show_selection_page(void);
  628 extern void toggle_my_groups(const char *group);
  629 
  630 /* sigfile.c */
  631 extern void msg_write_signature(FILE *fp, t_bool include_dot_signature, struct t_group *thisgroup);
  632 
  633 /* signal.c */
  634 extern RETSIGTYPE(*sigdisp (int signum, RETSIGTYPE (*func)(SIG_ARGS))) (SIG_ARGS);
  635 extern t_bool set_win_size(int *num_lines, int *num_cols);
  636 extern void allow_resize(t_bool allow);
  637 extern void handle_resize(t_bool repaint);
  638 extern void set_noteslines(int num_lines);
  639 extern void set_signal_catcher(int flag);
  640 extern void set_signal_handlers(void);
  641 
  642 /* strftime.c */
  643 extern size_t my_strftime(char *s, size_t maxsize, const char *format, struct tm *timeptr);
  644 
  645 /* string.c */
  646 extern char *eat_tab(char *s);
  647 extern char *fmt_string(const char *fmt, ...);
  648 extern char *my_strdup(const char *str);
  649 extern char *str_trim(char *string);
  650 extern char *strunc(const char *message, int len);
  651 extern char *tin_ltoa(t_artnum value, int digits);
  652 extern char *tin_strtok(char *str, const char *delim);
  653 extern int sh_format(char *dst, size_t len, const char *fmt, ...);
  654 extern int strwidth(const char *str);
  655 extern size_t mystrcat(char **t, const char *s);
  656 extern void my_strncpy(char *p, const char *q, size_t n);
  657 extern void parse_format_string(const char *fmtstr, struct t_fmt *fmt);
  658 extern void str_lwr(char *str);
  659 #if !defined(HAVE_STRCASESTR) || defined(DECL_STRCASESTR)
  660     extern char *strcasestr(const char *haystack, const char *needle);
  661 #endif /* !HAVE_STRCASESTR || DECL_STRCASESTR */
  662 #if !defined(HAVE_STRSEP) || defined(DECL_SEP)
  663     extern char *strsep(char **stringp, const char *delim);
  664 #endif /* !HAVE_STRSEP || DECL_STRSEP */
  665 #ifndef HAVE_STRPBRK
  666     extern char *strpbrk(const char *str1, const char *str2);
  667 #endif /* !HAVE_STRPBRK */
  668 #ifndef HAVE_STRSTR
  669     extern char *strstr(const char *text, const char *pattern);
  670 #endif /* !HAVE_STRSTR */
  671 #ifndef HAVE_STRCASECMP
  672     extern int strcasecmp(const char *p, const char *q);
  673 #endif /* !HAVE STRCASECMP */
  674 #ifndef HAVE_STRNCASECMP
  675     extern int strncasecmp(const char *p, const char *q, size_t n);
  676 #endif /* !HAVE_STRNCASECMP */
  677 #ifndef HAVE_ATOI
  678     extern int atoi(const char *s);
  679 #endif /* !HAVE_ATOI */
  680 #ifndef HAVE_ATOL
  681     extern long atol(const char *s);
  682 #endif /* !HAVE_ATOL */
  683 #ifndef HAVE_STRTOL
  684     extern long strtol(const char *str, char **ptr, int use_base);
  685 #endif /* !HAVE STRTOL */
  686 #ifndef HAVE_STRERROR
  687     extern char *my_strerror(int n);
  688 #   define strerror(n) my_strerror(n)
  689 #endif /* !HAVE_STRERROR */
  690 #ifndef HAVE_STRRSTR
  691     extern char *my_strrstr(const char *str, const char *pat);
  692 #   define strrstr(s,p) my_strrstr(s,p)
  693 #endif /* !HAVE_STRRSTR */
  694 #if defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  695     extern char *spart(const char *str, int columns, t_bool pad);
  696     extern char *wchar_t2char(const wchar_t *wstr);
  697     extern wchar_t *abbr_wcsgroupname(const wchar_t *grpname, int len);
  698     extern wchar_t *char2wchar_t(const char *str);
  699     extern wchar_t *wcspart(const wchar_t *wstr, int columns, t_bool pad);
  700     extern wchar_t *wexpand_tab(wchar_t *wstr, size_t tab_width);
  701     extern wchar_t *wstrunc(const wchar_t *wmessage, int len);
  702 #else
  703     extern char *abbr_groupname(const char *grpname, size_t len);
  704     extern char *expand_tab(char *str, size_t tab_width);
  705 #endif /* MULTIBYTE_ABLE && !NO_LOCALE */
  706 #if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && defined(HAVE_UNICODE_UBIDI_H) && !defined(NO_LOCALE)
  707     extern char *render_bidi(const char *str, t_bool *is_rtl);
  708 #endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && HAVE_UNICODE_UBIDI_H && !NO_LOCALE */
  709 #ifdef HAVE_UNICODE_NORMALIZATION
  710     extern char *normalize(const char *str);
  711 #endif /* HAVE_UNICODE_NORMALIZATION */
  712 #if defined(HAVE_LIBICUUC) && defined(MULTIBYTE_ABLE) && !defined(NO_LOCALE)
  713     extern UChar *char2UChar(const char *str);
  714     extern char *UChar2char(const UChar *ustr);
  715 #endif /* HAVE_LIBICUUC && MULTIBYTE_ABLE && !NO_LOCALE */
  716 
  717 /* tags.c */
  718 extern int line_is_tagged(int n);
  719 extern int tag_multipart(int base_index);
  720 extern t_bool arts_selected(void);
  721 extern t_bool set_range(int level, int min, int max, int curr);
  722 extern t_bool tag_article(int art);
  723 extern t_bool untag_all_articles(void);
  724 extern void do_auto_select_arts(void);
  725 extern void undo_auto_select_arts(void);
  726 extern void undo_selections(void);
  727 extern void untag_article(long art);
  728 
  729 /* tmpfile.c */
  730 #ifndef HAVE_TMPFILE
  731     extern FILE *tmpfile(void);
  732 #endif /* !HAVE_TMPFILE */
  733 
  734 /* my_tmpfile.c */
  735 extern int my_tmpfile(char *filename, size_t name_size, const char *base_dir);
  736 
  737 /* thread.c */
  738 extern int find_response(int i, int n);
  739 extern int get_score_of_thread(int n);
  740 extern int new_responses(int thread);
  741 extern int next_response(int n);
  742 extern int next_thread(int n);
  743 extern int next_unread(int n);
  744 extern int num_of_responses(int n);
  745 extern int prev_response(int n);
  746 extern int prev_unread(int n);
  747 extern int stat_thread(int n, struct t_art_stat *sbuf);
  748 extern int which_response(int n);
  749 extern int which_thread(int n);
  750 extern int thread_page(struct t_group *group, int respnum, int thread_depth, t_pagerinfo *page);
  751 extern t_bool thread_mark_postprocess(int function, t_function feed_type, int respnum);
  752 extern void fixup_thread(int respnum, t_bool redraw);
  753 
  754 /* version.c */
  755 extern enum rc_state check_upgrade(char *line, const char *skip, const char *version);
  756 extern void upgrade_prompt_quit(enum rc_state reason, const char *file);
  757 
  758 /* wildmat.c */
  759 extern t_bool wildmat(const char *text, char *p, t_bool icase);
  760 extern t_bool wildmatpos(const char *text, char *p, t_bool icase, int *srch_offsets, int srch_offsets_size);
  761 
  762 /* xface.c */
  763 #ifdef XFACE_ABLE
  764     extern void slrnface_stop(void);
  765     extern void slrnface_start(void);
  766     extern void slrnface_display_xface(char *face);
  767     extern void slrnface_clear_xface(void);
  768     extern void slrnface_suppress_xface(void);
  769     extern void slrnface_show_xface(void);
  770 #endif /* XFACE_ABLE */
  771 
  772 /* xref.c */
  773 extern t_bool overview_xref_support(void);
  774 extern void NSETRNG0(t_bitmap *bitmap, t_artnum low, t_artnum high);
  775 extern void NSETRNG1(t_bitmap *bitmap, t_artnum low, t_artnum high);
  776 extern void art_mark_xref_read(struct t_article *art);
  777 
  778 #endif /* !PROTO_H */