X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fconf.h;h=fd48ea64feb515b8cd94cf34a2cb70aed687b7db;hb=fc7a1cc27751514e3175c9c50781d724a91d0f0e;hp=c3cf6f7d642fee59748e4acf92518e95067d32f4;hpb=01eaeb3c9fa60ae9c6e5b866acd9baef79622d99;p=meshlink diff --git a/src/conf.h b/src/conf.h index c3cf6f7d..fd48ea64 100644 --- a/src/conf.h +++ b/src/conf.h @@ -1,6 +1,9 @@ +#ifndef MESHLINK_CONF_H +#define MESHLINK_CONF_H + /* conf.h -- header for conf.c - Copyright (C) 2014 Guus Sliepen + Copyright (C) 2014, 2017 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -17,9 +20,6 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef __MESHLINK_CONF_H__ -#define __MESHLINK_CONF_H__ - #include "list.h" #include "meshlink_internal.h" #include "splay_tree.h" @@ -33,7 +33,7 @@ typedef struct config_t { extern void init_configuration(struct splay_tree_t **); extern void exit_configuration(struct splay_tree_t **); -extern config_t *new_config(void) __attribute__ ((__malloc__)); +extern config_t *new_config(void) __attribute__((__malloc__)); extern void free_config(config_t *); extern void config_add(struct splay_tree_t *, config_t *); extern config_t *lookup_config(struct splay_tree_t *, char *); @@ -52,6 +52,7 @@ extern bool write_config_file(const struct splay_tree_t *, const char *); extern bool read_server_config(struct meshlink_handle *mesh); extern bool read_host_config(struct meshlink_handle *mesh, struct splay_tree_t *, const char *); extern bool write_host_config(struct meshlink_handle *mesh, const struct splay_tree_t *, const char *); -extern bool append_config_file(struct meshlink_handle *mesh, const char *, const char *, const char *); +extern bool modify_config_file(struct meshlink_handle *mesh, const char *name, const char *key, const char *value, int trim); +extern bool append_config_file(struct meshlink_handle *mesh, const char *name, const char *key, const char *value); -#endif /* __MESHLINK_CONF_H__ */ +#endif