CGI Response API.
Functions | |
| bool | qcgires_setcookie (qentry_t *request, const char *name, const char *value, int expire, const char *path, const char *domain, bool secure) |
| Set cookie. | |
| bool | qcgires_removecookie (qentry_t *request, const char *name, const char *path, const char *domain, bool secure) |
| Remove cookie. | |
| bool | qcgires_setcontenttype (qentry_t *request, const char *mimetype) |
| Set responding content-type. | |
| const char * | qcgires_getcontenttype (qentry_t *request) |
| Get content-type. | |
| bool | qcgires_redirect (qentry_t *request, const char *uri) |
| Send redirection header. | |
| int | qcgires_download (qentry_t *request, const char *filepath, const char *mimetype) |
| Force to send(download) file to client in accordance with given mime type. | |
| void | qcgires_error (qentry_t *request, char *format,...) |
| Print out HTML error page and exit program. | |
| bool qcgires_setcookie | ( | qentry_t * | request, |
| const char * | name, | ||
| const char * | value, | ||
| int | expire, | ||
| const char * | path, | ||
| const char * | domain, | ||
| bool | secure | ||
| ) |
Set cookie.
| request | a pointer of request structure |
| name | cookie name |
| value | cookie value |
| expire | expire related time in seconds (0 means end of session) |
| path | cookie path (NULL can current path) |
| domain | cookie domain (NULL means current domain) |
| secure | secure flag |
| bool qcgires_removecookie | ( | qentry_t * | request, |
| const char * | name, | ||
| const char * | path, | ||
| const char * | domain, | ||
| bool | secure | ||
| ) |
Remove cookie.
| request | a pointer of request structure |
| name | cookie name |
| path | cookie path |
| domain | cookie domain |
| secure | secure flag |
| bool qcgires_setcontenttype | ( | qentry_t * | request, |
| const char * | mimetype | ||
| ) |
Set responding content-type.
| request | a pointer of request structure |
| mimetype | mimetype |
| const char* qcgires_getcontenttype | ( | qentry_t * | request | ) |
Get content-type.
| request | a pointer of request structure |
| bool qcgires_redirect | ( | qentry_t * | request, |
| const char * | uri | ||
| ) |
Send redirection header.
| request | a pointer of request structure |
| uri | new URI |
| int qcgires_download | ( | qentry_t * | request, |
| const char * | filepath, | ||
| const char * | mimetype | ||
| ) |
Force to send(download) file to client in accordance with given mime type.
| request | a pointer of request structure |
| filepath | file to send |
| mimetype | mimetype. NULL can be used for "application/octet-stream". |
| void qcgires_error | ( | qentry_t * | request, |
| char * | format, | ||
| ... | |||
| ) |
Print out HTML error page and exit program.
| request | a pointer of request structure |
| format | error message |