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