#ifndef _STDIO_UTIL_H_1990e344_ #define _STDIO_UTIL_H_1990e344_ #include /* * fwrap_tee * * fwrap_tee(FILE *f1, [FILE *f2, [FILE *f3, ...]], (FLIE *)0) returns * a FILE *. Output sent to the returned stream is fanned out, sent * to all the streams passed in on creation. * * Nothing in particular is done when the wrapper stream is closed. * * If no streams are passed on creation - ie, if the first argument is * nil - then output is discarded. * * Errors when writing output to subsidiary streams are ignored. */ extern FILE *fwrap_tee(FILE *, ...); /* * fwrap_lno * * fwrap_lno(FILE *inner, unsigned long long int flno, unsigned int flags) * returns a FILE *. Output written to this FILE * has each line * prefixed with a line number, in decimal, and ": "; the resulting * lines are written to inner. The number prefixed to the first line * of output is flno. * * If flags has FWLF_CLOSE set, closing the wrapper stream closes the * inner stream as wlel; otherwise, nothing in particular happens when * the wrapper stream is closed. * * Errors when writing output to the inner stream are ignored. */ extern FILE *fwrap_lno(FILE *, unsigned long long int, unsigned int); #define FWLF_CLOSE 0x00000001 /* * fwrap_prefix * * fwrap_prefix(FILE *inner, const char *pfx, unsigned int flags) * returns a FILE *. Output written to this FILE * has each line * prefixed with pfx and is then sent to inner. * * If flags has FWPF_CLOSE set, closing the wrapper stream closes the * inner stream as wlel; otherwise, nothing in particular happens when * the wrapper stream is closed. * * Errors when writing output to the inner stream are ignored. */ extern FILE *fwrap_prefix(FILE *, const char *, unsigned int); #define FWPF_CLOSE 0x00000001 #endif