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

Function closing_paren

dpdk/drivers/net/failsafe/failsafe_args.c:40–56  ·  view source on GitHub ↗

* input: text. * output: 0: if text[0] != '(', * 0: if there are no corresponding ')' * n: distance to corresponding ')' otherwise */

Source from the content-addressed store, hash-verified

38 * n: distance to corresponding ')' otherwise
39 */
40static size_t
41closing_paren(const char *text)
42{
43 int nb_open = 0;
44 size_t i = 0;
45
46 while (text[i] != '\0') {
47 if (text[i] == '(')
48 nb_open++;
49 if (text[i] == ')')
50 nb_open--;
51 if (nb_open == 0)
52 return i;
53 i++;
54 }
55 return 0;
56}
57
58static int
59fs_parse_device(struct sub_device *sdev, char *args)

Callers 3

fs_parse_device_paramFunction · 0.85
fs_parse_sub_devicesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected