add directory and files for bchan HMI control library.
@@ -0,0 +1,55 @@ | ||
1 | +/* | |
2 | + * test_texteditor_textfragment.c | |
3 | + * | |
4 | + * Copyright (c) 2013 project bchan | |
5 | + * | |
6 | + * This software is provided 'as-is', without any express or implied | |
7 | + * warranty. In no event will the authors be held liable for any damages | |
8 | + * arising from the use of this software. | |
9 | + * | |
10 | + * Permission is granted to anyone to use this software for any purpose, | |
11 | + * including commercial applications, and to alter it and redistribute it | |
12 | + * freely, subject to the following restrictions: | |
13 | + * | |
14 | + * 1. The origin of this software must not be misrepresented; you must not | |
15 | + * claim that you wrote the original software. If you use this software | |
16 | + * in a product, an acknowledgment in the product documentation would be | |
17 | + * appreciated but is not required. | |
18 | + * | |
19 | + * 2. Altered source versions must be plainly marked as such, and must not be | |
20 | + * misrepresented as being the original software. | |
21 | + * | |
22 | + * 3. This notice may not be removed or altered from any source | |
23 | + * distribution. | |
24 | + * | |
25 | + */ | |
26 | + | |
27 | +#include "test_control.h" | |
28 | + | |
29 | +#include "texteditor_textfragment.h" | |
30 | + | |
31 | +#include <basic.h> | |
32 | +#include <bstdio.h> | |
33 | +#include <bstdlib.h> | |
34 | +#include <bstring.h> | |
35 | + | |
36 | +#include <unittest_driver.h> | |
37 | + | |
38 | +LOCAL UNITTEST_RESULT test_texteditor_textfragment_1() | |
39 | +{ | |
40 | + texteditor_textfragment_t fragment; | |
41 | + W err; | |
42 | + | |
43 | + err = texteditor_textfragment_initialize(&fragment); | |
44 | + if (err < 0) { | |
45 | + return UNITTEST_RESULT_FAIL; | |
46 | + } | |
47 | + texteditor_textfragment_finalize(&fragment); | |
48 | + | |
49 | + return UNITTEST_RESULT_PASS; | |
50 | +} | |
51 | + | |
52 | +EXPORT VOID test_texteditor_textfragment_main(unittest_driver_t *driver) | |
53 | +{ | |
54 | + UNITTEST_DRIVER_REGIST(driver, test_texteditor_textfragment_1); | |
55 | +} |
@@ -0,0 +1,49 @@ | ||
1 | +/* | |
2 | + * texteditor_textfragment.c | |
3 | + * | |
4 | + * Copyright (c) 2013 project bchan | |
5 | + * | |
6 | + * This software is provided 'as-is', without any express or implied | |
7 | + * warranty. In no event will the authors be held liable for any damages | |
8 | + * arising from the use of this software. | |
9 | + * | |
10 | + * Permission is granted to anyone to use this software for any purpose, | |
11 | + * including commercial applications, and to alter it and redistribute it | |
12 | + * freely, subject to the following restrictions: | |
13 | + * | |
14 | + * 1. The origin of this software must not be misrepresented; you must not | |
15 | + * claim that you wrote the original software. If you use this software | |
16 | + * in a product, an acknowledgment in the product documentation would be | |
17 | + * appreciated but is not required. | |
18 | + * | |
19 | + * 2. Altered source versions must be plainly marked as such, and must not be | |
20 | + * misrepresented as being the original software. | |
21 | + * | |
22 | + * 3. This notice may not be removed or altered from any source | |
23 | + * distribution. | |
24 | + * | |
25 | + */ | |
26 | + | |
27 | +#include "texteditor_textfragment.h" | |
28 | + | |
29 | +#include <bstdio.h> | |
30 | + | |
31 | +#include <tad/tadfragment.h> | |
32 | + | |
33 | +#ifdef BCHAN_CONFIG_DEBUG | |
34 | +# define DP(arg) printf arg | |
35 | +# define DP_ER(msg, err) printf("%s (%d/%x)\n", msg, err>>16, err) | |
36 | +#else | |
37 | +# define DP(arg) /**/ | |
38 | +# define DP_ER(msg, err) /**/ | |
39 | +#endif | |
40 | + | |
41 | +EXPORT W texteditor_textfragment_initialize(texteditor_textfragment_t *fragment) | |
42 | +{ | |
43 | + return tadfragment_initialize(&fragment->base); | |
44 | +} | |
45 | + | |
46 | +EXPORT VOID texteditor_textfragment_finalize(texteditor_textfragment_t *fragment) | |
47 | +{ | |
48 | + tadfragment_finalize(&fragment->base); | |
49 | +} |
@@ -0,0 +1,35 @@ | ||
1 | +/* | |
2 | + * test_control.h | |
3 | + * | |
4 | + * Copyright (c) 2013 project bchan | |
5 | + * | |
6 | + * This software is provided 'as-is', without any express or implied | |
7 | + * warranty. In no event will the authors be held liable for any damages | |
8 | + * arising from the use of this software. | |
9 | + * | |
10 | + * Permission is granted to anyone to use this software for any purpose, | |
11 | + * including commercial applications, and to alter it and redistribute it | |
12 | + * freely, subject to the following restrictions: | |
13 | + * | |
14 | + * 1. The origin of this software must not be misrepresented; you must not | |
15 | + * claim that you wrote the original software. If you use this software | |
16 | + * in a product, an acknowledgment in the product documentation would be | |
17 | + * appreciated but is not required. | |
18 | + * | |
19 | + * 2. Altered source versions must be plainly marked as such, and must not be | |
20 | + * misrepresented as being the original software. | |
21 | + * | |
22 | + * 3. This notice may not be removed or altered from any source | |
23 | + * distribution. | |
24 | + * | |
25 | + */ | |
26 | + | |
27 | +#include <basic.h> | |
28 | +#include <unittest_driver.h> | |
29 | + | |
30 | +#ifndef __TEST_CONTROL_H__ | |
31 | +#define __TEST_CONTROL_H__ | |
32 | + | |
33 | +IMPORT VOID test_texteditor_textfragment_main(unittest_driver_t *driver); | |
34 | + | |
35 | +#endif |
@@ -0,0 +1,44 @@ | ||
1 | +/* | |
2 | + * texteditor_textfragment.h | |
3 | + * | |
4 | + * Copyright (c) 2013 project bchan | |
5 | + * | |
6 | + * This software is provided 'as-is', without any express or implied | |
7 | + * warranty. In no event will the authors be held liable for any damages | |
8 | + * arising from the use of this software. | |
9 | + * | |
10 | + * Permission is granted to anyone to use this software for any purpose, | |
11 | + * including commercial applications, and to alter it and redistribute it | |
12 | + * freely, subject to the following restrictions: | |
13 | + * | |
14 | + * 1. The origin of this software must not be misrepresented; you must not | |
15 | + * claim that you wrote the original software. If you use this software | |
16 | + * in a product, an acknowledgment in the product documentation would be | |
17 | + * appreciated but is not required. | |
18 | + * | |
19 | + * 2. Altered source versions must be plainly marked as such, and must not be | |
20 | + * misrepresented as being the original software. | |
21 | + * | |
22 | + * 3. This notice may not be removed or altered from any source | |
23 | + * distribution. | |
24 | + * | |
25 | + */ | |
26 | + | |
27 | +#include <basic.h> | |
28 | + | |
29 | +#include <tad/tadfragment.h> | |
30 | + | |
31 | +#ifndef __TEXTEDITOR_TEXTFRAGMENT_H__ | |
32 | +#define __TEXTEDITOR_TEXTFRAGMENT_H__ | |
33 | + | |
34 | +/* Functionality name: texteditor */ | |
35 | +/* Detail name: textfragment */ | |
36 | +struct texteditor_textfragment_t_ { | |
37 | + tadfragment_t base; | |
38 | +}; | |
39 | +typedef struct texteditor_textfragment_t_ texteditor_textfragment_t; | |
40 | + | |
41 | +IMPORT W texteditor_textfragment_initialize(texteditor_textfragment_t *fragment); | |
42 | +IMPORT VOID texteditor_textfragment_finalize(texteditor_textfragment_t *fragment); | |
43 | + | |
44 | +#endif |