Rocco Rutte:
[apps/madmutt.git] / protos.h
1 /*
2  * Copyright notice from original mutt:
3  * Copyright (C) 1996-2000 Michael R. Elkins <me@mutt.org>
4  *
5  * This file is part of mutt-ng, see http://www.muttng.org/.
6  * It's licensed under the GNU General Public License,
7  * please see the file GPL in the top level source directory.
8  */
9
10 #ifdef HAVE_CONFIG_H
11 # include "config.h"
12 #endif
13
14 #if HAVE_STDINT_H
15 #include <stdint.h>
16 #elif HAVE_INTTYPES_H
17 #include <inttypes.h>
18 #endif
19 #include "mbyte.h"
20
21 #define MoreArgs(p) (*p->dptr && *p->dptr != ';' && *p->dptr != '#')
22
23 #define mutt_make_string(A,B,C,D,E) _mutt_make_string(A,B,C,D,E,0)
24 void _mutt_make_string (char *, size_t, const char *, CONTEXT *,
25                         HEADER *, format_flag);
26
27 int mutt_extract_token (BUFFER *, BUFFER *, int);
28 BUFFER *mutt_buffer_init (BUFFER *);
29 BUFFER *mutt_buffer_from (BUFFER *, char *);
30 void mutt_buffer_free (BUFFER **);
31 void mutt_buffer_add (BUFFER *, const char *, size_t);
32 void mutt_buffer_addstr (BUFFER *, const char *);
33 void mutt_buffer_addch (BUFFER *, char);
34
35 #define mutt_system(x) _mutt_system(x,0)
36 int _mutt_system (const char *, int);
37
38 #define mutt_next_thread(x) _mutt_aside_thread(x,1,0)
39 #define mutt_previous_thread(x) _mutt_aside_thread(x,0,0)
40 #define mutt_next_subthread(x) _mutt_aside_thread(x,1,1)
41 #define mutt_previous_subthread(x) _mutt_aside_thread(x,0,1)
42 int _mutt_aside_thread (HEADER *, short, short);
43
44 #define mutt_collapse_thread(x,y) _mutt_traverse_thread (x,y,M_THREAD_COLLAPSE)
45 #define mutt_uncollapse_thread(x,y) _mutt_traverse_thread (x,y,M_THREAD_UNCOLLAPSE)
46 #define mutt_get_hidden(x,y)_mutt_traverse_thread (x,y,M_THREAD_GET_HIDDEN)
47 #define mutt_thread_contains_unread(x,y) _mutt_traverse_thread (x,y,M_THREAD_UNREAD)
48 #define mutt_thread_next_unread(x,y) _mutt_traverse_thread(x,y,M_THREAD_NEXT_UNREAD)
49 int _mutt_traverse_thread (CONTEXT * ctx, HEADER * hdr, int flag);
50
51
52 #define mutt_new_parameter() safe_calloc (1, sizeof (PARAMETER))
53 #define mutt_new_header() safe_calloc (1, sizeof (HEADER))
54 #define mutt_new_envelope() safe_calloc (1, sizeof (ENVELOPE))
55 #define mutt_new_enter_state() safe_calloc (1, sizeof (ENTER_STATE))
56
57 typedef const char *format_t (char *, size_t, char, const char *,
58                               const char *, const char *, const char *,
59                               unsigned long, format_flag);
60
61 void mutt_FormatString (char *, size_t, const char *, format_t *,
62                         unsigned long, format_flag);
63 void mutt_parse_content_type (char *, BODY *);
64 void mutt_generate_boundary (PARAMETER **);
65 void mutt_delete_parameter (const char *attribute, PARAMETER ** p);
66 void mutt_set_parameter (const char *, const char *, PARAMETER **);
67
68
69 FILE *mutt_open_read (const char *, pid_t *);
70
71 void set_quadoption (int, int);
72 int query_quadoption (int, const char *);
73 int quadoption (int);
74
75 ADDRESS *mutt_default_from (void);
76 ADDRESS *mutt_get_address (ENVELOPE *, char **);
77 ADDRESS *mutt_lookup_alias (const char *s);
78 ADDRESS *mutt_remove_duplicates (ADDRESS *);
79 ADDRESS *mutt_expand_aliases (ADDRESS *);
80 ADDRESS *mutt_parse_adrlist (ADDRESS *, const char *);
81
82 BODY *mutt_make_file_attach (const char *);
83 BODY *mutt_make_message_attach (CONTEXT *, HEADER *, int);
84 BODY *mutt_remove_multipart (BODY *);
85 BODY *mutt_make_multipart (BODY *);
86 BODY *mutt_new_body (void);
87 BODY *mutt_parse_multipart (FILE *, const char *, long, int);
88 BODY *mutt_parse_messageRFC822 (FILE *, BODY *);
89 BODY *mutt_read_mime_header (FILE *, int);
90
91 CONTENT *mutt_get_content_info (const char *fname, BODY * b);
92
93 HASH *mutt_make_id_hash (CONTEXT *);
94 HASH *mutt_make_subj_hash (CONTEXT *);
95
96 LIST *mutt_make_references (ENVELOPE * e);
97 LIST *mutt_parse_references (char *, int);
98
99 ENVELOPE *mutt_read_rfc822_header (FILE *, HEADER *, short, short);
100 HEADER *mutt_dup_header (HEADER *);
101
102 int mutt_cmp_header (const HEADER*, const HEADER*);
103 int mutt_cmp_addr (const ADDRESS * a, const ADDRESS * b);
104 int mutt_cmp_list (const LIST * a, const LIST * b);
105 int mutt_cmp_env (const ENVELOPE * e1, const ENVELOPE * e2);
106 int mutt_cmp_param (const PARAMETER * p1, const PARAMETER * p2);
107 int mutt_cmp_body (const BODY * b1, const BODY * b2);
108
109 #if USE_HCACHE
110 void *mutt_hcache_open (const char *path, const char *folder);
111 void mutt_hcache_close (void *db);
112 HEADER *mutt_hcache_restore (const unsigned char *d, HEADER ** oh);
113 void *mutt_hcache_fetch (void *db, const char *filename,
114                          size_t (*keylen) (const char *fn));
115 int mutt_hcache_store (void *db, const char *filename, HEADER * h,
116                        unsigned long uid_validity,
117                        size_t (*keylen) (const char *fn));
118 int mutt_hcache_delete (void *db, const char *filename,
119                         size_t (*keylen) (const char *fn));
120 #endif /* USE_HCACHE */
121
122 ATTACHPTR **mutt_gen_attach_list (BODY *, int, ATTACHPTR **, short *, short *,
123                                   int, int);
124
125 time_t mutt_decrease_mtime (const char *, struct stat *);
126 time_t mutt_local_tz (time_t);
127 time_t mutt_mktime (struct tm *, int);
128 time_t mutt_parse_date (const char *, HEADER *);
129 int is_from (const char *, char *, size_t, time_t *);
130
131 const char *mutt_attach_fmt (char *dest,
132                              size_t destlen,
133                              char op,
134                              const char *src,
135                              const char *prefix,
136                              const char *ifstring,
137                              const char *elsestring,
138                              unsigned long data, format_flag flags);
139
140
141 char *mutt_charset_hook (const char *);
142 char *mutt_iconv_hook (const char *);
143 char *mutt_expand_path (char *, size_t);
144 char *_mutt_expand_path (char *, size_t, int);
145 char *mutt_find_hook (int, const char *);
146 char *mutt_gecos_name (char *, size_t, struct passwd *);
147 char *mutt_gen_msgid (void);
148 char *mutt_get_body_charset (char *, size_t, BODY *);
149 const char *mutt_get_name (ADDRESS *);
150 char *mutt_get_parameter (const char *, PARAMETER *);
151 char *mutt_crypt_hook (ADDRESS *);
152 char *mutt_make_date (char *, size_t);
153
154 const char *mutt_make_version (void);
155
156 const char *mutt_fqdn (short);
157
158 void mutt_account_hook (const char *url);
159 void mutt_add_to_reference_headers (ENVELOPE * env, ENVELOPE * curenv,
160                                     LIST *** pp, LIST *** qq);
161 void mutt_adv_mktemp (char *, size_t);
162 void mutt_alias_menu (char *, size_t, ALIAS *);
163 void mutt_allow_interrupt (int);
164 void mutt_attach_init (BODY *);
165 void mutt_block_signals (void);
166 void mutt_block_signals_system (void);
167 void mutt_body_handler (BODY *, STATE *);
168 int mutt_bounce_message (FILE * fp, HEADER *, ADDRESS *);
169 void mutt_break_thread (HEADER *);
170 void mutt_canonical_charset (char *, size_t, const char *);
171 void mutt_check_rescore (CONTEXT *);
172 void mutt_clear_error (void);
173 void mutt_create_alias (ENVELOPE *, ADDRESS *);
174 void mutt_decode_attachment (BODY *, STATE *);
175 void mutt_decode_base64 (STATE * s, long len, int istext, iconv_t cd);
176 void mutt_default_save (char *, size_t, HEADER *);
177 void mutt_display_address (ENVELOPE *);
178 void mutt_display_sanitize (char *);
179 void mutt_edit_content_type (HEADER *, BODY *, FILE *);
180 void mutt_edit_file (const char *, const char *);
181 void mutt_edit_headers (const char *, const char *, HEADER *, char *, size_t);
182 void mutt_curses_error (const char *, ...);
183 void mutt_curses_message (const char *, ...);
184 void mutt_enter_command (void);
185 void mutt_expand_aliases_env (ENVELOPE *);
186 void mutt_expand_file_fmt (char *, size_t, const char *, const char *);
187 void mutt_expand_fmt (char *, size_t, const char *, const char *);
188 void mutt_expand_link (char *, const char *, const char *);
189 void mutt_fix_reply_recipients (ENVELOPE * env);
190 void mutt_folder_hook (char *);
191 void mutt_format_string (char *, size_t, int, int, int, char, const char *,
192                          size_t, int);
193 void mutt_format_s (char *, size_t, const char *, const char *);
194 void mutt_format_s_tree (char *, size_t, const char *, const char *);
195 void mutt_forward_intro (FILE * fp, HEADER * cur);
196 void mutt_forward_trailer (FILE * fp);
197 void mutt_free_alias (ALIAS **);
198 void mutt_free_body (BODY **);
199 void mutt_free_color (int fg, int bg);
200 void mutt_free_enter_state (ENTER_STATE **);
201 void mutt_free_envelope (ENVELOPE **);
202 void mutt_free_header (HEADER **);
203 void mutt_free_parameter (PARAMETER **);
204 void mutt_generate_header (char *, size_t, HEADER *, int);
205 void mutt_help (int);
206 void mutt_draw_tree (CONTEXT *);
207 void mutt_check_lookup_list (BODY *, char *, int);
208 void mutt_make_attribution (CONTEXT * ctx, HEADER * cur, FILE * out);
209 void mutt_make_forward_subject (ENVELOPE * env, CONTEXT * ctx, HEADER * cur);
210 void mutt_make_help (char *, size_t, char *, int, int);
211 void mutt_make_misc_reply_headers (ENVELOPE * env, CONTEXT * ctx,
212                                    HEADER * cur, ENVELOPE * curenv);
213 void mutt_make_post_indent (CONTEXT * ctx, HEADER * cur, FILE * out);
214 void mutt_merge_envelopes (ENVELOPE* base, ENVELOPE** extra);
215 void mutt_message_to_7bit (BODY *, FILE *);
216
217 #define mutt_mktemp(a) _mutt_mktemp (a, __FILE__, __LINE__)
218 void _mutt_mktemp (char *, const char *, int);
219 void mutt_normalize_time (struct tm *);
220 void mutt_paddstr (int, const char *);
221 void mutt_parse_mime_message (CONTEXT * ctx, HEADER *);
222 void mutt_parse_part (FILE *, BODY *);
223 #define mutt_perror(a) _mutt_perror (a, __FILE__, __LINE__)
224 void _mutt_perror (const char*, const char*,int);
225 void mutt_prepare_envelope (ENVELOPE *, int);
226 void mutt_unprepare_envelope (ENVELOPE *);
227 void mutt_pretty_mailbox (char *);
228 void mutt_pretty_size (char *, size_t, long);
229 void mutt_pipe_message (HEADER *);
230 void mutt_print_message (HEADER *);
231 void mutt_print_patchlist (void);
232 void mutt_query_exit (void);
233 void mutt_query_menu (char *, size_t);
234 void mutt_safe_path (char *s, size_t l, ADDRESS * a);
235 void mutt_save_path (char *s, size_t l, ADDRESS * a);
236 void mutt_score_message (CONTEXT *, HEADER *, int);
237 void mutt_select_fcc (char *, size_t, HEADER *);
238
239 #define mutt_select_file(A,B,C) _mutt_select_file(A,B,C,NULL,NULL)
240 void _mutt_select_file (char *, size_t, int, char ***, int *);
241 void mutt_message_hook (CONTEXT *, HEADER *, int);
242 void _mutt_set_flag (CONTEXT *, HEADER *, int, int, int);
243
244 #define mutt_set_flag(a,b,c,d) _mutt_set_flag(a,b,c,d,1)
245 void mutt_set_followup_to (ENVELOPE *);
246 void mutt_shell_escape (void);
247 void mutt_show_error (void);
248 void mutt_signal_init (void);
249 void mutt_stamp_attachment (BODY * a);
250 void mutt_tabs_to_spaces (char *);
251 void mutt_tag_set_flag (int, int);
252 void mutt_unblock_signals (void);
253 void mutt_unblock_signals_system (int);
254 void mutt_update_encoding (BODY * a);
255 void mutt_update_tree (ATTACHPTR **, short);
256 void mutt_version (void);
257 void mutt_view_attachments (HEADER *);
258 void mutt_write_references (LIST *, FILE *);
259 void mutt_write_address_list (ADDRESS * adr, FILE * fp, int linelen,
260                               int display);
261 void mutt_set_virtual (CONTEXT *);
262
263 int mutt_addr_is_user (ADDRESS *);
264 int mutt_addwch (wchar_t);
265 int mutt_alias_complete (char *, size_t);
266 int mutt_alloc_color (int fg, int bg);
267 int mutt_any_key_to_continue (const char *);
268 int mutt_builtin_editor (const char *, HEADER *, HEADER *);
269 int mutt_can_decode (BODY *);
270 int mutt_change_flag (HEADER *, int);
271 int mutt_check_alias_name (const char *, char *);
272 int mutt_check_encoding (const char *);
273 int mutt_check_key (const char *);
274 int mutt_check_menu (const char *);
275 int mutt_check_mime_type (const char *);
276 int mutt_check_month (const char *);
277 int mutt_check_overwrite (const char *, const char *, char *, size_t, int *,
278                           char **);
279 int mutt_check_traditional_pgp (HEADER *, int *);
280 int mutt_command_complete (char *, size_t, int, int);
281 int mutt_var_value_complete (char *, size_t, int);
282 int mutt_complete (char *, size_t);
283 int mutt_compose_attachment (BODY * a);
284 int mutt_copy_body (FILE *, BODY **, BODY *);
285 int mutt_decode_save_attachment (FILE *, BODY *, char *, int, int);
286 int mutt_display_message (HEADER * h);
287 int mutt_dump_variables (void);
288 int mutt_edit_attachment (BODY *);
289 int mutt_edit_message (CONTEXT *, HEADER *);
290 int mutt_fetch_recips (ENVELOPE * out, ENVELOPE * in, int flags);
291 int mutt_chscmp (const char *s, const char *chs);
292
293 #define mutt_is_utf8(a) mutt_chscmp (a, "utf-8")
294 #define mutt_is_us_ascii(a) mutt_chscmp (a, "us-ascii")
295 int mutt_parent_message (CONTEXT *, HEADER *);
296 int mutt_prepare_template (FILE *, CONTEXT *, HEADER *, HEADER *, short);
297 int mutt_resend_message (FILE *, CONTEXT *, HEADER *);
298
299 #define mutt_enter_fname(A,B,C,D,E) _mutt_enter_fname(A,B,C,D,E,0,NULL,NULL)
300 int _mutt_enter_fname (const char *, char *, size_t, int *, int, int,
301                        char ***, int *);
302 int mutt_enter_string (char *buf, size_t buflen, int y, int x, int flags);
303 int _mutt_enter_string (char *, size_t, int, int, int, int, char ***, int *,
304                         ENTER_STATE *);
305 #define mutt_get_field(A,B,C,D) _mutt_get_field(A,B,C,D,0,NULL,NULL)
306 int _mutt_get_field (char *, char *, size_t, int, int, char ***, int *);
307 int mutt_get_hook_type (const char *);
308 int mutt_get_password (char *, char *, size_t);
309 int mutt_get_postponed (CONTEXT *, HEADER *, HEADER **, char *, size_t);
310 int mutt_get_tmp_attachment (BODY *);
311 int mutt_index_menu (void);
312 int mutt_invoke_mta (ADDRESS *, ADDRESS *, ADDRESS *, ADDRESS *, const char *,
313                      int);
314 int mutt_is_autoview (BODY *, const char *);
315 int mutt_is_mail_list (ADDRESS *);
316 int mutt_is_message_type (int, const char *);
317 int mutt_is_list_cc (int, ADDRESS *, ADDRESS *);
318 int mutt_is_list_recipient (int, ADDRESS *, ADDRESS *);
319 int mutt_is_subscribed_list (ADDRESS *);
320 int mutt_is_text_part (BODY *);
321 int mutt_is_valid_mailbox (const char *);
322 int mutt_link_threads (HEADER *, HEADER *, CONTEXT *);
323 int mutt_lookup_mime_type (BODY *, const char *);
324 int mutt_match_spam_list (const char *, SPAM_LIST *, char *, int);
325 int mutt_messages_in_thread (CONTEXT *, HEADER *, int);
326 int mutt_multi_choice (char *prompt, char *letters);
327 int mutt_needs_mailcap (BODY *);
328 int mutt_num_postponed (int);
329 int mutt_parse_bind (BUFFER *, BUFFER *, unsigned long, BUFFER *);
330 int mutt_parse_exec (BUFFER *, BUFFER *, unsigned long, BUFFER *);
331 int mutt_parse_color (BUFFER *, BUFFER *, unsigned long, BUFFER *);
332 int mutt_parse_uncolor (BUFFER *, BUFFER *, unsigned long, BUFFER *);
333 int mutt_parse_hook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
334 int mutt_parse_macro (BUFFER *, BUFFER *, unsigned long, BUFFER *);
335 int mutt_parse_mono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
336 int mutt_parse_unmono (BUFFER *, BUFFER *, unsigned long, BUFFER *);
337 int mutt_parse_push (BUFFER *, BUFFER *, unsigned long, BUFFER *);
338 int mutt_parse_rc_line ( /* const */ char *, BUFFER *, BUFFER *);
339 int mutt_parse_rfc822_line (ENVELOPE * e, HEADER * hdr, char *line, char *p,
340                             short user_hdrs, short weed, short do_2047,
341                             LIST ** lastp);
342 int mutt_parse_score (BUFFER *, BUFFER *, unsigned long, BUFFER *);
343 int mutt_parse_unscore (BUFFER *, BUFFER *, unsigned long, BUFFER *);
344 int mutt_parse_unhook (BUFFER *, BUFFER *, unsigned long, BUFFER *);
345 int mutt_pattern_func (int, char *);
346 int mutt_pipe_attachment (FILE *, BODY *, const char *, char *);
347 int mutt_print_attachment (FILE *, BODY *);
348 int mutt_query_complete (char *, size_t);
349 int mutt_query_variables (LIST * queries);
350 int mutt_save_attachment (FILE *, BODY *, char *, int, HEADER *);
351 void _mutt_save_message (HEADER *, CONTEXT *, int, int, int);
352 int mutt_save_message (HEADER *, int, int, int, int *);
353 int mutt_search_command (int, int);
354 int mutt_skipchars (const char *, const char *);
355 int mutt_strwidth (const char *);
356 int mutt_compose_menu (HEADER *, char *, size_t, HEADER *);
357 int mutt_thread_set_flag (HEADER *, int, int, int);
358 int mutt_update_list_file (char *, char *, char *, char *);
359 int mutt_user_is_recipient (HEADER *);
360 void mutt_update_num_postponed (void);
361 int mutt_view_attachment (FILE *, BODY *, int, HEADER *, ATTACHPTR **, short);
362 int mutt_wait_filter (pid_t);
363 int mutt_which_case (const char *);
364 int mutt_write_fcc (const char *path, HEADER * hdr, const char *msgid, int,
365                     char *);
366 int mutt_write_mime_body (BODY *, FILE *);
367 int mutt_write_mime_header (BODY *, FILE *);
368 int mutt_write_rfc822_header (FILE *, ENVELOPE *, BODY *, int, int);
369 int mutt_yesorno (const char *, int);
370 void mutt_set_header_color (CONTEXT *, HEADER *);
371 void mutt_sleep (short);
372 int mutt_save_confirm (const char *, struct stat *);
373
374 int mh_valid_message (const char *);
375
376 pid_t mutt_create_filter (const char *, FILE **, FILE **, FILE **);
377 pid_t mutt_create_filter_fd (const char *, FILE **, FILE **, FILE **, int,
378                              int, int);
379
380 ADDRESS *alias_reverse_lookup (ADDRESS *);
381
382 /* base64.c */
383 void mutt_to_base64 (unsigned char *, const unsigned char *, size_t, size_t);
384 int mutt_from_base64 (char *, const char *);
385
386 /* utf8.c */
387 int mutt_wctoutf8 (char *s, unsigned int c);
388
389 #ifdef LOCALES_HACK
390 #define IsPrint(c) (isprint((unsigned char)(c)) || \
391         ((unsigned char)(c) >= 0xa0))
392 #define IsWPrint(wc) (iswprint(wc) || wc >= 0xa0)
393 #else
394 #define IsPrint(c) (isprint((unsigned char)(c)) || \
395         (option (OPTLOCALES) ? 0 : \
396         ((unsigned char)(c) >= 0xa0)))
397 #define IsWPrint(wc) (iswprint(wc) || \
398         (option (OPTLOCALES) ? 0 : (wc >= 0xa0)))
399 #endif
400
401 #define new_pattern() safe_calloc(1, sizeof (pattern_t))
402
403 int mutt_pattern_exec (struct pattern_t *pat, pattern_exec_flag flags,
404                        CONTEXT * ctx, HEADER * h);
405 pattern_t *mutt_pattern_comp ( /* const */ char *s, int flags, BUFFER * err);
406 void mutt_check_simple (char *s, size_t len, const char *simple);
407 void mutt_pattern_free (pattern_t ** pat);
408
409 /* ----------------------------------------------------------------------------
410  * Prototypes for broken systems
411  */
412
413 #ifdef HAVE_SRAND48
414 #define LRAND lrand48
415 #define SRAND srand48
416 #define DRAND drand48
417 #else
418 #define LRAND rand
419 #define SRAND srand
420 #define DRAND (double)rand
421 #endif /* HAVE_SRAND48 */
422
423 /* HP-UX, ConvexOS and UNIXware don't have this macro */
424 #ifndef S_ISLNK
425 #define S_ISLNK(x) (((x) & S_IFMT) == S_IFLNK ? 1 : 0)
426 #endif
427
428 int getdnsdomainname (char *, size_t);
429
430 /* According to SCO support, this is how to detect SCO */
431 #if defined (_M_UNIX) || defined (M_OS)
432 #define SCO
433 #endif
434
435 /* SCO Unix uses chsize() instead of ftruncate() */
436 #ifndef HAVE_FTRUNCATE
437 #define ftruncate chsize
438 #endif
439
440 #ifndef HAVE_SNPRINTF
441 extern int snprintf (char *, size_t, const char *, ...);
442 #endif
443
444 #ifndef HAVE_VSNPRINTF
445 extern int vsnprintf (char *, size_t, const char *, va_list);
446 #endif
447
448 #ifndef HAVE_STRERROR
449 #ifndef STDC_HEADERS
450 extern int sys_nerr;
451 extern char *sys_errlist[];
452 #endif
453
454 #define strerror(x) ((x) > 0 && (x) < sys_nerr) ? sys_errlist[(x)] : 0
455 #endif /* !HAVE_STRERROR */
456
457 #ifndef HAVE_MEMMOVE
458 #define memmove(d,s,n) bcopy((s),(d),(n))
459 #endif
460
461 /* AIX doesn't define these in any headers (sigh) */
462 int strcasecmp (const char *, const char *);
463 int strncasecmp (const char *, const char *, size_t);
464
465 #ifdef _AIX
466 int setegid (gid_t);
467 #endif /* _AIX */
468
469 #ifndef STDC_HEADERS
470 extern FILE *fdopen ();
471 extern int system ();
472 extern int puts ();
473 extern int fputs ();
474 extern int fputc ();
475 extern int fseek ();
476 extern char *strchr ();
477 extern int getopt ();
478 extern int fputs ();
479 extern int fputc ();
480 extern int fclose ();
481 extern int fprintf ();
482 extern int printf ();
483 extern int fgetc ();
484 extern int tolower ();
485 extern int toupper ();
486 extern int sscanf ();
487 extern size_t fread ();
488 extern size_t fwrite ();
489 extern int system ();
490 extern int rename ();
491 extern time_t time ();
492 extern struct tm *localtime ();
493 extern char *asctime ();
494 extern char *strpbrk ();
495 extern int fflush ();
496 extern long lrand48 ();
497 extern void srand48 ();
498 extern time_t mktime ();
499 extern int vsprintf ();
500 extern int ungetc ();
501 extern char *mktemp ();
502 extern int ftruncate ();
503 extern void *memset ();
504 extern int pclose ();
505 extern int socket ();
506 extern int connect ();
507 extern size_t strftime ();
508 extern int lstat ();
509 extern void rewind ();
510 extern int readlink ();
511
512 /* IRIX barfs on empty var decls because the system include file uses elipsis
513    in the declaration.  So declare all the args to avoid compiler errors.  This
514    should be harmless on other systems.  */
515 int ioctl (int, int, ...);
516
517 #endif
518
519 /* unsorted */
520 void ci_bounce_message (HEADER *, int *);
521 int ci_send_message (int, HEADER *, char *, CONTEXT *, HEADER *);