OSDN Git Service

git-svn-id: http://svn.osdn.jp/svnroot/mimic/trunk@198 47198e57-cb75-475f-84c4-a814cd...
authornyatla <nyatla@47198e57-cb75-475f-84c4-a814cd6f29e0>
Sun, 10 Mar 2013 12:03:21 +0000 (12:03 +0000)
committernyatla <nyatla@47198e57-cb75-475f-84c4-a814cd6f29e0>
Sun, 10 Mar 2013 12:03:21 +0000 (12:03 +0000)
36 files changed:
lib/src/NyLPC_cMiMicEnv.c [new file with mode: 0644]
lib/src/NyLPC_cMiMicEnv.h [new file with mode: 0644]
lib/src/NyLPC_stdlib.c
lib/src/http/NyLPC_cHttpBodyWriter.c
lib/src/http/NyLPC_cHttpBodyWriter.h
lib/src/http/NyLPC_cHttpHeaderWriter.c
lib/src/http/NyLPC_cHttpShortRequestHeaderParser.c
lib/src/include/NyLPC_stdlib.h
lib/src/mimicvm/NyLPC_cMiMicTxtCompiler.c
lib/src/mimicvm/NyLPC_cMiMicTxtCompiler.h
lib/src/net/NyLPC_cNet.c [moved from lib/src/api/NyLPC_cNet.c with 100% similarity]
lib/src/net/NyLPC_cNet.h [moved from lib/src/api/NyLPC_cNet.h with 100% similarity]
lib/src/net/NyLPC_cNetConfig.c [moved from lib/src/api/NyLPC_cNetConfig.c with 100% similarity]
lib/src/net/NyLPC_cNetConfig.h [moved from lib/src/api/NyLPC_cNetConfig.h with 100% similarity]
lib/src/net/httpd/NyLPC_cHttpRequestPrefixParser.c [moved from lib/src/api/NyLPC_cHttpRequestPrefixParser.c with 93% similarity]
lib/src/net/httpd/NyLPC_cHttpRequestPrefixParser.h [moved from lib/src/api/NyLPC_cHttpRequestPrefixParser.h with 92% similarity]
lib/src/net/httpd/NyLPC_cHttpd.c [moved from lib/src/api/NyLPC_cHttpd.c with 68% similarity]
lib/src/net/httpd/NyLPC_cHttpd.h [moved from lib/src/api/NyLPC_cHttpd.h with 69% similarity]
lib/src/net/httpd/NyLPC_cHttpdConnection.c [moved from lib/src/api/NyLPC_cHttpdConnection.c with 77% similarity]
lib/src/net/httpd/NyLPC_cHttpdConnection.h [moved from lib/src/api/NyLPC_cHttpdConnection.h with 74% similarity]
lib/src/net/httpd/NyLPC_cHttpdConnection_protected.h [moved from lib/src/api/NyLPC_cHttpdConnection_protected.h with 73% similarity]
lib/src/net/httpd/NyLPC_cHttpdThread.c [moved from lib/src/api/NyLPC_cHttpdThread.c with 58% similarity]
lib/src/net/httpd/NyLPC_cHttpdThread.h [moved from lib/src/api/NyLPC_cHttpdThread.h with 91% similarity]
lib/src/net/httpd/mod/NyLPC_cHttpModUtils.c [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cHttpModUtils_protected.h [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.c [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.h [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.c [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.h [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModRomFiles.c [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModRomFiles.h [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModRomFiles_protected.h [new file with mode: 0644]
lib/src/net/httpd/mod/NyLPC_cModShortUrl.c [moved from lib/src/api/NyLPC_cModShortUrl.c with 73% similarity]
lib/src/net/httpd/mod/NyLPC_cModShortUrl.h [moved from lib/src/api/NyLPC_cModShortUrl.h with 84% similarity]
projects/example/sample.net.simplehttpd/.cproject
projects/example/sample.net.simplehttpd/src/sketch.c

diff --git a/lib/src/NyLPC_cMiMicEnv.c b/lib/src/NyLPC_cMiMicEnv.c
new file mode 100644 (file)
index 0000000..59b84f1
--- /dev/null
@@ -0,0 +1,2 @@
+\r
+const char* NyLPC_cMiMicEnv_PlatformName="Unknown Platform";\r
diff --git a/lib/src/NyLPC_cMiMicEnv.h b/lib/src/NyLPC_cMiMicEnv.h
new file mode 100644 (file)
index 0000000..612bfad
--- /dev/null
@@ -0,0 +1,26 @@
+/*\r
+ * NyLPC_cMiMicEnv.h\r
+ *\r
+ *  Created on: 2013/03/08\r
+ *      Author: nyatla\r
+ */\r
+\r
+#ifndef NYLPC_CMIMICENV_H_\r
+#define NYLPC_CMIMICENV_H_\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/**\r
+ * Platformを示す文字列\r
+ */\r
+extern const char* NyLPC_cMiMicEnv_PlatformName;\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif /* NYLPC_CMIMICENV_H_ */\r
index 3b9a684..0540937 100644 (file)
@@ -90,6 +90,36 @@ void NyLPC_TUInt32ArrayPtr_setBuf(struct NyLPC_TUInt32ArrayPtr* i_struct,NyLPC_T
 }\r
 \r
 \r
+/** ----------\r
+ * NyLPC_TTextIdTbl\r
+ ---------- */\r
+\r
+/**\r
+ * IDテーブル\r
+ */\r
+\r
+NyLPC_TUInt8 NyLPC_TTextIdTbl_getMatchId(const NyLPC_TChar* i_str,const struct NyLPC_TTextIdTbl i_tbl[])\r
+{\r
+       int i;\r
+       for(i=0;i_tbl[i].n!=NULL;i++){\r
+               if(strcmp(i_str,i_tbl[i].n)){\r
+                       break;\r
+               }\r
+       }\r
+       return i_tbl[i].id;\r
+}\r
+\r
+\r
+\r
+\r
+/** ----------\r
+ *\r
+ ---------- */\r
+\r
+\r
+\r
+\r
+\r
 void NyLPC_itoa(int i_n,char* o_out,int i_digit)\r
 {\r
         int i, sign;\r
index 073388c..4c7d742 100644 (file)
@@ -42,6 +42,7 @@ void NyLPC_cHttpBodyWriter_initialize(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TcH
        i_inst->_is_chunked=NyLPC_TUInt8_FALSE;\r
        i_inst->_is_error=NyLPC_TUInt8_FALSE;\r
        i_inst->_size_of_sent=0;\r
+       i_inst->_content_length=0;\r
        NyLPC_iHttpPtrStream_setWriteEncoding(i_inst->_ref_stream,NyLPC_TiHttpPtrStream_ET_NONE);\r
 }\r
 \r
@@ -50,6 +51,12 @@ void NyLPC_cHttpBodyWriter_setChunked(NyLPC_TcHttpBodyWriter_t* i_inst)
        i_inst->_is_chunked=NyLPC_TUInt8_TRUE;\r
        NyLPC_iHttpPtrStream_setWriteEncoding(i_inst->_ref_stream,NyLPC_TiHttpPtrStream_ET_CHUNKED);\r
 }\r
+void NyLPC_cHttpBodyWriter_setContentLength(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TUInt32 i_content_length)\r
+{\r
+       i_inst->_is_chunked=NyLPC_TUInt8_FALSE;\r
+       i_inst->_content_length=i_content_length;\r
+       NyLPC_iHttpPtrStream_setWriteEncoding(i_inst->_ref_stream,NyLPC_TiHttpPtrStream_ET_NONE);\r
+}\r
 \r
 \r
 /**\r
index b9262a7..3e251ba 100644 (file)
@@ -42,11 +42,19 @@ struct NyLPC_TcHttpBodyWriter
        NyLPC_TUInt8 _is_chunked;\r
        NyLPC_TUInt8 _is_error;\r
        NyLPC_TUInt32 _size_of_sent;\r
+       /** _is_chunked==NyLPC_TUInt8_TRUEの時のみ有効. ContentLengthの値*/\r
+       NyLPC_TUInt32 _content_length;\r
 };\r
 \r
+/**\r
+ * 送信モードの初期値は、contentlength=0,chunked無しです。\r
+ */\r
 void NyLPC_cHttpBodyWriter_initialize(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TcHttpStream_t* i_stream);\r
 #define NyLPC_cHttpBodyWriter_finalize(i);\r
+/** Chunkedエンコーディングで送信する場合*/\r
 void NyLPC_cHttpBodyWriter_setChunked(NyLPC_TcHttpBodyWriter_t* i_inst);\r
+/** Contentlengthで送信する場合*/\r
+void NyLPC_cHttpBodyWriter_setContentLength(NyLPC_TcHttpBodyWriter_t* i_inst,NyLPC_TUInt32 i_content_length);\r
 NyLPC_TBool NyLPC_cHttpBodyWriter_write(NyLPC_TcHttpBodyWriter_t* i_inst,const void* i_buf,NyLPC_TUInt32 i_len);\r
 NyLPC_TBool NyLPC_cHttpBodyWriter_close(NyLPC_TcHttpBodyWriter_t* i_inst);\r
 NyLPC_TBool NyLPC_cHttpBodyWriter_format(NyLPC_TcHttpBodyWriter_t* i_inst,const NyLPC_TChar* i_fmt,...);\r
index b25c3fa..3a82735 100644 (file)
@@ -88,6 +88,7 @@ const static struct{
        {400,"Bad Request"},\r
        {403,"Forbidden"},\r
        {404,"Not Found"},\r
+       {405,"Method Not Allowed"},\r
        {500,"Internal Server Error"},\r
        {0,NULL}//これ最後にしてね。\r
 };\r
index 7ed5172..889921b 100644 (file)
@@ -40,6 +40,7 @@ static NyLPC_TBool urlHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,NyLPC_TCha
        out->url[inst->url_len]=i_c;\r
        inst->url_len++;\r
        if(inst->url_len>=32){\r
+               out->url[inst->url_len-1]='\0';\r
                return NyLPC_TBool_FALSE;\r
        }\r
        return NyLPC_TBool_TRUE;\r
index 24a9450..09059c9 100644 (file)
@@ -442,10 +442,19 @@ NyLPC_TBool NyLPC_TUInt32ArrayPtr_seek(struct NyLPC_TUInt32ArrayPtr* i_struct,Ny
  */\r
 void NyLPC_TUInt32ArrayPtr_setBuf(struct NyLPC_TUInt32ArrayPtr* i_struct,NyLPC_TUInt32* i_ptr,NyLPC_TUInt16 i_len);\r
 \r
-#ifdef __cplusplus\r
-}\r
-#endif /* __cplusplus */\r
 \r
+/**\r
+ * TextとIDのテーブルです。\r
+ */\r
+struct NyLPC_TTextIdTbl{\r
+       const char* n;\r
+       NyLPC_TUInt8 id;\r
+};\r
+\r
+/**\r
+ * テーブルを検索してマッチしたIDを返します。テーブルのnがNULLの要素で愁嘆します。\r
+ */\r
+NyLPC_TUInt8 NyLPC_TTextIdTbl_getMatchId(const NyLPC_TChar* i_str,const struct NyLPC_TTextIdTbl i_tbl[]);\r
 \r
 /*********************************************************************************\r
  * standard function\r
@@ -453,10 +462,20 @@ void NyLPC_TUInt32ArrayPtr_setBuf(struct NyLPC_TUInt32ArrayPtr* i_struct,NyLPC_T
 void NyLPC_itoa(int i_n,char* o_out,int i_digit);\r
 void NyLPC_reverse(char* s);\r
 \r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+\r
+\r
 /*********************************************************************************\r
  *\r
  *********************************************************************************/\r
 \r
+#include "../NyLPC_cMiMicEnv.h"\r
 #include "../NyLPC_cRingBuffer.h"\r
 #include "../NyLPC_cPtrTbl.h"\r
 #include "../NyLPC_cFifoBuffer.h"\r
index 7550849..b7a3dab 100644 (file)
@@ -46,7 +46,7 @@ static NyLPC_TBool txt2WMId(const NyLPC_TChar* i_txt,NyLPC_TUInt8* out);
 static void NyLPC_TcMiMicVM_OPR_TYPE_getOpInfo(NyLPC_TcMiMicVM_OPR_TYPE i_type,NyLPC_TUInt8* oprbc_len,NyLPC_TUInt8* o_istlen);\r
 \r
 \r
-void NyLPC_cMiMicBcCompiler_initialize(NyLPC_TcMiMicTxtCompiler_t* i_inst)\r
+void NyLPC_cMiMicTxtCompiler_initialize(NyLPC_TcMiMicTxtCompiler_t* i_inst)\r
 {\r
        i_inst->out_buf=NULL;\r
        i_inst->st=NyLPC_TcMiMicTxtCompiler_ST_OPC;\r
@@ -74,7 +74,7 @@ void NyLPC_cMiMicBcCompiler_initialize(NyLPC_TcMiMicTxtCompiler_t* i_inst)
  * 実行結果を返します。NyLPC_TcMiMicTxtCompiler_RET_OKの場合に、i_binへo_bin_lenの長さのインストラクションを出力します。\r
  *\r
  */\r
-NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicBcCompiler_compileFragment(NyLPC_TcMiMicTxtCompiler_t* i_inst,const struct NyLPC_TCharArrayPtr* i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len,NyLPC_TUInt16* o_parsed_bc)\r
+NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicTxtCompiler_compileFragment(NyLPC_TcMiMicTxtCompiler_t* i_inst,const struct NyLPC_TCharArrayPtr* i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len,NyLPC_TUInt16* o_parsed_bc)\r
 {\r
        union NyLPC_TcMiMicVM_TInstruction* wptr;\r
        int i;\r
@@ -224,13 +224,13 @@ ERROR:
  * 実行結果を返します。TRUEのときは、ステータスをチェックしてください。\r
  *\r
  */\r
-NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicBcCompiler_compileFragment2(NyLPC_TcMiMicTxtCompiler_t* i_inst,NyLPC_TChar i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len)\r
+NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicTxtCompiler_compileFragment2(NyLPC_TcMiMicTxtCompiler_t* i_inst,NyLPC_TChar i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len)\r
 {\r
        struct NyLPC_TCharArrayPtr bc;\r
        NyLPC_TUInt16 bc_len;\r
        bc.ptr=&i_bc;\r
        bc.len=1;\r
-       return NyLPC_cMiMicBcCompiler_compileFragment(i_inst,&bc,i_bin,o_bin_len,&bc_len);\r
+       return NyLPC_cMiMicTxtCompiler_compileFragment(i_inst,&bc,i_bin,o_bin_len,&bc_len);\r
 }\r
 \r
 \r
index d324b0b..0bbbaed 100644 (file)
@@ -67,10 +67,10 @@ typedef NyLPC_TUInt8 NyLPC_TcMiMicTxtCompiler_RET;
 \r
 \r
 \r
-void NyLPC_cMiMicBcCompiler_initialize(NyLPC_TcMiMicTxtCompiler_t* i_inst);\r
-#define NyLPC_cMiMicBcCompiler_finalize(i)\r
-NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicBcCompiler_compileFragment(NyLPC_TcMiMicTxtCompiler_t* i_inst,const struct NyLPC_TCharArrayPtr* i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len,NyLPC_TUInt16* o_parsed_bc);\r
-NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicBcCompiler_compileFragment2(NyLPC_TcMiMicTxtCompiler_t* i_inst,NyLPC_TChar i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len);\r
+void NyLPC_cMiMicTxtCompiler_initialize(NyLPC_TcMiMicTxtCompiler_t* i_inst);\r
+#define NyLPC_cMiMicTxtCompiler_finalize(i)\r
+NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicTxtCompiler_compileFragment(NyLPC_TcMiMicTxtCompiler_t* i_inst,const struct NyLPC_TCharArrayPtr* i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len,NyLPC_TUInt16* o_parsed_bc);\r
+NyLPC_TcMiMicTxtCompiler_RET NyLPC_cMiMicTxtCompiler_compileFragment2(NyLPC_TcMiMicTxtCompiler_t* i_inst,NyLPC_TChar i_bc,struct NyLPC_TUInt32ArrayPtr* i_bin,NyLPC_TUInt16* o_bin_len);\r
 \r
 \r
 #ifdef __cplusplus\r
@@ -49,7 +49,10 @@ static NyLPC_TBool message_handler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,const
        return NyLPC_TBool_TRUE;\r
 }\r
 \r
-\r
+const NyLPC_TChar* NyLPC_cHttpRequestPrefixParser_getUrlPrefix(const NyLPC_TcHttpRequestPrefixParser_t* i_inst)\r
+{\r
+       return i_inst->_url;\r
+}\r
 /**\r
  * URLハンドラ。\r
  * 規定文字数のPathを入力されるか、Pathが終了するまで文字列を蓄積する。\r
@@ -51,6 +51,6 @@ void NyLPC_cHttpRequestPrefixParser_initialize(NyLPC_TcHttpRequestPrefixParser_t
  */\r
 NyLPC_TBool NyLPC_cHttpRequestPrefixParser_parse(NyLPC_TcHttpRequestPrefixParser_t* i_inst,NyLPC_TcHttpStream_t* i_stream);\r
 \r
-\r
+const NyLPC_TChar* NyLPC_cHttpRequestPrefixParser_getUrlPrefix(const NyLPC_TcHttpRequestPrefixParser_t* i_inst);\r
 \r
 #endif /* NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_ */\r
similarity index 68%
rename from lib/src/api/NyLPC_cHttpd.c
rename to lib/src/net/httpd/NyLPC_cHttpd.c
index 483dba1..bcadc92 100644 (file)
@@ -6,11 +6,16 @@ void NyLPC_cHttpd_initialize(NyLPC_TcHttpd_t* i_inst,NyLPC_TUInt16 i_port_number
 {\r
        int i;\r
        i_inst->_num_of_active_connection=0;\r
+       NyLPC_cMutex_initialize(&i_inst->_mutex);\r
        NyLPC_cTcpListener_initialize(&(i_inst->_listener),i_port_number);\r
        for(i=0;i<NyLPC_cNet_NUMBER_OF_THREAD;i++){\r
                NyLPC_cHttpdThread_initialize(&(i_inst->_thread[i]),i_inst,NyLPC_TcThread_PRIORITY_IDLE);\r
        }\r
 }\r
+void NyLPC_cHttpd_finalize(NyLPC_TcHttpd_t* i_inst)\r
+{\r
+       NyLPC_cMutex_finalize(&i_inst->_mutex);\r
+}\r
 \r
 void NyLPC_cHttpd_loop(NyLPC_TcHttpd_t* i_inst)\r
 {\r
@@ -38,3 +43,18 @@ NyLPC_TUInt16 NyLPC_cHttpd_decNumOfConnection(NyLPC_TcHttpd_t* i_inst)
        NyLPC_Assert(i_inst->_num_of_active_connection>=0);\r
        return i_inst->_num_of_active_connection;\r
 }\r
+\r
+/**\r
+* Httpd全体で唯一のロックを取得する。\r
+*/\r
+void NyLPC_cHttpd_lock(NyLPC_TcHttpd_t* i_inst)\r
+{\r
+       NyLPC_cMutex_lock(&i_inst->_mutex);\r
+}\r
+/**\r
+* Httpd全体で唯一のロックを開放する。\r
+*/\r
+void NyLPC_cHttpd_unlock(NyLPC_TcHttpd_t* i_inst)\r
+{\r
+       NyLPC_cMutex_unlock(&i_inst->_mutex);\r
+}\r
similarity index 69%
rename from lib/src/api/NyLPC_cHttpd.h
rename to lib/src/net/httpd/NyLPC_cHttpd.h
index 2ef41c8..29e9830 100644 (file)
@@ -1,6 +1,6 @@
 #include "NyLPC_stdlib.h"\r
 #include "NyLPC_uipService.h"\r
-#include "NyLPC_cNetConfig.h"\r
+#include "../NyLPC_cNetConfig.h"\r
 #include "NyLPC_cHttpdThread.h"\r
 \r
 #ifndef NYLPC_CHTTPD_H_\r
@@ -17,6 +17,7 @@ struct NyLPC_TcHttpd
        struct{\r
                NyLPC_TcHttpd_onRequest _handler;\r
        }function;\r
+       NyLPC_TcMutex_t _mutex;\r
        NyLPC_TcTcpListener_t _listener;\r
        NyLPC_TcHttpdThread_t _thread[NyLPC_cNet_NUMBER_OF_THREAD];\r
        NyLPC_TUInt16 _num_of_active_connection;\r
@@ -24,6 +25,7 @@ struct NyLPC_TcHttpd
 \r
 \r
 void NyLPC_cHttpd_initialize(NyLPC_TcHttpd_t* i_inst,NyLPC_TUInt16 i_port_number);\r
+void NyLPC_cHttpd_finalize(NyLPC_TcHttpd_t* i_inst);\r
 \r
 void NyLPC_cHttpd_loop(NyLPC_TcHttpd_t* i_inst);\r
 \r
@@ -37,6 +39,17 @@ NyLPC_TUInt16 NyLPC_cHttpd_incNumOfConnection(NyLPC_TcHttpd_t* i_inst);
 \r
 NyLPC_TUInt16 NyLPC_cHttpd_decNumOfConnection(NyLPC_TcHttpd_t* i_inst);\r
 \r
+/**\r
+* Httpd全体で唯一のロックを取得する。\r
+*/\r
+void NyLPC_cHttpd_lock(NyLPC_TcHttpd_t* i_inst);\r
+\r
+/**\r
+* Httpd全体で唯一のロックを開放する。\r
+*/\r
+void NyLPC_cHttpd_unlock(NyLPC_TcHttpd_t* i_inst);\r
+\r
+\r
 \r
 \r
 #endif /* NYLPC_CHTTPD_H_ */\r
similarity index 77%
rename from lib/src/api/NyLPC_cHttpdConnection.c
rename to lib/src/net/httpd/NyLPC_cHttpdConnection.c
index 369b0ff..291a2a4 100644 (file)
@@ -1,12 +1,15 @@
 #include "NyLPC_cHttpdConnection_protected.h"\r
 #include "../http/NyLPC_cHttpNullRequestHeaderParser.h"\r
+#include "./mod/NyLPC_cHttpModUtils_protected.h"\r
+#include "NyLPC_cHttpd.h"\r
 \r
 \r
 \r
-void NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst)\r
+void NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpd_t* i_parent_httpd)\r
 {\r
        NyLPC_cTcpSocket_initialize(&(i_inst->_socket),i_inst->_rxbuf,NyLPC_NyLPC_TcHttpdConnection_SIZE_OF_RX_BUF);\r
        NyLPC_cHttpRequestPrefixParser_initialize(&(i_inst->_pparser));\r
+       i_inst->_parent_httpd=i_parent_httpd;\r
        i_inst->_res_status=NyLPC_cHttpdConnection_ResStatus_CLOSED;\r
        i_inst->_req_status=NyLPC_cHttpdConnection_ReqStatus_LISTEN;\r
 }\r
@@ -19,11 +22,22 @@ void NyLPC_cHttpdConnection_finalize(NyLPC_TcHttpdConnection_t* i_inst)
        NyLPC_cTcpSocket_finalize(&(i_inst->_socket));\r
 }\r
 \r
+const NyLPC_TChar* NyLPC_cHttpdConnection_getUrlPrefix(const NyLPC_TcHttpdConnection_t* i_inst)\r
+{\r
+       return NyLPC_cHttpRequestPrefixParser_getUrlPrefix(&i_inst->_pparser);\r
+}\r
+\r
+#define NyLPC_cHttpHeaderWriter_CONTENT_LENGTH_UNLIMITED 0xFFFFFFFF\r
 /**\r
  * レスポンスヘッダを送信します。\r
  */\r
 NyLPC_TBool NyLPC_cHttpdConnection_sendResponseHeader(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TUInt16 i_response_code,const NyLPC_TChar* i_content_type,const NyLPC_TChar* i_additional_header)\r
 {\r
+       return NyLPC_cHttpdConnection_sendResponseHeader2(i_inst,i_response_code,i_content_type,NyLPC_cHttpHeaderWriter_CONTENT_LENGTH_UNLIMITED,i_additional_header);\r
+}\r
+\r
+NyLPC_TBool NyLPC_cHttpdConnection_sendResponseHeader2(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TUInt16 i_response_code,const NyLPC_TChar* i_content_type,NyLPC_TUInt32 i_content_length,const NyLPC_TChar* i_additional_header)\r
+{\r
        NyLPC_TcHttpHeaderWriter_t* h=&(i_inst->_head_writer);\r
        //状態の確認\r
        if(i_inst->_res_status!=NyLPC_cHttpdConnection_ResStatus_HEAD)\r
@@ -34,8 +48,12 @@ NyLPC_TBool NyLPC_cHttpdConnection_sendResponseHeader(NyLPC_TcHttpdConnection_t*
        if(!NyLPC_cHttpHeaderWriter_initialize(h,&(i_inst->_in_stream),NULL)){\r
                NyLPC_OnErrorGoto(ERROR_SEND);\r
        }\r
-       //Headerへchunkedセット\r
-       NyLPC_cHttpHeaderWriter_setChunked(h);\r
+       //Headerの転送モードセット\r
+       if(i_content_length==NyLPC_cHttpHeaderWriter_CONTENT_LENGTH_UNLIMITED){\r
+               NyLPC_cHttpHeaderWriter_setChunked(h);\r
+       }else{\r
+               NyLPC_cHttpHeaderWriter_setContentLength(h,i_content_length);\r
+       }\r
        //closeがセットされていればclose\r
        if(i_inst->_connection_message_mode==NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE)\r
        {\r
@@ -59,7 +77,11 @@ NyLPC_TBool NyLPC_cHttpdConnection_sendResponseHeader(NyLPC_TcHttpdConnection_t*
        //BodyWriter生成\r
        NyLPC_cHttpBodyWriter_initialize(&(i_inst->_body_writer),&(i_inst->_in_stream));\r
        //bodyのchunkedもセット\r
-       NyLPC_cHttpBodyWriter_setChunked(&(i_inst->_body_writer));\r
+       if(i_content_length==NyLPC_cHttpHeaderWriter_CONTENT_LENGTH_UNLIMITED){\r
+               NyLPC_cHttpBodyWriter_setChunked(&(i_inst->_body_writer));\r
+       }else{\r
+               NyLPC_cHttpBodyWriter_setContentLength(&(i_inst->_body_writer),i_content_length);\r
+       }\r
        return NyLPC_TBool_TRUE;\r
 ERROR_SEND:\r
        NyLPC_cHttpHeaderWriter_finalize(&(i_inst->_head_writer));\r
@@ -73,7 +95,7 @@ Error_Status:
  * レスポンスBodyを送信します。\r
  * 関数を実行後、_res_statusはBODYかERRORに遷移します。\r
  */\r
-NyLPC_TBool NyLPC_cHttpdConnection_sendResponseBody(NyLPC_TcHttpdConnection_t* i_inst,const void* i_data,NyLPC_TUInt16 i_size)\r
+NyLPC_TBool NyLPC_cHttpdConnection_sendResponseBody(NyLPC_TcHttpdConnection_t* i_inst,const void* i_data,NyLPC_TUInt32 i_size)\r
 {\r
        if(i_inst->_res_status!=NyLPC_cHttpdConnection_ResStatus_BODY)\r
        {\r
@@ -171,7 +193,25 @@ void NyLPC_cHttpdConnection_setConnectionMode(NyLPC_TcHttpdConnection_t* i_inst,
        i_inst->_connection_message_mode=i_mode;\r
 }\r
 \r
-\r
+/**\r
+ * コネクションのプリフェッチデータをヘッダパーサへpushします。\r
+ */\r
+NyLPC_TBool NyLPC_cHttpdConnection_pushPrefetchInfo(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpBasicHeaderParser_t* i_header_parser,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       const char* method=NyLPC_cHttpdModUtils_getMethodPrefix(i_inst->_pparser.method);\r
+       if(NyLPC_cHttpBasicHeaderParser_parseChar(i_header_parser,method,strlen(method),o_out)<0){\r
+               NyLPC_OnErrorGoto(Error);\r
+       }\r
+       if(NyLPC_cHttpBasicHeaderParser_parseChar(i_header_parser," ",1,o_out)<0){\r
+               NyLPC_OnErrorGoto(Error);\r
+       }\r
+       if(NyLPC_cHttpBasicHeaderParser_parseChar(i_header_parser,i_inst->_pparser._url,strlen(i_inst->_pparser._url),o_out)<0){\r
+               NyLPC_OnErrorGoto(Error);\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+Error:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
 \r
 #define NyLPC_cHttpdConnection_TIMEOUT_ACCEPT  3000\r
 #define NyLPC_cHttpdConnection_TIMEOUT_CLOSE   5000\r
@@ -298,4 +338,17 @@ void NyLPC_cHttpdConnection_closeSocket(NyLPC_TcHttpdConnection_t* i_inst)
        i_inst->_res_status=NyLPC_cHttpdConnection_ResStatus_CLOSED;\r
 }\r
 \r
-\r
+/**\r
+ * Httpd全体で唯一のロックを取得する。\r
+ */\r
+void NyLPC_cHttpdConnection_lock(NyLPC_TcHttpdConnection_t* i_inst)\r
+{\r
+       NyLPC_cHttpd_lock((NyLPC_TcHttpd_t*)(i_inst->_parent_httpd));\r
+}\r
+/**\r
+ * Httpd全体で唯一のロックを開放する。\r
+ */\r
+void NyLPC_cHttpdConnection_unlock(NyLPC_TcHttpdConnection_t* i_inst)\r
+{\r
+       NyLPC_cHttpd_unlock((NyLPC_TcHttpd_t*)(i_inst->_parent_httpd));\r
+}\r
similarity index 74%
rename from lib/src/api/NyLPC_cHttpdConnection.h
rename to lib/src/net/httpd/NyLPC_cHttpdConnection.h
index e812fb5..02c42fd 100644 (file)
@@ -12,6 +12,7 @@
 #include "NyLPC_cHttpRequestPrefixParser.h"\r
 \r
 \r
+\r
 /** 受信バッファのサイズ*/\r
 #define NyLPC_NyLPC_TcHttpdConnection_SIZE_OF_RX_BUF 512\r
 \r
@@ -40,6 +41,7 @@ typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_Status;
 #define NyLPC_cHttpdConnection_ResStatus_ERROR 4\r
 \r
 \r
+typedef struct NyLPC_TcHttpd NyLPC_TcHttpd_t;\r
 /**\r
  * Httpdのハンドラが引き渡す、HTTPDコネクションクラス。\r
  *\r
@@ -50,6 +52,7 @@ struct NyLPC_TcHttpdConnection
        NyLPC_TUInt8 _req_status;//リクエストステータス\r
        NyLPC_TUInt8 _res_status;//レスポンスステータス\r
        NyLPC_TUInt8 _connection_message_mode;//COnnection:closeをヘッダに書き込むかのフラグ\r
+       NyLPC_TcHttpd_t* _parent_httpd; //NyLPC_cHttpd\r
        NyLPC_TcTcpSocket_t _socket;\r
        NyLPC_TUInt8 _rxbuf[NyLPC_NyLPC_TcHttpdConnection_SIZE_OF_RX_BUF];\r
        NyLPC_TcHttpStream_t _in_stream;\r
@@ -60,22 +63,32 @@ struct NyLPC_TcHttpdConnection
        };\r
 };\r
 \r
-void NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst);\r
+/**\r
+ * @param i_parent_httpd\r
+ *\r
+ */\r
+void NyLPC_cHttpdConnection_initialize(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpd_t* i_parent_httpd);\r
 void NyLPC_cHttpdConnection_finalize(NyLPC_TcHttpdConnection_t* i_inst);\r
 \r
 \r
 \r
 /**\r
  * レスポンスヘッダを送信します。\r
+ * BodyはChunkedエンコーディングで送信します。\r
  */\r
 NyLPC_TBool NyLPC_cHttpdConnection_sendResponseHeader(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TUInt16 i_response_code,const NyLPC_TChar* i_content_type,const NyLPC_TChar* i_additional_header);\r
-\r
-\r
+/**\r
+ * レスポンスヘッダを送信します。\r
+ * BodyはContentLengthを伴って送信します。Body送信時にサイズチェックは行いません。\r
+ * @i_content_length\r
+ * 最大で0x0fffffffを指定できます。\r
+ */\r
+NyLPC_TBool NyLPC_cHttpdConnection_sendResponseHeader2(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TUInt16 i_response_code,const NyLPC_TChar* i_content_type,NyLPC_TUInt32 i_content_length,const NyLPC_TChar* i_additional_header);\r
 /**\r
  * レスポンスBodyを送信します。\r
  * 関数を実行後、_res_statusはBODYかERRORに遷移します。\r
  */\r
-NyLPC_TBool NyLPC_cHttpdConnection_sendResponseBody(NyLPC_TcHttpdConnection_t* i_inst,const void* i_data,NyLPC_TUInt16 i_size);\r
+NyLPC_TBool NyLPC_cHttpdConnection_sendResponseBody(NyLPC_TcHttpdConnection_t* i_inst,const void* i_data,NyLPC_TUInt32 i_size);\r
 \r
 /**\r
  * レスポンスBodyを書式出力して送信します。\r
@@ -90,7 +103,8 @@ NyLPC_TBool NyLPC_cHttpdConnection_sendResponseBodyF(NyLPC_TcHttpdConnection_t*
  */\r
 #define NyLPC_cHttpdConnection_refStream(i_inst) (&(i_inst->_in_stream))\r
 \r
-#define NyLPC_cHttpdConnection_getStatus(i_inst) (&(i_inst->_pparser.method))\r
+#define NyLPC_cHttpdConnection_getMethod(i_inst) (i_inst->_pparser.method)\r
+#define NyLPC_cHttpdConnection_getReqStatus(i_inst) (i_inst->_req_status)\r
 \r
 \r
 #endif /* NYLPC_CHTTPDCONNECTION_H_ */\r
@@ -8,7 +8,7 @@
 #ifndef NYLPC_CHTTPDCONNECTION_PROTECTED_H_\r
 #define NYLPC_CHTTPDCONNECTION_PROTECTED_H_\r
 #include "NyLPC_cHttpdConnection.h"\r
-\r
+#include "NyLPC_stdlib.h"\r
 /**\r
  * コネクションモード\r
  */\r
@@ -23,6 +23,12 @@ typedef NyLPC_TUInt8 NyLPC_TcHttpdConnection_CONNECTION_MODE;
 #define NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE    2\r
 \r
 /**\r
+ * URL Prefixを返却します。\r
+ */\r
+const NyLPC_TChar* NyLPC_cHttpdConnection_getUrlPrefix(const NyLPC_TcHttpdConnection_t* i_inst);\r
+\r
+\r
+/**\r
  * 関数を実行後、_res_statusはCLOSEDかHEADかERRORに遷移する。\r
  * @return\r
  * TRUE/FALSE TCPコネクションを切断するかどうかのフラグ\r
@@ -47,7 +53,17 @@ NyLPC_TBool NyLPC_cHttpdConnection_acceptSocket(NyLPC_TcHttpdConnection_t* i_ins
  */\r
 void NyLPC_cHttpdConnection_closeSocket(NyLPC_TcHttpdConnection_t* i_inst);\r
 \r
+/**\r
+ * ヘッダをprefetchします。\r
+ */\r
 NyLPC_TBool NyLPC_cHttpdConnection_prefetch(NyLPC_TcHttpdConnection_t* i_inst);\r
+\r
+/**\r
+ * コネクションのプリフェッチデータをヘッダパーサへpushします。\r
+ */\r
+NyLPC_TBool NyLPC_cHttpdConnection_pushPrefetchInfo(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpBasicHeaderParser_t* i_header_parser,struct NyLPC_THttpBasicHeader* o_out);\r
+\r
+\r
 /**\r
  * 次のプリフェッチを準備する。\r
  */\r
@@ -66,4 +82,15 @@ void NyLPC_cHttpdConnection_requestParsed(NyLPC_TcHttpdConnection_t* i_inst);
  */\r
 void NyLPC_cHttpdConnection_setConnectionMode(NyLPC_TcHttpdConnection_t* i_inst,NyLPC_TcHttpdConnection_CONNECTION_MODE i_mode);\r
 \r
+\r
+/**\r
+ * Httpd全体で唯一のロックを取得する。\r
+ */\r
+void NyLPC_cHttpdConnection_lock(NyLPC_TcHttpdConnection_t* i_inst);\r
+\r
+/**\r
+ * Httpd全体で唯一のロックを開放する。\r
+ */\r
+void NyLPC_cHttpdConnection_unlock(NyLPC_TcHttpdConnection_t* i_inst);\r
+\r
 #endif /* NYLPC_CHTTPDCONNECTION_H_ */\r
similarity index 58%
rename from lib/src/api/NyLPC_cHttpdThread.c
rename to lib/src/net/httpd/NyLPC_cHttpdThread.c
index 9687050..b7b2bd4 100644 (file)
@@ -8,9 +8,8 @@ static int server(void* p);
 \r
 void NyLPC_cHttpdThread_initialize(NyLPC_TcHttpdThread_t* i_inst,NyLPC_TcHttpd_t* i_parent,NyLPC_TInt32 i_prio)\r
 {\r
-       NyLPC_cHttpdConnection_initialize(&(i_inst->_connection));\r
+       NyLPC_cHttpdConnection_initialize(&(i_inst->_connection),i_parent);\r
        NyLPC_cThread_initialize(&(i_inst->_super),NyLPC_TcHttpdThread_SIZE_OF_THREAD_STACK,i_prio);\r
-       i_inst->_parent=i_parent;\r
 }\r
 void NyLPC_cHttpdThread_finalize(NyLPC_TcHttpdThread_t* i_inst)\r
 {\r
@@ -29,7 +28,7 @@ NyLPC_TBool NyLPC_cHttpdThread_start(NyLPC_TcHttpdThread_t* i_inst,NyLPC_TcTcpLi
                return NyLPC_TBool_FALSE;\r
        }\r
        //Accept可能なので開始。\r
-       NyLPC_cThread_start(&(i_inst->_super),server,i_inst);\r
+       NyLPC_cThread_start(&(i_inst->_super),server,&i_inst->_connection);\r
        return NyLPC_TBool_TRUE;\r
 \r
 }\r
@@ -40,46 +39,46 @@ NyLPC_TBool NyLPC_cHttpdThread_start(NyLPC_TcHttpdThread_t* i_inst,NyLPC_TcTcpLi
 //Httpのセッション関数\r
 static int server(void* p)\r
 {\r
-       NyLPC_TcHttpdThread_t* inst=(NyLPC_TcHttpdThread_t*)p;\r
+       NyLPC_TcHttpdConnection_t* inst=(NyLPC_TcHttpdConnection_t*)p;\r
        //コネクションをAccept\r
-       if(!NyLPC_cHttpdConnection_acceptSocket(&(inst->_connection))){\r
+       if(!NyLPC_cHttpdConnection_acceptSocket(inst)){\r
                NyLPC_OnErrorGoto(Error);\r
        }\r
        //コネクション数の追加\r
-       NyLPC_cHttpd_incNumOfConnection(inst->_parent);\r
+       NyLPC_cHttpd_incNumOfConnection(inst->_parent_httpd);\r
 \r
 \r
        //サブネットアクセスの確認\r
        for(;;){\r
                //リクエストのプレフィクスを取得\r
-               if(!NyLPC_cHttpdConnection_prefetch(&inst->_connection)){\r
+               if(!NyLPC_cHttpdConnection_prefetch(inst)){\r
                        //Prefetch出来ないならループ終了。\r
                        break;\r
                }\r
                //コネクションをクローズにリセット\r
-               NyLPC_cHttpdConnection_setConnectionMode(&(inst->_connection),NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE);\r
+               NyLPC_cHttpdConnection_setConnectionMode(inst,NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE);\r
 \r
                {//handler\r
-                       (inst->_parent->function._handler)(&inst->_connection);\r
+                       (inst->_parent_httpd->function._handler)(inst);\r
                }\r
                //コネクションが増えすぎたら持続性接続を停止するためにCLOSEDにする。\r
-               if(NyLPC_cHttpd_getNumOfConnection((inst->_parent))>LIMIT_OF_PERSISTENT_CONNECTION){\r
-                       NyLPC_cHttpdConnection_setConnectionMode(&(inst->_connection),NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE);\r
+               if(NyLPC_cHttpd_getNumOfConnection(inst->_parent_httpd)>LIMIT_OF_PERSISTENT_CONNECTION){\r
+                       NyLPC_cHttpdConnection_setConnectionMode(inst,NyLPC_TcHttpdConnection_CONNECTION_MODE_CLOSE);\r
                }\r
                //HTTP層のクローズ\r
-               if(!NyLPC_cHttpdConnection_closeResponse(&inst->_connection)){\r
+               if(!NyLPC_cHttpdConnection_closeResponse(inst)){\r
                        break;\r
                }\r
                //次のプリフェッチを準備。\r
-               if(!NyLPC_cHttpdConnection_prevNextPrefetch(&inst->_connection)){\r
+               if(!NyLPC_cHttpdConnection_prevNextPrefetch(inst)){\r
                        break;\r
                }\r
        }\r
-       NyLPC_cHttpd_decNumOfConnection(inst->_parent);\r
-       NyLPC_cHttpdConnection_closeSocket(&(inst->_connection));\r
+       NyLPC_cHttpd_decNumOfConnection(inst->_parent_httpd);\r
+       NyLPC_cHttpdConnection_closeSocket(inst);\r
        return 0;\r
 Error:\r
-       NyLPC_cHttpdConnection_closeSocket(&(inst->_connection));\r
+       NyLPC_cHttpdConnection_closeSocket(inst);\r
        return -1;\r
 }\r
 \r
similarity index 91%
rename from lib/src/api/NyLPC_cHttpdThread.h
rename to lib/src/net/httpd/NyLPC_cHttpdThread.h
index ed23e67..f622c45 100644 (file)
@@ -10,7 +10,7 @@
 \r
 #include "NyLPC_stdlib.h"\r
 #include "NyLPC_uipService.h"\r
-#include "NyLPC_cNetConfig.h"\r
+#include "../NyLPC_cNetConfig.h"\r
 #include "NyLPC_cHttpdConnection.h"\r
 \r
 #ifndef NYLPC_CHTTPD_H_\r
@@ -29,7 +29,6 @@ typedef struct NyLPC_TcHttpdThread NyLPC_TcHttpdThread_t;
 struct NyLPC_TcHttpdThread\r
 {\r
        NyLPC_TcThread_t _super;\r
-       NyLPC_TcHttpd_t* _parent;\r
        /** 関数アドレスを格納したポインタ*/\r
        NyLPC_TcHttpdConnection_t _connection;\r
 };\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cHttpModUtils.c b/lib/src/net/httpd/mod/NyLPC_cHttpModUtils.c
new file mode 100644 (file)
index 0000000..51d37a0
--- /dev/null
@@ -0,0 +1,59 @@
+/*\r
+ * NyLPC_cHttpModUtils_protected.c\r
+ *\r
+ *  Created on: 2013/03/05\r
+ *      Author: nyatla\r
+ */\r
+#include "NyLPC_cHttpmodUtils_protected.h"\r
+#include "../http/NyLPC_cHttpBasicHeaderParser_protected.h"\r
+\r
+\r
+const char* NyLPC_cHttpdModUtils_getMethodPrefix(NyLPC_THttpMethodType i_method)\r
+{\r
+       static const char* method_prefix[3]={"GET","POST","HEAD"};\r
+       switch(i_method)\r
+       {\r
+       case NyLPC_THttpMethodType_GET:\r
+               return method_prefix[0];\r
+       case NyLPC_THttpMethodType_POST:\r
+               return method_prefix[1];\r
+       case NyLPC_THttpMethodType_HEAD:\r
+               return method_prefix[2];\r
+       default:\r
+               NyLPC_Abort();\r
+       }\r
+       return NULL;\r
+}\r
+\r
+NyLPC_TBool NyLPC_cHttpdModUtils_sendFixedContentBatch(NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_content_type,const NyLPC_TChar* i_content,NyLPC_TUInt32 i_size)\r
+{\r
+       //HEAD or GET\r
+       switch(NyLPC_cHttpdConnection_getMethod(i_connection))\r
+       {\r
+       case NyLPC_THttpMethodType_HEAD:\r
+               //HTTP Header\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,200,i_content_type,i_size,NULL);\r
+               break;\r
+       case NyLPC_THttpMethodType_GET:\r
+               //HTTP Header\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,200,i_content_type,i_size,NULL);\r
+               //HTTP Body\r
+               NyLPC_cHttpdConnection_sendResponseBody(i_connection,i_content,i_size);\r
+               break;\r
+       default:\r
+               //ERROR 405\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,405,"text/html",0,NULL);\r
+               return NyLPC_TBool_FALSE;\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+\r
+/**\r
+ * 標準的なJsonヘッダを送信する。\r
+ */\r
+NyLPC_TBool NyLPC_cHttpdModUtils_sendJsonHeader(NyLPC_TcHttpdConnection_t* i_connection)\r
+{\r
+       const static char* additional_header="Access-Control-Allow-Origin:*\r\n";\r
+       const static char* content_type="application/json";\r
+       return NyLPC_cHttpdConnection_sendResponseHeader(i_connection,200,content_type,additional_header);\r
+}\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cHttpModUtils_protected.h b/lib/src/net/httpd/mod/NyLPC_cHttpModUtils_protected.h
new file mode 100644 (file)
index 0000000..c8b2d7f
--- /dev/null
@@ -0,0 +1,29 @@
+/*\r
+ * NyLPC_httpmod_utils_protected.h\r
+ *\r
+ *  Created on: 2013/03/05\r
+ *      Author: nyatla\r
+ */\r
+\r
+#ifndef NYLPC_HTTPMOD_UTILS_PROTECTED_H_\r
+#define NYLPC_HTTPMOD_UTILS_PROTECTED_H_\r
+\r
+#include "NyLPC_stdlib.h"\r
+#include "../http/NyLPC_cHttpBasicHeaderParser.h"\r
+#include "../NyLPC_cHttpdConnection.h"\r
+\r
+/**\r
+ * Method文字列を返します。\r
+ */\r
+const char* NyLPC_cHttpdModUtils_getMethodPrefix(NyLPC_THttpMethodType i_method);\r
+/**\r
+ * 固定長コンテンツを送信する。\r
+ */\r
+NyLPC_TBool NyLPC_cHttpdModUtils_sendFixedContentBatch(NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_content_type,const NyLPC_TChar* i_content,NyLPC_TUInt32 i_size);\r
+/**\r
+ * 標準的なJsonヘッダを送信する。\r
+ */\r
+NyLPC_TBool NyLPC_cHttpdModUtils_sendJsonHeader(NyLPC_TcHttpdConnection_t* i_connection);\r
+\r
+\r
+#endif /* NYLPC_HTTPMOD_UTILS_PROTECTED_H_ */\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.c b/lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.c
new file mode 100644 (file)
index 0000000..404e393
--- /dev/null
@@ -0,0 +1,413 @@
+/*********************************************************************************\r
+ * PROJECT: MiMic\r
+ * --------------------------------------------------------------------------------\r
+ *\r
+ * This file is part of MiMic\r
+ * Copyright (C)2011 Ryo Iizuka\r
+ *\r
+ * MiMic is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published\r
+ * by the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * For further information please contact.\r
+ *     http://nyatla.jp/\r
+ *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ *\r
+ *********************************************************************************/\r
+#include "NyLPC_cModMiMicSetting.h"\r
+#include "NyLPC_stdlib.h"\r
+#include "NyLPC_cHttpmodUtils_protected.h"\r
+#include "../http/NyLPC_cHttpShortRequestHeaderParser.h"\r
+#include "../mimicvm/NyLPC_cMiMicDbCompiler.h"\r
+#include "../flash/NyLPC_cMiMicConfiglation.h"\r
+#include "../NyLPC_cHttpdConnection_protected.h"\r
+\r
+#define MOD_VERSION "ModMiMicSetting/1.0"\r
+#define SIZE_OF_SETUP_PARAM 16\r
+struct TModMiMicSettingRequest\r
+{\r
+       struct NyLPC_THttpBasicHeader super;\r
+       NyLPC_TUInt8 _content_id;\r
+       //解析用\r
+       NyLPC_TUInt8 _qery_name_id;\r
+       NyLPC_TUInt16 _prefix_len;\r
+       NyLPC_TUInt8 _astate;\r
+       NyLPC_TcStr_t _tstr;\r
+       NyLPC_TChar _tstr_buf[16];\r
+       /** 文字列のパーサ*/\r
+       NyLPC_TcMiMicDbCompiler_t _binparser;\r
+       union{\r
+               struct{\r
+                       /**pパラメータ。最大長さは16。長さ6であること。\r
+                        * [0]:MACAddrの、[0][1][2][3]\r
+                        * [1]:MACAddrの、[4][5][X][X]\r
+                        * [2]:IPAddr(Networkorder)\r
+                        * [3]:Subnetmask(Networkorder)\r
+                        * [4]:Defaultgateway\r
+                        * [5]:[port(Networkorder16bit)][X][X]\r
+                        */\r
+                       NyLPC_TUInt32 param_buf[SIZE_OF_SETUP_PARAM];\r
+                       NyLPC_TUInt16 param_len;\r
+                       NyLPC_TUInt32 cval;//コマンド値\r
+               }setup;\r
+               struct{\r
+                       /**\r
+                        * 不明な名前の場合は、ここに名前をコピー\r
+                        */\r
+                       NyLPC_TChar path[32];\r
+               }unknown;\r
+       }content;\r
+};\r
+\r
+\r
+static NyLPC_TBool messageHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,const NyLPC_TChar* i_name,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       (void)i_inst;\r
+       (void)i_name;\r
+       (void)i_c;\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+\r
+#define ST_PARSE_PATH 1\r
+#define ST_PARSE_QUERY_NAME 2\r
+#define ST_PARSE_QUERY_VALUE 3         //Query読み出し中\r
+#define ST_PARSE_QUERY_VALUE_P 4\r
+#define ST_PARSE_QUERY_VALUE_C 5\r
+/**\r
+ * コンテンツID定義(コンテンツ名に対応)\r
+ */\r
+#define CONTENT_ID_UNKNOWN 1\r
+#define CONTENT_ID_SETUP   2\r
+#define CONTENT_ID_INDEX   3\r
+#define CONTENT_ID_STATUS  4\r
+#define CONTENT_ID_CSS     5\r
+#define CONTENT_ID_LOGO    6\r
+\r
+#define QNAME_ID_P     4\r
+#define QNAME_ID_C     5\r
+#define QNAME_ID_UNKNOWN 0\r
+\r
+#define QVAL_C_GET 1\r
+#define QVAL_C_UPDATE 2\r
+#define QVAL_C_UNKNOWN 0\r
+\r
+\r
+const struct NyLPC_TTextIdTbl url_tbl[]=\r
+{\r
+       {"setup.api",CONTENT_ID_SETUP},\r
+       {NULL,CONTENT_ID_UNKNOWN}\r
+};\r
+\r
+const struct NyLPC_TTextIdTbl qname_id_table[]=\r
+{\r
+       {"p",QNAME_ID_P},\r
+       {"c",QNAME_ID_C},\r
+       {NULL,QNAME_ID_UNKNOWN}\r
+};\r
+\r
+\r
+\r
+\r
+static NyLPC_TBool urlHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+\r
+       struct TModMiMicSettingRequest* out=(struct TModMiMicSettingRequest*)o_out;\r
+       //読み飛ばし\r
+       if(out->_prefix_len<0){\r
+               out->_prefix_len++;\r
+               return NyLPC_TBool_TRUE;//読み飛ばし\r
+       }\r
+       if(out->_astate==ST_PARSE_PATH){\r
+               switch(i_c){\r
+               case '\0':\r
+               case '?':\r
+                       out->_content_id=NyLPC_TTextIdTbl_getMatchId(NyLPC_cStr_str(&(out->_tstr)),url_tbl);\r
+                       switch(out->_content_id)\r
+                       {\r
+                       case CONTENT_ID_SETUP:\r
+                               out->content.setup.param_len=0;\r
+                               out->content.setup.cval=QVAL_C_UNKNOWN;\r
+                               break;\r
+                       default:\r
+                               break;\r
+                       }\r
+                       NyLPC_cStr_clear(&(out->_tstr));\r
+                       out->_astate=ST_PARSE_QUERY_NAME;//クエリ名解析へ\r
+                       return NyLPC_TBool_TRUE;\r
+               default:\r
+                       break;\r
+               }\r
+               return NyLPC_TBool_TRUE;\r
+       }\r
+       switch(out->_content_id)\r
+       {\r
+       case CONTENT_ID_SETUP:\r
+               switch(out->_astate){\r
+               case ST_PARSE_QUERY_NAME:\r
+                       if(i_c!='\0' && i_c!='&' && i_c!='='){\r
+                               if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //Query確定。\r
+                       out->_qery_name_id=NyLPC_TTextIdTbl_getMatchId(NyLPC_cStr_str(&(out->_tstr)),qname_id_table);\r
+                       NyLPC_cStr_clear(&(out->_tstr));\r
+                       //クエリ値がある場合\r
+                       switch(out->_qery_name_id){\r
+                       case QNAME_ID_P:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE_P;//MIMICBCのDBパラメータパーサを借用。\r
+                               out->content.setup.param_len=0;\r
+                               break;\r
+                       case QNAME_ID_C:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE_C;\r
+                               break;\r
+                       default:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE;\r
+                               break;\r
+                       }\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE:\r
+                       //未知のクエリは無視\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //クエリ値解析完了\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE_C:\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       if(NyLPC_cStr_isEqual(&out->_tstr,"get")){\r
+                               out->content.setup.cval=QVAL_C_GET;\r
+                       }else if(NyLPC_cStr_isEqual(&out->_tstr,"update")){\r
+                               out->content.setup.cval=QVAL_C_UPDATE;\r
+                       }else{\r
+                               NyLPC_OnErrorGoto(ERROR);\r
+                       }\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE_P:\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               switch(NyLPC_cMiMicDbCompiler_compileFragment2(&(out->_binparser),i_c,out->content.setup.param_buf+out->content.setup.param_len))\r
+                               {\r
+                               case NyLPC_TcMiMicDbCompiler_RET_CONTINUE:\r
+                                       break;\r
+                               case NyLPC_TcMiMicDbCompiler_RET_OK:\r
+                                       out->content.setup.param_len++;\r
+                                       if(out->content.setup.param_len>=SIZE_OF_SETUP_PARAM)\r
+                                       {\r
+                                               NyLPC_OnErrorGoto(ERROR);\r
+                                       }\r
+                                       break;\r
+                               case NyLPC_TcMiMicDbCompiler_RET_ERROR:\r
+                               default:\r
+                                       //ERROR\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //区切りのいいところで終わってる?\r
+                       if(NyLPC_cMiMicDbCompiler_hasFragment(&(out->_binparser))){\r
+                               //ERROR\r
+                               NyLPC_OnErrorGoto(ERROR);\r
+                       }\r
+                       //終端しているなら、次のクエリへ\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               default:\r
+                       break;\r
+               }\r
+               NyLPC_OnErrorGoto(ERROR);\r
+       default:\r
+               NyLPC_OnErrorGoto(ERROR);\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+ERROR:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
+/**\r
+ * デフォルトハンドラ\r
+ */\r
+static const struct NyLPC_TcHttpBasicHeaderParser_Handler handler=\r
+{\r
+       messageHandler,\r
+       urlHandler\r
+};\r
+\r
+\r
+/**\r
+ * コンストラクタ。\r
+ */\r
+void NyLPC_cModMiMicSetting_initialize(NyLPC_TcModMiMicSetting_t* i_inst,const NyLPC_TChar* i_ref_root_path)\r
+{\r
+       NyLPC_cModRomFiles_initialize(&i_inst->super,i_ref_root_path,NULL,0);\r
+}\r
+void NyLPC_cModMiMicSetting_finalize(NyLPC_TcModMiMicSetting_t* i_inst)\r
+{\r
+       NyLPC_cModRomFiles_finalize(&i_inst->super);\r
+}\r
+/**\r
+ * モジュールがコネクションをハンドリングできるかを返します。\r
+ */\r
+NyLPC_TBool NyLPC_cModMiMicSetting_canHandle(NyLPC_TcModMiMicSetting_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection)\r
+{\r
+       return NyLPC_cModRomFiles_canHandle(&i_inst->super,i_connection);\r
+}\r
+\r
+\r
+\r
+static void setup_proc(NyLPC_TcHttpdConnection_t* i_connection,struct TModMiMicSettingRequest* i_req);\r
+\r
+/**\r
+ * モジュールを実行します。\r
+ */\r
+NyLPC_TBool NyLPC_cModMiMicSetting_execute(NyLPC_TcModMiMicSetting_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path)\r
+{\r
+       struct TModMiMicSettingRequest header;\r
+       NyLPC_TcHttpBasicHeaderParser_t parser;\r
+       //connectonの状態を確認\r
+       if(!NyLPC_cHttpdConnection_getReqStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
+       {\r
+               NyLPC_OnErrorGoto(Error1);\r
+       }\r
+       //URL解析の準備\r
+       header._prefix_len=-(NyLPC_TInt16)strlen(i_inst->super._ref_root_path);\r
+       header._astate=ST_PARSE_PATH;\r
+       NyLPC_cStr_initialize(&header._tstr,header._tstr_buf,16);\r
+       NyLPC_cMiMicDbCompiler_initialize(&header._binparser);\r
+\r
+       NyLPC_cHttpBasicHeaderParser_initialize(&parser,&handler);\r
+       //プリフェッチしたデータを流す\r
+       NyLPC_cHttpBasicHeaderParser_parseInit(&parser,&(header.super));\r
+       NyLPC_cHttpdConnection_pushPrefetchInfo(i_connection,&parser,&header.super);\r
+       //後続をストリームから取り込む\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseStream(&parser,NyLPC_cHttpdConnection_refStream(i_connection),&(header.super))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseFinish(&parser,&(header.super))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       //GETのみ\r
+       if(NyLPC_cHttpdConnection_getMethod(i_connection)!=NyLPC_THttpMethodType_GET)\r
+       {\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,405,"text/html",0,NULL);\r
+               NyLPC_OnErrorGoto(Error1);\r
+       }\r
+       //Connection Modeの設定 1.1 && !closeの場合はCONTINUE\r
+       if(header.super.connection!=NyLPC_THttpMessgeHeader_Connection_CLOSE && header.super.startline.req.version==NyLPC_THttpVersion_11)\r
+       {\r
+               NyLPC_cHttpdConnection_setConnectionMode(i_connection,NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE);\r
+       }\r
+       //CGIの実行\r
+       switch(header._content_id)\r
+       {\r
+       case CONTENT_ID_SETUP:\r
+               setup_proc(i_connection,&header);\r
+               break;\r
+       case CONTENT_ID_UNKNOWN:\r
+       default:\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
+       NyLPC_cMiMicDbCompiler_finalize(&header._binparser);\r
+       NyLPC_cStr_finalize(&(header._tstr));\r
+       return NyLPC_TBool_TRUE;\r
+Error2:\r
+       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,500,"text/html",0,NULL);\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
+       NyLPC_cMiMicDbCompiler_finalize(&header._binparser);\r
+       NyLPC_cStr_finalize(&(header._tstr));\r
+Error1:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
+\r
+\r
+static void setup_proc(NyLPC_TcHttpdConnection_t* i_connection,struct TModMiMicSettingRequest* i_req)\r
+{\r
+       NyLPC_TBool ret;\r
+       const struct NyLPC_TMimicConfigulation* config;\r
+       struct NyLPC_TMimicConfigulation cfg_image;\r
+\r
+       switch(i_req->content.setup.cval){\r
+       case QVAL_C_GET:\r
+               if(!NyLPC_cHttpdModUtils_sendJsonHeader(i_connection)){\r
+                       NyLPC_OnErrorGoto(Error);\r
+               }\r
+               config=NyLPC_cMiMicConfiglation_loadMiMicConfigulation();\r
+               //JSONを書く。\r
+               if(!NyLPC_cHttpdConnection_sendResponseBodyF(i_connection,\r
+                       "{\"application\":\""MOD_VERSION";%s\",\"mac00010203\":%u,\"mac0405xxxx\":%u,\"ip\":%u,\"mask\":%u,\"droute\":%u,\"port\":%u,\"access\":%u}",\r
+                       NyLPC_cMiMicEnv_PlatformName,\r
+                       config->mac_00_01_02_03,\r
+                       config->mac_04_05_xx_xx,\r
+                       config->ipv4_addr_net,\r
+                       config->ipv4_mask_net,\r
+                       config->ipv4_drut_net,\r
+                       config->ipv4_port,\r
+                       config->accessmode\r
+                       )){\r
+                       NyLPC_OnErrorGoto(Error);\r
+               }\r
+               break;\r
+       case QVAL_C_UPDATE:\r
+               //check parameter length\r
+               if(i_req->content.setup.param_len!=SIZE_OF_SETUP_PARAM)\r
+               {\r
+                       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,500,"text/html",0,NULL);\r
+               }else{\r
+                       //パラメータ→ROMイメージ変換\r
+                       cfg_image.fast_boot=0xffffffff;\r
+                       cfg_image.mac_00_01_02_03=(i_req->content.setup.param_buf[0]);\r
+                       cfg_image.mac_04_05_xx_xx=(i_req->content.setup.param_buf[1]&0xffff0000);\r
+                       cfg_image.ipv4_addr_net  =i_req->content.setup.param_buf[2];\r
+                       cfg_image.ipv4_mask_net  =i_req->content.setup.param_buf[3];\r
+                       cfg_image.ipv4_drut_net  =i_req->content.setup.param_buf[4];\r
+                       cfg_image.ipv4_port =(NyLPC_TUInt16)(i_req->content.setup.param_buf[5]>>16);\r
+                       cfg_image.accessmode=(i_req->content.setup.param_buf[6]);\r
+                       //一応確認。\r
+                       if((cfg_image.ipv4_port==0)|| (cfg_image.accessmode & 0xFEFE0000)!=0x00000000){\r
+                               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,500,"text/html",0,NULL);\r
+                       }else{\r
+                               //FreeRTOSの停止\r
+                               NyLPC_cIsr_enterCritical();\r
+                               //Flashへの書き込み\r
+                               ret=NyLPC_cMiMicConfiglation_updateConfigulation(&cfg_image);\r
+                               //FreeRTOSの復帰\r
+                               NyLPC_cIsr_exitCritical();\r
+                               if(!ret){\r
+                                       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,500,"text/html",0,NULL);\r
+                               }else{\r
+                                       if(!NyLPC_cHttpdModUtils_sendJsonHeader(i_connection)){\r
+                                               NyLPC_OnErrorGoto(Error);\r
+                                       }\r
+                                       NyLPC_cHttpdConnection_sendResponseBodyF(i_connection,\r
+                                               "{\"application\":\""MOD_VERSION";%s\",\"result\":%u}",\r
+                                               NyLPC_cMiMicEnv_PlatformName,ret?0x80000000:0x00000000);\r
+                               }\r
+                       }\r
+               }\r
+               //JSONを書く。\r
+               break;\r
+       default:\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,403,"text/html",0,NULL);\r
+               NyLPC_OnErrorGoto(Error);\r
+               break;\r
+       }\r
+       return;\r
+Error:\r
+       return;\r
+}\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.h b/lib/src/net/httpd/mod/NyLPC_cModMiMicSetting.h
new file mode 100644 (file)
index 0000000..a3fc514
--- /dev/null
@@ -0,0 +1,92 @@
+/*********************************************************************************\r
+ * PROJECT: MiMic\r
+ * --------------------------------------------------------------------------------\r
+ *\r
+ * This file is part of MiMic\r
+ * Copyright (C)2011 Ryo Iizuka\r
+ *\r
+ * MiMic is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published\r
+ * by the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * For further information please contact.\r
+ *     http://nyatla.jp/\r
+ *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ *\r
+ *********************************************************************************/\r
+#ifndef NYLPC_CMODSHORTURL_H_\r
+#define NYLPC_CMODSHORTURL_H_\r
+#include "../http/NyLPC_cHttpBasicHeaderParser.h"\r
+#include "../NyLPC_cHttpdConnection.h"\r
+#include "NyLPC_cModRomFiles.h"\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+/**\r
+ * MiMicの動作設定CGIです。\r
+ * 以下のAPIを提供します。\r
+ * ./setup.api?c=[update|get]&p=[:param:]\r
+ * JSONインタフェイスです。MiMicの動作設定と取得を行います。\r
+ * c=get 現在の状態をjson形式で返却する。\r
+ * {\r
+ *             application: [:string:],\r
+ *             mac00010203: [:HEX32:],\r
+ *             mac0405xxxx: [:HEX32:],\r
+ *             ip: [:HEX32:],\r
+ *             mask: [:HEX32:],\r
+ *             droute: [:HEX32:]\r
+ *             port: [:HEX16:]\r
+ *             access\":%u}",\r
+ * c=update pパラメタの内容でFlashをアップデートする。\r
+ *             [:param:]=[:emac:][:hostaddr:][:subnetmask:][:defaultroot:][:port:]\r
+ *             ROMパラメータ。固定長のHEX文字列である。\r
+ *             [:emac:]=[[:HEX32:]{2}}\r
+ *             ビックエンディアン48bit値+パディング16bit\r
+ *             [:hostaddr:]=[:HEX32:]\r
+ *             IPアドレス。32bit値。ビックエンディアン\r
+ *             [:subnetmask:]=[:HEX32:]\r
+ *             サブネットマスク。32bit値。ビックエンディアン\r
+ *             [:defaultroot:]=[:HEX32:]\r
+ *             defaultrootアドレス。32bit値。ビックエンディアン\r
+ *             [:port:]=[:HEX32:]\r
+ *             ポート番号。2桁のHEX値である。ビックエンディアン。値16bit、パディング16bit\r
+ */\r
+typedef struct NyLPC_TcModMiMicSetting NyLPC_TcModMiMicSetting_t;\r
+\r
+\r
+struct NyLPC_TcModMiMicSetting\r
+{\r
+       NyLPC_TcModRomFiles_t super;\r
+};\r
+\r
+/**\r
+ * コンストラクタ。\r
+ */\r
+void NyLPC_cModMiMicSetting_initialize(NyLPC_TcModMiMicSetting_t* i_inst,const NyLPC_TChar* i_ref_root_path);\r
+void NyLPC_cModMiMicSetting_finalize(NyLPC_TcModMiMicSetting_t* i_inst);\r
+\r
+/**\r
+ * モジュールがコネクションをハンドリングできるかを返します。\r
+ */\r
+NyLPC_TBool NyLPC_cModMiMicSetting_canHandle(NyLPC_TcModMiMicSetting_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
+/**\r
+ * モジュールを実行します。\r
+ */\r
+NyLPC_TBool NyLPC_cModMiMicSetting_execute(NyLPC_TcModMiMicSetting_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path);\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif /* NYLPC_CHTTPSHORTHTTPHEADERPARSER_H_ */\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.c b/lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.c
new file mode 100644 (file)
index 0000000..3cc5515
--- /dev/null
@@ -0,0 +1,524 @@
+/*********************************************************************************\r
+ * PROJECT: MiMic\r
+ * --------------------------------------------------------------------------------\r
+ *\r
+ * This file is part of MiMic\r
+ * Copyright (C)2011 Ryo Iizuka\r
+ *\r
+ * MiMic is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published\r
+ * by the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * For further information please contact.\r
+ *     http://nyatla.jp/\r
+ *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ *\r
+ *********************************************************************************/\r
+#include "NyLPC_cModRemoteMcu.h"\r
+#include "NyLPC_stdlib.h"\r
+#include "../http/NyLPC_cHttpShortRequestHeaderParser.h"\r
+#include "../NyLPC_cHttpdConnection_protected.h"\r
+#include "../../../mimicvm/NyLPC_cMiMicDbCompiler.h"\r
+#include "../../../mimicvm/NyLPC_cMiMicTxtCompiler.h"\r
+#include "NyLPC_cHttpmodUtils_protected.h"\r
+#include "../../../mimicvm/NyLPC_cMiMicVM_protected.h"\r
+\r
+\r
+#define MVM_VERSION "MiMicVM/1.0;Json/1.0"\r
+#define SIZE_OF_IBUF 256\r
+struct TModMiMicRemoteMcuHeader\r
+{\r
+       struct NyLPC_THttpBasicHeader super;\r
+       NyLPC_TUInt8 _content_id;\r
+       //解析用\r
+       NyLPC_TUInt8 _qery_name_id;\r
+       NyLPC_TUInt16 _prefix_len;\r
+       NyLPC_TUInt8 _astate;\r
+       NyLPC_TcStr_t _tstr;\r
+       NyLPC_TChar _tstr_buf[16];\r
+       struct NyLPC_TUInt32ArrayPtr _binarray;\r
+       /** 文字列のパーサ*/\r
+       NyLPC_TcMiMicDbCompiler_t _binparser;\r
+       NyLPC_TcMiMicTxtCompiler_t _txtcmp;\r
+       union{\r
+               struct{\r
+                       NyLPC_TUInt8 v;//バージョン\r
+                       NyLPC_TUInt8 o;//outputスタイル\r
+                       /**\r
+                        * il_bufはbcとdbの2パートのデータを格納します。\r
+                        * 先頭からbc_lenの長さのBCパートと、db_partからdb_lenの長さのデータです。\r
+                        */\r
+                       struct{\r
+                               /** MiMicVMインストラクションの蓄積用。前半にTXT,後半にDBを格納する。 */\r
+                               NyLPC_TUInt32 bc_buf[SIZE_OF_IBUF];\r
+                               /** MiMicVM入力ストリーム(MimicDB)の開始位置(bufの一部を指す) */\r
+                               const NyLPC_TUInt32* db_part;\r
+                               /** MiMicTXTのワード長(1ワード32bit)*/\r
+                               NyLPC_TUInt16 txt_len;\r
+                               /** MiMicDBのワード長(1ワード32bit)*/\r
+                               NyLPC_TUInt16 db_len;\r
+                       }vm_instruction;\r
+               }mvm;\r
+               struct{\r
+                       /**\r
+                        * 不明な名前の場合は、ここに名前をコピー\r
+                        */\r
+                       NyLPC_TChar path[32];\r
+               }unknown;\r
+       }content;\r
+};\r
+\r
+\r
+static void mvm(NyLPC_TcHttpdConnection_t* i_connection,const struct TModMiMicRemoteMcuHeader* i_rqh);\r
+\r
+\r
+static NyLPC_TBool messageHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,const NyLPC_TChar* i_name,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       (void)i_inst;\r
+       (void)i_name;\r
+       (void)i_c;\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+\r
+#define ST_PARSE_PATH 1\r
+#define ST_PARSE_QUERY_NAME 2\r
+#define ST_PARSE_QUERY_VALUE 3         //Query読み出し中\r
+#define ST_PARSE_QUERY_VALUE_V 4\r
+#define ST_PARSE_QUERY_VALUE_O 5\r
+#define ST_PARSE_QUERY_VALUE_BC 6\r
+#define ST_PARSE_QUERY_VALUE_DB 7\r
+/**\r
+ * コンテンツID定義(コンテンツ名に対応)\r
+ */\r
+#define CONTENT_ID_MVM   2\r
+#define CONTENT_ID_STATUS  3\r
+#define CONTENT_ID_UNKNOWN 0\r
+\r
+\r
+#define QNAME_ID_V     1\r
+#define QNAME_ID_O     2\r
+#define QNAME_ID_BC    3\r
+#define QNAME_ID_UNKNOWN 0\r
+\r
+/**\r
+ * TRemoteMcuRequest.content.mvm.oの値\r
+ */\r
+#define QVAL_O_UNKNOWN 0       //default\r
+#define QVAL_O_XML     1\r
+#define QVAL_O_JSON    2\r
+\r
+#define QVAL_V_UNKNOWN 0\r
+#define QVAL_V_1               1\r
+\r
+\r
+const struct NyLPC_TTextIdTbl url_tbl[]=\r
+{\r
+       {"mvm.api",CONTENT_ID_MVM},\r
+       {"status.api",CONTENT_ID_STATUS},\r
+       {NULL,CONTENT_ID_UNKNOWN}\r
+};\r
+\r
+const struct NyLPC_TTextIdTbl qname_id_table[]=\r
+{\r
+       {"o",QNAME_ID_O},\r
+       {"bc",QNAME_ID_BC},\r
+       {"v",QNAME_ID_V},\r
+       {NULL,QNAME_ID_UNKNOWN}\r
+};\r
+\r
+\r
+\r
+static NyLPC_TBool urlHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       NyLPC_TUInt16 ol;\r
+       struct TModMiMicRemoteMcuHeader* out=(struct TModMiMicRemoteMcuHeader*)o_out;\r
+       //読み飛ばし\r
+       if(out->_prefix_len<0){\r
+               out->_prefix_len++;\r
+               return NyLPC_TBool_TRUE;//読み飛ばし\r
+       }\r
+       if(out->_astate==ST_PARSE_PATH){\r
+               switch(i_c){\r
+               case '\0':\r
+               case '?':\r
+                       out->_content_id=NyLPC_TTextIdTbl_getMatchId(NyLPC_cStr_str(&(out->_tstr)),url_tbl);\r
+                       switch(out->_content_id)\r
+                       {\r
+                       case CONTENT_ID_MVM:\r
+                               out->content.mvm.vm_instruction.txt_len=0;\r
+                               out->content.mvm.vm_instruction.db_len=0;\r
+                               out->content.mvm.vm_instruction.db_part=NULL;\r
+                               NyLPC_TUInt32ArrayPtr_setBuf(&out->_binarray,out->content.mvm.vm_instruction.bc_buf,SIZE_OF_IBUF);\r
+                               out->content.mvm.o=QVAL_O_UNKNOWN;\r
+                               out->content.mvm.v=QVAL_V_UNKNOWN;\r
+                               break;\r
+                       default:\r
+                               break;\r
+                       }\r
+\r
+                       NyLPC_cStr_clear(&(out->_tstr));\r
+                       out->_astate=ST_PARSE_QUERY_NAME;//クエリ名解析へ\r
+                       return NyLPC_TBool_TRUE;\r
+               default:\r
+                       break;\r
+               }\r
+               return NyLPC_TBool_TRUE;\r
+       }\r
+       switch(out->_content_id)\r
+       {\r
+       case CONTENT_ID_MVM:\r
+               switch(out->_astate){\r
+               case ST_PARSE_QUERY_NAME:\r
+                       if(i_c!='\0' && i_c!='&' && i_c!='='){\r
+                               if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //Query確定。\r
+                       out->_qery_name_id=NyLPC_TTextIdTbl_getMatchId(NyLPC_cStr_str(&(out->_tstr)),qname_id_table);\r
+                       NyLPC_cStr_clear(&(out->_tstr));\r
+                       //クエリ値がある場合\r
+                       switch(out->_qery_name_id){\r
+                       case QNAME_ID_O:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE_O;//MIMICBCのDBパラメータパーサを借用。\r
+                               break;\r
+                       case QNAME_ID_V:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE_V;\r
+                               break;\r
+                       case QNAME_ID_BC:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE_BC;\r
+                               break;\r
+                       default:\r
+                               out->_astate=ST_PARSE_QUERY_VALUE;\r
+                               break;\r
+                       }\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE:\r
+                       //未知のクエリは無視\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //クエリ値解析完了\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE_O:\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       if(NyLPC_cStr_isEqual(&(out->_tstr),"j")){\r
+                               out->content.mvm.o=QVAL_O_JSON;\r
+                       }else if(NyLPC_cStr_isEqual(&(out->_tstr),"x")){\r
+                               out->content.mvm.o=QVAL_O_XML;\r
+                       }\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE_V:\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               if(!NyLPC_cStr_put(&(out->_tstr),i_c)){\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       if(NyLPC_cStr_isEqual(&(out->_tstr),"1")){\r
+                               out->content.mvm.v=QVAL_V_1;\r
+                       }\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               case ST_PARSE_QUERY_VALUE_BC:\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               //コンパイル\r
+                               switch(NyLPC_cMiMicTxtCompiler_compileFragment2(&(out->_txtcmp),i_c,&(out->_binarray),&ol))\r
+                               {\r
+                               case NyLPC_TcMiMicTxtCompiler_RET_OK:\r
+                                       //命令確定。\r
+                                       break;\r
+                               case NyLPC_TcMiMicTxtCompiler_RET_OK_END:\r
+                                       //命令終端検出->モード切替\r
+                                       out->content.mvm.vm_instruction.txt_len=SIZE_OF_IBUF-out->_binarray.len+ol;\r
+                                       out->content.mvm.vm_instruction.db_part=out->content.mvm.vm_instruction.bc_buf+out->content.mvm.vm_instruction.txt_len;\r
+                                       out->_astate=ST_PARSE_QUERY_VALUE_DB;\r
+                                       break;\r
+                               case NyLPC_TcMiMicTxtCompiler_RET_CONTINUE:\r
+                                       //何もしない\r
+                                       break;\r
+                               case NyLPC_TcMiMicTxtCompiler_RET_NG:\r
+                               default:\r
+                                       //ERROR\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //フラグメント終端が検出できない終了はエラー\r
+                       NyLPC_OnErrorGoto(ERROR);\r
+               case ST_PARSE_QUERY_VALUE_DB:\r
+                       if(i_c!='\0' || i_c!='&'){\r
+                               switch(NyLPC_cMiMicDbCompiler_compileFragment2(&(out->_binparser),i_c,out->_binarray.ptr))\r
+                               {\r
+                               case NyLPC_TcMiMicDbCompiler_RET_CONTINUE:\r
+                                       break;\r
+                               case NyLPC_TcMiMicDbCompiler_RET_OK:\r
+                                       //\r
+                                       if(!NyLPC_TUInt32ArrayPtr_seek(&(out->_binarray),1)){\r
+                                               //ERROR\r
+                                               NyLPC_OnErrorGoto(ERROR);\r
+                                       }\r
+                                       break;\r
+                               case NyLPC_TcMiMicDbCompiler_RET_ERROR:\r
+                               default:\r
+                                       //ERROR\r
+                                       NyLPC_OnErrorGoto(ERROR);\r
+                               }\r
+                               return NyLPC_TBool_TRUE;\r
+                       }\r
+                       //区切りのいいところで終わってる?\r
+                       if(NyLPC_cMiMicDbCompiler_hasFragment(&(out->_binparser))){\r
+                               //ERROR\r
+                               NyLPC_OnErrorGoto(ERROR);\r
+                       }\r
+                       //終端しているなら、次のクエリへ\r
+                       out->_astate=ST_PARSE_QUERY_NAME;\r
+                       return NyLPC_TBool_TRUE;\r
+               default:\r
+                       break;\r
+               }\r
+               NyLPC_OnErrorGoto(ERROR);\r
+       default:\r
+               NyLPC_OnErrorGoto(ERROR);\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+ERROR:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
+/**\r
+ * デフォルトハンドラ\r
+ */\r
+static const struct NyLPC_TcHttpBasicHeaderParser_Handler handler=\r
+{\r
+       messageHandler,\r
+       urlHandler\r
+};\r
+\r
+\r
+/**\r
+ * コンストラクタ。\r
+ */\r
+void NyLPC_cModMiMicSetting_initialize(NyLPC_TcModRemoteMcu_t* i_inst,const NyLPC_TChar* i_ref_root_path)\r
+{\r
+       NyLPC_cModRomFiles_initialize(&i_inst->super,i_ref_root_path,NULL,0);\r
+}\r
+void NyLPC_cModMiMicSetting_finalize(NyLPC_TcModRemoteMcu_t* i_inst)\r
+{\r
+       NyLPC_cModRomFiles_finalize(&i_inst->super);\r
+}\r
+/**\r
+ * モジュールがコネクションをハンドリングできるかを返します。\r
+ */\r
+NyLPC_TBool NyLPC_cModMiMicSetting_canHandle(NyLPC_TcModRemoteMcu_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection)\r
+{\r
+       return NyLPC_cModRomFiles_canHandle(&i_inst->super,i_connection);\r
+}\r
+\r
+/**\r
+ * モジュールを実行します。\r
+ */\r
+NyLPC_TBool NyLPC_cModMiMicSetting_execute(NyLPC_TcModRemoteMcu_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path)\r
+{\r
+       struct TModMiMicRemoteMcuHeader header;\r
+       NyLPC_TcHttpBasicHeaderParser_t parser;\r
+       //connectonの状態を確認\r
+       if(!NyLPC_cHttpdConnection_getReqStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
+       {\r
+               NyLPC_OnErrorGoto(Error1);\r
+       }\r
+//リソース占有\r
+       //VM起動の為の排他ロック\r
+       NyLPC_cHttpdConnection_lock(i_connection);\r
+\r
+\r
+       //URL解析の準備\r
+       header._prefix_len=-(NyLPC_TInt16)strlen(i_inst->super._ref_root_path);\r
+       header._astate=ST_PARSE_PATH;\r
+       NyLPC_cStr_initialize(&header._tstr,header._tstr_buf,16);\r
+       NyLPC_cMiMicDbCompiler_initialize(&header._binparser);\r
+       NyLPC_cMiMicTxtCompiler_initialize(&header._txtcmp);\r
+\r
+       NyLPC_cHttpBasicHeaderParser_initialize(&parser,&handler);\r
+\r
+       //プリフェッチしたデータを流す\r
+       NyLPC_cHttpBasicHeaderParser_parseInit(&parser,&(header.super));\r
+       NyLPC_cHttpdConnection_pushPrefetchInfo(i_connection,&parser,&header.super);\r
+       //後続をストリームから取り込む\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseStream(&parser,NyLPC_cHttpdConnection_refStream(i_connection),&(header.super))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseFinish(&parser,&(header.super))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       //Connection Modeの設定 1.1 && !closeの場合はCONTINUE\r
+       if(header.super.connection!=NyLPC_THttpMessgeHeader_Connection_CLOSE && header.super.startline.req.version==NyLPC_THttpVersion_11)\r
+       {\r
+               NyLPC_cHttpdConnection_setConnectionMode(i_connection,NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE);\r
+       }\r
+       //CGIの実行\r
+       switch(header._content_id)\r
+       {\r
+       case CONTENT_ID_MVM:\r
+               mvm(i_connection,&header);\r
+               break;\r
+       default:\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       NyLPC_cStr_finalize(&header._tstr);\r
+       NyLPC_cMiMicDbCompiler_finalize(&header._binparser);\r
+       NyLPC_cMiMicTxtCompiler_finalize(&header._txtcmp);\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
+//占有解除\r
+       NyLPC_cHttpdConnection_unlock(i_connection);\r
+       return NyLPC_TBool_TRUE;\r
+Error2:\r
+       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,500,"text/html",0,NULL);\r
+       NyLPC_cStr_finalize(&header._tstr);\r
+       NyLPC_cMiMicDbCompiler_finalize(&header._binparser);\r
+       NyLPC_cMiMicTxtCompiler_finalize(&header._txtcmp);\r
+       NyLPC_cHttpBasicHeaderParser_finalize(&parser);\r
+       //VM排他ロックの解除\r
+       NyLPC_cHttpdConnection_unlock(i_connection);\r
+Error1:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
+\r
+\r
+/**\r
+ * イベントハンドラを継承\r
+ */\r
+struct TVmEventHandler\r
+{\r
+       struct NyLPC_TcMiMicVM_TEvent super;\r
+       const struct TModMiMicRemoteMcuHeader* req;\r
+       NyLPC_TcHttpdConnection_t* connection;\r
+       NyLPC_TUInt16 db_pos;\r
+       /** ストリームへ出力したデータの数*/\r
+       NyLPC_TUInt16 st_len;\r
+};\r
+\r
+/**\r
+ * ストリームハンドラ(put)\r
+ */\r
+static NyLPC_TBool mvmputs_json(struct NyLPC_TcMiMicVM_TEvent* i_eh,NyLPC_TUInt32 i_val)\r
+{\r
+       struct TVmEventHandler* eh=(struct TVmEventHandler*)i_eh;\r
+       if(eh->st_len>0){\r
+               eh->st_len++;\r
+               return NyLPC_cHttpdConnection_sendResponseBodyF(eh->connection,",%u",i_val);\r
+       }else{\r
+               eh->st_len++;\r
+               return NyLPC_cHttpdConnection_sendResponseBodyF(eh->connection,"%u",i_val);\r
+       }\r
+}\r
+\r
+/**\r
+ * ストリームハンドラ(get)\r
+ */\r
+static NyLPC_TBool mvmgets(struct NyLPC_TcMiMicVM_TEvent* i_eh,NyLPC_TUInt32* o_val)\r
+{\r
+       struct TVmEventHandler* eh=(struct TVmEventHandler*)i_eh;\r
+       //読み出し済みDBサイズの確認\r
+       if(eh->req->content.mvm.vm_instruction.db_len<=eh->db_pos){\r
+               //読めない\r
+               return NyLPC_TBool_FALSE;\r
+       }\r
+       *o_val=eh->req->content.mvm.vm_instruction.db_part[eh->db_pos];\r
+       eh->db_pos++;\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+/**\r
+ * ネイティブCALLハンドラ\r
+ */\r
+static NyLPC_TUInt32 nativeCall(struct NyLPC_TcMiMicVM_TEvent* i_evh,NyLPC_TUInt32 i_id,NyLPC_TcMiMicVM_t* i_vm)\r
+{\r
+       (void)i_evh;\r
+//     NyLPC_TNativeFunction f=getNativeFunctionById(i_id);\r
+//     if(f==NULL){\r
+//             return NyLPC_cMiMicVM_RESULT_RUNTIME_NG_UNKNOWN_CALL;\r
+//     }\r
+//     return f(i_vm)?NyLPC_cMiMicVM_RESULT_OK:NyLPC_cMiMicVM_RESULT_RUNTIME_NG_CALL;\r
+       return NyLPC_cMiMicVM_RESULT_RUNTIME_NG_CALL;\r
+}\r
+\r
+\r
+static void mvmsleep(struct NyLPC_TcMiMicVM_TEvent* i_eh,NyLPC_TUInt32 i_sleep_in_msec)\r
+{\r
+       (void)i_eh;\r
+       NyLPC_cThread_sleep(i_sleep_in_msec);\r
+}\r
+\r
+\r
+/**\r
+ * MimicVMの起動と,ResponseJSONの起動\r
+ * @return\r
+ * 持続性接続を継続するかの真偽値\r
+ */\r
+static void mvm(NyLPC_TcHttpdConnection_t* i_connection,const struct TModMiMicRemoteMcuHeader* i_rqh)\r
+{\r
+       struct TVmEventHandler he;\r
+       NyLPC_TcMiMicVM_t vm;\r
+       NyLPC_TUInt32 vmret;\r
+       if(i_rqh->content.mvm.v!=QVAL_V_1 || i_rqh->content.mvm.o!=QVAL_O_JSON)\r
+       {\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,500,"text/html",0,NULL);\r
+               return;\r
+       }\r
+\r
+       //Bodyを書く\r
+//ここでリクエストパーサのエラー原因を調べて、詳細JSONをかくのもあり\r
+       //ハンドラインスタンスの設定\r
+       if(!NyLPC_cHttpdModUtils_sendJsonHeader(i_connection)){\r
+               NyLPC_OnErrorGoto(Error1);\r
+       }\r
+\r
+       he.super.get_stream=mvmgets;\r
+       he.super.put_stream=mvmputs_json;\r
+       he.super.native_call=nativeCall;\r
+       he.super.sleep=mvmsleep;\r
+       he.db_pos=0;\r
+       he.st_len=0;\r
+       he.connection=i_connection;\r
+       he.req=i_rqh;\r
+\r
+       //起動VMの初期化\r
+       NyLPC_cMiMicVM_initialize(&vm,(struct NyLPC_TcMiMicVM_TEvent*)&(he.super));\r
+\r
+       //JSONを書く。\r
+       if(!NyLPC_cHttpdConnection_sendResponseBodyF(i_connection,"{\"version\":\""MVM_VERSION"\",\"stream\":[")){\r
+               NyLPC_OnErrorGoto(Error3);\r
+       }\r
+       //VMの実行\r
+       vmret=NyLPC_cMiMicVM_run(&(vm),i_rqh->content.mvm.vm_instruction.bc_buf,i_rqh->content.mvm.vm_instruction.txt_len);\r
+       if(!NyLPC_cHttpdConnection_sendResponseBodyF(i_connection,"],\"result\":%u}",vmret)){\r
+               NyLPC_OnErrorGoto(Error3);\r
+       }\r
+       NyLPC_cMiMicVM_finalize(&vm);\r
+\r
+       return;\r
+Error3:\r
+       NyLPC_cMiMicVM_finalize(&vm);\r
+Error1:\r
+       //VM排他ロックの解除\r
+       NyLPC_cMiMicVM_finalize(&vm);\r
+       NyLPC_cHttpBodyWriter_finalize(&hw);\r
+       return;\r
+}\r
+\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.h b/lib/src/net/httpd/mod/NyLPC_cModRemoteMcu.h
new file mode 100644 (file)
index 0000000..6bd82ad
--- /dev/null
@@ -0,0 +1,49 @@
+/*\r
+ * NyLPC_cModRemoteMcu.h\r
+ *\r
+ *  Created on: 2013/03/07\r
+ *      Author: nyatla\r
+ */\r
+\r
+#ifndef NYLPC_CMODREMOTEMCU_H_\r
+#define NYLPC_CMODREMOTEMCU_H_\r
+\r
+#include "../http/NyLPC_cHttpBasicHeaderParser.h"\r
+#include "../NyLPC_cHttpdConnection.h"\r
+#include "NyLPC_cModRomFiles.h"\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+/**\r
+ * URLが最大31文字までの、短いHttpリクエストを処理します。\r
+ * このクラスは、NyLPC_TBasicHttpHeader_tにキャストできます。\r
+ */\r
+typedef struct NyLPC_TcModRemoteMcu NyLPC_TcModRemoteMcu_t;\r
+\r
+\r
+struct NyLPC_TcModRemoteMcu\r
+{\r
+       NyLPC_TcModRomFiles_t super;\r
+};\r
+\r
+/**\r
+ * コンストラクタ。\r
+ */\r
+void NyLPC_cModRemoteMcu_initialize(NyLPC_TcModRemoteMcu_t* i_inst,const NyLPC_TChar* i_ref_root_path);\r
+void NyLPC_cModRemoteMcu_finalize(NyLPC_TcModRemoteMcu_t* i_inst);\r
+\r
+/**\r
+ * モジュールがコネクションをハンドリングできるかを返します。\r
+ */\r
+NyLPC_TBool NyLPC_cModRemoteMcu_canHandle(NyLPC_TcModRemoteMcu_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
+/**\r
+ * モジュールを実行します。\r
+ */\r
+NyLPC_TBool NyLPC_cModRemoteMcu_execute(NyLPC_TcModRemoteMcu_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path);\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif /* NYLPC_CMODREMOTEMCU_H_ */\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModRomFiles.c b/lib/src/net/httpd/mod/NyLPC_cModRomFiles.c
new file mode 100644 (file)
index 0000000..90984e2
--- /dev/null
@@ -0,0 +1,186 @@
+/*********************************************************************************\r
+ * PROJECT: MiMic\r
+ * --------------------------------------------------------------------------------\r
+ *\r
+ * This file is part of MiMic\r
+ * Copyright (C)2011 Ryo Iizuka\r
+ *\r
+ * MiMic is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published\r
+ * by the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * For further information please contact.\r
+ *     http://nyatla.jp/\r
+ *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ *\r
+ *********************************************************************************/\r
+#include "NyLPC_cModRomFiles_protected.h"\r
+#include "NyLPC_stdlib.h"\r
+#include "../http/NyLPC_cHttpShortRequestHeaderParser.h"\r
+#include "NyLPC_cHttpmodUtils_protected.h"\r
+#include "../NyLPC_cHttpdConnection_protected.h"\r
+\r
+\r
+/**\r
+ * コンストラクタ。\r
+ * @param i_ref_path\r
+ * 16文字以内のルートパスを指定します。文字列は外部参照です。インスタンスをfinalizeするまで維持してください。\r
+ * 文字列は/で開始され/で終了する必要があります。\r
+ * path:= /({.,14}/)?\r
+ * @param i_data\r
+ * ROMFile構造体の配列の先頭アドレス\r
+ */\r
+void NyLPC_cModRomFiles_initialize(NyLPC_TcModRomFiles_t* i_inst,const NyLPC_TChar* i_ref_root_path,const struct NyLPC_TRomFileData* i_data,int i_num_of_data)\r
+{\r
+       i_inst->_data=i_data;\r
+       i_inst->_num_of_data=i_num_of_data;\r
+}\r
+void NyLPC_cModRomFiles_finalize(NyLPC_TcModRomFiles_t* i_inst)\r
+{\r
+}\r
+\r
+/**\r
+ * モジュールがコネクションをハンドリングできるかを返します。\r
+ */\r
+NyLPC_TBool NyLPC_cModRomFiles_canHandle(NyLPC_TcModRomFiles_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection)\r
+{\r
+       const NyLPC_TChar* in_url;\r
+       const NyLPC_TChar* base_url=i_inst->_ref_root_path;\r
+       in_url=NyLPC_cHttpdConnection_getUrlPrefix(i_connection);\r
+       size_t base_url_len=strlen(base_url);\r
+       if(strlen(in_url)<base_url_len){\r
+               return NyLPC_TBool_FALSE;\r
+       }\r
+       if(strncmp(in_url,base_url,base_url_len)!=0){\r
+               return NyLPC_TBool_FALSE;\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+\r
+/**\r
+ * URL解析の為の各兆クラス\r
+ */\r
+\r
+\r
+\r
+\r
+\r
+static NyLPC_TBool NyLPC_cModRomFiles_messageHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,const NyLPC_TChar* i_name,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       (void)i_inst;\r
+       (void)i_name;\r
+       (void)i_c;\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+static NyLPC_TBool NyLPC_cModRomFiles_urlHandler(NyLPC_TcHttpBasicHeaderParser_t* i_inst,NyLPC_TChar i_c,struct NyLPC_THttpBasicHeader* o_out)\r
+{\r
+       struct NyLPC_TRomFileRequestHeader* out=(struct NyLPC_TRomFileRequestHeader*)o_out;\r
+       //読み飛ばし\r
+       if(out->_prefix_len<0){\r
+               out->_prefix_len++;\r
+               return NyLPC_TBool_TRUE;//読み飛ばし\r
+       }\r
+       //終端確認\r
+       out->url[out->_prefix_len]=i_c;\r
+       if(i_c=='\0'){\r
+               return NyLPC_TBool_TRUE;//読み飛ばし\r
+       }\r
+       //蓄積チェック\r
+       out->_prefix_len++;\r
+       if(out->_prefix_len>=out->url_max){\r
+               return NyLPC_TBool_FALSE;\r
+       }\r
+       return NyLPC_TBool_TRUE;\r
+}\r
+/**\r
+ * デフォルトハンドラ\r
+ */\r
+static const struct NyLPC_TcHttpBasicHeaderParser_Handler _handler=\r
+{\r
+       NyLPC_cModRomFiles_messageHandler,\r
+       NyLPC_cModRomFiles_urlHandler\r
+};\r
+\r
+\r
+\r
+/**\r
+ * モジュールを実行します。\r
+ */\r
+NyLPC_TBool NyLPC_cModRomFiles_execute(NyLPC_TcModRomFiles_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path)\r
+{\r
+       int i;\r
+       NyLPC_TUInt16 status_code;\r
+       NyLPC_TChar urls[32];\r
+       struct NyLPC_TRomFileRequestHeader header;\r
+       //connectonの状態を確認\r
+       if(!NyLPC_cHttpdConnection_getReqStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
+       {\r
+               NyLPC_OnErrorGoto(Error1);\r
+       }\r
+       //URL解析の準備\r
+       header.url_max=32;\r
+       header.url=urls;\r
+       //URLパース\r
+       status_code=NyLPC_cModRomFiles_getUrlSuffix(i_inst,i_connection,i_root_path,&header);\r
+       if(status_code!=200)\r
+       {\r
+               //エラー送信\r
+               NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,status_code,"text/html",0,NULL);\r
+               return NyLPC_TBool_FALSE;\r
+       }\r
+       //URL比較\r
+       for(i=i_inst->_num_of_data-1;i>=0;i--)\r
+       {\r
+               if(strcmp(urls,i_inst->_data[i].name)!=0){\r
+                       continue;\r
+               }\r
+               //Connection Modeの設定 1.1 && !closeの場合はCONTINUE\r
+               if(header.super.connection!=NyLPC_THttpMessgeHeader_Connection_CLOSE && header.super.startline.req.version==NyLPC_THttpVersion_11)\r
+               {\r
+                       NyLPC_cHttpdConnection_setConnectionMode(i_connection,NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE);\r
+               }\r
+               return NyLPC_cHttpdModUtils_sendFixedContentBatch(i_connection,i_inst->_data[i].content_type,i_inst->_data[i].data,i_inst->_data[i].size);\r
+       }\r
+       //404Error\r
+       NyLPC_cHttpdConnection_sendResponseHeader2(i_connection,405,"text/html",0,NULL);\r
+       return NyLPC_TBool_FALSE;\r
+Error1:\r
+       return NyLPC_TBool_FALSE;\r
+}\r
+\r
+\r
+/**\r
+ * URLサフィックスを取得する。\r
+ */\r
+NyLPC_TUInt16 NyLPC_cModRomFiles_getUrlSuffix(NyLPC_TcModRomFiles_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path,struct NyLPC_TRomFileRequestHeader* header)\r
+{\r
+       NyLPC_TcHttpBasicHeaderParser_t parser;\r
+       //URL解析の準備\r
+       header->_prefix_len=-(NyLPC_TInt16)strlen(i_inst->_ref_root_path);\r
+       NyLPC_cHttpBasicHeaderParser_initialize(&parser,&_handler);\r
+       //プリフェッチしたデータを流す\r
+       NyLPC_cHttpBasicHeaderParser_parseInit(&parser,&(header->super));\r
+       NyLPC_cHttpdConnection_pushPrefetchInfo(i_connection,&parser,&(header->super));\r
+       //後続をストリームから取り込む\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseStream(&parser,NyLPC_cHttpdConnection_refStream(i_connection),&(header->super))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       if(!NyLPC_cHttpBasicHeaderParser_parseFinish(&parser,&(header->super))){\r
+               NyLPC_OnErrorGoto(Error2);\r
+       }\r
+       NyLPC_cHttpShortRequestHeaderParser_finalize(&parser);\r
+       return 200;\r
+Error2:\r
+       //BadRequest\r
+       return 400;\r
+}\r
+\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModRomFiles.h b/lib/src/net/httpd/mod/NyLPC_cModRomFiles.h
new file mode 100644 (file)
index 0000000..2082503
--- /dev/null
@@ -0,0 +1,83 @@
+/*********************************************************************************\r
+ * PROJECT: MiMic\r
+ * --------------------------------------------------------------------------------\r
+ *\r
+ * This file is part of MiMic\r
+ * Copyright (C)2011 Ryo Iizuka\r
+ *\r
+ * MiMic is free software: you can redistribute it and/or modify\r
+ * it under the terms of the GNU Lesser General Public License as published\r
+ * by the Free Software Foundation, either version 3 of the License, or\r
+ * (at your option) any later version.\r
+ *\r
+ * This program is distributed in the hope that it will be useful,\r
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+ * GNU General Public License for more details.\r
+ *\r
+ * You should have received a copy of the GNU Lesser General Public License\r
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.\r
+ *\r
+ * For further information please contact.\r
+ *     http://nyatla.jp/\r
+ *     <airmail(at)ebony.plala.or.jp> or <nyatla(at)nyatla.jp>\r
+ *\r
+ *********************************************************************************/\r
+#ifndef NYLPC_CMODROMFILES_H_\r
+#define NYLPC_CMODROMFILES_H_\r
+#include "../http/NyLPC_cHttpBasicHeaderParser.h"\r
+#include "../NyLPC_cHttpdConnection.h"\r
+#include "../utils/NyLPC_cRomFileSet.h"\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif /* __cplusplus */\r
+\r
+\r
+/**\r
+ * ROMFileDataに格納したファイルデータを返すモジュールクラスです。\r
+ * モジュールに登録したファイルデータは、initializeに登録したルートパスが一致したときに動作します。\r
+ * 例えばrootpathが"/test/"の場合に、"/test/my.jpg"のリクエストが有る場合、\r
+ * "my.jpg"が登録されていればそれを返します。登録されていなければ404エラーを返します。\r
+ */\r
+typedef struct NyLPC_TcModRomFiles NyLPC_TcModRomFiles_t;\r
+\r
+\r
+struct NyLPC_TcModRomFiles\r
+{\r
+       /** ルートパス*/\r
+       const NyLPC_TChar* _ref_root_path;\r
+       /** ROMFileのデータ*/\r
+       const struct NyLPC_TRomFileData* _data;\r
+       /** ROMFILEデータの数*/\r
+       int _num_of_data;\r
+};\r
+\r
+/**\r
+ * コンストラクタ。\r
+ * @param i_ref_path\r
+ * 16文字以内のルートパスを指定します。文字列は外部参照です。インスタンスをfinalizeするまで維持してください。\r
+ * 文字列は/で開始され/で終了する必要があります。\r
+ * path:= /({.,14}/)?\r
+ */\r
+void NyLPC_cModRomFiles_initialize(NyLPC_TcModRomFiles_t* i_inst,const NyLPC_TChar* i_ref_root_path,const struct NyLPC_TRomFileData* i_data,int i_num_of_data);\r
+void NyLPC_cModRomFiles_finalize(NyLPC_TcModRomFiles_t* i_inst);\r
+\r
+/**\r
+ * モジュールがコネクションをハンドリングできるかを返します。\r
+ */\r
+NyLPC_TBool NyLPC_cModRomFiles_canHandle(NyLPC_TcModRomFiles_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
+/**\r
+ * モジュールを実行します。\r
+ */\r
+NyLPC_TBool NyLPC_cModRomFiles_execute(NyLPC_TcModRomFiles_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path);\r
+\r
+\r
+\r
+\r
+\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif /* __cplusplus */\r
+\r
+#endif /* NYLPC_CMODROMFILES_H_ */\r
diff --git a/lib/src/net/httpd/mod/NyLPC_cModRomFiles_protected.h b/lib/src/net/httpd/mod/NyLPC_cModRomFiles_protected.h
new file mode 100644 (file)
index 0000000..d380e36
--- /dev/null
@@ -0,0 +1,25 @@
+/*\r
+ * NyLPC_cModRomFiles_protected.h\r
+ *\r
+ *  Created on: 2013/03/06\r
+ *      Author: nyatla\r
+ */\r
+\r
+#ifndef NYLPC_CMODROMFILES_PROTECTED_H_\r
+#define NYLPC_CMODROMFILES_PROTECTED_H_\r
+\r
+#include "NyLPC_cModRomFiles.h"\r
+\r
+struct NyLPC_TRomFileRequestHeader\r
+{\r
+       struct NyLPC_THttpBasicHeader super;\r
+       NyLPC_TUInt16 _prefix_len;\r
+       NyLPC_TUInt16 url_max;\r
+       NyLPC_TChar* url;\r
+};\r
+/**\r
+ * URLサフィックスを取得する。\r
+ */\r
+NyLPC_TUInt16 NyLPC_cModRomFiles_getUrlSuffix(NyLPC_TcModRomFiles_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection,const NyLPC_TChar* i_root_path,struct NyLPC_TRomFileRequestHeader* header);\r
+\r
+#endif /* NYLPC_CMODROMFILES_PROTECTED_H_ */\r
similarity index 73%
rename from lib/src/api/NyLPC_cModShortUrl.c
rename to lib/src/net/httpd/mod/NyLPC_cModShortUrl.c
index 570a5ec..4eb2e42 100644 (file)
@@ -26,8 +26,8 @@
 #include "NyLPC_cModShortUrl.h"\r
 #include "NyLPC_stdlib.h"\r
 #include "../http/NyLPC_cHttpShortRequestHeaderParser.h"\r
-\r
-\r
+#include "NyLPC_cHttpModUtils_protected.h"\r
+#include "../NyLPC_cHttpdConnection_protected.h"\r
 \r
 void NyLPC_cModShortUrl_initialize(NyLPC_TcModShortUrl_t* i_inst)\r
 {\r
@@ -61,37 +61,18 @@ NyLPC_THttpMethodType NyLPC_cModShortUrl_getMethod(const NyLPC_TcModShortUrl_t*
 \r
 \r
 \r
-static const char* getMethodPrefix(NyLPC_THttpMethodType i_method)\r
-{\r
-       static const char* method_prefix[3]={"GET ","POST ","HEAD "};\r
-       switch(i_method)\r
-       {\r
-       case NyLPC_THttpMethodType_GET:\r
-               return method_prefix[0];\r
-       case NyLPC_THttpMethodType_POST:\r
-               return method_prefix[1];\r
-       case NyLPC_THttpMethodType_HEAD:\r
-               return method_prefix[2];\r
-       default:\r
-               NyLPC_Abort();\r
-       }\r
-       return NULL;\r
-}\r
 \r
-NyLPC_TBool NyLPC_cModShortUrl_parse(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection)\r
+NyLPC_TBool NyLPC_cModShortUrl_execute(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection)\r
 {\r
-       const char* method;\r
        NyLPC_TcHttpShortRequestHeaderParser_t parser;\r
-       if(!NyLPC_cHttpdConnection_getStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
+       if(!NyLPC_cHttpdConnection_getReqStatus(i_connection)==NyLPC_cHttpdConnection_ReqStatus_REQPARSE)\r
        {\r
                NyLPC_OnErrorGoto(Error1);\r
        }\r
-       method=getMethodPrefix(i_connection->_pparser.method);\r
        NyLPC_cHttpShortRequestHeaderParser_initialize(&parser);\r
        //プリフェッチしたデータを流す\r
        NyLPC_cHttpShortRequestHeaderParser_parseInit(&parser,&(i_inst->_header));\r
-       NyLPC_cHttpShortRequestHeaderParser_parseChar(&parser,method,strlen(method),&(i_inst->_header));\r
-       NyLPC_cHttpShortRequestHeaderParser_parseChar(&parser,i_connection->_pparser._url,strlen(i_connection->_pparser._url),&(i_inst->_header));\r
+       NyLPC_cHttpdConnection_pushPrefetchInfo(i_connection,&parser.super,&(i_inst->_header.super));\r
        //後続をストリームから取り込む\r
        if(!NyLPC_cHttpShortRequestHeaderParser_parseStream(&parser,NyLPC_cHttpdConnection_refStream(i_connection),&(i_inst->_header))){\r
                NyLPC_OnErrorGoto(Error2);\r
@@ -99,6 +80,12 @@ NyLPC_TBool NyLPC_cModShortUrl_parse(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpd
        if(!NyLPC_cHttpShortRequestHeaderParser_parseFinish(&parser,&(i_inst->_header))){\r
                NyLPC_OnErrorGoto(Error2);\r
        }\r
+       //Connection Modeの設定 1.1 && !closeの場合はCONTINUE\r
+       if(i_inst->_header.super.connection!=NyLPC_THttpMessgeHeader_Connection_CLOSE && i_inst->_header.super.startline.req.version==NyLPC_THttpVersion_11)\r
+       {\r
+               NyLPC_cHttpdConnection_setConnectionMode(i_connection,NyLPC_TcHttpdConnection_CONNECTION_MODE_CONTINUE);\r
+       }\r
+\r
        NyLPC_cHttpShortRequestHeaderParser_finalize(&parser);\r
        return NyLPC_TBool_TRUE;\r
 Error2:\r
similarity index 84%
rename from lib/src/api/NyLPC_cModShortUrl.h
rename to lib/src/net/httpd/mod/NyLPC_cModShortUrl.h
index 0fa48a1..5aa4893 100644 (file)
  *********************************************************************************/\r
 #ifndef NYLPC_CMODSHORTURL_H_\r
 #define NYLPC_CMODSHORTURL_H_\r
-\r
+#include "../http/NyLPC_cHttpShortRequestHeaderParser.h"\r
+#include "../NyLPC_cHttpdConnection.h"\r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif /* __cplusplus */\r
-#include "../http/NyLPC_cHttpBasicHeaderParser.h"\r
-#include "NyLPC_cHttpdConnection.h"\r
 \r
 /**\r
- * URLが最大31文字までの、短いHttpリクエストを処理します。\r
- * このクラスは、NyLPC_TBasicHttpHeader_tにキャストできます。\r
+ * URLが最大31文字までの、短いHttpリクエストを処理して、リクエスト内容を取得します。\r
  */\r
 typedef struct NyLPC_TcModShortUrl NyLPC_TcModShortUrl_t;\r
 \r
@@ -50,7 +48,10 @@ struct NyLPC_TcModShortUrl
 void NyLPC_cModShortUrl_initialize(NyLPC_TcModShortUrl_t* i_inst);\r
 void NyLPC_cModShortUrl_finalize(NyLPC_TcModShortUrl_t* i_inst);\r
 \r
-NyLPC_TBool NyLPC_cModShortUrl_parse(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
+/**\r
+ * ShortURLのパースを実行して、コネクションの返却準備をします。\r
+ */\r
+NyLPC_TBool NyLPC_cModShortUrl_execute(NyLPC_TcModShortUrl_t* i_inst,NyLPC_TcHttpdConnection_t* i_connection);\r
 \r
 /**\r
  * basicヘッダオブジェクトを返します。\r
index c474604..e952ebd 100644 (file)
@@ -74,6 +74,7 @@
                                                                        <listOptionValue builtIn="false" value="&quot;${workspace_loc:/FreeRTOSLib}&quot;"/>\r
                                                                </option>\r
                                                                <inputType id="com.crt.advproject.assembler.input.1954791986" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1192114959" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
                                                        </tool>\r
                                                        <tool id="com.crt.advproject.link.cpp.exe.debug.696640668" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug"/>\r
                                                        <tool id="com.crt.advproject.link.exe.debug.1514106711" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">\r
                                        <externalSetting>\r
                                                <entry flags="VALUE_WORKSPACE_PATH" kind="includePath" name="/NyLPCLib"/>\r
                                                <entry flags="VALUE_WORKSPACE_PATH" kind="libraryPath" name="/NyLPCLib/Debug"/>\r
-                                               <entry flags="RESOLVED" kind="libraryFile" name="NyLPCLib"/>\r
+                                               <entry flags="RESOLVED" kind="libraryFile" name="NyLPCLib" srcPrefixMapping="" srcRootPath=""/>\r
                                        </externalSetting>\r
                                </externalSettings>\r
                        </storageModule>\r
                        <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
                        <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
                        <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>\r
-                       <storageModule moduleId="scannerConfiguration">\r
-                               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>\r
-                               <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="false" filePath=""/>\r
-                                               <parser enabled="false"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="false" filePath=""/>\r
-                                               <parser enabled="false"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="false" filePath=""/>\r
-                                               <parser enabled="false"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                               <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="makefileGenerator">\r
-                                               <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.429003282;com.crt.advproject.config.exe.release.429003282.;com.crt.advproject.gcc.exe.release.660269152;com.crt.advproject.compiler.input.1760064385">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.358435974;com.crt.advproject.config.exe.debug.358435974.;com.crt.advproject.gas.exe.debug.152194393;com.crt.advproject.assembler.input.1954791986">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.358435974;com.crt.advproject.config.exe.debug.358435974.;com.crt.advproject.gcc.exe.debug.496871390;com.crt.advproject.compiler.input.40206634">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.429003282;com.crt.advproject.config.exe.release.429003282.;com.crt.advproject.gas.exe.release.340210131;com.crt.advproject.assembler.input.1748919550">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                       </storageModule>\r
                </cconfiguration>\r
                <cconfiguration id="com.crt.advproject.config.exe.release.429003282">\r
                        <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.release.429003282" moduleId="org.eclipse.cdt.core.settings" name="Release">\r
                                                                <option id="com.crt.advproject.gas.thumb.147071109" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>\r
                                                                <option id="gnu.both.asm.option.flags.crt.2019607838" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DNDEBUG -D__CODE_RED -D__REDLIB__ " valueType="string"/>\r
                                                                <inputType id="com.crt.advproject.assembler.input.1748919550" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.983037209" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>\r
                                                        </tool>\r
                                                        <tool id="com.crt.advproject.link.cpp.exe.release.116216997" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.release"/>\r
                                                        <tool id="com.crt.advproject.link.exe.release.1686532392" name="MCU Linker" superClass="com.crt.advproject.link.exe.release">\r
                        <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
                        <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
                        <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>\r
-                       <storageModule moduleId="scannerConfiguration">\r
-                               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>\r
-                               <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="false" filePath=""/>\r
-                                               <parser enabled="false"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="false" filePath=""/>\r
-                                               <parser enabled="false"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="false" filePath=""/>\r
-                                               <parser enabled="false"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                               <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="makefileGenerator">\r
-                                               <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                       <buildOutputProvider>\r
-                                               <openAction enabled="true" filePath=""/>\r
-                                               <parser enabled="true"/>\r
-                                       </buildOutputProvider>\r
-                                       <scannerInfoProvider id="specsFile">\r
-                                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                               <parser enabled="true"/>\r
-                                       </scannerInfoProvider>\r
-                               </profile>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.429003282;com.crt.advproject.config.exe.release.429003282.;com.crt.advproject.gcc.exe.release.660269152;com.crt.advproject.compiler.input.1760064385">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.358435974;com.crt.advproject.config.exe.debug.358435974.;com.crt.advproject.gas.exe.debug.152194393;com.crt.advproject.assembler.input.1954791986">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.358435974;com.crt.advproject.config.exe.debug.358435974.;com.crt.advproject.gcc.exe.debug.496871390;com.crt.advproject.compiler.input.40206634">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.429003282;com.crt.advproject.config.exe.release.429003282.;com.crt.advproject.gas.exe.release.340210131;com.crt.advproject.assembler.input.1748919550">\r
-                                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="false" filePath=""/>\r
-                                                       <parser enabled="false"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
-                                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="makefileGenerator">\r
-                                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
-                                               <buildOutputProvider>\r
-                                                       <openAction enabled="true" filePath=""/>\r
-                                                       <parser enabled="true"/>\r
-                                               </buildOutputProvider>\r
-                                               <scannerInfoProvider id="specsFile">\r
-                                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
-                                                       <parser enabled="true"/>\r
-                                               </scannerInfoProvider>\r
-                                       </profile>\r
-                               </scannerConfigBuildInfo>\r
-                       </storageModule>\r
                </cconfiguration>\r
        </storageModule>\r
        <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
 &lt;/infoList&gt;&#13;\r
 &lt;/TargetConfig&gt;</projectStorage>\r
        </storageModule>\r
+       <storageModule moduleId="refreshScope"/>\r
+       <storageModule moduleId="scannerConfiguration">\r
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile"/>\r
+               <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="false" filePath=""/>\r
+                               <parser enabled="false"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="false" filePath=""/>\r
+                               <parser enabled="false"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="false" filePath=""/>\r
+                               <parser enabled="false"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                               <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="makefileGenerator">\r
+                               <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
+                       <buildOutputProvider>\r
+                               <openAction enabled="true" filePath=""/>\r
+                               <parser enabled="true"/>\r
+                       </buildOutputProvider>\r
+                       <scannerInfoProvider id="specsFile">\r
+                               <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                               <parser enabled="true"/>\r
+                       </scannerInfoProvider>\r
+               </profile>\r
+               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.429003282;com.crt.advproject.config.exe.release.429003282.;com.crt.advproject.gcc.exe.release.660269152;com.crt.advproject.compiler.input.1760064385">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="makefileGenerator">\r
+                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+               </scannerConfigBuildInfo>\r
+               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.358435974;com.crt.advproject.config.exe.debug.358435974.;com.crt.advproject.gas.exe.debug.152194393;com.crt.advproject.assembler.input.1954791986">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="makefileGenerator">\r
+                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+               </scannerConfigBuildInfo>\r
+               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.debug.358435974;com.crt.advproject.config.exe.debug.358435974.;com.crt.advproject.gcc.exe.debug.496871390;com.crt.advproject.compiler.input.40206634">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="makefileGenerator">\r
+                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+               </scannerConfigBuildInfo>\r
+               <scannerConfigBuildInfo instanceId="com.crt.advproject.config.exe.release.429003282;com.crt.advproject.config.exe.release.429003282.;com.crt.advproject.gas.exe.release.340210131;com.crt.advproject.assembler.input.1748919550">\r
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="com.crt.advproject.GCCManagedMakePerProjectProfile"/>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-c++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="com.crt.advproject.GASManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="false" filePath=""/>\r
+                                       <parser enabled="false"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="com.crt.advproject.specsFile">\r
+                                       <runAction arguments="-x assembler-with-cpp -E -P -v -dD ${plugin_state_location}/${specs_file}" command="arm-none-eabi-gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="makefileGenerator">\r
+                                       <runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+                       <profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">\r
+                               <buildOutputProvider>\r
+                                       <openAction enabled="true" filePath=""/>\r
+                                       <parser enabled="true"/>\r
+                               </buildOutputProvider>\r
+                               <scannerInfoProvider id="specsFile">\r
+                                       <runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>\r
+                                       <parser enabled="true"/>\r
+                               </scannerInfoProvider>\r
+                       </profile>\r
+               </scannerConfigBuildInfo>\r
+       </storageModule>\r
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>\r
 </cproject>\r
index 7965dee..e46e82a 100644 (file)
@@ -8,9 +8,9 @@
 #include "NyLPC_utils.h"\r
 #include <stdio.h>\r
 \r
-#include "../api/NyLPC_cNet.h"\r
-#include "../api/NyLPC_cHttpd.h"\r
-#include "../api/NyLPC_cModShortUrl.h"\r
+#include "../net/NyLPC_cNet.h"\r
+#include "../net/httpd/NyLPC_cHttpd.h"\r
+#include "../net/httpd/mod/NyLPC_cModShortUrl.h"\r
 \r
 NyLPC_TcNet_t net;\r
 struct MyHttpd{\r
@@ -22,8 +22,8 @@ void handler(NyLPC_TcHttpdConnection_t* i_connection)
 {\r
        NyLPC_THttpMethodType m;\r
        NyLPC_TcModShortUrl_t mod_surl;\r
-\r
-       NyLPC_cModShortUrl_parse(&mod_surl,i_connection);\r
+       NyLPC_cModShortUrl_initialize(&mod_surl);\r
+       NyLPC_cModShortUrl_execute(&mod_surl,i_connection);\r
        m=NyLPC_cModShortUrl_getMethod(&mod_surl);\r
        if(m!=NyLPC_THttpMethodType_HEAD || m!=NyLPC_THttpMethodType_GET){\r
                NyLPC_cHttpdConnection_sendResponseHeader(i_connection,200,"text/html",NULL);\r
@@ -34,6 +34,7 @@ void handler(NyLPC_TcHttpdConnection_t* i_connection)
 \r
                NyLPC_cHttpdConnection_sendResponseBodyF(i_connection,"</body></html>");\r
        }\r
+       NyLPC_cModShortUrl_finalize(&mod_surl);\r
        return;\r
 }\r
 void setup(void)\r
@@ -42,7 +43,7 @@ void setup(void)
        NyLPC_cNet_initialize(&net);\r
        NyLPC_cHttpd_initialize(&httpd.super,80);\r
        httpd.super.function._handler=handler;\r
-       NyLPC_cModShortUrl_initialize(&mod_surl);\r
+\r
 }\r
 \r
 \r