#include "gras_private.h" /* prototypes of this module */
-GRAS_LOG_NEW_DEFAULT_CATEGORY(config);
+GRAS_LOG_NEW_DEFAULT_SUBCATEGORY(config,tbx);
/* gras_cfgelm_t: the typedef corresponding to a config cell.
gras_cfgelm_t *res;
gras_error_t errcode;
- TRYCATCH(mismatch_error,gras_dict_retrieve((gras_dict_t*)cfg,name,(void**)&res));
+ TRYCATCH(mismatch_error,gras_dict_get((gras_dict_t*)cfg,name,(void**)&res));
if (errcode != mismatch_error) {
- WARNING1("Config elem %s registered twice.",name);
+ WARN1("Config elem %s registered twice.",name);
/* Will be removed by the insertion of the new one */
}
ERROR1("%d is an invalide type code",type);
}
- return gras_dict_insert((gras_dict_t*)cfg,name,res,&gras_cfgelm_free);
+ return gras_dict_set((gras_dict_t*)cfg,name,res,&gras_cfgelm_free);
}
/**
/* OUT */ gras_cfgelm_t **whereto){
gras_error_t errcode;
- TRYCATCH(mismatch_error,gras_dict_retrieve((gras_dict_t*)cfg,name,(void**)whereto));
+ TRYCATCH(mismatch_error,gras_dict_get((gras_dict_t*)cfg,name,(void**)whereto));
if (errcode == mismatch_error) {
ERROR1("No registered cell %s in this config set",
gras_cfgelm_t *cell;
gras_error_t errcode;
- TRYCATCH(mismatch_error,gras_dict_retrieve((gras_dict_t*)cfg,name,(void**)&cell));
+ TRYCATCH(mismatch_error,gras_dict_get((gras_dict_t*)cfg,name,(void**)&cell));
if (errcode == mismatch_error) {
ERROR1("Can't get the type of '%s' since this cell does not exist",
DEBUG2("name='%s';val='%s'",name,val);
- errcode=gras_dict_retrieve((gras_dict_t*)cfg,name,(void**)&cell);
+ errcode=gras_dict_get((gras_dict_t*)cfg,name,(void**)&cell);
switch (errcode) {
case no_error:
break;
gras_error_t errcode;
TRYCATCH(mismatch_error,
- gras_dict_retrieve((gras_dict_t*)cfg,name,(void**)&cell));
+ gras_dict_get((gras_dict_t*)cfg,name,(void**)&cell));
if (errcode == mismatch_error) {
ERROR1("Can't empty '%s' since this config element does not exist",
name);
TRY (gras_cfgelm_get(cfg,name,gras_cfgelm_int,&cell));
if (gras_dynar_length(cell->content) > 1) {
- WARNING2("You asked for the first value of the config element '%s', but there is %d values\n",
+ WARN2("You asked for the first value of the config element '%s', but there is %d values\n",
name, gras_dynar_length(cell->content));
}
TRY (gras_cfgelm_get(cfg,name,gras_cfgelm_double,&cell));
if (gras_dynar_length(cell->content) > 1) {
- WARNING2("You asked for the first value of the config element '%s', but there is %d values\n",
+ WARN2("You asked for the first value of the config element '%s', but there is %d values\n",
name, gras_dynar_length(cell->content));
}
TRY (gras_cfgelm_get(cfg,name,gras_cfgelm_string,&cell));
if (gras_dynar_length(cell->content) > 1) {
- WARNING2("You asked for the first value of the config element '%s', but there is %d values\n",
+ WARN2("You asked for the first value of the config element '%s', but there is %d values\n",
name, gras_dynar_length(cell->content));
}
TRY (gras_cfgelm_get(cfg,name,gras_cfgelm_host,&cell));
if (gras_dynar_length(cell->content) > 1) {
- WARNING2("You asked for the first value of the config element '%s', but there is %d values\n",
+ WARN2("You asked for the first value of the config element '%s', but there is %d values\n",
name, gras_dynar_length(cell->content));
}