MCPcopy Create free account
hub / github.com/F-Stack/f-stack / parse_uint

Function parse_uint

dpdk/drivers/net/mlx5/mlx5_testpmd.c:30–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28#define PARSE_DELIMITER " \f\n\r\t\v"
29
30static int
31parse_uint(uint64_t *value, const char *str)
32{
33 char *next = NULL;
34 uint64_t n;
35
36 errno = 0;
37 /* Parse number string */
38 if (!strncasecmp(str, "0x", 2)) {
39 str += 2;
40 n = strtol(str, &next, 16);
41 } else {
42 n = strtol(str, &next, 10);
43 }
44 if (errno != 0 || str == next || *next != '\0')
45 return -1;
46
47 *value = n;
48
49 return 0;
50}
51
52/**
53 * Disable the host shaper and re-arm available descriptor threshold event.

Callers 1

Calls 2

strncasecmpFunction · 0.85
strtolFunction · 0.85

Tested by

no test coverage detected