aboutsummaryrefslogtreecommitdiff
path: root/doc/documentation/tutorial-examples/006.c
diff options
context:
space:
mode:
authorSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2017-12-04 17:39:55 +0100
committerSchanzenbach, Martin <martin.schanzenbach@aisec.fraunhofer.de>2017-12-04 17:39:55 +0100
commitd4b252fd73bdda7be51a971ba06a650a1dceb45c (patch)
tree15026001f43b756e4a86d7ec80f62fc0d9756dea /doc/documentation/tutorial-examples/006.c
parent514dd6f53cb735d0e48f35ddf92eae469c0abc8a (diff)
parent24a0b84d503375bf66b5df932cd18631cc88cf8d (diff)
Merge branch 'identity_abe' into identity_oidc
Diffstat (limited to 'doc/documentation/tutorial-examples/006.c')
-rw-r--r--doc/documentation/tutorial-examples/006.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/documentation/tutorial-examples/006.c b/doc/documentation/tutorial-examples/006.c
new file mode 100644
index 0000000000..944d2b18c7
--- /dev/null
+++ b/doc/documentation/tutorial-examples/006.c
@@ -0,0 +1,31 @@
+static void
+handle_fix (void *cls, const struct MyMessage *msg)
+{
+ // process 'msg'
+}
+
+static int
+check_var (void *cls, const struct MyVarMessage *msg)
+{
+ // check 'msg' is well-formed
+ return GNUNET_OK;
+}
+
+static void
+handle_var (void *cls, const struct MyVarMessage *msg)
+{
+ // process 'msg'
+}
+
+struct GNUNET_MQ_MessageHandler handlers[] = {
+ GNUNET_MQ_hd_fixed_size (fix,
+ GNUNET_MESSAGE_TYPE_MY_FIX,
+ struct MyMessage,
+ NULL),
+ GNUNET_MQ_hd_fixed_size (var,
+ GNUNET_MESSAGE_TYPE_MY_VAR,
+ struct MyVarMessage,
+ NULL),
+
+ GNUNET_MQ_handler_end ()
+};