[sr-dev] git:master: tm: rpc doc strings moved to tm.c

Andrei Pelinescu-Onciul andrei at iptel.org
Mon Mar 8 14:16:23 CET 2010


Module: sip-router
Branch: master
Commit: 22a6f9805b0ee13357110edf201d301039119870
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=22a6f9805b0ee13357110edf201d301039119870

Author: Andrei Pelinescu-Onciul <andrei at iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei at iptel.org>
Date:   Sun Mar  7 12:52:27 2010 +0100

tm: rpc doc strings moved to tm.c

Moved all the rpc doc strings into tm.c, close to the rpc exports
declaration. This will also allow automatic documentation
generation for the rpcs (the script that generates the rpc docs,
parses C code and cannot "resolve" symbols defined in other
files).

---

 modules/tm/rpc_uac.c  |   15 ------------
 modules/tm/rpc_uac.h  |    2 -
 modules/tm/t_cancel.c |    6 -----
 modules/tm/t_cancel.h |    1 -
 modules/tm/t_reply.c  |    5 ----
 modules/tm/t_reply.h  |    1 -
 modules/tm/t_stats.c  |   11 ---------
 modules/tm/t_stats.h  |    2 -
 modules/tm/tm.c       |   60 +++++++++++++++++++++++++++++++++++++++++-------
 9 files changed, 51 insertions(+), 52 deletions(-)

diff --git a/modules/tm/rpc_uac.c b/modules/tm/rpc_uac.c
index f177094..34f7c36 100644
--- a/modules/tm/rpc_uac.c
+++ b/modules/tm/rpc_uac.c
@@ -57,21 +57,6 @@ struct str_list {
 
 
 
-const char* rpc_t_uac_start_doc[2] = {
-	"starts a tm uac using  a list of string parameters: method, ruri, dst_uri"
-		", send_sock, headers (CRLF separated) and body (optional)",
-	0
-};
-
-const char* rpc_t_uac_wait_doc[2] = {
-	"starts a tm uac and waits for the final reply, using a list of string "
-		"parameters: method, ruri, dst_uri send_sock, headers (CRLF separated)"
-		" and body (optional)",
-	0
-};
-
-
-
 /** make sure the rpc user created the msg properly.
  * Make sure that the FIFO user created the message
  * correctly and fill some extra parameters in function
diff --git a/modules/tm/rpc_uac.h b/modules/tm/rpc_uac.h
index df8d9e8..0aa5c00 100644
--- a/modules/tm/rpc_uac.h
+++ b/modules/tm/rpc_uac.h
@@ -29,8 +29,6 @@
 
 #include "../../rpc.h"
 
-extern const char* rpc_t_uac_start_doc[2];
-extern const char* rpc_t_uac_wait_doc[2];
 
 void rpc_t_uac_start(rpc_t* rpc, void* c);
 void rpc_t_uac_wait(rpc_t* rpc, void* c);
diff --git a/modules/tm/t_cancel.c b/modules/tm/t_cancel.c
index 52f086b..bae4d32 100644
--- a/modules/tm/t_cancel.c
+++ b/modules/tm/t_cancel.c
@@ -322,12 +322,6 @@ int cancel_branch( struct cell *t, int branch, int flags )
 }
 
 
-const char* rpc_cancel_doc[2] = {
-	"Cancel a pending transaction",
-	0
-};
-
-
 /* fifo command to cancel a pending call (Uli)
  * Syntax:
  *
diff --git a/modules/tm/t_cancel.h b/modules/tm/t_cancel.h
index 0ef3f37..9e22dc8 100644
--- a/modules/tm/t_cancel.h
+++ b/modules/tm/t_cancel.h
@@ -128,7 +128,6 @@ inline short static prepare_cancel_branch( struct cell *t, int b, int noreply )
 	return 0;
 }
 
-extern const char* rpc_cancel_doc[2];
 void rpc_cancel(rpc_t* rpc, void* c);
 int cancel_b_flags_fixup(void* handle, str* gname, str* name, void** val);
 int cancel_b_flags_get(unsigned int* f, int m);
diff --git a/modules/tm/t_reply.c b/modules/tm/t_reply.c
index f28cf05..4415294 100644
--- a/modules/tm/t_reply.c
+++ b/modules/tm/t_reply.c
@@ -2431,11 +2431,6 @@ static int send_reply(struct cell *trans, unsigned int code, str* text, str* bod
 #endif
 
 
-const char* rpc_reply_doc[2] = {
-	"Reply transaction",
-	0
-};
-
 /*
   Syntax:
 
diff --git a/modules/tm/t_reply.h b/modules/tm/t_reply.h
index 0a97e6a..7ea9dc8 100644
--- a/modules/tm/t_reply.h
+++ b/modules/tm/t_reply.h
@@ -155,7 +155,6 @@ int t_pick_branch_blind(struct cell *t, int *res_code);
  */
 void t_drop_replies(int v);
 
-extern const char* rpc_reply_doc[2];
 void rpc_reply(rpc_t* rpc, void* c);
 
 void faked_env( struct cell *t,struct sip_msg *msg);
diff --git a/modules/tm/t_stats.c b/modules/tm/t_stats.c
index 627b379..69573a5 100644
--- a/modules/tm/t_stats.c
+++ b/modules/tm/t_stats.c
@@ -94,17 +94,6 @@ void free_tm_stats()
 
 
 
-const char* tm_rpc_stats_doc[2] = {
-	"Print transaction statistics.",
-	0
-};
-
-const char* tm_rpc_hash_stats_doc[2] = {
-	"Prints hash table statistics (can be used only if tm is compiled"
-		" with -DTM_HASH_STATS).",
-	0
-};
-
 /* res=s1+s2 */
 #define tm_proc_stats_add_base(res, s1, s2) \
 	do{\
diff --git a/modules/tm/t_stats.h b/modules/tm/t_stats.h
index 734b4ad..33fb9fa 100644
--- a/modules/tm/t_stats.h
+++ b/modules/tm/t_stats.h
@@ -141,10 +141,8 @@ int init_tm_stats(void);
 int init_tm_stats_child(void);
 void free_tm_stats();
 
-extern const char* tm_rpc_stats_doc[2];
 void tm_rpc_stats(rpc_t* rpc, void* c);
 
-extern const char* tm_rpc_hash_stats_doc[2];
 void tm_rpc_hash_stats(rpc_t* rpc, void* c);
 
 typedef int (*tm_get_stats_f)(struct t_proc_stats *all);
diff --git a/modules/tm/tm.c b/modules/tm/tm.c
index 2b35681..34a9e9f 100644
--- a/modules/tm/tm.c
+++ b/modules/tm/tm.c
@@ -1906,15 +1906,7 @@ static int w_t_save_lumps(struct sip_msg* msg, char* foo, char* bar)
 #endif
 }
 
-static rpc_export_t tm_rpc[] = {
-	{"tm.cancel", rpc_cancel,   rpc_cancel_doc,   0},
-	{"tm.reply",  rpc_reply,    rpc_reply_doc,    0},
-	{"tm.stats",  tm_rpc_stats, tm_rpc_stats_doc, 0},
-	{"tm.hash_stats",  tm_rpc_hash_stats, tm_rpc_hash_stats_doc, 0},
-	{"tm.t_uac_start", rpc_t_uac_start, rpc_t_uac_start_doc, 0 },
-	{"tm.t_uac_wait",  rpc_t_uac_wait,  rpc_t_uac_wait_doc, RET_ARRAY},
-	{0, 0, 0, 0}
-};
+
 
 /* wrapper function needed after changes in w_t_reply */
 int w_t_reply_wrp(struct sip_msg *m, unsigned int code, char *txt)
@@ -2143,3 +2135,53 @@ inline static int w_t_relay_to(struct sip_msg *msg, char *proxy, char *flags)
 	return _w_t_relay_to(msg, px, PROTO_NONE);
 }
 
