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