Browse code

app_lua: cleanup of indentation

Daniel-Constantin Mierla authored on 11/04/2016 10:53:22
Showing 7 changed files
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *
... ...
@@ -77,7 +77,7 @@ static sr_lua_script_ver_t *sr_lua_script_ver = NULL;
77 77
 int lua_sr_alloc_script_ver(void)
78 78
 {
79 79
 	int size = _sr_L_env.nload;
80
-	
80
+
81 81
 	sr_lua_script_ver = (sr_lua_script_ver_t *) shm_malloc(sizeof(sr_lua_script_ver_t));
82 82
 	if(sr_lua_script_ver==NULL)
83 83
 	{
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *
... ...
@@ -180,7 +180,7 @@ static rls_api_t _lua_rlsb;
180 180
 static alias_db_api_t _lua_alias_dbb;
181 181
 
182 182
 /**
183
- * msilo 
183
+ * msilo
184 184
  */
185 185
 static msilo_api_t _lua_msilob;
186 186
 
... ...
@@ -242,7 +242,7 @@ static int lua_sr_sl_send_reply (lua_State *L)
242 242
 
243 243
 	if(code<100 || code>=800)
244 244
 		return app_lua_return_error(L);
245
-	
245
+
246 246
 	txt.s = (char*)lua_tostring(L, -1);
247 247
 	if(txt.s==NULL || env_L->msg==NULL)
248 248
 		return app_lua_return_error(L);
... ...
@@ -2292,7 +2292,7 @@ static int lua_sr_pres_auth_status(lua_State *L)
2292 2292
 	sr_lua_env_t *env_L;
2293 2293
 
2294 2294
 	env_L = sr_lua_env_get();
2295
-	
2295
+
2296 2296
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_PRESENCE))
2297 2297
 	{
2298 2298
 		LM_WARN("weird: presence function executed but module not registered\n");
... ...
@@ -2315,7 +2315,7 @@ static int lua_sr_pres_auth_status(lua_State *L)
2315 2315
 	param[0].len = strlen(param[0].s);
2316 2316
 	param[1].s = (char *) lua_tostring(L, -1);
2317 2317
 	param[1].len = strlen(param[1].s);
2318
-	
2318
+
2319 2319
 	ret = _lua_presenceb.pres_auth_status(env_L->msg, param[0], param[1]);
2320 2320
 	return app_lua_return_int(L, ret);
2321 2321
 }
... ...
@@ -2329,7 +2329,7 @@ static int lua_sr_pres_handle_publish(lua_State *L)
2329 2329
 	sr_lua_env_t *env_L;
2330 2330
 
2331 2331
 	env_L = sr_lua_env_get();
2332
-	
2332
+
2333 2333
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_PRESENCE))
2334 2334
 	{
2335 2335
 		LM_WARN("weird: presence function executed but module not registered\n");
... ...
@@ -2361,7 +2361,7 @@ static int lua_sr_pres_handle_subscribe(lua_State *L)
2361 2361
 	sr_lua_env_t *env_L;
2362 2362
 
2363 2363
 	env_L = sr_lua_env_get();
2364
-	
2364
+
2365 2365
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_PRESENCE))
2366 2366
 	{
2367 2367
 		LM_WARN("weird: presence function executed but module not registered\n");
... ...
@@ -2419,7 +2419,7 @@ static int lua_sr_pres_check_basic(lua_State *L)
2419 2419
 	sr_lua_env_t *env_L;
2420 2420
 
2421 2421
 	env_L = sr_lua_env_get();
2422
-	
2422
+
2423 2423
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_PRESENCE_XML))
2424 2424
 	{
2425 2425
 		LM_WARN("weird: presence_xml function executed but module not registered\n");
... ...
@@ -2442,7 +2442,7 @@ static int lua_sr_pres_check_basic(lua_State *L)
2442 2442
 	param[0].len = strlen(param[0].s);
2443 2443
 	param[1].s = (char *) lua_tostring(L, -1);
2444 2444
 	param[1].len = strlen(param[1].s);
2445
-	
2445
+
2446 2446
 	ret = _lua_presence_xmlb.pres_check_basic(env_L->msg, param[0], param[1]);
2447 2447
 	return app_lua_return_int(L, ret);
2448 2448
 }
... ...
@@ -2457,7 +2457,7 @@ static int lua_sr_pres_check_activities(lua_State *L)
2457 2457
 	sr_lua_env_t *env_L;
2458 2458
 
2459 2459
 	env_L = sr_lua_env_get();
2460
-	
2460
+
2461 2461
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_PRESENCE_XML))
2462 2462
 	{
2463 2463
 		LM_WARN("weird: presence_xml function executed but module not registered\n");
... ...
@@ -2480,7 +2480,7 @@ static int lua_sr_pres_check_activities(lua_State *L)
2480 2480
 	param[0].len = strlen(param[0].s);
2481 2481
 	param[1].s = (char *) lua_tostring(L, -1);
2482 2482
 	param[1].len = strlen(param[1].s);
2483
-	
2483
+
2484 2484
 	ret = _lua_presence_xmlb.pres_check_activities(env_L->msg, param[0], param[1]);
2485 2485
 	return app_lua_return_int(L, ret);
2486 2486
 }
