A direction, either "in" or "out", internally handled as a boolean. */
| 66 | |
| 67 | /* A direction, either "in" or "out", internally handled as a boolean. */ |
| 68 | static struct command_result *param_direction(struct command *cmd, |
| 69 | const char *name, |
| 70 | const char *buffer, |
| 71 | const jsmntok_t *tok, |
| 72 | bool **out_direction) |
| 73 | { |
| 74 | const char *value; |
| 75 | struct command_result *ret = |
| 76 | param_string(cmd, name, buffer, tok, &value); |
| 77 | if (ret) |
| 78 | return ret; |
| 79 | |
| 80 | *out_direction = tal(cmd, bool); |
| 81 | if (streq(value, "in")) |
| 82 | **out_direction = false; |
| 83 | else if (streq(value, "out")) |
| 84 | **out_direction = true; |
| 85 | else { |
| 86 | tal_free(value); |
| 87 | return command_fail_badparam( |
| 88 | cmd, name, buffer, tok, |
| 89 | "Expected either in or out values."); |
| 90 | } |
| 91 | |
| 92 | tal_free(value); |
| 93 | return NULL; |
| 94 | } |
| 95 | |
| 96 | static bool is_maxhops(const char *s) |
| 97 | { |
nothing calls this directly
no test coverage detected