From 987942a206ef0f2342bf81d5de6432c6af42b7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 21 Nov 2023 09:56:26 +0100 Subject: New upstream version 4.17 --- doc/string_ops.rst | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'doc/string_ops.rst') diff --git a/doc/string_ops.rst b/doc/string_ops.rst index 9bb711f..d818d2d 100644 --- a/doc/string_ops.rst +++ b/doc/string_ops.rst @@ -456,17 +456,20 @@ Conversion from/to human-readable durations with units #include unsigned long long HX_strtoull_sec(const char *s, char **end); + unsigned long long HX_strtoull_nsec(const char *s, char **end); char *HX_unit_seconds(char *out, size_t outsize, unsigned long long seconds, unsigned int flags); -``HX_strtoull_sec`` converts a time duration with units, such as ``"15min30s"`` -into an all-seconds value. The recognized unit strings are: ``years``, -``year``, ``y``, ``months``, ``month``, ``days``, ``day``, ``d``, ``hours``, -``hour``, ``h``, ``minutes``, ``minute``, ``min``, ``seconds``, ``second``, -``s`` and the empty string (for seconds). When parsing stops at any point, -``*end`` is set to the location, similar to how the ``strtoull`` C function -would. +``HX_strtoull_sec`` and ``HX_strtoull_nsec`` convert a time duration with +units, such as ``"15min30s"`` into an all-seconds and all-nanoseconds value, +respectively. The recognized unit strings are: ``years``, ``year``, ``y``, +``months``, ``month``, ``days``, ``day``, ``d``, ``hours``, ``hour``, ``h``, +``minutes``, ``minute``, ``min``, ``seconds``, ``second``, ``s``, the empty +string (to mean seconds), ``msec``, ``ms``, ``µsec``, ``µs``, ``nsec`` and +``ns``. Negative durations are not supported. Support for fractions is +implementation-defined. When parsing stops at any point, ``*end`` is set to the +location, similar to how the ``strtoull`` C function would. One year is defined to be 365.25 days of 86400 seconds; one month is defined to be 1/12 such a year. This is consistent with the units employed by systemd. -- cgit v1.2.3