Add minimal config subsystem

This commit is contained in:
emersion 2017-12-05 10:40:55 +01:00
parent 83b4c0648d
commit 90f7f1a0e6
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
11 changed files with 1091 additions and 19 deletions

18
sway/security.c Normal file
View file

@ -0,0 +1,18 @@
#define _XOPEN_SOURCE 700
#include <stdlib.h>
#include <string.h>
#include "sway/security.h"
struct command_policy *alloc_command_policy(const char *command) {
struct command_policy *policy = malloc(sizeof(struct command_policy));
if (!policy) {
return NULL;
}
policy->command = strdup(command);
if (!policy->command) {
free(policy);
return NULL;
}
policy->context = 0;
return policy;
}