aboutsummaryrefslogtreecommitdiff
path: root/src/response.h
blob: 346ce3d3c09dfd7f7474ad51056fce5f4a931a41 (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
36
37
38
39
#ifndef MAGI_INCLUDED_RESPONSE
#define MAGI_INCLUDED_RESPONSE

#include "error.h"


enum magi_content_type { magi_xhtml };

struct magi_response {
    struct magi_cookie_list * cookies;
    struct magi_param_list *  http_params;
    struct magi_param_list *  url_params;
    char *                    content_type;
    char *                    content;
};

void magi_response_content_type(struct magi_response * response,
                                enum magi_content_type type);

void magi_reponse_add(struct magi_response * response, const char * addon);
void magi_reponse_add_format(struct magi_response * response,
                             const char *           addon,
                             ...);

void magi_response_cookie(struct magi_response *     response,
                          const struct magi_cookie * cookie);

void magi_response_cookie_easy(struct magi_response * response,
                               const char *           name,
                               const char *           value);

void magi_response_cookie_delete(struct magi_response * response,
                                 const char *           name);


void magi_response_destroy(struct magi_response * response);


#endif