| 2027 | } |
| 2028 | |
| 2029 | void plugins_init(struct plugins *plugins) |
| 2030 | { |
| 2031 | plugins->default_dir = path_join(plugins, plugins->ld->config_basedir, "plugins"); |
| 2032 | plugins_add_default_dir(plugins); |
| 2033 | |
| 2034 | if (plugins->dev_builtin_plugins_unimportant) { |
| 2035 | size_t i; |
| 2036 | |
| 2037 | log_debug(plugins->log, "Builtin plugins now unimportant"); |
| 2038 | |
| 2039 | /* For each builtin plugin, check for a matching plugin |
| 2040 | * and make it unimportant. */ |
| 2041 | for (i = 0; list_of_builtin_plugins[i]; ++i) { |
| 2042 | const char *name = list_of_builtin_plugins[i]; |
| 2043 | struct plugin *p; |
| 2044 | list_for_each(&plugins->plugins, p, list) { |
| 2045 | if (plugin_paths_match(p->cmd, name)) { |
| 2046 | p->important = false; |
| 2047 | break; |
| 2048 | } |
| 2049 | } |
| 2050 | } |
| 2051 | } |
| 2052 | |
| 2053 | setenv("LIGHTNINGD_PLUGIN", "1", 1); |
| 2054 | setenv("LIGHTNINGD_VERSION", version(), 1); |
| 2055 | |
| 2056 | if (plugins_send_getmanifest(plugins, NULL)) |
| 2057 | io_loop_with_timers(plugins->ld); |
| 2058 | } |
| 2059 | |
| 2060 | static void plugin_config_cb(const char *buffer, |
| 2061 | const jsmntok_t *toks, |
no test coverage detected