Iterate through the options in the manifest response, and add them * to the plugin and the command line options */
| 1159 | /* Iterate through the options in the manifest response, and add them |
| 1160 | * to the plugin and the command line options */ |
| 1161 | static const char *plugin_opts_add(struct plugin *plugin, |
| 1162 | const char *buffer, |
| 1163 | const jsmntok_t *resulttok) |
| 1164 | { |
| 1165 | const jsmntok_t *options = json_get_member(buffer, resulttok, "options"); |
| 1166 | size_t i; |
| 1167 | const jsmntok_t *t; |
| 1168 | |
| 1169 | if (!options) { |
| 1170 | return tal_fmt(plugin, |
| 1171 | "\"result.options\" was not found in the manifest"); |
| 1172 | } |
| 1173 | |
| 1174 | if (options->type != JSMN_ARRAY) { |
| 1175 | return tal_fmt(plugin, "\"result.options\" is not an array"); |
| 1176 | } |
| 1177 | |
| 1178 | json_for_each_arr(i, t, options) { |
| 1179 | const char *err = plugin_opt_add(plugin, buffer, t); |
| 1180 | if (err) |
| 1181 | return err; |
| 1182 | } |
| 1183 | |
| 1184 | return NULL; |
| 1185 | } |
| 1186 | |
| 1187 | static void json_stream_forward_change_id(struct json_stream *stream, |
| 1188 | const char *buffer, |
no test coverage detected