1/*++ 2/* NAME 3/* rec2stream 1 4/* SUMMARY 5/* convert record stream to stream-lf format 6/* SYNOPSIS 7/* rec2stream 8/* DESCRIPTION 9/* rec2stream reads a record stream from standard input and 10/* writes the content to standard output in stream-lf format. 11/* DIAGNOSTICS 12/* Problems are reported to the standard error stream. 13/* LICENSE 14/* .ad 15/* .fi 16/* The Secure Mailer license must be distributed with this software. 17/* AUTHOR(S) 18/* Wietse Venema 19/* IBM T.J. Watson Research 20/* P.O. Box 704 21/* Yorktown Heights, NY 10598, USA 22/*--*/ 23 24/* System library. */ 25 26#include <sys_defs.h> 27 28/* Utility library. */ 29 30#include <vstring.h> 31#include <vstream.h> 32 33/* Global library. */ 34 35#include <record.h> 36#include <rec_streamlf.h> 37 38int main(void) 39{ 40 VSTRING *buf = vstring_alloc(100); 41 int type; 42 43 while ((type = rec_get(VSTREAM_IN, buf, 0)) > 0) 44 REC_STREAMLF_PUT_BUF(VSTREAM_OUT, type, buf); 45 vstream_fflush(VSTREAM_OUT); 46 return (0); 47} 48