1/* $NetBSD$ */ 2 3/*++ 4/* NAME 5/* rec2stream 1 6/* SUMMARY 7/* convert record stream to stream-lf format 8/* SYNOPSIS 9/* rec2stream 10/* DESCRIPTION 11/* rec2stream reads a record stream from standard input and 12/* writes the content to standard output in stream-lf format. 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/*--*/ 25 26/* System library. */ 27 28#include <sys_defs.h> 29 30/* Utility library. */ 31 32#include <vstring.h> 33#include <vstream.h> 34 35/* Global library. */ 36 37#include <record.h> 38#include <rec_streamlf.h> 39 40int main(void) 41{ 42 VSTRING *buf = vstring_alloc(100); 43 int type; 44 45 while ((type = rec_get(VSTREAM_IN, buf, 0)) > 0) 46 REC_STREAMLF_PUT_BUF(VSTREAM_OUT, type, buf); 47 vstream_fflush(VSTREAM_OUT); 48 return (0); 49} 50