diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-11-21 09:56:26 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2023-11-21 09:56:26 +0100 |
commit | 987942a206ef0f2342bf81d5de6432c6af42b7e7 (patch) | |
tree | 6befd1ab8680f2936d94ac84c94cf4f68f16c14e /doc/string_ops.rst | |
parent | 163bc6d7fc268bdb1c7cc03699f69d0c5cc0b4cd (diff) |
New upstream version 4.17upstream/4.17
Diffstat (limited to 'doc/string_ops.rst')
-rw-r--r-- | doc/string_ops.rst | 17 |
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. |