Add new config parser
The current config parser, parses the ini file and pulls out the values specified by the struct config_section passed to parse_config_file() and then throw the rest away. This means that every place we want to get info out of the ini file, we have to parse the whole thing again. It's not a big overhead, but it's also not a convenient API. This patch adds a parser that parses the ini file to a data structure and puts that in weston_compositor->config along with API to query comfig keys from the data structure. The old parser is still available, but we'll transition to the new approach over the next few commits.
This commit is contained in:
@@ -2790,6 +2790,7 @@ weston_compositor_init(struct weston_compositor *ec,
|
||||
memset(&xkb_names, 0, sizeof(xkb_names));
|
||||
|
||||
ec->config_fd = config_fd;
|
||||
ec->config = weston_config_parse(config_fd);
|
||||
parse_config_file(config_fd, cs, ARRAY_LENGTH(cs), ec);
|
||||
|
||||
ec->wl_display = display;
|
||||
|
||||
@@ -498,6 +498,7 @@ struct weston_compositor {
|
||||
|
||||
struct wl_display *wl_display;
|
||||
struct weston_shell_interface shell_interface;
|
||||
struct weston_config *config;
|
||||
|
||||
struct wl_signal activate_signal;
|
||||
struct wl_signal kill_signal;
|
||||
|
||||
Reference in New Issue
Block a user