Xref: utzoo comp.sources.wanted:17309 alt.sources.wanted:1392 comp.lang.c:40582 Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!zaphod.mps.ohio-state.edu!usc!apple!well!jef From: jef@well.sf.ca.us (Jef Poskanzer) Newsgroups: comp.sources.wanted,alt.sources.wanted,comp.lang.c Subject: Portable mini-vfprintf? Message-ID: <25767@well.sf.ca.us> Date: 29 Jun 91 00:08:49 GMT Organization: Acme Software Lines: 43 I have this large software package, pbmplus, which I would like to be as portable as possible. It has a unified message and error routine called pm_message, which really ought to be a varargs routine. The problem is doing this portably. I can deal with varargs.h vs. stdarg.h easily enough, but what about the substantial minority of systems out there which don't have vfprintf? The proposed skeleton of the portable version is appended. If you can think of a way to do this without needing to supply a vfprintf, I'd love to hear about it. Otherwise, do you have a vfprintf lying around? --- Jef Jef Poskanzer jef@well.sf.ca.us {apple, ucbvax, hplabs}!well!jef "Swell." #if __STDC__ static void pm_message( char* fmt, ... ) { va_list ap; va_start( ap, fmt ); #else /*__STDC__*/ /*VARARGS1*/ static void pm_message( va_alist ) va_dcl { va_list ap; char* fmt; va_start(ap); fmt = va_arg( ap, char* ); #endif /*__STDC__*/ (void) vfprintf( stderr, fmt, ap ); va_end( ap ); } #ifdef NEED_VFPRINTF /* portable mini-vfprintf goes here */ #endif /*NEED_VFPRINTF*/