Expand PMF_FN_* macros.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / mail_stream.h
bloba8d93a696bcfba2923e0478742f352c5727bea89
1 /* $NetBSD$ */
3 #ifndef _MAIL_STREAM_H_INCLUDED_
4 #define _MAIL_STREAM_H_INCLUDED_
6 /*++
7 /* NAME
8 /* mail_stream 3h
9 /* SUMMARY
10 /* mail stream management
11 /* SYNOPSIS
12 /* #include <mail_stream.h>
13 /* DESCRIPTION
14 /* .nf
17 * System library.
19 #include <sys/time.h>
22 * Utility library.
24 #include <vstream.h>
25 #include <vstring.h>
28 * External interface.
30 typedef struct MAIL_STREAM MAIL_STREAM;
32 typedef int (*MAIL_STREAM_FINISH_FN) (MAIL_STREAM *, VSTRING *);
33 typedef int (*MAIL_STREAM_CLOSE_FN) (VSTREAM *);
35 struct MAIL_STREAM {
36 VSTREAM *stream; /* file or pipe or socket */
37 char *queue; /* (initial) queue name */
38 char *id; /* queue id */
39 MAIL_STREAM_FINISH_FN finish; /* finish code */
40 MAIL_STREAM_CLOSE_FN close; /* close stream */
41 char *class; /* trigger class */
42 char *service; /* trigger service */
43 int mode; /* additional permissions */
44 #ifdef DELAY_ACTION
45 int delay; /* deferred delivery */
46 #endif
47 struct timeval ctime; /* creation time */
50 #define MAIL_STREAM_CTL_END 0 /* Terminator */
51 #define MAIL_STREAM_CTL_QUEUE 1 /* Change queue */
52 #define MAIL_STREAM_CTL_CLASS 2 /* Change notification class */
53 #define MAIL_STREAM_CTL_SERVICE 3 /* Change notification service */
54 #define MAIL_STREAM_CTL_MODE 4 /* Change final queue file mode */
55 #ifdef DELAY_ACTION
56 #define MAIL_STREAM_CTL_DELAY 5 /* Change final queue file mtime */
57 #endif
59 extern MAIL_STREAM *mail_stream_file(const char *, const char *, const char *, int);
60 extern MAIL_STREAM *mail_stream_service(const char *, const char *);
61 extern MAIL_STREAM *mail_stream_command(const char *);
62 extern void mail_stream_cleanup(MAIL_STREAM *);
63 extern int mail_stream_finish(MAIL_STREAM *, VSTRING *);
64 extern void mail_stream_ctl(MAIL_STREAM *, int,...);
67 /* LICENSE
68 /* .ad
69 /* .fi
70 /* The Secure Mailer license must be distributed with this software.
71 /* AUTHOR(S)
72 /* Wietse Venema
73 /* IBM T.J. Watson Research
74 /* P.O. Box 704
75 /* Yorktown Heights, NY 10598, USA
76 /*--*/
78 #endif