I'm creating an application using the fastcgi library, and their method of printing is a little verbose. I'm trying to wrap their fprintf function in my own method:
I would like to turn
FCGX_FPrintF(out, char* fmt, ...);
into
write(char* strFormat, ...);
I've found the magic of va_list but can't find an easy way to pass va_list values into their fprintf function. Is there a way to do this? I know vsprintf and vprintf exist so it must be harder than I imagine it is.
If all else fails, I'll just overload a write function
I don't believe there is any way to do this in a platform independent way. I would probably format the string myself using vsprintf then just send that to the printing function.
You would have to find the analogue of
vfprintf()
in the Fast CGI library. It is at least moderately plausible that there is one; the easy way to implementFCGX_FPrintF()
is:So it is highly probable that the function exists; you will need to check whether it is exposed officially or not.
A quick visit to the Fast CGI web site reveals that the FCGX prefix is used by functions declared in the fgciapp.h header, and that in turn contains:
So, there's the function with the interface completed.