+
+
+/* rpc docs */
+
+static const char* rpc_cancel_doc[2] = {
+	"Cancel a pending transaction",
+	0
+};
+
+static const char* rpc_reply_doc[2] = {
+	"Reply transaction",
+	0
+};
+
+static const char* tm_rpc_stats_doc[2] = {
+	"Print transaction statistics.",
+	0
+};
+
+static const char* tm_rpc_hash_stats_doc[2] = {
+	"Prints hash table statistics (can be used only if tm is compiled"
+		" with -DTM_HASH_STATS).",
+	0
+};
+
+static const char* rpc_t_uac_start_doc[2] = {
+	"starts a tm uac using  a list of string parameters: method, ruri, dst_uri"
+		", send_sock, headers (CRLF separated) and body (optional)",
+	0
+};
+
+static const char* rpc_t_uac_wait_doc[2] = {
+	"starts a tm uac and waits for the final reply, using a list of string "
+		"parameters: method, ruri, dst_uri send_sock, headers (CRLF separated)"
+		" and body (optional)",
+	0
+};
+
+
+/* rpc exports */
+static rpc_export_t tm_rpc[] = {
+	{"tm.cancel", rpc_cancel,   rpc_cancel_doc,   0},
+	{"tm.reply",  rpc_reply,    rpc_reply_doc,    0},
+	{"tm.stats",  tm_rpc_stats, tm_rpc_stats_doc, 0},
+	{"tm.hash_stats",  tm_rpc_hash_stats, tm_rpc_hash_stats_doc, 0},
+	{"tm.t_uac_start", rpc_t_uac_start, rpc_t_uac_start_doc, 0 },
+	{"tm.t_uac_wait",  rpc_t_uac_wait,  rpc_t_uac_wait_doc, RET_ARRAY},
+	{0, 0, 0, 0}
+};
+




More information about the sr-dev mailing list