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