[sr-dev] rpc: inter module rpc printf callback structure

Ovidiu Sas osas at voipembedded.com
Sat Jun 26 15:13:18 CEST 2010


Hello all,

I need to pass the rpc printf params between two modules via a
callback functions.
The current implementation allows passing a pointer during the
callback call and I would like to reuse the existing callback pointer
to pass a everything that I need through it.
I would like to define a new structure for rpc and pass a pointer to
that structure during the callback call:

diff --git a/rpc.h b/rpc.h
index 1434146..ff66b5a 100644
--- a/rpc.h
+++ b/rpc.h
@@ -88,6 +88,10 @@ typedef struct rpc_delayed_ctx{
    /* more private data might follow */
 } rpc_delayed_ctx_t;

+typedef struct rpc_cb_ctx {
+   rpc_t *rpc;
+   void *c;
+} rpc_cb_ctx_t;

 /*
  * RPC Function Prototype


This will allow printing mixed info from different modules, in my
particular case, printing qos context info along with dialog context
info (modules_k: dialog and qos).
Since I'm not familiar with the rpc interface, please advice if this
is the right way of doing it or if there is another better
alternative.


Regards,
Ovidiu Sas



More information about the sr-dev mailing list