summaryrefslogtreecommitdiff
path: root/doc/string_ops.rst
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2023-11-21 09:56:28 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2023-11-21 09:56:28 +0100
commit45e1231149779c363c9abb78cc09e21d047c463f (patch)
tree111b91a23e747bb2c9df60b0170914cbbd74dec3 /doc/string_ops.rst
parentd391e80c7378e6604c8f84538f27df8b915ebd2a (diff)
parent987942a206ef0f2342bf81d5de6432c6af42b7e7 (diff)
Update upstream source from tag 'upstream/4.17'
Update to upstream version '4.17' with Debian dir da192eda54f0b421cbc1b9ba383659593db8d3db
Diffstat (limited to 'doc/string_ops.rst')
-rw-r--r--doc/string_ops.rst17
1 files changed, 10 insertions, 7 deletions
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 <libHX/string.h>
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.