-
-struct cgi_get_ctx {
- char *buffer;
- int offset;
-};
-
-
-int cgi_getchar(void *ctx, size_t count, unsigned char *c)
-{
- struct cgi_get_ctx *buf = NULL;
-
- buf = (struct cgi_get_ctx *) ctx;
-
- while (count-- > 0 && *c != 0) {
- *c = buf->buffer[buf->offset++];
- }
-
- return (*c == 0);
-}