From: Christian Grothoff Date: Thu, 5 Jan 2012 15:17:18 +0000 (+0000) Subject: -docu X-Git-Tag: initial-import-from-subversion-38251~15419 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=74684dd41c5e9dd2cab0e53ca831ac13e38e6b4e;p=oweals%2Fgnunet.git -docu --- 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) {