discover/discover-server: Restrict clients based on uid
[petitboot] / discover / parser-utils.h
1 #ifndef PARSER_UTILS_H
2 #define PARSER_UTILS_H
3
4 #include "types/types.h"
5 #include "parser.h"
6
7 #define streq(a,b) (!strcasecmp((a),(b)))
8
9 #define artwork_pathname(file) (PKG_SHARE_DIR "/artwork/" file)
10
11 #define __parser_funcname(_n) __register_parser ## _ ## _n
12 #define  _parser_funcname(_n) __parser_funcname(_n)
13
14 #define register_parser(_parser)                                        \
15         static  __attribute__((constructor))                            \
16                 void _parser_funcname(__COUNTER__)(void)                \
17         {                                                               \
18                 __register_parser(&_parser);                            \
19         }
20
21 void __register_parser(struct parser *parser);
22
23 void device_add_boot_option(struct device *device,
24                 struct boot_option *boot_option);
25
26 const char *generic_icon_file(enum generic_icon_type type);
27
28 enum generic_icon_type guess_device_type(struct discover_context *ctx);
29
30 #endif /* PARSER_UTILS_H */