#include <sys_defs.h>
#include <stdlib.h>
#include <msg_vstream.h>
#include <record.h>
#include <rec_streamlf.h>
#include <rec_type.h>
int main(int unused_argc, char **argv)
{
VSTRING *buf = vstring_alloc(100);
long offset;
int type;
msg_vstream_init(argv[0], VSTREAM_OUT);
while (offset = vstream_ftell(VSTREAM_IN),
((type = rec_get(VSTREAM_IN, buf, 0)) != REC_TYPE_EOF
&& type != REC_TYPE_ERROR)) {
vstream_fprintf(VSTREAM_OUT, "%15s|%4ld|%3ld|%s\n",
rec_type_name(type), offset,
(long) VSTRING_LEN(buf), vstring_str(buf));
}
vstream_fflush(VSTREAM_OUT);
vstring_free(buf);
exit(0);
}