summaryrefslogtreecommitdiff
path: root/config-parse.h
diff options
context:
space:
mode:
authorDavid Härdeman <david@hardeman.nu>2020-06-22 12:43:27 +0200
committerDavid Härdeman <david@hardeman.nu>2020-06-22 12:43:27 +0200
commit6a0ce89e1110cb49ed1c00bec2d96073b9378cb3 (patch)
tree02fb998ad1a271ac8e18ba71f38ef93ad057ce28 /config-parse.h
parent2fe1271d25eae0f30401fb52330db3a324504952 (diff)
config-parser is a better name
Diffstat (limited to 'config-parse.h')
-rw-r--r--config-parse.h59
1 files changed, 0 insertions, 59 deletions
diff --git a/config-parse.h b/config-parse.h
deleted file mode 100644
index c8d10dc..0000000
--- a/config-parse.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef fooconfigparsehfoo
-#define fooconfigparsehfoo
-
-#define _GNU_SOURCE
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netdb.h>
-#include <signal.h>
-
-enum cfg_value_type {
- CFG_VAL_TYPE_INVALID,
- CFG_VAL_TYPE_STRING,
- CFG_VAL_TYPE_UINT16,
- CFG_VAL_TYPE_ADDRS,
- CFG_VAL_TYPE_ASYNC_ADDRS,
- CFG_VAL_TYPE_BOOL,
-};
-
-struct dns_async;
-
-typedef void (dns_cb_t)(struct dns_async *);
-
-struct dns_async {
- char name[FQDN_STR_LEN + 1];
- char port[PORT_STR_LEN + 1];
- struct addrinfo req;
- struct gaicb gcb;
- struct sigevent sev;
- dns_cb_t *cb;
- void *priv;
- struct list_head list;
-};
-
-struct cfg_key_value_map {
- const char *key_name;
- int key_value;
- enum cfg_value_type value_type;
-};
-
-struct cfg_value {
- enum cfg_value_type type;
- union {
- const char *str;
- uint16_t uint16;
- struct list_head saddrs;
- struct dns_async *dns_async;
- bool boolean;
- };
-};
-
-bool config_parse_line(const char *filename, char **buf,
- struct cfg_key_value_map *kvmap,
- int *rkey, const char **rkeyname,
- struct cfg_value *rvalue);
-
-bool config_parse_header(const char *filename,
- const char *title, char **buf);
-
-#endif