From 74684dd41c5e9dd2cab0e53ca831ac13e38e6b4e Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 5 Jan 2012 15:17:18 +0000 Subject: [PATCH] -docu --- src/include/gnunet_common.h | 15 +++++++++++++++ src/util/common_endian.c | 10 ++++++++++ 2 files changed, 25 insertions(+) diff --git a/src/include/gnunet_common.h b/src/include/gnunet_common.h index cecc94c9e..76b26ddff 100644 --- a/src/include/gnunet_common.h +++ b/src/include/gnunet_common.h @@ -496,6 +496,21 @@ GNUNET_ntohll (uint64_t n); uint64_t GNUNET_htonll (uint64_t n); +/** + * Convert double to network-byte-order. + * @param d the value in network byte order + * @return the same value in host byte order + */ +double +GNUNET_hton_double (double in); + +/** + * Convert double to host-byte-order + * @param d the value in network byte order + * @return the same value in host byte order + */ +double +GNUNET_ntoh_double (double in); /* ************************* allocation functions ****************** */ diff --git a/src/util/common_endian.c b/src/util/common_endian.c index d7e11ac0c..1a2ddd9c1 100644 --- a/src/util/common_endian.c +++ b/src/util/common_endian.c @@ -50,6 +50,11 @@ GNUNET_htonll (uint64_t n) } +/** + * Convert double to network-byte-order. + * @param n the value in network byte order + * @return the same value in host byte order + */ double GNUNET_hton_double (double d) { @@ -63,6 +68,11 @@ GNUNET_hton_double (double d) } +/** + * Convert double to host-byte-order + * @param d the value in network byte order + * @return the same value in host byte order + */ double GNUNET_ntoh_double (double d) { -- 2.25.1