OSDN Git Service

一部のコンフィギュレーションを外部指定できるように変更
[mimic/MiMicSDK.git] / lib / src / net / httpd / NyLPC_cHttpd.h
1 \r
2 #ifndef NYLPC_CHTTPD_H_\r
3 #define NYLPC_CHTTPD_H_\r
4 \r
5 #include "NyLPC_stdlib.h"\r
6 #include "../NyLPC_cNetConfig.h"\r
7 #include "NyLPC_cHttpdThread.h"\r
8 \r
9 #ifdef __cplusplus\r
10 extern "C" {\r
11 #endif /* __cplusplus */\r
12 \r
13 /**\r
14  * HTTPコネクションスレッドの数\r
15  */\r
16 #ifndef NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD\r
17 #       define NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD 3\r
18 #endif\r
19 \r
20 /**\r
21  * 持続性接続を許可するコネクションの数\r
22  * NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD-1以下にしてください。\r
23  */\r
24 #ifndef NyLPC_cHttpd_MAX_PERSISTENT_CONNECTION\r
25 #       define NyLPC_cHttpd_MAX_PERSISTENT_CONNECTION (NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD-1)\r
26 #endif\r
27 \r
28 \r
29 \r
30 \r
31 \r
32 #ifndef DEFINE_NyLPC_TcHttpdConnection_t\r
33         typedef struct NyLPC_TcHttpdConnection NyLPC_TcHttpdConnection_t;\r
34         #define DEFINE_NyLPC_TcHttpdConnection_t\r
35 #endif\r
36 \r
37 \r
38 \r
39 \r
40 \r
41 typedef void (*NyLPC_TcHttpd_onRequest)(NyLPC_TcHttpdConnection_t* i_inst);\r
42 \r
43 /**\r
44  * class definition\r
45  */\r
46 #ifndef DEFINE_NyLPC_TcHttpd_t\r
47         typedef struct NyLPC_TcHttpd NyLPC_TcHttpd_t;\r
48         #define DEFINE_NyLPC_TcHttpd_t\r
49 #endif\r
50 struct NyLPC_TcHttpd\r
51 {\r
52         struct{\r
53                 NyLPC_TcHttpd_onRequest onRequest;\r
54         }function;\r
55         NyLPC_TcMutex_t _mutex;\r
56         NyLPC_TcTcpListener_t _listener;\r
57         NyLPC_TcHttpdThread_t _thread[NyLPC_cHttpd_NUMBER_OF_CONNECTION_THREAD];\r
58         NyLPC_TInt16 _num_of_active_connection;\r
59 };\r
60 \r
61 \r
62 \r
63 \r
64 void NyLPC_cHttpd_initialize(NyLPC_TcHttpd_t* i_inst,NyLPC_TUInt16 i_port_number);\r
65 void NyLPC_cHttpd_finalize(NyLPC_TcHttpd_t* i_inst);\r
66 void NyLPC_cHttpd_loop(NyLPC_TcHttpd_t* i_inst);\r
67 void NyLPC_cHttpd_lock(NyLPC_TcHttpd_t* i_inst);\r
68 void NyLPC_cHttpd_unlock(NyLPC_TcHttpd_t* i_inst);\r
69 \r
70 \r
71 #ifdef __cplusplus\r
72 }\r
73 #endif /* __cplusplus */\r
74 \r
75 #endif /* NYLPC_CHTTPD_H_ */\r