Introduce new CompostCtx struct that is passed into all the handlers#10
Introduce new CompostCtx struct that is passed into all the handlers#10blazra wants to merge 2 commits into
CompostCtx struct that is passed into all the handlers#10Conversation
Allocator is now passed as part of the `ctx`. `ctx` also contains the rx and tx messages and `user_ctx` - a void pointer passed by the user to `compost_msg_process()`
|
The idea and implementation is solid, this change will cover a lot of different use cases in the future. One small thing though, the test binary compiles with warnings due to unused ctx argument: I think this is the only drawback, that handler will always have this parameter but user won't necessarily need it every time. But I think it's fine, compared to some more complicated solutions, like having it optionally for only some RPC's. |
|
Yeah, the unused warning is annoying. I don't think there is a way how to silence it in C11. User will have to do the cast to void trick to silence the unused warning. I will do it in the test. |
|
PowerPC tests are passing. No more warnings. Ready to merge. |
Allocator is now passed as part of the
ctx.ctxalso contains the rx and tx messages anduser_ctx- a void pointer passed by the user tocompost_msg_process()Documentation needs to be changed.
PowerPC tests to be done.