diff options
Diffstat (limited to 'config.h')
-rw-r--r-- | config.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/config.h b/config.h new file mode 100644 index 0000000..d1f31a8 --- /dev/null +++ b/config.h @@ -0,0 +1,25 @@ +#pragma once + +#include <stdbool.h> + +/* Config file format + * + * Each line is a command that modifies some part of the configuration. A line + * starting with a '#' is a comment and is ignored. The available commands are + * as follows: + * - 'apikey': the line contains three space-separated fields: 'apikey', the + * key itself, and a permission bit vector (string of 0/1 characters). The + * permission bit vector has the following elements: + * 1. Whether 'sendat' is allowed. + */ + + +// Writes to stderr and exits on failure. +void config_init(const char *filename); + +// Permissions for a particular API key +struct apikey_perm { + bool sendat; +}; + +struct apikey_perm config_check_apikey(const char *apikey); |