flow: Merged 'tcc-loader' to ('develop').
--- a/CMakeLists.txt Mon Aug 22 15:37:51 2016 -0500
+++ b/CMakeLists.txt Tue Aug 23 12:00:37 2016 -0500
@@ -195,6 +195,7 @@
###############################################################################
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/cmake/Modules/FindLibTcc.cmake Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,51 @@
+find_path(libtcc_INCLUDE_DIR +# find home brew and stash the prefix of tcc if there is one + find_program(BREW brew) + COMMAND ${BREW} --prefix tcc + OUTPUT_VARIABLE BREW_TCC_PREFIX + OUTPUT_STRIP_TRAILING_WHITESPACE + set(BREW_TCC_LIB_DIR ${BREW_TCC_PREFIX}/lib) + set(BREW_TCC_INCLUDE_DIR ${BREW_TCC_PREFIX}/include) +find_path(LIBTCC_INCLUDE_DIR + ${BREW_TCC_INCLUDE_DIR} +find_library(LIBTCC_LIBRARIES + /usr/lib/x86_64-linux-gnu + /usr/lib/x86_32-linux-gnu +include(CMakeParseArguments) +find_package_handle_standard_args(libtcc REQUIRED_VARS LIBTCC_LIBRARIES LIBTCC_INCLUDE_DIR) +set(TCC_FOUND ${LIBTCC_FOUND}) + set(TCC_INCLUDE_DIRS ${LIBTCC_INCLUDE_DIR}) + set(TCC_LIBRARIES ${LIBTCC_LIBRARY}) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/CMakeLists.txt Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,39 @@
+ "Whether or not to build the TCC plugin loader" + set(GPLUGIN_TCC_SOURCES + set(GPLUGIN_TCC_HEADERS + find_package(LibTcc REQUIRED) + include_directories(${LIBTCC_INCLUDE_DIR}) + #pkg_check_modules(TCC REQUIRED libtcc) + add_library(gplugin-tcc MODULE + set_target_properties(gplugin-tcc PROPERTIES PREFIX "") + target_link_libraries(gplugin-tcc + install(TARGETS gplugin-tcc DESTINATION lib/gplugin) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-core.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,67 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +#include "gplugin-tcc-loader.h" +#include "gplugin-tcc-plugin.h" +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + const gchar * const authors[] = { + "Eion Robb <eion@robbmob.com>", + return gplugin_plugin_info_new( + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, + "name", "C source plugin loader", + "version", GPLUGIN_VERSION, + "summary", "A plugin that can load C source plugins", + "description", "This plugin allows the loading of plugins written in C.", + "website", GPLUGIN_WEBSITE, +G_MODULE_EXPORT gboolean +gplugin_load(GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) + gplugin_tcc_loader_register(plugin); + gplugin_tcc_plugin_register(plugin); + gplugin_manager_register_loader(gplugin_tcc_loader_get_type()); +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-loader.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,203 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "gplugin-tcc-loader.h" +#include "gplugin-tcc-plugin.h" +/****************************************************************************** + *****************************************************************************/ +static GObjectClass *parent_class = NULL; +static GType type_real = 0; +/****************************************************************************** + * GPluginLoaderInterface API + *****************************************************************************/ +gplugin_tcc_loader_class_supported_extensions(GPLUGIN_UNUSED const GPluginLoaderClass *klass) { + exts = g_slist_append(exts, "c"); +gplugin_tcc_loader_query(GPluginLoader *loader, const gchar *filename, + GPluginPlugin *plugin = NULL; + GPluginPluginInfo *info = NULL; + gpointer memneeded = NULL; + GPluginTccPluginQueryFunc gplugin_query = NULL; + tcc_set_output_type(s, TCC_OUTPUT_MEMORY); + if(tcc_add_file(s, filename) == -1) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "couldn't load file %s", filename); + /* copy code into memory */ + if((memsize = tcc_relocate(s, NULL)) < 0) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "couldn't work out how much memory is needed"); + memneeded = g_malloc0(memsize); + if(tcc_relocate(s, memneeded) < 0) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "could not relocate plugin into memory"); + gplugin_query = (GPluginTccPluginQueryFunc) tcc_get_symbol(s, "gplugin_query"); + if (gplugin_query == NULL) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "no gplugin_query function found"); + info = gplugin_query(error); + plugin = g_object_new(GPLUGIN_TYPE_TCC_PLUGIN, +gplugin_tcc_loader_load(GPLUGIN_UNUSED GPluginLoader *loader, + GPluginTccPluginLoadFunc gplugin_load = NULL; + TCCState *s = gplugin_tcc_plugin_get_state(GPLUGIN_TCC_PLUGIN(plugin)); + gplugin_load = (GPluginTccPluginLoadFunc) tcc_get_symbol(s, "gplugin_load"); + if (gplugin_load == NULL) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "no gplugin_load function found"); + return gplugin_load(GPLUGIN_NATIVE_PLUGIN(plugin), error); +gplugin_tcc_loader_unload(GPLUGIN_UNUSED GPluginLoader *loader, + GPluginTccPluginLoadFunc gplugin_unload = NULL; + TCCState *s = gplugin_tcc_plugin_get_state(GPLUGIN_TCC_PLUGIN(plugin)); + gplugin_unload = (GPluginTccPluginUnloadFunc) tcc_get_symbol(s, "gplugin_unload"); + if (gplugin_unload == NULL) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "no gplugin_unload function found"); + return gplugin_unload(GPLUGIN_NATIVE_PLUGIN(plugin), error); +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_loader_class_init(GPluginTccLoaderClass *klass) { + GPluginLoaderClass *loader_class = GPLUGIN_LOADER_CLASS(klass); + parent_class = g_type_class_peek_parent(klass); + loader_class->supported_extensions = + gplugin_tcc_loader_class_supported_extensions; + loader_class->query = gplugin_tcc_loader_query; + loader_class->load = gplugin_tcc_loader_load; + loader_class->unload = gplugin_tcc_loader_unload; +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_loader_register(GPluginNativePlugin *plugin) { + if(g_once_init_enter(&type_real)) { + static const GTypeInfo info = { + .class_size = sizeof(GPluginTccLoaderClass), + .class_init = (GClassInitFunc)gplugin_tcc_loader_class_init, + .instance_size = sizeof(GPluginTccLoader), + type = gplugin_native_plugin_register_type(plugin, + g_once_init_leave(&type_real, type); +gplugin_tcc_loader_get_type(void) { + if(G_UNLIKELY(type_real == 0)) { + g_warning("gplugin_tcc_loader_get_type was called before " + "the type was registered!\n"); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-loader.h Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,59 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifndef GPLUGIN_TCC_LOADER_H +#define GPLUGIN_TCC_LOADER_H +#define GPLUGIN_TYPE_TCC_LOADER (gplugin_tcc_loader_get_type()) +#define GPLUGIN_TCC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_TCC_LOADER, GPluginTccLoader)) +#define GPLUGIN_TCC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_TCC_LOADER, GPluginTccLoaderClass)) +#define GPLUGIN_IS_TCC_LOADER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_TCC_LOADER)) +#define GPLUGIN_IS_TCC_LOADER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_TCC_LOADER)) +#define GPLUGIN_TCC_LOADER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_TCC_LOADER, GPluginTccLoaderClass)) +typedef struct _GPluginTccLoader GPluginTccLoader; +typedef struct _GPluginTccLoaderClass GPluginTccLoaderClass; +#include <gplugin-native.h> +struct _GPluginTccLoader { + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +struct _GPluginTccLoaderClass { + GPluginLoaderClass parent; + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +void gplugin_tcc_loader_register(GPluginNativePlugin *plugin); +GType gplugin_tcc_loader_get_type(void); +#endif /* GPLUGIN_TCC_LOADER_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-plugin.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,183 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include "gplugin-tcc-plugin.h" +#define GPLUGIN_TCC_PLUGIN_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPluginPrivate)) +/****************************************************************************** + *****************************************************************************/ +} GPluginTccPluginPrivate; +/****************************************************************************** + *****************************************************************************/ +/****************************************************************************** + *****************************************************************************/ +static GObjectClass *parent_class = NULL; +static GType type_real = 0; +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_plugin_set_state(GPluginTccPlugin *plugin, TCCState *s) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(plugin); +gplugin_tcc_plugin_set_memory(GPluginTccPlugin *plugin, gpointer mem) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(plugin); +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_plugin_get_property(GObject *obj, guint param_id, GValue *value, + GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj); + g_value_set_pointer(value, + gplugin_tcc_plugin_get_state(plugin)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +gplugin_tcc_plugin_set_property(GObject *obj, guint param_id, + const GValue *value, GParamSpec *pspec) + GPluginTccPlugin *plugin = GPLUGIN_TCC_PLUGIN(obj); + gplugin_tcc_plugin_set_state(plugin, + g_value_get_pointer(value)); + gplugin_tcc_plugin_set_memory(plugin, + g_value_get_pointer(value)); + G_OBJECT_WARN_INVALID_PROPERTY_ID(obj, param_id, pspec); +gplugin_tcc_plugin_finalize(GObject *obj) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(obj); + G_OBJECT_CLASS(parent_class)->finalize(obj); +gplugin_tcc_plugin_class_init(GPluginTccPluginClass *klass) { + GObjectClass *obj_class = G_OBJECT_CLASS(klass); + parent_class = g_type_class_peek_parent(klass); + g_type_class_add_private(klass, sizeof(GPluginTccPluginPrivate)); + obj_class->get_property = gplugin_tcc_plugin_get_property; + obj_class->set_property = gplugin_tcc_plugin_set_property; + obj_class->finalize = gplugin_tcc_plugin_finalize; + g_object_class_install_property(obj_class, PROP_STATE, + g_param_spec_pointer("state", "state", + "The TCC compilation context for the plugin", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); + g_object_class_install_property(obj_class, PROP_MEM, + g_param_spec_pointer("memory", "memory", + "The memory allocated for the symbol table for the plugin", + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)); +/****************************************************************************** + *****************************************************************************/ +gplugin_tcc_plugin_register(GPluginNativePlugin *plugin) { + if(g_once_init_enter(&type_real)) { + static const GTypeInfo info = { + .class_size = sizeof(GPluginTccPluginClass), + .class_init = (GClassInitFunc)gplugin_tcc_plugin_class_init, + .instance_size = sizeof(GPluginTccPlugin), + type = gplugin_native_plugin_register_type(plugin, + g_once_init_leave(&type_real, type); +gplugin_tcc_plugin_get_type(void) { + if(G_UNLIKELY(type_real == 0)) { + g_warning("gplugin_tcc_plugin_get_type was called before " + "the type was registered!\n"); +gplugin_tcc_plugin_get_state(const GPluginTccPlugin *plugin) { + GPluginTccPluginPrivate *priv = GPLUGIN_TCC_PLUGIN_GET_PRIVATE(plugin); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/gplugin-tcc-plugin.h Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,62 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#ifndef GPLUGIN_TCC_PLUGIN_H +#define GPLUGIN_TCC_PLUGIN_H +#define GPLUGIN_TYPE_TCC_PLUGIN (gplugin_tcc_plugin_get_type()) +#define GPLUGIN_TCC_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPlugin)) +#define GPLUGIN_TCC_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPluginClass)) +#define GPLUGIN_IS_TCC_PLUGIN(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GPLUGIN_TYPE_TCC_PLUGIN)) +#define GPLUGIN_IS_TCC_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((obj), GPLUGIN_TYPE_TCC_PLUGIN)) +#define GPLUGIN_TCC_PLUGIN_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GPLUGIN_TYPE_TCC_PLUGIN, GPluginTccPluginClass)) +typedef struct _GPluginTccPlugin GPluginTccPlugin; +typedef struct _GPluginTccPluginClass GPluginTccPluginClass; +#include <gplugin-native.h> +struct _GPluginTccPlugin { +struct _GPluginTccPluginClass { + GPluginPluginClass parent; + void (*_gplugin_reserved_1)(void); + void (*_gplugin_reserved_2)(void); + void (*_gplugin_reserved_3)(void); + void (*_gplugin_reserved_4)(void); +void gplugin_tcc_plugin_register(GPluginNativePlugin *plugin); +GType gplugin_tcc_plugin_get_type(void); +TCCState *gplugin_tcc_plugin_get_state(const GPluginTccPlugin *plugin); +typedef GPluginPluginInfo *(*GPluginTccPluginQueryFunc)(GError **error); +typedef gboolean (*GPluginTccPluginLoadFunc)(GPluginNativePlugin *plugin, GError **error); +typedef gboolean (*GPluginTccPluginUnloadFunc)(GPluginNativePlugin *plugin, GError **error); +#endif /* GPLUGIN_TCC_PLUGIN_H */ --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/CMakeLists.txt Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,52 @@
+macro(add_tcc_gtest target) + add_executable(${target} ${target}.c) + target_link_libraries(${target} + ${GLIB_LIBRARIES} ${TCC_LIBRARIES} gplugin + add_dependencies(${target} gplugin-tcc) + get_target_property(_output_name ${target} RUNTIME_OUTPUT_NAME) + if(NOT ${_output_name}) + get_target_property(_output_name ${target} LOCATION) + endif(NOT ${_output_name}) + list(APPEND TCC_TESTS ${_output_name}) + -DTCC_LOADER_DIR="${CMAKE_BINARY_DIR}/tcc" + -DTCC_PLUGIN_DIR="${CMAKE_CURRENT_SOURCE_DIR}/plugins" +add_tcc_gtest(test-tcc-loader) +target_link_libraries(test-tcc-loader gplugin-loader-tests) +set(GTESTER_TCC_TESTS "${TCC_TESTS}") +set(GTESTER_TCC_LOG "test-gplugin-tcc.xml") +set(GTESTER_TCC_JUNIT "test-gplugin-tcc-junit.xml") + COMMAND ${GTESTER} -k --verbose -o ${GTESTER_TCC_LOG} ${TCC_TESTS} + OUTPUT ${GTESTER_TCC_LOG} + DEPENDS gplugin ${GPLUGIN_GIR_TARGETS} gplugin-tcc + ${TCC_TESTS} ${CMAKE_CURRENT_SOURCE_DIR}/plugins + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${XSLTPROC} -o ${GTESTER_TCC_JUNIT} --nonet + ${CMAKE_SOURCE_DIR}/xsl/gtester-junit.xsl + OUTPUT ${GTESTER_TCC_JUNIT} + DEPENDS ${GTESTER_TCC_LOG} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +add_custom_target(tcc-tests ALL + DEPENDS ${GTESTER_TCC_LOG} ${GTESTER_TCC_JUNIT} ${TCC_TESTS} --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/basic-plugin.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,55 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + const gchar * const authors[] = { + return gplugin_plugin_info_new( + "gplugin/native-basic-plugin", + "name", "basic plugin", + "license-id", "license", + "description", "description", +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/dependent.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,49 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + const gchar * const dependencies[] = { + return gplugin_plugin_info_new( + "gplugin/native-dependent-plugin", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, + "dependencies", dependencies, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/load-exception.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,42 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + return gplugin_plugin_info_new( + "gplugin/native-load-exception", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/load-failed.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,43 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + return gplugin_plugin_info_new( + "gplugin/native-load-failed", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, GError **error) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "expected error"); +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/plugins/unload-failed.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,43 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin-native.h> +G_MODULE_EXPORT GPluginPluginInfo * +gplugin_query(GPLUGIN_UNUSED GError **error) { + return gplugin_plugin_info_new( + "gplugin/native-unload-failed", + GPLUGIN_NATIVE_PLUGIN_ABI_VERSION, +G_MODULE_EXPORT gboolean +gplugin_load(GPLUGIN_UNUSED GPluginNativePlugin *plugin, + GPLUGIN_UNUSED GError **error) +G_MODULE_EXPORT gboolean +gplugin_unload(GPLUGIN_UNUSED GPluginNativePlugin *plugin, GError **error) { + *error = g_error_new(GPLUGIN_DOMAIN, 0, "expected error"); --- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/tcc/tests/test-tcc-loader.c Tue Aug 23 12:00:37 2016 -0500
@@ -0,0 +1,31 @@
+ * Copyright (C) 2011-2013 Gary Kramlich <grim@reaperworld.com> + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. +#include <gplugin/gplugin-loader-tests.h> +main(gint argc, gchar **argv) { + g_test_init(&argc, &argv, NULL); + gplugin_loader_tests_main(TCC_LOADER_DIR, TCC_PLUGIN_DIR, "c");