7 /* write DSN structure to stream
9 /* #include <dsn_print.h>
11 /* int dsn_print(print_fn, stream, flags, ptr)
12 /* ATTR_PRINT_MASTER_FN print_fn;
17 /* dsn_print() writes a DSN structure to the named stream using
18 /* the specified attribute print routine. dsn_print() is meant
19 /* to be passed as a call-back to attr_print(), thusly:
21 /* ... ATTR_TYPE_FUNC, dsn_print, (void *) dsn, ...
23 /* Fatal: out of memory.
27 /* The Secure Mailer license must be distributed with this software.
30 /* IBM T.J. Watson Research
32 /* Yorktown Heights, NY 10598, USA
39 /* Utility library. */
45 #include <mail_proto.h>
46 #include <dsn_print.h>
48 /* dsn_print - write DSN to stream */
50 int dsn_print(ATTR_PRINT_MASTER_FN print_fn
, VSTREAM
*fp
,
53 DSN
*dsn
= (DSN
*) ptr
;
57 * The attribute order is determined by backwards compatibility. It can
58 * be sanitized after all the ad-hoc DSN read/write code is replaced.
60 ret
= print_fn(fp
, flags
| ATTR_FLAG_MORE
,
61 ATTR_TYPE_STR
, MAIL_ATTR_DSN_STATUS
, dsn
->status
,
62 ATTR_TYPE_STR
, MAIL_ATTR_DSN_DTYPE
, dsn
->dtype
,
63 ATTR_TYPE_STR
, MAIL_ATTR_DSN_DTEXT
, dsn
->dtext
,
64 ATTR_TYPE_STR
, MAIL_ATTR_DSN_MTYPE
, dsn
->mtype
,
65 ATTR_TYPE_STR
, MAIL_ATTR_DSN_MNAME
, dsn
->mname
,
66 ATTR_TYPE_STR
, MAIL_ATTR_DSN_ACTION
, dsn
->action
,
67 ATTR_TYPE_STR
, MAIL_ATTR_WHY
, dsn
->reason
,