Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / global / stream2rec.c
blob5b5180a67a3f1dd348cbd0e3320778c78d2a79dc
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* stream2rec 1
6 /* SUMMARY
7 /* convert stream-lf data to record format
8 /* SYNOPSIS
9 /* stream2rec
10 /* DESCRIPTION
11 /* stream2rec reads lines from standard input and writes
12 /* them to standard output in record form.
13 /* DIAGNOSTICS
14 /* Problems are reported to the standard error stream.
15 /* LICENSE
16 /* .ad
17 /* .fi
18 /* The Secure Mailer license must be distributed with this software.
19 /* AUTHOR(S)
20 /* Wietse Venema
21 /* IBM T.J. Watson Research
22 /* P.O. Box 704
23 /* Yorktown Heights, NY 10598, USA
24 /*--*/
26 /* System library. */
28 #include <sys_defs.h>
30 /* Utility library. */
32 #include <vstream.h>
33 #include <vstring.h>
35 /* Global library. */
37 #include <record.h>
38 #include <rec_streamlf.h>
40 int main(void)
42 VSTRING *buf = vstring_alloc(150);
43 int type;
45 while ((type = rec_streamlf_get(VSTREAM_IN, buf, 150)) > 0)
46 REC_PUT_BUF(VSTREAM_OUT, type, buf);
47 vstream_fflush(VSTREAM_OUT);
48 return (0);