... ...
@@ -2504,7 +2504,7 @@ static int lua_sr_textops_is_privacy(lua_State *L)
2504 2504
 	sr_lua_env_t *env_L;
2505 2505
 
2506 2506
 	env_L = sr_lua_env_get();
2507
-	
2507
+
2508 2508
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_TEXTOPS))
2509 2509
 	{
2510 2510
 		LM_WARN("weird: textops function executed but module not registered\n");
... ...
@@ -2525,7 +2525,7 @@ static int lua_sr_textops_is_privacy(lua_State *L)
2525 2525
 
2526 2526
 	param[0].s = (char *) lua_tostring(L, -1);
2527 2527
 	param[0].len = strlen(param[0].s);
2528
-	
2528
+
2529 2529
 	ret = _lua_textopsb.is_privacy(env_L->msg, &param[0]);
2530 2530
 	return app_lua_return_int(L, ret);
2531 2531
 }
... ...
@@ -2547,7 +2547,7 @@ static int lua_sr_pua_usrloc_set_publish(lua_State *L)
2547 2547
 	sr_lua_env_t *env_L;
2548 2548
 
2549 2549
 	env_L = sr_lua_env_get();
2550
-	
2550
+
2551 2551
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_PUA_USRLOC))
2552 2552
 	{
2553 2553
 		LM_WARN("weird: pua_usrloc function executed but module not registered\n");
... ...
@@ -2587,7 +2587,7 @@ static int lua_sr_siputils_has_totag(lua_State *L)
2587 2587
 	sr_lua_env_t *env_L;
2588 2588
 
2589 2589
 	env_L = sr_lua_env_get();
2590
-	
2590
+
2591 2591
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_SIPUTILS))
2592 2592
 	{
2593 2593
 		LM_WARN("weird: siputils function executed but module not registered\n");
... ...
@@ -2620,7 +2620,7 @@ static int lua_sr_siputils_is_uri_user_e164(lua_State *L)
2620 2620
 	str param[1];
2621 2621
 
2622 2622
 	env_L = sr_lua_env_get();
2623
-	
2623
+
2624 2624
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_SIPUTILS))
2625 2625
 	{
2626 2626
 		LM_WARN("weird: siputils function executed but module not registered\n");
... ...
@@ -2641,7 +2641,7 @@ static int lua_sr_siputils_is_uri_user_e164(lua_State *L)
2641 2641
 
2642 2642
 	param[0].s = (char *) lua_tostring(L, -1);
2643 2643
 	param[0].len = strlen(param[0].s);
2644
-	
2644
+
2645 2645
 	ret = _lua_siputilsb.is_uri_user_e164(&param[0]);
2646 2646
 	if (ret < 0)
2647 2647
 		return app_lua_return_false(L);
... ...
@@ -2667,7 +2667,7 @@ static int lua_sr_rls_handle_subscribe(lua_State *L)
2667 2667
 	sr_lua_env_t *env_L;
2668 2668
 
2669 2669
 	env_L = sr_lua_env_get();
2670
-	
2670
+
2671 2671
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_RLS))
2672 2672
 	{
2673 2673
 		LM_WARN("weird: rls function executed but module not registered\n");
... ...
@@ -2714,7 +2714,7 @@ static int lua_sr_rls_handle_notify(lua_State *L)
2714 2714
 	sr_lua_env_t *env_L;
2715 2715
 
2716 2716
 	env_L = sr_lua_env_get();
2717
-	
2717
+
2718 2718
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_RLS))
2719 2719
 	{
2720 2720
 		LM_WARN("weird: rls function executed but module not registered\n");
... ...
@@ -2756,7 +2756,7 @@ static int lua_sr_alias_db_lookup(lua_State *L)
2756 2756
 	sr_lua_env_t *env_L;
2757 2757
 
2758 2758
 	env_L = sr_lua_env_get();
2759
-	
2759
+
2760 2760
 	if(!(_sr_lua_exp_reg_mods&SR_LUA_EXP_MOD_ALIAS_DB))
2761 2761
 	{
2762 2762
 		LM_WARN("weird: alias_db function executed but module not registered\n");
... ...
@@ -2777,7 +2777,7 @@ static int lua_sr_alias_db_lookup(lua_State *L)
2777 2777
 
2778 2778
 	param[0].s = (char *) lua_tostring(L, -1);
2779 2779
 	param[0].len = strlen(param[0].s);
2780
-	
2780
+
2781 2781
 	ret = _lua_alias_dbb.alias_db_lookup(env_L->msg, param[0]);
2782 2782
 	return app_lua_return_int(L, ret);
2783 2783
 }
... ...
@@ -2920,7 +2920,7 @@ static int lua_sr_uac_replace_x(lua_State *L, int htype)
2920 2920
 		param[0].len = 0;
2921 2921
 		param[1].s = (char *) lua_tostring(L, -1);
2922 2922
 		param[1].len = strlen(param[1].s);
2923
-	
2923
+
2924 2924
 	}
2925 2925
 	else if (lua_gettop(L) == 2)
