No empty .Rs/.Re
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / rcpt_print.c
blob5cb28b2b9c3b325aaf4a4005c8c711b3e526e2b4
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* rcpt_print
6 /* SUMMARY
7 /* write RECIPIENT structure to stream
8 /* SYNOPSIS
9 /* #include <rcpt_print.h>
11 /* int rcpt_print(print_fn, stream, flags, ptr)
12 /* ATTR_PRINT_MASTER_FN print_fn;
13 /* VSTREAM *stream;
14 /* int flags;
15 /* void *ptr;
16 /* DESCRIPTION
17 /* rcpt_print() writes the contents of a RECIPIENT structure
18 /* to the named stream using the specified attribute print
19 /* routine. rcpt_print() is meant to be passed as a call-back
20 /* to attr_print(), thusly:
22 /* ... ATTR_TYPE_FUNC, rcpt_print, (void *) recipient, ...
23 /* DIAGNOSTICS
24 /* Fatal: out of memory.
25 /* LICENSE
26 /* .ad
27 /* .fi
28 /* The Secure Mailer license must be distributed with this
29 /* software.
30 /* AUTHOR(S)
31 /* Wietse Venema IBM T.J. Watson Research P.O. Box 704 Yorktown
32 /* Heights, NY 10598, USA
33 /*--*/
35 /* System library. */
37 #include <sys_defs.h>
39 /* Utility library. */
41 #include <attr.h>
43 /* Global library. */
45 #include <mail_proto.h>
46 #include <recipient_list.h>
47 #include <rcpt_print.h>
49 /* rcpt_print - write recipient to stream */
51 int rcpt_print(ATTR_PRINT_MASTER_FN print_fn, VSTREAM *fp,
52 int flags, void *ptr)
54 RECIPIENT *rcpt = (RECIPIENT *) ptr;
55 int ret;
58 * The attribute order is determined by backwards compatibility. It can
59 * be sanitized after all the ad-hoc recipient read/write code is
60 * replaced.
62 ret =
63 print_fn(fp, flags | ATTR_FLAG_MORE,
64 ATTR_TYPE_STR, MAIL_ATTR_ORCPT, rcpt->orig_addr,
65 ATTR_TYPE_STR, MAIL_ATTR_RECIP, rcpt->address,
66 ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, rcpt->offset,
67 ATTR_TYPE_STR, MAIL_ATTR_DSN_ORCPT, rcpt->dsn_orcpt,
68 ATTR_TYPE_INT, MAIL_ATTR_DSN_NOTIFY, rcpt->dsn_notify,
69 ATTR_TYPE_END);
70 return (ret);