xref: /haiku/headers/os/drivers/driver_settings.h (revision 1e36cfc2721ef13a187c6f7354dc9cbc485e89d3)
1 #ifndef _DRIVER_SETTINGS_H
2 #define _DRIVER_SETTINGS_H
3 
4 
5 #include <OS.h>
6 
7 
8 typedef struct driver_parameter {
9 	char *name;
10 	int	value_count;
11 	char **values;
12 	int parameter_count;
13 	struct driver_parameter *parameters;
14 } driver_parameter;
15 
16 typedef struct driver_settings {
17 	int parameter_count;
18 	struct driver_parameter *parameters;
19 } driver_settings;
20 
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 extern void			*load_driver_settings(const char *driverName);
27 extern status_t		unload_driver_settings(void *handle);
28 
29 extern void			*parse_driver_settings_string(const char *settingsString);
30 extern status_t		get_driver_settings_string(void *_handle, char *buffer,
31 						size_t *_bufferSize, bool flat);
32 extern status_t		delete_driver_settings(void *handle);
33 
34 extern const char	*get_driver_parameter(void *handle, const char *key,
35 						const char *unknownValue,	/* key not present */
36 						const char *noargValue);	/* key has no value */
37 extern bool			get_driver_boolean_parameter(void *handle, const char *key,
38 						bool unknownValue, bool noargValue);
39 
40 extern const driver_settings *get_driver_settings(void *handle);
41 
42 /* Pass this in as drivername to access safe mode settings */
43 #define B_SAFEMODE_DRIVER_SETTINGS	"/safemode/"
44 
45 /* Pass this as the key value to check if safe mode is enabled */
46 #define B_SAFEMODE_SAFE_MODE		"safemode"
47 
48 #ifdef __cplusplus
49 }
50 #endif
51 
52 #endif	/* _DRIVER_SETTINGS_H */
53