| 1766 | } |
| 1767 | |
| 1768 | void plugins_init(struct plugins *plugins) |
| 1769 | { |
| 1770 | plugins->default_dir = path_join(plugins, plugins->ld->config_basedir, "plugins"); |
| 1771 | plugins_add_default_dir(plugins); |
| 1772 | |
| 1773 | #if DEVELOPER |
| 1774 | if (plugins->dev_builtin_plugins_unimportant) { |
| 1775 | size_t i; |
| 1776 | |
| 1777 | log_debug(plugins->log, "Builtin plugins now unimportant"); |
| 1778 | |
| 1779 | /* For each builtin plugin, check for a matching plugin |
| 1780 | * and make it unimportant. */ |
| 1781 | for (i = 0; list_of_builtin_plugins[i]; ++i) { |
| 1782 | const char *name = list_of_builtin_plugins[i]; |
| 1783 | struct plugin *p; |
| 1784 | list_for_each(&plugins->plugins, p, list) { |
| 1785 | if (plugin_paths_match(p->cmd, name)) { |
| 1786 | p->important = false; |
| 1787 | break; |
| 1788 | } |
| 1789 | } |
| 1790 | } |
| 1791 | } |
| 1792 | #endif /* DEVELOPER */ |
| 1793 | |
| 1794 | setenv("LIGHTNINGD_PLUGIN", "1", 1); |
| 1795 | setenv("LIGHTNINGD_VERSION", version(), 1); |
| 1796 | |
| 1797 | if (plugins_send_getmanifest(plugins, NULL)) { |
| 1798 | void *ret; |
| 1799 | ret = io_loop_with_timers(plugins->ld); |
| 1800 | log_debug(plugins->ld->log, "io_loop_with_timers: %s", __func__); |
| 1801 | assert(ret == plugins); |
| 1802 | } |
| 1803 | } |
| 1804 | |
| 1805 | static void plugin_config_cb(const char *buffer, |
| 1806 | const jsmntok_t *toks, |
no test coverage detected