Index: EcnlProtoTool/trunk/ntshell/webserver/websocket.h
===================================================================
--- EcnlProtoTool/trunk/ntshell/webserver/websocket.h	(revision 278)
+++ EcnlProtoTool/trunk/ntshell/webserver/websocket.h	(revision 279)
@@ -58,89 +58,10 @@
 #include "t_stddef.h"
 
-#define NUM_ECHONET_MEMPOOL_BLOCK (60)		/* é»æç¨ã¡ã¢ãªãã­ãã¯ã®æ° */
-#define ECHONET_MEMPOOL_BLOCK_SIZE (256)	/* é»æç¨ã¡ã¢ãªãã­ãã¯ã®ãµã¤ãº */
+#define NUM_WEBSOCKET_MBXID	2
 
-/* T_EDATAç®¡çé åãµã¤ãº */
-#define DEF_ECN_EDT_HDR_LEN (sizeof(intptr_t))
+#ifndef TOPPERS_MACRO_ONLY
+#include "websocket_fbs.h"
 
-/* ç®¡çé åãµã¤ãº(64byte - sizeof(T_MSG)) */
-/* #define DEF_ECN_FBS_LIB_HDR_LEN ((ECHONET_MEMPOOL_BLOCK_SIZE + sizeof(int) - 1)>> 2) // */
-#define DEF_ECN_FBS_LIB_HDR_LEN (64 - DEF_ECN_EDT_HDR_LEN)
-
-/* ç®¡çé åãå«ããã­ãã¯ã«ä¿æãããã¼ã¿ãµã¤ãº */
-#define DEF_ECN_FBS_FST_DAT_LEN (64)
-
-/* ãªã³ã¯ãã¤ã³ã¿é
-åã®ãµã¤ãº(byte) */
-#define DEF_ECN_FBS_LNK_LEN (ECHONET_MEMPOOL_BLOCK_SIZE - DEF_ECN_EDT_HDR_LEN - DEF_ECN_FBS_LIB_HDR_LEN - DEF_ECN_FBS_FST_DAT_LEN)
-
-/* åºå®é·ãããã¡æå¤§ãµã¤ãº */
-#define DEF_ECN_FBS_BUF_MAXLEN ((DEF_ECN_FBS_LNK_LEN / sizeof(void *)) * ECHONET_MEMPOOL_BLOCK_SIZE + DEF_ECN_FBS_FST_DAT_LEN)
-
-/* å­è¦ç´ ãããã¡ã®ãµã¤ãº */
-#define DEF_ECN_FBS_SUB_BUF_LEN ECHONET_MEMPOOL_BLOCK_SIZE
-
-/* ãªã³ã¯ãã¤ã³ã¿é
-åã«åæããããå­è¦ç´ ãããã¡ */
-typedef struct {
-	uint8_t	payload[ECHONET_MEMPOOL_BLOCK_SIZE];
-} T_ECN_SUB_BLK;
-
-/* ãªã³ã¯ãã¤ã³ã¿é
-å */
-typedef union {
-	T_ECN_SUB_BLK	*p_sub[DEF_ECN_FBS_LNK_LEN / sizeof(T_ECN_SUB_BLK *)];
-	uint8_t			bin[DEF_ECN_FBS_LNK_LEN];
-} T_ECN_FBS_LNK;
-
-/* ç®¡çé å(64byte - sizeof(T_MSG)) */
-typedef struct {
-	uint16_t	length;			/* ã¡ãã»ã¼ã¸é· */
-	uint16_t	type;			/* ã¡ãã»ã¼ã¸ã¿ã¤ã */
-	union {
-		ID mbxid;				/* éä¿¡å
-ã¡ã¼ã«ããã¯ã¹IDï¼å
-é¨ã¡ãã»ã¼ã¸ï¼ */
-	}sender;
-	union {
-		ID mbxid;				/* éä¿¡å
-ã¡ã¼ã«ããã¯ã¹IDï¼å
-é¨ã¡ãã»ã¼ã¸ï¼ */
-	}target;
-	union {
-		ID mbxid;				/* è¿ä¿¡å
-ã¡ã¼ã«ããã¯ã¹IDï¼å
-é¨ã¡ãã»ã¼ã¸ï¼ */
-	}reply;
-
-	int			rd;				/*	èª­ã¿åããããæ
-å ±	*/
-	int			wr;				/*	æ¸ãè¾¼ã¿ãããæ
-å ±	*/
-} T_ECN_FBS_HDR;
-
-/* ç®¡çé åãå«ããã­ãã¯ã®æ§é  */
-typedef struct {
-	uint8_t	_msg[DEF_ECN_EDT_HDR_LEN];	/* T_MSG */
-	T_ECN_FBS_HDR	hdr;	/*	ç®¡çé å  64byte  - sizeof(T_MSG)	*/
-	uint8_t			_gap[DEF_ECN_FBS_LIB_HDR_LEN - sizeof(T_ECN_FBS_HDR)];
-	T_ECN_FBS_LNK	lnk;	/*	ãªã³ã¯ãã¤ã³ã¿é
-å	128byte			*/
-	uint8_t			payload[DEF_ECN_FBS_FST_DAT_LEN];
-} T_ECN_FST_BLK;
-
-/* FBS-ID */
-typedef struct ecn_fbs_id_strc {
-	T_ECN_FST_BLK	*ptr;
-} ECN_FBS_ID;
-
-ER _ecn_fbs_cre(size_t fa_req_size, ECN_FBS_ID *fp_id);
-ER _ecn_fbs_del(ECN_FBS_ID fa_id);
-size_t _ecn_fbs_get_datalen(ECN_FBS_ID fa_id);
-int _ecn_fbs_peek(ECN_FBS_ID fa_id, size_t fa_seek);
-ER _ecn_fbs_poke(ECN_FBS_ID fa_id, size_t fa_seek, int fa_val);
-
-extern ID ecn_api_mailboxid;
-extern ID WEBSOCKET_MBXID;
+extern ID ws_api_mailboxid;
 
 typedef struct ws_state
@@ -168,5 +89,5 @@
 	ws_state_t wstate;
 	ws_state_t rstate;
-	ECN_FBS_ID cur_in_msg;
+	WS_FBS_ID cur_in_msg;
 };
 
@@ -179,3 +100,5 @@
 int websocket_output(struct websocket *ws, void *data, int len);
 
+#endif /* TOPPERS_MACRO_ONLY */
+
 #endif  /* WEBSOCKET_H */
