From d9ea3082fb608935c72620e272f4b3e74b2c3a44 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 30 Jan 2013 22:00:32 +0100 Subject: ConfigData: add constructors/destructors --- src/ConfigData.hxx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/ConfigData.hxx') diff --git a/src/ConfigData.hxx b/src/ConfigData.hxx index b71c0a9e..36e3ea33 100644 --- a/src/ConfigData.hxx +++ b/src/ConfigData.hxx @@ -45,6 +45,10 @@ struct block_param { * this option yet. */ mutable bool used; + + gcc_nonnull_all + block_param(const char *_name, const char *_value, int _line=-1) + :name(_name), value(_value), line(_line), used(false) {} }; #endif @@ -61,6 +65,11 @@ struct config_param { * this option yet. */ bool used; + + config_param(int _line=-1) + :value(nullptr), line(_line), used(false) {} + config_param(const char *_value, int _line=-1); + ~config_param(); #endif }; @@ -76,13 +85,6 @@ struct ConfigData { extern "C" { #endif -gcc_malloc -struct config_param * -config_new_param(const char *value, int line); - -void -config_param_free(struct config_param *param); - void config_add_block_param(struct config_param * param, const char *name, const char *value, int line); -- cgit v1.2.3