Postfix3.3.1
dsn_print.c
[詳解]
1 /*++
2 /* NAME
3 /* dsn_print
4 /* SUMMARY
5 /* write DSN structure to stream
6 /* SYNOPSIS
7 /* #include <dsn_print.h>
8 /*
9 /* int dsn_print(print_fn, stream, flags, ptr)
10 /* ATTR_PRINT_MASTER_FN print_fn;
11 /* VSTREAM *stream;
12 /* int flags;
13 /* void *ptr;
14 /* DESCRIPTION
15 /* dsn_print() writes a DSN structure to the named stream using
16 /* the specified attribute print routine. dsn_print() is meant
17 /* to be passed as a call-back to attr_print(), thusly:
18 /*
19 /* ... SEND_ATTR_FUNC(dsn_print, (void *) dsn), ...
20 /* DIAGNOSTICS
21 /* Fatal: out of memory.
22 /* LICENSE
23 /* .ad
24 /* .fi
25 /* The Secure Mailer license must be distributed with this software.
26 /* AUTHOR(S)
27 /* Wietse Venema
28 /* IBM T.J. Watson Research
29 /* P.O. Box 704
30 /* Yorktown Heights, NY 10598, USA
31 /*--*/
32 
33 /* System library. */
34 
35 #include <sys_defs.h>
36 
37 /* Utility library. */
38 
39 #include <attr.h>
40 
41 /* Global library. */
42 
43 #include <mail_proto.h>
44 #include <dsn_print.h>
45 
46 /* dsn_print - write DSN to stream */
47 
49  int flags, void *ptr)
50 {
51  DSN *dsn = (DSN *) ptr;
52  int ret;
53 
54  /*
55  * The attribute order is determined by backwards compatibility. It can
56  * be sanitized after all the ad-hoc DSN read/write code is replaced.
57  */
58  ret = print_fn(fp, flags | ATTR_FLAG_MORE,
67  return (ret);
68 }
int dsn_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp, int flags, void *ptr)
Definition: dsn_print.c:48
int(* ATTR_PRINT_MASTER_FN)(VSTREAM *, int,...)
Definition: attr.h:33
const char * dtext
Definition: dsn.h:22
const char * action
Definition: dsn.h:19
const char * reason
Definition: dsn.h:20
#define ATTR_TYPE_END
Definition: attr.h:39
#define MAIL_ATTR_DSN_ACTION
Definition: mail_proto.h:272
#define MAIL_ATTR_DSN_STATUS
Definition: mail_proto.h:267
#define MAIL_ATTR_DSN_MNAME
Definition: mail_proto.h:271
#define MAIL_ATTR_WHY
Definition: mail_proto.h:135
const char * mname
Definition: dsn.h:24
const char * status
Definition: dsn.h:18
Definition: dsn.h:17
const char * mtype
Definition: dsn.h:23
#define MAIL_ATTR_DSN_MTYPE
Definition: mail_proto.h:270
#define MAIL_ATTR_DSN_DTEXT
Definition: mail_proto.h:269
const char * dtype
Definition: dsn.h:21
#define ATTR_FLAG_MORE
Definition: attr.h:101
#define SEND_ATTR_STR(name, val)
Definition: attr.h:64
#define MAIL_ATTR_DSN_DTYPE
Definition: mail_proto.h:268