Unify Framework Lib 1.6.0
config.h File Reference
#include <stdbool.h>

Go to the source code of this file.

Macros

#define CONFIG_KEY_MQTT_HOST   "mqtt.host"
 
#define CONFIG_KEY_MQTT_PORT   "mqtt.port"
 
#define CONFIG_KEY_MQTT_CLIENT_ID   "mqtt.client_id"
 
#define CONFIG_KEY_MQTT_CAFILE   "mqtt.cafile"
 
#define CONFIG_KEY_MQTT_CERTFILE   "mqtt.certfile"
 
#define CONFIG_KEY_MQTT_KEYFILE   "mqtt.keyfile"
 
#define CONFIG_KEY_LOG_LEVEL   "log.level"
 
#define CONFIG_KEY_LOG_TAG_LEVEL   "log.tag_level"
 
#define DEFAULT_CONFIG_PATH   "/etc/uic/uic.cfg"
 

Enumerations

enum  config_status_t {
  CONFIG_STATUS_OK = 0x0 , CONFIG_STATUS_NOK = 0x1 , CONFIG_STATUS_ERROR = 0x2 , CONFIG_STATUS_INVALID_TYPE = 0x4 ,
  CONFIG_STATUS_DOES_NOT_EXIST = 0x8 , CONFIG_STATUS_INFO_MESSAGE = 0x10
}
 

Functions

config_status_t config_add_string (const char *name, const char *help, const char *default_value)
 Add string configuration. More...
 
config_status_t config_add_int (const char *name, const char *help, int default_value)
 Add an integer configuration. More...
 
config_status_t config_add_double (const char *name, const char *help, double default_value)
 Add a double configuration. More...
 
config_status_t config_add_bool (const char *name, const char *help, bool default_value)
 Add a bool configuration. More...
 
config_status_t config_add_flag (const char *name, const char *help)
 Add a flag configuration. More...
 
config_status_t config_parse (int argc, char **argv, const char *version)
 Parse command line arguments to the config system. More...
 
config_status_t config_get_as_string (const char *name, const char **result)
 Get the config as a C-string. More...
 
config_status_t config_get_as_int (const char *name, int *result)
 Get the config as an integer. More...
 
config_status_t config_get_as_double (const char *name, double *result)
 Get the config as a double. More...
 
config_status_t config_get_as_bool (const char *name, bool *result)
 Get the config as bool. More...
 
config_status_t config_has_flag (const char *name)
 Check is a config paramter exists. More...
 
void config_reset ()
 Reset the config. More...