//
// Provides support for FastCGI via C++ iostreams.
//
-// $Id: fcgio.h,v 1.12 2001/11/27 14:01:35 robs Exp $
+// $Id: fcgio.h,v 1.13 2001/12/04 00:22:04 robs Exp $
//
// This work is based on routines written by George Feinberg. They
// have been mostly re-written and extensively changed by
DLLAPI fcgi_streambuf(char * buf, int len);
- DLLAPI fcgi_streambuf(FCGX_Stream * fcgx = NULL);
+ DLLAPI fcgi_streambuf(FCGX_Stream * fcgx = 0);
DLLAPI ~fcgi_streambuf(void);
public:
// deprecated
- DLLAPI fcgi_istream(FCGX_Stream * fcgx = NULL);
+ DLLAPI fcgi_istream(FCGX_Stream * fcgx = 0);
// deprecated
DLLAPI ~fcgi_istream(void) {}
public:
// deprecated
- DLLAPI fcgi_ostream(FCGX_Stream * fcgx = NULL);
+ DLLAPI fcgi_ostream(FCGX_Stream * fcgx = 0);
// deprecated
DLLAPI ~fcgi_ostream(void) {}
//
-// $Id: fcgio.cpp,v 1.11 2001/11/26 18:09:03 robs Exp $
+// $Id: fcgio.cpp,v 1.12 2001/12/04 00:22:06 robs Exp $
//
// Allows you communicate with FastCGI streams using C++ iostreams
//
#include "fcgio.h"
-fcgi_streambuf::fcgi_streambuf(FCGX_Stream * fcgx, char * buf, int bufsize)
+fcgi_streambuf::fcgi_streambuf(FCGX_Stream * fs, char * b, int bs)
{
- init(fcgx, buf, bufsize);
+ init(fs, b, bs);
}
-fcgi_streambuf::fcgi_streambuf(char * buf, int bufsize)
+fcgi_streambuf::fcgi_streambuf(char * b, int bs)
{
- init(NULL, buf, bufsize);
+ init(0, b, bs);
}
-fcgi_streambuf::fcgi_streambuf(FCGX_Stream * fcgx)
+fcgi_streambuf::fcgi_streambuf(FCGX_Stream * fs)
{
- init(fcgx, NULL, 0);
+ init(fs, 0, 0);
}
fcgi_streambuf::~fcgi_streambuf(void)
// FCGX_Finish()/FCGX_Accept() will flush and close
}
-void fcgi_streambuf::init(FCGX_Stream * fcgx, char * buf, int bufsize)
+void fcgi_streambuf::init(FCGX_Stream * fs, char * b, int bs)
{
- this->fcgx = fcgx;
- this->buf = NULL;
+ this->fcgx = fs;
+ this->buf = 0;
this->bufsize = 0;
- setbuf(buf, bufsize);
+ setbuf(b, bs);
}
int fcgi_streambuf::overflow(int c)
setp(this->buf, this->buf + this->bufsize);
}
-streambuf * fcgi_streambuf::setbuf(char * buf, int len)
+streambuf * fcgi_streambuf::setbuf(char * b, int bs)
{
// XXX support moving data from an old buffer
- if (this->bufsize) return NULL;
+ if (this->bufsize) return 0;
- this->buf = buf;
- this->bufsize = len;
+ this->buf = b;
+ this->bufsize = bs;
// the base setbuf() *has* to be called
- streambuf::setbuf(buf, len);
+ streambuf::setbuf(b, bs);
reset();
return this;
}
-int fcgi_streambuf::attach(FCGX_Stream * strm)
+int fcgi_streambuf::attach(FCGX_Stream * fs)
{
- this->fcgx = strm;
+ this->fcgx = fs;
if (this->bufsize)
{
}
// deprecated
-fcgi_istream::fcgi_istream(FCGX_Stream * strm) :
+fcgi_istream::fcgi_istream(FCGX_Stream * fs) :
istream(&fcgi_strmbuf)
{
- fcgi_strmbuf.attach(strm);
+ fcgi_strmbuf.attach(fs);
}
// deprecated
-void fcgi_istream::attach(FCGX_Stream * strm)
+void fcgi_istream::attach(FCGX_Stream * fs)
{
- fcgi_strmbuf.attach(strm);
+ fcgi_strmbuf.attach(fs);
}
// deprecated
-fcgi_ostream::fcgi_ostream(FCGX_Stream * strm) :
+fcgi_ostream::fcgi_ostream(FCGX_Stream * fs) :
ostream(&fcgi_strmbuf)
{
- fcgi_strmbuf.attach(strm);
+ fcgi_strmbuf.attach(fs);
}
// deprecated
-void fcgi_ostream::attach(FCGX_Stream * strm)
+void fcgi_ostream::attach(FCGX_Stream * fs)
{
- fcgi_strmbuf.attach(strm);
+ fcgi_strmbuf.attach(fs);
}