diff options
author | Jo-Philipp Wich <jo@mein.io> | 2021-12-13 00:00:44 +0100 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-01-04 16:19:59 +0100 |
commit | 599d233f0a7283f0b73f9a9d6c422efea418a59e (patch) | |
tree | 60ea21b984b24851b05fb93482b1ed50b40f1f6d /include | |
parent | 1377e23afff90128b18ac60c10071295fc0afbab (diff) |
vallist: store double values in a platform neutral manner
Import the binary64 double packing routines from the struct module and
use them to store numeric double values in a platform agnostic big
endian format.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'include')
-rw-r--r-- | include/ucode/vallist.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/ucode/vallist.h b/include/ucode/vallist.h index 47ddc7d..a1b33a5 100644 --- a/include/ucode/vallist.h +++ b/include/ucode/vallist.h @@ -43,6 +43,9 @@ typedef enum { uc_value_t *uc_number_parse(const char *buf, char **end); +bool uc_double_pack(double d, char *buf, bool little_endian); +double uc_double_unpack(const char *buf, bool little_endian); + void uc_vallist_init(uc_value_list_t *list); void uc_vallist_free(uc_value_list_t *list); |