5
/* convert record stream to printable form
9
/* recdump reads a record stream from standard input and
10
/* writes the content to standard output in printable form.
12
/* Problems are reported to the standard error stream.
16
/* The Secure Mailer license must be distributed with this software.
19
/* IBM T.J. Watson Research
21
/* Yorktown Heights, NY 10598, USA
28
/* Utility library. */
30
#include <msg_vstream.h>
35
#include <rec_streamlf.h>
38
int main(int unused_argc, char **argv)
40
VSTRING *buf = vstring_alloc(100);
44
msg_vstream_init(argv[0], VSTREAM_OUT);
46
while (offset = vstream_ftell(VSTREAM_IN),
47
((type = rec_get(VSTREAM_IN, buf, 0)) != REC_TYPE_EOF
48
&& type != REC_TYPE_ERROR)) {
49
vstream_fprintf(VSTREAM_OUT, "%15s|%4ld|%3d|%s\n",
50
rec_type_name(type), offset,
51
VSTRING_LEN(buf), vstring_str(buf));
53
vstream_fflush(VSTREAM_OUT);