7 /* write MSG_STATS structure to stream
9 /* #include <msg_stats.h>
11 /* int msg_stats_print(print_fn, stream, flags, ptr)
12 /* ATTR_PRINT_MASTER_FN print_fn;
17 /* msg_stats_print() writes an MSG_STATS structure to the named
18 /* stream using the specified attribute print routine.
19 /* msg_stats_print() is meant to be passed as a call-back to
20 /* attr_print(), thusly:
22 /* ... ATTR_TYPE_FUNC, msg_stats_print, (void *) stats, ...
24 /* Fatal: out of memory.
28 /* The Secure Mailer license must be distributed with this software.
31 /* IBM T.J. Watson Research
33 /* Yorktown Heights, NY 10598, USA
40 /* Utility library. */
46 #include <mail_proto.h>
47 #include <msg_stats.h>
49 /* msg_stats_print - write MSG_STATS to stream */
51 int msg_stats_print(ATTR_PRINT_MASTER_FN print_fn
, VSTREAM
*fp
,
57 * Send the entire structure. This is not only simpler but also likely to
58 * be quicker than having the sender figure out what fields need to be
59 * sent, converting numbers to string and back, and having the receiver
60 * initialize the unused fields by hand.
62 ret
= print_fn(fp
, flags
| ATTR_FLAG_MORE
,
63 ATTR_TYPE_DATA
, MAIL_ATTR_TIME
, sizeof(MSG_STATS
), ptr
,