Description
in RecCore.*
int RecGetRecordInt(const char *name, RecInt * rec_int, bool lock = true); //------------------------------------------------------------------------- // RecGetRecordXXX //------------------------------------------------------------------------- int RecGetRecordInt(const char *name, RecInt *rec_int, bool lock) { int err; RecData data; if ((err = RecGetRecord_Xmalloc(name, RECD_INT, &data, lock)) == REC_ERR_OKAY) *rec_int = data.rec_int; return err; }
and there is something heavy used:
//------------------------------------------------------------------------- // Backwards Compatibility Items (REC_ prefix) //------------------------------------------------------------------------- #define REC_ReadConfigInt32(_var,_config_var_name) do { \ RecInt tmp = 0; \ RecGetRecordInt(_config_var_name, (RecInt*) &tmp); \ _var = (int32_t)tmp; \ } while (0) #define REC_ReadConfigInteger(_var,_config_var_name) do { \ RecInt tmp = 0; \ RecGetRecordInt(_config_var_name, &tmp); \ _var = tmp; \ } while (0)
and a real case, the REC_ReadConfigInteger is renamed to IOCORE_ReadConfigInteger:
RecInt cache_config_threads_per_disk = 12;
#define IOCORE_ReadConfigInteger REC_ReadConfigInteger
IOCORE_ReadConfigInteger(cache_config_threads_per_disk, "proxy.config.cache.threads_per_disk");
my question is, why it is so complex in all these renaming? why not just:
RecGetRecordInt("proxy.config.cache.threads_per_disk", &cache_config_threads_per_disk);
brief talk with Leif, we may need to cleanup the use of REC_*. make it a small task here
Attachments
Attachments
Issue Links
- is duplicated by
-
TS-1019 clean up access to librecords and remove wrappers
- Closed