aboutsummaryrefslogtreecommitdiff
path: root/sway/config.c
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2016-12-01 19:38:36 -0500
committerDrew DeVault <sir@cmpwn.com>2016-12-01 19:38:36 -0500
commit44cc0ef125332f1fe3dad7d16ed0a78a25cd1974 (patch)
tree834a20ac4bc2982dda46f144932dd16177b04224 /sway/config.c
parent5831f7ab68a7166a492812d6301868541fdc9ae3 (diff)
Add config related code and initial headers
Diffstat (limited to 'sway/config.c')
-rw-r--r--sway/config.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sway/config.c b/sway/config.c
index 7d5999d8..a2f6a728 100644
--- a/sway/config.c
+++ b/sway/config.c
@@ -167,6 +167,16 @@ void free_pid_workspace(struct pid_workspace *pw) {
free(pw);
}
+void free_command_policy(struct command_policy *policy) {
+ free(policy->command);
+ free(policy);
+}
+
+void free_feature_policy(struct feature_policy *policy) {
+ free(policy->program);
+ free(policy);
+}
+
void free_config(struct sway_config *config) {
int i;
for (i = 0; i < config->symbols->length; ++i) {
@@ -211,6 +221,16 @@ void free_config(struct sway_config *config) {
}
list_free(config->output_configs);
+ for (i = 0; i < config->command_policies->length; ++i) {
+ free_command_policy(config->command_policies->items[i]);
+ }
+ list_free(config->command_policies);
+
+ for (i = 0; i < config->feature_policies->length; ++i) {
+ free_feature_policy(config->feature_policies->items[i]);
+ }
+ list_free(config->feature_policies);
+
list_free(config->active_bar_modifiers);
free_flat_list(config->config_chain);
free(config->font);
@@ -321,6 +341,10 @@ static void config_defaults(struct sway_config *config) {
config->border_colors.placeholder.child_border = 0x0C0C0CFF;
config->border_colors.background = 0xFFFFFFFF;
+
+ // Security
+ config->command_policies = create_list();
+ config->feature_policies = create_list();
}
static int compare_modifiers(const void *left, const void *right) {