gnunet-svn
[Top][All Lists]
Advanced

[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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]