131
131
int qemu_strtoul(const char *nptr, const char **endptr, int base,
132
132
unsigned long *result);
133
int qemu_strtoll(const char *nptr, const char **endptr, int base,
135
int qemu_strtoull(const char *nptr, const char **endptr, int base,
133
int qemu_strtoi64(const char *nptr, const char **endptr, int base,
135
int qemu_strtou64(const char *nptr, const char **endptr, int base,
136
136
uint64_t *result);
138
138
int parse_uint(const char *s, unsigned long long *value, char **endptr,
140
140
int parse_uint_full(const char *s, unsigned long long *value, int base);
143
* qemu_strtosz() suffixes used to specify the default treatment of an
144
* argument passed to qemu_strtosz() without an explicit suffix.
145
* These should be defined using upper case characters in the range
146
* A-Z, as qemu_strtosz() will use qemu_toupper() on the given argument
147
* prior to comparison.
149
#define QEMU_STRTOSZ_DEFSUFFIX_EB 'E'
150
#define QEMU_STRTOSZ_DEFSUFFIX_PB 'P'
151
#define QEMU_STRTOSZ_DEFSUFFIX_TB 'T'
152
#define QEMU_STRTOSZ_DEFSUFFIX_GB 'G'
153
#define QEMU_STRTOSZ_DEFSUFFIX_MB 'M'
154
#define QEMU_STRTOSZ_DEFSUFFIX_KB 'K'
155
#define QEMU_STRTOSZ_DEFSUFFIX_B 'B'
156
int64_t qemu_strtosz(const char *nptr, char **end);
157
int64_t qemu_strtosz_suffix(const char *nptr, char **end,
158
const char default_suffix);
159
int64_t qemu_strtosz_suffix_unit(const char *nptr, char **end,
160
const char default_suffix, int64_t unit);
142
int qemu_strtosz(const char *nptr, char **end, uint64_t *result);
143
int qemu_strtosz_MiB(const char *nptr, char **end, uint64_t *result);
144
int qemu_strtosz_metric(const char *nptr, char **end, uint64_t *result);
161
146
#define K_BYTE (1ULL << 10)
162
147
#define M_BYTE (1ULL << 20)
163
148
#define G_BYTE (1ULL << 30)