30 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_LIB 39 static const char suffix[] =
"bkmgKMG";
42 static const uint64_t multiplier[] = {
57 pos = strchr(suffix, *end);
60 *
out *= multiplier[pos - suffix];
75 uint64_t unit_mul = 1000000000;
77 uint64_t pow_of_10 = 1;
79 static const char *unit[] = {
85 static const uint64_t multiplier[] = {
98 for (
i = 0;
i < end - arg; ++
i) {
106 if (
rc == 0 && *end !=
'\0') {
108 if (strncmp(end, unit[
i], strlen(unit[
i]) + 1) == 0) {
109 unit_mul = multiplier[
i];
117 *
out = before * unit_mul + after * unit_mul / pow_of_10;
121 #undef M0_TRACE_SUBSYSTEM
const char M0_GETOPTS_DECIMAL_POINT
uint64_t m0_strtou64(const char *str, char **endptr, int base)
M0_INTERNAL int m0_time_get(const char *arg, m0_time_t *out)
M0_INTERNAL int m0_bcount_get(const char *arg, m0_bcount_t *out)