diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-01-05 15:17:18 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-01-05 15:17:18 +0000 |
commit | 74684dd41c5e9dd2cab0e53ca831ac13e38e6b4e (patch) | |
tree | 1e42c621a5fa6f37ddca90c9a6d61c14a269d24f | |
parent | 33dfaada638d98163e265e46ca527a6630437613 (diff) | |
download | gnunet-74684dd41c5e9dd2cab0e53ca831ac13e38e6b4e.tar.gz gnunet-74684dd41c5e9dd2cab0e53ca831ac13e38e6b4e.zip |
-docu
-rw-r--r-- | src/include/gnunet_common.h | 15 | ||||
-rw-r--r-- | src/util/common_endian.c | 10 |
2 files changed, 25 insertions, 0 deletions
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); | |||
496 | uint64_t | 496 | uint64_t |
497 | GNUNET_htonll (uint64_t n); | 497 | GNUNET_htonll (uint64_t n); |
498 | 498 | ||
499 | /** | ||
500 | * Convert double to network-byte-order. | ||
501 | * @param d the value in network byte order | ||
502 | * @return the same value in host byte order | ||
503 | */ | ||
504 | double | ||
505 | GNUNET_hton_double (double in); | ||
506 | |||
507 | /** | ||
508 | * Convert double to host-byte-order | ||
509 | * @param d the value in network byte order | ||
510 | * @return the same value in host byte order | ||
511 | */ | ||
512 | double | ||
513 | GNUNET_ntoh_double (double in); | ||
499 | 514 | ||
500 | /* ************************* allocation functions ****************** */ | 515 | /* ************************* allocation functions ****************** */ |
501 | 516 | ||
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) | |||
50 | } | 50 | } |
51 | 51 | ||
52 | 52 | ||
53 | /** | ||
54 | * Convert double to network-byte-order. | ||
55 | * @param n the value in network byte order | ||
56 | * @return the same value in host byte order | ||
57 | */ | ||
53 | double | 58 | double |
54 | GNUNET_hton_double (double d) | 59 | GNUNET_hton_double (double d) |
55 | { | 60 | { |
@@ -63,6 +68,11 @@ GNUNET_hton_double (double d) | |||
63 | } | 68 | } |
64 | 69 | ||
65 | 70 | ||
71 | /** | ||
72 | * Convert double to host-byte-order | ||
73 | * @param d the value in network byte order | ||
74 | * @return the same value in host byte order | ||
75 | */ | ||
66 | double | 76 | double |
67 | GNUNET_ntoh_double (double d) | 77 | GNUNET_ntoh_double (double d) |
68 | { | 78 | { |