*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include <stdio.h>
const gchar *(*name) (void);
const gchar *(*desc) (void);
const gchar *(*type) (void);
+ const gchar *(*licence) (void);
GSList *rdeps;
};
gint (*plugin_init) (gchar **error);
gpointer plugin_name, plugin_desc;
const gchar *(*plugin_type)(void);
+ const gchar *(*plugin_licence)(void);
gint ok;
g_return_val_if_fail(filename != NULL, NULL);
if (!g_module_symbol(plugin->module, "plugin_name", &plugin_name) ||
!g_module_symbol(plugin->module, "plugin_desc", &plugin_desc) ||
!g_module_symbol(plugin->module, "plugin_type", (gpointer)&plugin_type) ||
+ !g_module_symbol(plugin->module, "plugin_licence", (gpointer)&plugin_licence) ||
!g_module_symbol(plugin->module, "plugin_init", (gpointer)&plugin_init)) {
*error = g_strdup(g_module_error());
g_module_close(plugin->module);
return NULL;
}
+ if (strcmp(plugin_licence(), "GPL")
+ && strncmp(plugin_licence(), "GPL-compatible", strlen("GPL-compatible"))) {
+ *error = g_strdup(_("This module is not licenced under a GPL compatible licence."));
+ g_module_close(plugin->module);
+ g_free(plugin);
+ return NULL;
+ }
+
if (!strcmp(plugin_type(), "GTK")) {
*error = g_strdup(_("This module is for Sylpheed-Claws GTK1."));
g_module_close(plugin->module);
plugin->name = plugin_name;
plugin->desc = plugin_desc;
plugin->type = plugin_type;
+ plugin->licence = plugin_licence;
plugin->filename = g_strdup(filename);
plugins = g_slist_append(plugins, plugin);