diff options
Diffstat (limited to 'apps/plugins/helloworld.c')
-rw-r--r-- | apps/plugins/helloworld.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/apps/plugins/helloworld.c b/apps/plugins/helloworld.c new file mode 100644 index 0000000000..ea347fbf79 --- /dev/null +++ b/apps/plugins/helloworld.c | |||
@@ -0,0 +1,48 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2002 Björn Stenberg | ||
11 | * | ||
12 | * All files in this archive are subject to the GNU General Public License. | ||
13 | * See the file COPYING in the source tree root for full license agreement. | ||
14 | * | ||
15 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
16 | * KIND, either express or implied. | ||
17 | * | ||
18 | ****************************************************************************/ | ||
19 | #include "plugin.h" | ||
20 | |||
21 | /* welcome to the example rockbox plugin */ | ||
22 | |||
23 | /* here is a global api struct pointer. while not strictly necessary, | ||
24 | it's nice not to have to pass the api pointer in all function calls | ||
25 | in the plugin */ | ||
26 | static struct plugin_api* rb; | ||
27 | |||
28 | /* this is the plugin entry point */ | ||
29 | enum plugin_status plugin_start(struct plugin_api* api, void* parameter) | ||
30 | { | ||
31 | /* this macro should be called as the first thing you do in the plugin. | ||
32 | it test that the api version and model the plugin was compiled for | ||
33 | matches the machine it is running on */ | ||
34 | TEST_PLUGIN_API(api); | ||
35 | |||
36 | /* if you don't use the parameter, you can do like | ||
37 | this to avoid the compiler warning about it */ | ||
38 | (void)parameter; | ||
39 | |||
40 | /* if you are using a global api pointer, don't forget to copy it! | ||
41 | otherwise you will get lovely "I04: IllInstr" errors... :-) */ | ||
42 | rb = api; | ||
43 | |||
44 | /* now go ahead and have fun! */ | ||
45 | rb->splash(HZ*2, 0, true, "Hello world!"); | ||
46 | |||
47 | return PLUGIN_OK; | ||
48 | } | ||