Back to index

courier  0.68.2
encode.h
Go to the documentation of this file.
00001 /*
00002 */
00003 #ifndef       rfc822_encode_h
00004 #define       rfc822_encode_h
00005 
00006 /*
00007 ** Copyright 2004 Double Precision, Inc.
00008 ** See COPYING for distribution information.
00009 */
00010 
00011 #if    HAVE_CONFIG_H
00012 #include      "../rfc822/config.h" /* VPATH build */
00013 #endif
00014 #include      <stdio.h>
00015 #include      <sys/types.h>
00016 #include      <stdlib.h>
00017 #include      <time.h>
00018 
00019 #ifdef  __cplusplus
00020 extern "C" {
00021 #endif
00022 
00023 struct libmail_encode_info {
00024        char output_buffer[BUFSIZ];
00025        int output_buf_cnt;
00026 
00027        char input_buffer[57]; /* For base64 */
00028        int input_buf_cnt;
00029 
00030        int (*encoding_func)(struct libmail_encode_info *,
00031                           const char *, size_t);
00032        int (*callback_func)(const char *, size_t, void *);
00033        void *callback_arg;
00034 };
00035 
00036 const char *libmail_encode_autodetect_fp(FILE *, int, int *);
00037 const char *libmail_encode_autodetect_fpoff(FILE *, int, off_t, off_t, int *);
00038 const char *libmail_encode_autodetect_buf(const char *, int);
00039 
00040 void libmail_encode_start(struct libmail_encode_info *info,
00041                        const char *transfer_encoding,
00042                        int (*callback_func)(const char *, size_t, void *),
00043                        void *callback_arg);
00044 
00045 int libmail_encode(struct libmail_encode_info *info,
00046                  const char *ptr,
00047                  size_t cnt);
00048 
00049 int libmail_encode_end(struct libmail_encode_info *info);
00050 
00051 #ifdef  __cplusplus
00052 }
00053 #endif
00054 
00055 #endif