On Jun 28, 2010 at 17:55, Ovidiu Sas osas@voipembedded.com wrote:
So ... are there any objections of defining the rpc_cb_ctx_t typedef inside rpc.h?
I'm not sure I understand what it's needed for and what impact will it have on existing code. If it means changing the existing interface, then a lot of code would have to be updated and I wouldn't agree with it, particularly very close to a code freeze.
Could you come up with a small code/pseudo-code example?
From your description I don't understand why you need to pack
rpc_t and c (I assume c is here the rpc context) in a structure, since every rpc "callback" already gets both of them as parameters.
Andrei
Thanks, Ovidiu Sas
On Sat, Jun 26, 2010 at 9:13 AM, Ovidiu Sas osas@voipembedded.com wrote:
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
sr-dev mailing list sr-dev@lists.sip-router.org http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev