response.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (c) 2005-2012 by KoanLogic s.r.l. <http://www.koanlogic.com>
00003  * All rights reserved.
00004  *
00005  * This file is part of KLone, and as such it is subject to the license stated
00006  * in the LICENSE file which you have received as part of this distribution.
00007  *
00008  * $Id: response.h,v 1.12 2007/10/22 15:49:47 tat Exp $
00009  */
00010 
00011 #ifndef _KLONE_RESPONSE_H_
00012 #define _KLONE_RESPONSE_H_
00013 
00014 #include <klone/io.h>
00015 #include <klone/header.h>
00016 #include <klone/http.h>
00017 
00018 #ifdef __cplusplus
00019 extern "C" {
00020 #endif
00021 
00024 enum { COOKIE_MAX_SIZE = 4096 };
00025 
00026 struct response_s;
00027 typedef struct response_s response_t;
00028 
00029 int response_create(http_t *http, response_t **prs);
00030 int response_free(response_t *rs);
00031 int response_bind(response_t *rs, io_t *);
00032 
00033 int response_redirect(response_t *rs, const char *url);
00034 
00035 int response_set_status(response_t *rs, int code);
00036 int response_get_status(response_t *rs);
00037 void response_set_method(response_t *rs, int method);
00038 int response_get_method(response_t *rs);
00039 
00040 int response_enable_caching(response_t *rs);
00041 int response_disable_caching(response_t *rs);
00042 
00043 void response_set_cgi(response_t *rs, int cgi);
00044 
00045 int response_print_header(response_t *rs);
00046 int response_print_header_to_io(response_t *rs, io_t *io);
00047 size_t response_get_max_header_size(response_t *rs);
00048 
00049 io_t* response_io(response_t *rs);
00050 
00051 header_t* response_get_header(response_t *rs);
00052 
00053 field_t* response_get_field(response_t *rs, const char *name);
00054 const char* response_get_field_value(response_t *rs, const char *name);
00055 
00056 int response_set_field(response_t *rs, const char *name, const char *value);
00057 int response_set_content_type(response_t *rs, const char *mime_type);
00058 int response_set_content_length(response_t *rs, size_t sz);
00059 int response_set_content_encoding(response_t *rs, const char *encoding);
00060 int response_set_last_modified(response_t *rs, time_t mtime);
00061 int response_set_date(response_t *rs, time_t now);
00062 
00063 int response_set_cookie(response_t *rs, const char *name, const char *value,
00064     time_t expire, const char *path, const char *domain, int secure);
00065 
00066 #ifdef __cplusplus
00067 }
00068 #endif 
00069 
00070 #endif

←Products
Copyright © 2005-2012 - KoanLogic S.r.l. - All rights reserved