| 1 | // SPDX-License-Identifier: GPL-3.0-or-later |
| 2 | |
| 3 | #ifndef LIBNETDATA_PARSERS_ENTRIES_H |
| 4 | #define LIBNETDATA_PARSERS_ENTRIES_H |
| 5 | |
| 6 | #include "parsers.h" |
| 7 | |
| 8 | bool entries_parse(const char *entries_str, uint64_t *result, const char *default_unit); |
| 9 | #define entries_parse_k(size_str, kb) size_parse(size_str, kb, "K") |
| 10 | #define entries_parse_m(size_str, mb) size_parse(size_str, mb, "M") |
| 11 | #define entries_parse_g(size_str, gb) size_parse(size_str, gb, "G") |
| 12 | |
| 13 | ssize_t entries_snprintf(char *dst, size_t dst_size, uint64_t value, const char *unit, bool accurate); |
| 14 | #define entries_snprintf_n(dst, dst_size, value) size_snprintf(dst, dst_size, value, "", true) |
| 15 | #define entries_snprintf_k(dst, dst_size, value) size_snprintf(dst, dst_size, value, "K", true) |
| 16 | #define entries_snprintf_m(dst, dst_size, value) size_snprintf(dst, dst_size, value, "M", true) |
| 17 | #define entries_snprintf_g(dst, dst_size, value) size_snprintf(dst, dst_size, value, "G", true) |
| 18 | |
| 19 | #endif //LIBNETDATA_PARSERS_ENTRIES_H |