The input is read into a buffer and decoded during the construction
of the object.
If there should be errors (e.g. with the environment variables),
the method is_open
will afterwards return BOOL_FALSE
.
One should check this before calling read
.
CGI input is a sequence of name/value pairs.
Currently,
only the value associated with the name "program
"
is used.
All other name/value pairs are ignored.
Later, when options are needed,
other name/value pairs will probably be translated
into the correct syntax for options.
The goal is that there is no difference between CGI input and file input.
in_cgi_c(void)
;bool_t close(void)
;is_open
to false.
The method always returns BOOL_TRUE
.
int read(char *buf, int size)
;buf
and size size
.
It returns the number of characters actually read.
As long as this is greater than zero,
everything is ok.
If it is zero,
the end of input was reached.
No errors can occur during the call to this method.
Note that the input in the buffer will not be null-terminated.
bool_t is_open(void)
;BOOL_TRUE
iff the CGI input was successfully read and decoded
(and close
was not called in the meantime).
One should check is_open
before calling any of the other
functions.
str_t filename(void)
;STR_NIL
,
because there is no real filename.
An alternative (still considered) is "cgi
".