LIRC libraries
LinuxInfraredRemoteControl
lirc_options.h
Go to the documentation of this file.
1 /****************************************************************************
2 ** options.h ***************************************************************
3 ****************************************************************************/
4 
12 #ifndef LIRC_OPTIONS
13 #define LIRC_OPTIONS
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 #include "lirc_log.h"
20 #include "ciniparser.h"
21 
22 /* Global options instance with all option values. */
23 extern dictionary* lirc_options;
24 
25 /* Set given option to value (always a string). */
26 void options_set_opt(const char* key, const char* value);
27 
29 loglevel_t options_set_loglevel(const char* optarg);
30 
38 loglevel_t options_get_app_loglevel(const char* app);
39 
40 /* Get a [string|int|boolean] option with 0 as default value. */
41 const char* options_getstring(const char* const key);
42 int options_getint(const char* const key);
43 int options_getboolean(const char* const key);
44 
45 
46 /*
47  * Set unset options using values in defaults list.
48  * Arguments:
49  * - defaults: NULL-terminated list of key, value [, key, value]...
50  */
51 void options_add_defaults(const char* const defaults[]);
52 
53 
54 /*
55  * Parse global option file and command line. On exit, all values
56  * @ingroup private_api
57  * are set, possibly to defaults.
58  * Arguments:
59  * - argc, argv; As handled to main()
60  * - options-file: Path to options file. If NULL, the default one
61  * will be used.
62  * - options_load: Function called as options_load(argc, argv, path).
63  * argc and argv are as given to options_init; path is the absolute
64  * path to the configuration file.
65  *
66  */
67 void options_load(int argc,
68  char** const argv,
69  const char* options_file,
70  void (*options_load)(int, char** const));
71 
72 
73 /* Reset options to pristine state. */
74 void options_unload(void);
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #endif
Logging functionality.
loglevel_t options_get_app_loglevel(const char *app)
Return loglevel based on (falling priority)
Definition: lirc_options.c:160
loglevel_t
The defined loglevels.
Definition: lirc_log.h:36
loglevel_t options_set_loglevel(const char *optarg)
Parse and store a loglevel, returning value (possibly LIRC_BADLEVEL).
Definition: lirc_options.c:40
Dictionary object.
Definition: dictionary.h:67
Parser for ini files.