[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r27544 - gnunet/doc
From: |
gnunet |
Subject: |
[GNUnet-SVN] r27544 - gnunet/doc |
Date: |
Mon, 24 Jun 2013 11:27:07 +0200 |
Author: wachs
Date: 2013-06-24 11:27:07 +0200 (Mon, 24 Jun 2013)
New Revision: 27544
Modified:
gnunet/doc/gnunet-c-tutorial.pdf
gnunet/doc/gnunet-c-tutorial.tex
Log:
Updating the tutorial section in the source and including
an updated version of the pdf about command line parsing.
This update describes how a developer can check if a
command line argument was set at all by initializing the
variables storing the commandline arguments with a
specific value and checking this value after the run
function applied the commandline parsing.
Modified: gnunet/doc/gnunet-c-tutorial.pdf
===================================================================
(Binary files differ)
Modified: gnunet/doc/gnunet-c-tutorial.tex
===================================================================
--- gnunet/doc/gnunet-c-tutorial.tex 2013-06-23 18:17:10 UTC (rev 27543)
+++ gnunet/doc/gnunet-c-tutorial.tex 2013-06-24 09:27:07 UTC (rev 27544)
@@ -594,6 +594,8 @@
&GNUNET_GETOPT_set_one, &a_flag},
GNUNET_GETOPT_OPTION_END
};
+ string_option = NULL;
+ a_flag = GNUNET_SYSERR;
// ...
\end{lstlisting}
@@ -602,7 +604,10 @@
using this approach. Other {\tt GNUNET\_GETOPT\_}-functions can be used
to obtain integer value options, increment counters, etc. You can
even write custom option parsers for special circumstances not covered
-by the available handlers.
+by the available handlers. To check if an argument was specified by the
+user you initialize the variable with a specific value (e.g. NULL for
+a string and GNUNET\_SYSERR for a integer) and check after parsing
+happened if the values were modified.
Inside the {\tt run} method, the program would perform the
application-specific logic, which typically involves initializing and
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r27544 - gnunet/doc,
gnunet <=