OSDN Git Service

change version number
[bbk/bchanl.git] / src / retriever.h
1 /*
2  * retriever.h
3  *
4  * Copyright (c) 2009 project bchan
5  *
6  * This software is provided 'as-is', without any express or implied
7  * warranty. In no event will the authors be held liable for any damages
8  * arising from the use of this software.
9  *
10  * Permission is granted to anyone to use this software for any purpose,
11  * including commercial applications, and to alter it and redistribute it
12  * freely, subject to the following restrictions:
13  *
14  * 1. The origin of this software must not be misrepresented; you must not
15  *    claim that you wrote the original software. If you use this software
16  *    in a product, an acknowledgment in the product documentation would be
17  *    appreciated but is not required.
18  *
19  * 2. Altered source versions must be plainly marked as such, and must not be
20  *    misrepresented as being the original software.
21  *
22  * 3. This notice may not be removed or altered from any source
23  *    distribution.
24  *
25  */
26
27 #include        <basic.h>
28
29 #ifndef __RETREIEVER_H__
30 #define __RETREIEVER_H__
31
32 typedef struct retriever_t_ retriever_t;
33
34 IMPORT retriever_t* retriever_new();
35 IMPORT VOID retriever_delete(retriever_t *retriever);
36 IMPORT W retriever_gethost(retriever_t *retriever, UB *host);
37 IMPORT W retriever_request(retriever_t *retriever);
38 IMPORT B* retriever_getheader(retriever_t *retriever);
39 IMPORT W retriever_getheaderlength(retriever_t *retriever);
40 IMPORT B* retriever_getbody(retriever_t *retriever);
41 IMPORT W retriever_getbodylength(retriever_t *retriever);
42
43 IMPORT W retriver_connectsocket(retriever_t *retriever);
44 IMPORT VOID retriever_clearbuffer(retriever_t *retriever);
45 IMPORT W retriever_recieve(retriever_t *retriever, W sock);
46 IMPORT W retriever_parsehttpresponse(retriever_t *retriever);
47 IMPORT W retriever_parse_response_status(retriever_t *retriever);
48 IMPORT W retriever_decompress(retriever_t *retriever);
49
50 #ifdef BCHANL_CONFIG_DEBUG
51 IMPORT VOID retriever_debugprint(retriever_t *retriever);
52 IMPORT VOID retriever_dumpheader(retriever_t *retriever);
53 #else
54 #define retriever_debugprint(retriever) /**/
55 #define retriever_dumpheader(retriever) /**/
56 #endif
57
58 #endif