d9898ee8 |
1 | /* |
2 | ** $Id: encode.h,v 1.2 2004/05/23 14:28:24 mrsam Exp $ |
3 | */ |
4 | #ifndef rfc822_encode_h |
5 | #define rfc822_encode_h |
6 | |
7 | /* |
8 | ** Copyright 2004 Double Precision, Inc. |
9 | ** See COPYING for distribution information. |
10 | */ |
11 | |
12 | #if HAVE_CONFIG_H |
13 | #include "../rfc822/config.h" /* VPATH build */ |
14 | #endif |
15 | #include <stdio.h> |
16 | #include <sys/types.h> |
17 | #include <stdlib.h> |
18 | #include <time.h> |
19 | |
20 | #ifdef __cplusplus |
21 | extern "C" { |
22 | #endif |
23 | |
24 | struct libmail_encode_info { |
25 | char output_buffer[BUFSIZ]; |
26 | int output_buf_cnt; |
27 | |
28 | char input_buffer[57]; /* For base64 */ |
29 | int input_buf_cnt; |
30 | |
31 | int (*encoding_func)(struct libmail_encode_info *, |
32 | const char *, size_t); |
33 | int (*callback_func)(const char *, size_t, void *); |
34 | void *callback_arg; |
35 | }; |
36 | |
37 | const char *libmail_encode_autodetect_fp(FILE *, int okQp); |
38 | const char *libmail_encode_autodetect_fppos(FILE *, const char *, off_t, off_t); |
39 | const char *libmail_encode_autodetect_str(const char *, const char *); |
40 | |
41 | void libmail_encode_start(struct libmail_encode_info *info, |
42 | const char *transfer_encoding, |
43 | int (*callback_func)(const char *, size_t, void *), |
44 | void *callback_arg); |
45 | |
46 | int libmail_encode(struct libmail_encode_info *info, |
47 | const char *ptr, |
48 | size_t cnt); |
49 | |
50 | int libmail_encode_end(struct libmail_encode_info *info); |
51 | |
52 | #ifdef __cplusplus |
53 | } |
54 | #endif |
55 | |
56 | #endif |