fork download
  1. /* callback taking a pointer to a "generic" msg as argument */
  2. typedef void (*Callback_t)(void *msg);
  3.  
  4. struct action0_t;
  5. struct action1_t;
  6.  
  7. /* implement callback for each message id */
  8. void ProcessMsgAction0(action0_t *msg) { /* ... */ }
  9. void ProcessMsgAction1(action1_t *msg) { /* ... */ }
  10.  
  11. /* initialize callback pointer */
  12. Callback_t const Callback[] =
  13. {
  14. (Callback_t)ProcessMsgAction0, /**< 0: MSGID_ACTION_0 */
  15. (Callback_t)(ProcessMsgAction1), /**< 1: MSGID_ACTION_1 */
  16. /* ... */
  17. };
  18.  
  19. int main() {return 0;}
  20.  
Success #stdin #stdout 0s 3336KB
stdin
Standard input is empty
stdout
Standard output is empty