ConfigData: add constructors/destructors

This commit is contained in:
Max Kellermann
2013-01-30 22:00:32 +01:00
parent 2d63c26936
commit d9ea3082fb
8 changed files with 33 additions and 57 deletions

View File

@@ -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);