2926 2926
 	{
... ...
@@ -3148,14 +3148,14 @@ static int lua_sr_mq_add(lua_State *L)
3148 3148
 		LM_WARN("invalid number of parameters from Lua\n");
3149 3149
 		return app_lua_return_error(L);
3150 3150
 	}
3151
-	
3151
+
3152 3152
 	param[0].s = (char *) lua_tostring(L, -3);
3153 3153
 	param[0].len = strlen(param[0].s);
3154 3154
 	param[1].s = (char *) lua_tostring(L, -2);
3155 3155
 	param[1].len = strlen(param[1].s);
3156 3156
 	param[2].s = (char *) lua_tostring(L, -1);
3157 3157
 	param[2].len = strlen(param[2].s);
3158
-	
3158
+
3159 3159
 	ret = _lua_mqb.add(&param[0], &param[1], &param[2]);
3160 3160
 	return app_lua_return_int(L, ret);
3161 3161
 }
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *
... ...
@@ -117,7 +117,7 @@ static int mod_init(void)
117 117
 	if(lua_sr_init_mod()<0)
118 118
 		return -1;
119 119
 
120
-	if(app_lua_init_rpc()<0)  
120
+	if(app_lua_init_rpc()<0)
121 121
 	{
122 122
 		LM_ERR("failed to register RPC commands\n");
123 123
 		return -1;
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *
... ...
@@ -878,7 +878,7 @@ static int lua_sr_pv_get (lua_State *L)
878 878
 {
879 879
 	str pvn;
880 880
 	pv_spec_t *pvs;
881
-    pv_value_t val;
881
+	pv_value_t val;
882 882
 	sr_lua_env_t *env_L;
883 883
 	int pl;
884 884
 
... ...
@@ -928,7 +928,7 @@ static int lua_sr_pv_seti (lua_State *L)
928 928
 {
929 929
 	str pvn;
930 930
 	pv_spec_t *pvs;
931
-    pv_value_t val;
931
+	pv_value_t val;
932 932
 	sr_lua_env_t *env_L;
933 933
 	int pl;
934 934
 
... ...
@@ -947,7 +947,7 @@ static int lua_sr_pv_seti (lua_State *L)
947 947
 	memset(&val, 0, sizeof(pv_value_t));
948 948
 	val.ri = lua_tointeger(L, -1);
949 949
 	val.flags |= PV_TYPE_INT|PV_VAL_INT;
950
-	
950
+
951 951
 	pvn.s = (char*)lua_tostring(L, -2);
952 952
 	if(pvn.s==NULL || env_L->msg==NULL)
953 953
 		return 0;
... ...
@@ -982,7 +982,7 @@ static int lua_sr_pv_sets (lua_State *L)
982 982
 {
983 983
 	str pvn;
984 984
 	pv_spec_t *pvs;
985
-    pv_value_t val;
985
+	pv_value_t val;
986 986
 	sr_lua_env_t *env_L;
987 987
 	int pl;
988 988
 
... ...
@@ -997,7 +997,7 @@ static int lua_sr_pv_sets (lua_State *L)
997 997
 	if(!lua_isstring(L, -1))
998 998
 	{
999 999
 		LM_ERR("Cannot convert to a string when assigning value to variable: %s\n",
1000
-			   lua_tostring(L, -2));
1000
+				lua_tostring(L, -2));
1001 1001
 		return 0;
1002 1002
 	}
1003 1003
 
... ...
@@ -1005,7 +1005,7 @@ static int lua_sr_pv_sets (lua_State *L)
1005 1005
 	val.rs.s = (char*)lua_tostring(L, -1);
1006 1006
 	val.rs.len = strlen(val.rs.s);
1007 1007
 	val.flags |= PV_VAL_STR;
1008
-	
1008
+
1009 1009
 	pvn.s = (char*)lua_tostring(L, -2);
1010 1010
 	if(pvn.s==NULL || env_L->msg==NULL)
1011 1011
 		return 0;
... ...
@@ -1040,7 +1040,7 @@ static int lua_sr_pv_unset (lua_State *L)
1040 1040
 {
1041 1041
 	str pvn;
1042 1042
 	pv_spec_t *pvs;
1043
-    pv_value_t val;
1043
+	pv_value_t val;
1044 1044
 	sr_lua_env_t *env_L;
1045 1045
 	int pl;
1046 1046
 
... ...
@@ -1082,7 +1082,7 @@ static int lua_sr_pv_is_null (lua_State *L)
1082 1082
 {
1083 1083
 	str pvn;
1084 1084
 	pv_spec_t *pvs;
1085
-    pv_value_t val;
1085
+	pv_value_t val;
1086 1086
 	sr_lua_env_t *env_L;
1087 1087
 	int pl;
1088 1088
 
... ...
@@ -1,5 +1,5 @@
1 1
 /**
2
- * Copyright (C) 2010 Daniel-Constantin Mierla (asipto.com)
2
+ * Copyright (C) 2010-2016 Daniel-Constantin Mierla (asipto.com)
3 3
  *
4 4
  * This file is part of Kamailio, a free SIP server.
5 5
  *