mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 05:27:01 +03:00
misc changes (see PR) (#340)
* misc changes (see PR) * macro only parsing
This commit is contained in:
@@ -9,11 +9,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef PARSE_WITH_FUNC
|
||||
#define PARSE_PARAM(S,P,C,V) config_parse_param_int(S,P,C,(int*)&V)
|
||||
#define PARSE_PARAM_STR(S,P,C,V,I) config_parse_param_str(S,P,C,V,I)
|
||||
#define PARSE_PARAM_FLOAT(S,P,C,V) config_parse_param_float(S,P,C,&V)
|
||||
#else
|
||||
#define PARSE_PARAM(S,P,C,V) do { \
|
||||
char *__p; \
|
||||
if ((__p = strcasestr(S, P)) && (__p = strchr(__p, C))) V = atoi(__p+1); \
|
||||
@@ -31,7 +26,7 @@ extern "C" {
|
||||
sscanf(__p,"%" #I "[^,]", V); \
|
||||
} \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
#define DECLARE_SET_DEFAULT(t) void config_set_default_## t (const char *key, t value);
|
||||
#define DECLARE_GET_NUM(t) esp_err_t config_get_## t (const char *key, t * value);
|
||||
#ifndef FREE_RESET
|
||||
@@ -55,9 +50,6 @@ bool config_has_changes();
|
||||
void config_commit_to_nvs();
|
||||
void config_start_timer();
|
||||
void config_init();
|
||||
bool config_parse_param_int(const char * config,const char * param, char delimiter,int * value);
|
||||
bool config_parse_param_float(const char * config,const char * param, char delimiter,double * value);
|
||||
bool config_parse_param_str(const char *source, const char *param, char delimiter, char *value, size_t value_size);
|
||||
void * config_alloc_get_default(nvs_type_t type, const char *key, void * default_value, size_t blob_size);
|
||||
void * config_alloc_get_str(const char *key, char *lead, char *fallback);
|
||||
cJSON * config_alloc_get_cjson(const char *key);
|
||||
@@ -65,7 +57,7 @@ esp_err_t config_set_cjson_str_and_free(const char *key, cJSON *value);
|
||||
esp_err_t config_set_cjson(const char *key, cJSON *value, bool free_cjson);
|
||||
void config_get_uint16t_from_str(const char *key, uint16_t *value, uint16_t default_value);
|
||||
void config_delete_key(const char *key);
|
||||
void config_set_default(nvs_type_t type, const char *key, void * default_value, size_t blob_size);
|
||||
void config_set_default(nvs_type_t type, const char *key, const void * default_value, size_t blob_size);
|
||||
void * config_alloc_get(nvs_type_t nvs_type, const char *key) ;
|
||||
bool wait_for_commit();
|
||||
char * config_alloc_get_json(bool bFormatted);
|
||||
|
||||
Reference in New Issue
Block a user