diff options
Diffstat (limited to 'apps/plugins/lib/button_helper.h')
-rw-r--r-- | apps/plugins/lib/button_helper.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/apps/plugins/lib/button_helper.h b/apps/plugins/lib/button_helper.h new file mode 100644 index 0000000000..1197b172b0 --- /dev/null +++ b/apps/plugins/lib/button_helper.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2021 William Wilgus | ||
11 | * | ||
12 | * | ||
13 | * This program is free software; you can redistribute it and/or | ||
14 | * modify it under the terms of the GNU General Public License | ||
15 | * as published by the Free Software Foundation; either version 2 | ||
16 | * of the License, or (at your option) any later version. | ||
17 | * | ||
18 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
19 | * KIND, either express or implied. | ||
20 | * | ||
21 | ****************************************************************************/ | ||
22 | #ifndef _BUTTON_HELPER_H_ | ||
23 | #define _BUTTON_HELPER_H_ | ||
24 | struct available_button | ||
25 | { | ||
26 | const char* name; | ||
27 | unsigned long value; | ||
28 | }; | ||
29 | |||
30 | /* *available_buttons is holding a pointer to the first element of an array | ||
31 | * of struct available_button it is set up in such a way due to the file being | ||
32 | * generated at compile time you can still call it as such though | ||
33 | * eg available_buttons[0] or available_buttons[available_button_count] (NULL SENTINEL, 0)*/ | ||
34 | |||
35 | extern const struct available_button * const available_buttons; | ||
36 | extern const int available_button_count; | ||
37 | int get_button_names(char *buf, size_t bufsz, unsigned long button); | ||
38 | #endif /* _BUTTON_HELPER_H_ */ | ||