gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnunet] branch master updated: add json from abs_time_nbo


From: gnunet
Subject: [GNUnet-SVN] [gnunet] branch master updated: add json from abs_time_nbo
Date: Sun, 05 Nov 2017 22:12:20 +0100

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository gnunet.

The following commit(s) were added to refs/heads/master by this push:
     new 529585639 add json from abs_time_nbo
529585639 is described below

commit 5295856396dc8364bf5ba3c710fb5210c095198a
Author: Christian Grothoff <address@hidden>
AuthorDate: Sun Nov 5 22:12:10 2017 +0100

    add json from abs_time_nbo
---
 src/include/gnunet_getopt_lib.h | 54 ++++++++++++++++++++---------------------
 src/include/gnunet_json_lib.h   | 10 ++++++++
 src/json/json_generator.c       | 13 ++++++++++
 3 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/src/include/gnunet_getopt_lib.h b/src/include/gnunet_getopt_lib.h
index f707bb091..e38925f14 100644
--- a/src/include/gnunet_getopt_lib.h
+++ b/src/include/gnunet_getopt_lib.h
@@ -230,11 +230,11 @@ GNUNET_GETOPT_option_filename (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_base32_fixed_size (char shortName,
-                                            const char *name,
-                                            const char *argumentHelp,
-                                            const char *description,
-                                            void *val,
-                                            size_t val_size);
+                                        const char *name,
+                                        const char *argumentHelp,
+                                        const char *description,
+                                        void *val,
+                                        size_t val_size);
 
 
 /**
@@ -264,9 +264,9 @@ GNUNET_GETOPT_option_base32_fixed_size (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_flag (char shortName,
-                              const char *name,
-                              const char *description,
-                              int *val);
+                           const char *name,
+                           const char *description,
+                           int *val);
 
 
 /**
@@ -280,10 +280,10 @@ GNUNET_GETOPT_option_flag (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_uint (char shortName,
-                               const char *name,
-                               const char *argumentHelp,
-                               const char *description,
-                               unsigned int *val);
+                           const char *name,
+                           const char *argumentHelp,
+                           const char *description,
+                           unsigned int *val);
 
 
 /**
@@ -297,10 +297,10 @@ GNUNET_GETOPT_option_uint (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_ulong (char shortName,
-                                const char *name,
-                                const char *argumentHelp,
-                                const char *description,
-                                unsigned long long *val);
+                            const char *name,
+                            const char *argumentHelp,
+                            const char *description,
+                            unsigned long long *val);
 
 
 /**
@@ -315,10 +315,10 @@ GNUNET_GETOPT_option_ulong (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_relative_time (char shortName,
-                                        const char *name,
-                                        const char *argumentHelp,
-                                        const char *description,
-                                        struct GNUNET_TIME_Relative *val);
+                                    const char *name,
+                                    const char *argumentHelp,
+                                    const char *description,
+                                    struct GNUNET_TIME_Relative *val);
 
 
 /**
@@ -333,10 +333,10 @@ GNUNET_GETOPT_option_relative_time (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_absolute_time (char shortName,
-                                        const char *name,
-                                        const char *argumentHelp,
-                                        const char *description,
-                                        struct GNUNET_TIME_Absolute *val);
+                                    const char *name,
+                                    const char *argumentHelp,
+                                    const char *description,
+                                    struct GNUNET_TIME_Absolute *val);
 
 
 /**
@@ -350,9 +350,9 @@ GNUNET_GETOPT_option_absolute_time (char shortName,
  */
 struct GNUNET_GETOPT_CommandLineOption
 GNUNET_GETOPT_option_increment_uint (char shortName,
-                                      const char *name,
-                                      const char *description,
-                                      unsigned int *val);
+                                     const char *name,
+                                     const char *description,
+                                     unsigned int *val);
 
 
 /**
diff --git a/src/include/gnunet_json_lib.h b/src/include/gnunet_json_lib.h
index f2682bea7..c12badcd9 100644
--- a/src/include/gnunet_json_lib.h
+++ b/src/include/gnunet_json_lib.h
@@ -343,6 +343,16 @@ GNUNET_JSON_from_time_abs (struct GNUNET_TIME_Absolute 
stamp);
 
 
 /**
+ * Convert absolute timestamp to a json string.
+ *
+ * @param stamp the time stamp
+ * @return a json string with the timestamp in @a stamp
+ */
+json_t *
+GNUNET_JSON_from_time_abs_nbo (struct GNUNET_TIME_AbsoluteNBO stamp);
+
+
+/**
  * Convert relative timestamp to a json string.
  *
  * @param stamp the time stamp
diff --git a/src/json/json_generator.c b/src/json/json_generator.c
index e660e10c5..98f7163bc 100644
--- a/src/json/json_generator.c
+++ b/src/json/json_generator.c
@@ -73,6 +73,19 @@ GNUNET_JSON_from_time_abs (struct GNUNET_TIME_Absolute stamp)
 
 
 /**
+ * Convert absolute timestamp to a json string.
+ *
+ * @param stamp the time stamp
+ * @return a json string with the timestamp in @a stamp
+ */
+json_t *
+GNUNET_JSON_from_time_abs_nbo (struct GNUNET_TIME_AbsoluteNBO stamp)
+{
+  return GNUNET_JSON_from_time_abs (GNUNET_TIME_absolute_ntoh (stamp));
+}
+
+
+/**
  * Convert relative timestamp to a json string.
  *
  * @param stamp the time stamp

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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