MCPcopy Create free account
hub / github.com/antirez/ds4 / parse_backend

Function parse_backend

ds4_bench.c:102–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100 return (uint64_t)v;
101}
102
103static double bytes_to_gib(uint64_t bytes) {
104 return (double)bytes / (1024.0 * 1024.0 * 1024.0);
105}
106
107static void usage(FILE *fp, const char *topic) {
108 ds4_help_print(fp, DS4_HELP_BENCH, topic);
109}
110
111static int parse_int(const char *s, const char *opt) {
112 char *end = NULL;
113 long v = strtol(s, &end, 10);
114 if (s[0] == '\0' || *end != '\0' || v <= 0 || v > INT_MAX) {
115 fprintf(stderr, "ds4-bench: invalid value for %s: %s\n", opt, s);
116 exit(2);
117 }
118 return (int)v;
119}
120

Callers 1

parse_optionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected