* input: text. * output: 0: if text[0] != '(', * 0: if there are no corresponding ')' * n: distance to corresponding ')' otherwise */
| 38 | * n: distance to corresponding ')' otherwise |
| 39 | */ |
| 40 | static size_t |
| 41 | closing_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 | |
| 58 | static int |
| 59 | fs_parse_device(struct sub_device *sdev, char *args) |
no outgoing calls
no test coverage detected