move docmentation to separate folder
[oweals/gnunet.git] / doc / documentation / tutorial-examples / 006.c
1 static void
2 handle_fix (void *cls, const struct MyMessage *msg)
3 {
4   // process 'msg'
5 }
6
7 static int
8 check_var (void *cls, const struct MyVarMessage *msg)
9 {
10   // check 'msg' is well-formed
11   return GNUNET_OK;
12 }
13
14 static void
15 handle_var (void *cls, const struct MyVarMessage *msg)
16 {
17   // process 'msg'
18 }
19
20 struct GNUNET_MQ_MessageHandler handlers[] = {
21   GNUNET_MQ_hd_fixed_size (fix,
22                           GNUNET_MESSAGE_TYPE_MY_FIX,
23                           struct MyMessage,
24                           NULL),
25   GNUNET_MQ_hd_fixed_size (var,
26                           GNUNET_MESSAGE_TYPE_MY_VAR,
27                           struct MyVarMessage,
28                           NULL),
29
30   GNUNET_MQ_handler_end ()
31 };