#ifndef _MAIL_STREAM_H_INCLUDED_
#define _MAIL_STREAM_H_INCLUDED_
#include <sys/time.h>
#include <vstream.h>
#include <vstring.h>
typedef struct MAIL_STREAM MAIL_STREAM;
typedef int (*MAIL_STREAM_FINISH_FN) (MAIL_STREAM *, VSTRING *);
typedef int (*MAIL_STREAM_CLOSE_FN) (VSTREAM *);
struct MAIL_STREAM {
VSTREAM *stream;
char *queue;
char *id;
MAIL_STREAM_FINISH_FN finish;
MAIL_STREAM_CLOSE_FN close;
char *class;
char *service;
int mode;
#ifdef DELAY_ACTION
int delay;
#endif
struct timeval ctime;
};
#define MAIL_STREAM_CTL_END 0
#define MAIL_STREAM_CTL_QUEUE 1
#define MAIL_STREAM_CTL_CLASS 2
#define MAIL_STREAM_CTL_SERVICE 3
#define MAIL_STREAM_CTL_MODE 4
#ifdef DELAY_ACTION
#define MAIL_STREAM_CTL_DELAY 5
#endif
extern MAIL_STREAM *mail_stream_file(const char *, const char *, const char *, int);
extern MAIL_STREAM *mail_stream_service(const char *, const char *);
extern MAIL_STREAM *mail_stream_command(const char *);
extern void mail_stream_cleanup(MAIL_STREAM *);
extern int mail_stream_finish(MAIL_STREAM *, VSTRING *);
extern void mail_stream_ctl(MAIL_STREAM *, int,...);
#endif