X-Git-Url: http://git.itanic.dy.fi/?p=log-plotter;a=blobdiff_plain;f=config.h;fp=config.h;h=851c7d42ca7d8fbed65c58e791577f115d3188bc;hp=37437ea1a52cdf4f262577387c60fe3216e5a11e;hb=6100946ec13ca780c199b5202995c03c963dede1;hpb=f4695fc44c2d2ea6a2ace36dbddbc7ca3791d284 diff --git a/config.h b/config.h index 37437ea..851c7d4 100644 --- a/config.h +++ b/config.h @@ -1,6 +1,17 @@ #ifndef _CONFIG_H_ #define _CONFIG_H_ +struct variable_value { + char *name; + int type; + void *ptr; +}; + +enum { + TYPE_INT, + TYPE_STRING, +}; + struct plotter_config { char *charger_name; @@ -11,10 +22,15 @@ struct plotter_config { int baudrate; char *log_path; char *config_file_path; + + struct variable_value *variables; }; int read_args(int argc, char *argv[], struct plotter_config *cfg); int populate_config_data_from_file(const char *path, struct plotter_config *cfg); +int replace_variables_with_values(char *str, size_t len, + const struct plotter_config *cfg); + #endif