aboutsummaryrefslogtreecommitdiff
path: root/include/magi/cgi.h
blob: c365f2f806c877b73130f159296438dab7febe8c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef MAGI_INCLUDED_CGI
#define MAGI_INCLUDED_CGI
/** @file cgi.h
 * @brief blah...
 *
 * blah-blah...
 */
#include "error.h"
#include "request.h"
#include "response.h"


/** @brief Analyses non-post part of request from environment.
 * @return Returns null only in case of error. */
int magi_request_cgi_head(magi_request *request);

/** @brief Complete request with post data from standard input.
 * @return Returns null only in case of error. */
int magi_request_cgi_body(magi_request *request);

/** @brief Shortcut for analysing both head and body of request. */
int magi_request_cgi(magi_request *request);


/** @brief Sends response to standard output and destroys it.
 * @return Returns null only in case of error. */
int magi_response_cgi(magi_response *response);


/** @brief Sends a standard response of Bad Request error.
 * @return Returns null only in case of error. */
int magi_error_cgi(magi_error error);


#endif