aboutsummaryrefslogtreecommitdiffstats
path: root/include/serd
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-02-25 16:16:54 -0500
committerDavid Robillard <d@drobilla.net>2021-03-08 23:23:05 -0500
commitfc2e2b667d82f6114e339e542edd8e2ca708dc1b (patch)
treeb70f70fbb932e2f035c02a6ef0b7a1aeceeca36e /include/serd
parentc4821c8e6bf1f81c6ea31e11ebc0fc1666e9337b (diff)
downloadserd-fc2e2b667d82f6114e339e542edd8e2ca708dc1b.tar.gz
serd-fc2e2b667d82f6114e339e542edd8e2ca708dc1b.tar.bz2
serd-fc2e2b667d82f6114e339e542edd8e2ca708dc1b.zip
WIP: Use exess for reading and writing numeric and binary literals
Diffstat (limited to 'include/serd')
-rw-r--r--include/serd/serd.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/include/serd/serd.h b/include/serd/serd.h
index 16c600ef..697674c9 100644
--- a/include/serd/serd.h
+++ b/include/serd/serd.h
@@ -324,7 +324,7 @@ serd_strlen(const char* SERD_NONNULL str, SerdNodeFlags* SERD_NULLABLE flags);
SERD_API
double
serd_strtod(const char* SERD_NONNULL str,
- char* SERD_NONNULL* SERD_NULLABLE endptr);
+ const char* SERD_NONNULL* SERD_NULLABLE endptr);
/**
Decode a base64 string.
@@ -611,23 +611,15 @@ serd_new_file_uri(SerdStringView path, SerdStringView hostname);
Create a new node by serialising `d` into an xsd:decimal string
The resulting node will always contain a `.', start with a digit, and end
- with a digit (i.e. will have a leading and/or trailing `0' if necessary).
- It will never be in scientific notation. A maximum of `frac_digits` digits
- will be written after the decimal point, but trailing zeros will
- automatically be omitted (except one if `d` is a round integer).
-
- Note that about 16 and 8 fractional digits are required to precisely
- represent a double and float, respectively.
+ with a digit (a leading and/or trailing `0` will be added if necessary). It
+ will never be in scientific notation.
@param d The value for the new node.
- @param frac_digits The maximum number of digits after the decimal place.
@param datatype Datatype of node, or NULL for xsd:decimal.
*/
SERD_API
SerdNode* SERD_ALLOCATED
-serd_new_decimal(double d,
- unsigned frac_digits,
- const SerdNode* SERD_NULLABLE datatype);
+serd_new_decimal(double d, const SerdNode* SERD_NULLABLE datatype);
/**
Create a new node by serialising `i` into an xsd:integer string.
@@ -647,14 +639,12 @@ serd_new_integer(int64_t i, const SerdNode* SERD_NULLABLE datatype);
@param buf Raw binary input data.
@param size Size of `buf`.
- @param wrap_lines Wrap lines at 76 characters to conform to RFC 2045.
@param datatype Datatype of node, or NULL for xsd:base64Binary.
*/
SERD_API
SerdNode* SERD_ALLOCATED
serd_new_blob(const void* SERD_NONNULL buf,
size_t size,
- bool wrap_lines,
const SerdNode* SERD_NULLABLE datatype);
/// Return a deep copy of `node`