浏览代码

topos_redis: clang-format for coherent indentation and coding style

Victor Seva 2 年之前
父节点
当前提交
f57e9aa15b

+ 19 - 24
src/modules/topos_redis/topos_redis_mod.c

@@ -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 */
 };
 
 
@@ -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;
 	}
@@ -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;
 	}
@@ -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;

文件差异内容过多而无法显示
+ 261 - 267
src/modules/topos_redis/topos_redis_storage.c


+ 6 - 6
src/modules/topos_redis/topos_redis_storage.h

@@ -36,13 +36,13 @@ int tps_redis_insert_dialog(tps_data_t *td);
 int tps_redis_clean_dialogs(void);
 int tps_redis_insert_branch(tps_data_t *td);
 int tps_redis_clean_branches(void);
-int tps_redis_load_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
-		uint32_t mode);
+int tps_redis_load_branch(
+		sip_msg_t *msg, tps_data_t *md, tps_data_t *sd, uint32_t mode);
 int tps_redis_load_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd);
-int tps_redis_update_branch(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
-		uint32_t mode);
-int tps_redis_update_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd,
-		uint32_t mode);
+int tps_redis_update_branch(
+		sip_msg_t *msg, tps_data_t *md, tps_data_t *sd, uint32_t mode);
+int tps_redis_update_dialog(
+		sip_msg_t *msg, tps_data_t *md, tps_data_t *sd, uint32_t mode);
 int tps_redis_end_dialog(sip_msg_t *msg, tps_data_t *md, tps_data_t *sd);
 
 #endif

部分文件因为文件数量过多而无法显示