فهرست منبع

enum: coherent indentation and whitespacing using clang format

Daniel-Constantin Mierla 8 سال پیش
والد
کامیت
28d3d37e08
4فایلهای تغییر یافته به همراه387 افزوده شده و 375 حذف شده
  1. 358 350
      src/modules/enum/enum.c
  2. 16 15
      src/modules/enum/enum.h
  3. 7 4
      src/modules/enum/enum_mod.c
  4. 6 6
      src/modules/enum/enum_mod.h

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 358 - 350
src/modules/enum/enum.c


+ 16 - 15
src/modules/enum/enum.h

@@ -36,41 +36,42 @@
 
 #define MAX_DOMAIN_SIZE 256
 #define MAX_NUM_LEN 33
-#define MAX_COMPONENT_SIZE (MAX_NUM_LEN * 2)  /* separator, apex, ... This simplifies checks */
+#define MAX_COMPONENT_SIZE \
+	(MAX_NUM_LEN * 2) /* separator, apex, ... This simplifies checks */
 
 
 /*
  * Check if from user is an e164 number and has a naptr record
  */
-int is_from_user_enum_0(struct sip_msg* _msg, char* _str1, char* _str2);
-int is_from_user_enum_1(struct sip_msg* _msg, char* _suffix, char* _str2);
-int is_from_user_enum_2(struct sip_msg* _msg, char* _suffix, char* _service);
+int is_from_user_enum_0(struct sip_msg *_msg, char *_str1, char *_str2);
+int is_from_user_enum_1(struct sip_msg *_msg, char *_suffix, char *_str2);
+int is_from_user_enum_2(struct sip_msg *_msg, char *_suffix, char *_service);
 
 /*
  * do source number destination routing.
  * that is, make the ruri based on the from number
  * this is like source ip policy routing
  */
-int enum_pv_query_1(struct sip_msg* _msg, char* _sp);
-int enum_pv_query_2(struct sip_msg* _msg, char* _sp, char* _suffix);
-int enum_pv_query_3(struct sip_msg* _msg, char* _sp, char* _suffix,
-		    char* _service);
+int enum_pv_query_1(struct sip_msg *_msg, char *_sp);
+int enum_pv_query_2(struct sip_msg *_msg, char *_sp, char *_suffix);
+int enum_pv_query_3(
+		struct sip_msg *_msg, char *_sp, char *_suffix, char *_service);
 
 /*
  * Make enum query and if query succeeds, replace current uri with the
  * result of the query
  */
-int enum_query(struct sip_msg* _msg, str* suffix, str* service);
-int enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
-int enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
-int enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
+int enum_query(struct sip_msg *_msg, str *suffix, str *service);
+int enum_query_0(struct sip_msg *_msg, char *_str1, char *_str2);
+int enum_query_1(struct sip_msg *_msg, char *_suffix, char *_str2);
+int enum_query_2(struct sip_msg *_msg, char *_suffix, char *_service);
 
 /*
  * Infrastructure ENUM versions.
  */
-int i_enum_query_0(struct sip_msg* _msg, char* _str1, char* _str2);
-int i_enum_query_1(struct sip_msg* _msg, char* _suffix, char* _str2);
-int i_enum_query_2(struct sip_msg* _msg, char* _suffix, char* _service);
+int i_enum_query_0(struct sip_msg *_msg, char *_str1, char *_str2);
+int i_enum_query_1(struct sip_msg *_msg, char *_suffix, char *_str2);
+int i_enum_query_2(struct sip_msg *_msg, char *_suffix, char *_service);
 
 
 #endif /* ENUM_H */

+ 7 - 4
src/modules/enum/enum_mod.c

@@ -49,11 +49,12 @@ str i_branchlabel = str_init("i");
 str i_suffix = str_init("e164.arpa.");
 str i_bl_alg = str_init("cc");
 
-str service = {0,0};
+str service = {0, 0};
 
 /*
  * Exported functions
  */
+/* clang-format off */
 static cmd_export_t cmds[] = {
 	{"enum_query", (cmd_function)enum_query_0, 0, 0, 0, REQUEST_ROUTE},
 	{"enum_query", (cmd_function)enum_query_1, 1, fixup_spve_null, 0,
@@ -79,11 +80,12 @@ static cmd_export_t cmds[] = {
 	 REQUEST_ROUTE},
 	{0, 0, 0, 0, 0, 0}
 };
-
+/* clang-format on */
 
 /*
  * Exported parameters
  */
+/* clang-format off */
 static param_export_t params[] = {
 	{"domain_suffix", PARAM_STR, &suffix},
 	{"tel_uri_params", PARAM_STR, &param},
@@ -92,11 +94,12 @@ static param_export_t params[] = {
 	{"bl_algorithm", PARAM_STR, &i_bl_alg},
 	{0, 0, 0}
 };
-
+/* clang-format on */
 
 /*
  * Module parameter variables
  */
+/* clang-format off */
 struct module_exports exports = {
 	"enum", 
 	DEFAULT_DLFLAGS, /* dlopen flags */
@@ -111,4 +114,4 @@ struct module_exports exports = {
 	0,        /* destroy function */
 	0         /* per-child init function */
 };
-
+/* clang-format on */

+ 6 - 6
src/modules/enum/enum_mod.h

@@ -38,13 +38,13 @@
 /*
  * Internal module variables
  */
-extern str suffix;           /* str version of domain_suffix */
-extern str param;            /* str version of tel_uri_params */
-extern str service;          /* default (empty) service */
+extern str suffix;  /* str version of domain_suffix */
+extern str param;   /* str version of tel_uri_params */
+extern str service; /* default (empty) service */
 
-extern str i_suffix;         /* suffix for infrastructure ENUM */
-extern str i_branchlabel;    /* the label branching off the infrastructure tree */
-extern str i_bl_alg;         /* how to know where to branch off */
+extern str i_suffix;	  /* suffix for infrastructure ENUM */
+extern str i_branchlabel; /* the label branching off the infrastructure tree */
+extern str i_bl_alg;	  /* how to know where to branch off */
 
 
 #endif /* ENUM_MOD_H */

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است