OSDN Git Service

add directory and files for bchan HMI control library.
authorornse01 <ornse01@users.sourceforge.jp>
Mon, 25 Nov 2013 16:52:07 +0000 (16:52 +0000)
committerornse01 <ornse01@users.sourceforge.jp>
Mon, 25 Nov 2013 16:52:07 +0000 (16:52 +0000)
git-svn-id: http://svn.sourceforge.jp/svnroot/bchan/bchanf/trunk@591 20a0b8eb-f62a-4a12-8fe1-b598822500fb

src/control/test_control.h [new file with mode: 0644]
src/control/test_texteditor_textfragment.c [new file with mode: 0644]
src/control/texteditor_textfragment.c [new file with mode: 0644]
src/control/texteditor_textfragment.h [new file with mode: 0644]

diff --git a/src/control/test_control.h b/src/control/test_control.h
new file mode 100644 (file)
index 0000000..518a098
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * test_control.h
+ *
+ * Copyright (c) 2013 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ *    distribution.
+ *
+ */
+
+#include       <basic.h>
+#include    <unittest_driver.h>
+
+#ifndef __TEST_CONTROL_H__
+#define __TEST_CONTROL_H__
+
+IMPORT VOID test_texteditor_textfragment_main(unittest_driver_t *driver);
+
+#endif
diff --git a/src/control/test_texteditor_textfragment.c b/src/control/test_texteditor_textfragment.c
new file mode 100644 (file)
index 0000000..bf736a4
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * test_texteditor_textfragment.c
+ *
+ * Copyright (c) 2013 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ *    distribution.
+ *
+ */
+
+#include "test_control.h"
+
+#include "texteditor_textfragment.h"
+
+#include       <basic.h>
+#include       <bstdio.h>
+#include       <bstdlib.h>
+#include       <bstring.h>
+
+#include    <unittest_driver.h>
+
+LOCAL UNITTEST_RESULT test_texteditor_textfragment_1()
+{
+       texteditor_textfragment_t fragment;
+       W err;
+
+       err = texteditor_textfragment_initialize(&fragment);
+       if (err < 0) {
+               return UNITTEST_RESULT_FAIL;
+       }
+       texteditor_textfragment_finalize(&fragment);
+
+       return UNITTEST_RESULT_PASS;
+}
+
+EXPORT VOID test_texteditor_textfragment_main(unittest_driver_t *driver)
+{
+       UNITTEST_DRIVER_REGIST(driver, test_texteditor_textfragment_1);
+}
diff --git a/src/control/texteditor_textfragment.c b/src/control/texteditor_textfragment.c
new file mode 100644 (file)
index 0000000..710ad51
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * texteditor_textfragment.c
+ *
+ * Copyright (c) 2013 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ *    distribution.
+ *
+ */
+
+#include       "texteditor_textfragment.h"
+
+#include       <bstdio.h>
+
+#include       <tad/tadfragment.h>
+
+#ifdef BCHAN_CONFIG_DEBUG
+# define DP(arg) printf arg
+# define DP_ER(msg, err) printf("%s (%d/%x)\n", msg, err>>16, err)
+#else
+# define DP(arg) /**/
+# define DP_ER(msg, err) /**/
+#endif
+
+EXPORT W texteditor_textfragment_initialize(texteditor_textfragment_t *fragment)
+{
+       return tadfragment_initialize(&fragment->base);
+}
+
+EXPORT VOID texteditor_textfragment_finalize(texteditor_textfragment_t *fragment)
+{
+       tadfragment_finalize(&fragment->base);
+}
diff --git a/src/control/texteditor_textfragment.h b/src/control/texteditor_textfragment.h
new file mode 100644 (file)
index 0000000..bfed670
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * texteditor_textfragment.h
+ *
+ * Copyright (c) 2013 project bchan
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any damages
+ * arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any purpose,
+ * including commercial applications, and to alter it and redistribute it
+ * freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you must not
+ *    claim that you wrote the original software. If you use this software
+ *    in a product, an acknowledgment in the product documentation would be
+ *    appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and must not be
+ *    misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ *    distribution.
+ *
+ */
+
+#include    <basic.h>
+
+#include       <tad/tadfragment.h>
+
+#ifndef __TEXTEDITOR_TEXTFRAGMENT_H__
+#define __TEXTEDITOR_TEXTFRAGMENT_H__
+
+/* Functionality name: texteditor */
+/* Detail name: textfragment */
+struct texteditor_textfragment_t_ {
+       tadfragment_t base;
+};
+typedef struct texteditor_textfragment_t_ texteditor_textfragment_t;
+
+IMPORT W texteditor_textfragment_initialize(texteditor_textfragment_t *fragment);
+IMPORT VOID texteditor_textfragment_finalize(texteditor_textfragment_t *fragment);
+
+#endif