diff --git a/src/plugins/rx3270/pluginmain.cc b/src/plugins/rx3270/pluginmain.cc index 3723ff9..785fd8b 100644 --- a/src/plugins/rx3270/pluginmain.cc +++ b/src/plugins/rx3270/pluginmain.cc @@ -95,15 +95,14 @@ static void call_rexx_script(GtkAction *action, GtkWidget *widget, const gchar *filename) { - const gchar * args = (const gchar *) g_object_get_data(G_OBJECT(action),"args"); + const gchar * args = (const gchar *) g_object_get_data(G_OBJECT(action),"args"); - struct rexx_application_data appdata = { action, widget, filename }; + struct rexx_application_data appdata = { action, widget, filename }; RexxInstance * instance; RexxThreadContext * threadContext; RexxOption options[25]; RexxContextExit exits[2]; - RexxLibraryPackage package; memset(options,0,sizeof(options)); memset(exits,0,sizeof(exits)); @@ -122,11 +121,7 @@ // options[0].optionName = LOAD_REQUIRED_LIBRARY; // options[0].option = "rx3270"; - package.registeredName = "rx3270"; - package.table = &rx3270_package_entry; - - options[2].optionName = REGISTER_LIBRARY; - options[2].option = (void *) &package; + rx3270_set_package_option(&options[2]); options[3].optionName = EXTERNAL_CALL_PATH; options[3].option = pw3270_get_datadir(NULL); diff --git a/src/plugins/rx3270/rx3270.h b/src/plugins/rx3270/rx3270.h index 42f6ded..7dbe917 100644 --- a/src/plugins/rx3270/rx3270.h +++ b/src/plugins/rx3270/rx3270.h @@ -124,8 +124,6 @@ /*---[ Globals ]---------------------------------------------------------------------------------------------*/ - LIB3270_EXPORT RexxPackageEntry rx3270_package_entry; - /*--[ 3270 Session ]-----------------------------------------------------------------------------------------*/ #if defined (HAVE_GNUC_VISIBILITY) @@ -212,4 +210,14 @@ rx3270 * create_lib3270_instance(void); +#ifdef __cplusplus + extern "C" { +#endif + + LIB3270_EXPORT void rx3270_set_package_option(RexxOption *option); + +#ifdef __cplusplus + } +#endif + #endif // RX3270_H_INCLUDED diff --git a/src/plugins/rx3270/rxapimain.cc b/src/plugins/rx3270/rxapimain.cc index cc738a5..938298b 100644 --- a/src/plugins/rx3270/rxapimain.cc +++ b/src/plugins/rx3270/rxapimain.cc @@ -183,6 +183,19 @@ OOREXX_GET_PACKAGE(rx3270); */ BEGIN_EXTERN_C() + +LIB3270_EXPORT void rx3270_set_package_option(RexxOption *option) +{ + static const RexxLibraryPackage package = { "rx3270", &rx3270_package_entry }; + +// package.registeredName = "rx3270"; +// package.table = ; + + option->optionName = REGISTER_LIBRARY; + option->option = (void *) &package; + +} + LIB3270_EXPORT RexxPackageEntry * RexxEntry RexxGetPackage(void) { return &rx3270_package_entry; -- libgit2 0.21.2