Skip to content

Commit

Permalink
topos_redis: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent f55112c commit f57e9aa
Show file tree
Hide file tree
Showing 3 changed files with 457 additions and 466 deletions.
43 changes: 19 additions & 24 deletions src/modules/topos_redis/topos_redis_mod.c
Expand Up @@ -38,35 +38,31 @@ MODULE_VERSION

str _topos_redis_serverid = STR_NULL;

static int mod_init(void);
static int mod_init(void);
static void mod_destroy(void);
static int child_init(int rank);
static int child_init(int rank);

tps_storage_api_t _tps_storage_api = {0};
topos_api_t _tps_api = {0};

ndb_redis_api_t _tps_redis_api = {0};

static cmd_export_t cmds[]={
{0, 0, 0, 0, 0, 0}
};
static cmd_export_t cmds[] = {{0, 0, 0, 0, 0, 0}};

static param_export_t params[]={
{"serverid", PARAM_STR, &_topos_redis_serverid},
{0, 0, 0}
};
static param_export_t params[] = {
{"serverid", PARAM_STR, &_topos_redis_serverid}, {0, 0, 0}};

struct module_exports exports = {
"topos_redis", /* module name */
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* exported functions */
params, /* exported parameters */
0, /* exported rpc functions */
0, /* exported pseudo-variables */
0, /* response handling function */
mod_init, /* module init function */
child_init, /* per child init function */
mod_destroy /* destroy function */
"topos_redis", /* module name */
DEFAULT_DLFLAGS, /* dlopen flags */
cmds, /* exported functions */
params, /* exported parameters */
0, /* exported rpc functions */
0, /* exported pseudo-variables */
0, /* response handling function */
mod_init, /* module init function */
child_init, /* per child init function */
mod_destroy /* destroy function */
};


Expand All @@ -75,12 +71,11 @@ struct module_exports exports = {
*/
static int mod_init(void)
{
if(_topos_redis_serverid.s==NULL
|| _topos_redis_serverid.len<=0) {
if(_topos_redis_serverid.s == NULL || _topos_redis_serverid.len <= 0) {
LM_ERR("invalid serverid parameter\n");
return -1;
}
if(topos_load_api(&_tps_api)<0) {
if(topos_load_api(&_tps_api) < 0) {
LM_ERR("failed to bind to topos module\n");
return -1;
}
Expand All @@ -99,7 +94,7 @@ static int mod_init(void)
_tps_storage_api.update_dialog = tps_redis_update_dialog;
_tps_storage_api.end_dialog = tps_redis_end_dialog;

if(_tps_api.set_storage_api(&_tps_storage_api)<0) {
if(_tps_api.set_storage_api(&_tps_storage_api) < 0) {
LM_ERR("failed to set topos storage api\n");
return -1;
}
Expand All @@ -112,7 +107,7 @@ static int mod_init(void)
static int child_init(int rank)
{
/* skip child init for non-worker process ranks */
if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN)
if(rank == PROC_INIT || rank == PROC_MAIN || rank == PROC_TCP_MAIN)
return 0;

return 0;
Expand Down

0 comments on commit f57e9aa

Please sign in to comment.