[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] 04/06: doc: gnunet-c-tutorial: example 6.
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] 04/06: doc: gnunet-c-tutorial: example 6. |
Date: |
Tue, 05 Sep 2017 14:23:55 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnunet.
commit 0406fa6f2e3b6014f465c4d987759324065375df
Author: ng0 <address@hidden>
AuthorDate: Tue Sep 5 12:10:12 2017 +0000
doc: gnunet-c-tutorial: example 6.
---
doc/gnunet-c-tutorial.texi | 36 ++----------------------------------
doc/tutorial-examples/006.c | 31 +++++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 34 deletions(-)
diff --git a/doc/gnunet-c-tutorial.texi b/doc/gnunet-c-tutorial.texi
index a08888845..6b2c770f3 100644
--- a/doc/gnunet-c-tutorial.texi
+++ b/doc/gnunet-c-tutorial.texi
@@ -693,40 +693,8 @@ to actually process the message. Fixed size messages are
fully
checked by the MQ-logic, and thus only need to provide the handler
to process the message. Note that the prefixes {\tt check\_}
and {\tt handle\_} are mandatory.
-
-\lstset{language=c}
-\begin{lstlisting}
-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 ()
-};
address@hidden
address@hidden tutorial-examples/006.c
@end example
Exercise: Expand your helper function to receive a response message
diff --git a/doc/tutorial-examples/006.c b/doc/tutorial-examples/006.c
new file mode 100644
index 000000000..944d2b18c
--- /dev/null
+++ b/doc/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 ()
+};
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnunet] branch master updated (c1a9bb5df -> 2efea52ad), gnunet, 2017/09/05
- [GNUnet-SVN] [gnunet] 02/06: doc: gnunet-c-tutorial: include testbed_test.c, gnunet, 2017/09/05
- [GNUnet-SVN] [gnunet] 01/06: doc: gnunet-c-tutorial: move example code to separate files., gnunet, 2017/09/05
- [GNUnet-SVN] [gnunet] 03/06: doc: gnunet-c-tutorial: include example 4 and 5., gnunet, 2017/09/05
- [GNUnet-SVN] [gnunet] 04/06: doc: gnunet-c-tutorial: example 6.,
gnunet <=
- [GNUnet-SVN] [gnunet] 06/06: Merge branch 'master' of gnunet.org:gnunet, gnunet, 2017/09/05
- [GNUnet-SVN] [gnunet] 05/06: doc: gnunet-c-tutorial: more includes of examples., gnunet, 2017/09/05