-extern config_t *config;
-extern int debug_lvl;
-extern int timeout;
-extern int upstreamindex;
-extern int sighup;
-extern char *configfilename;
+extern void init_configuration(splay_tree_t **config_tree);
+extern void exit_configuration(splay_tree_t **config_tree);
+extern config_t *new_config(void) __attribute__((__malloc__));
+extern void free_config(config_t *config);
+extern void config_add(splay_tree_t *config_tree, config_t *config);
+extern config_t *lookup_config(splay_tree_t *config_tree, char *variable);
+extern config_t *lookup_config_next(splay_tree_t *config_tree, const config_t *config);
+extern bool get_config_bool(const config_t *config, bool *result);
+extern bool get_config_int(const config_t *config, int *result);
+extern bool get_config_string(const config_t *config, char **result);
+extern bool get_config_address(const config_t *config, struct addrinfo **result);
+extern bool get_config_subnet(const config_t *config, struct subnet_t **result);