diff --git a/src/include/pw3270.h b/src/include/pw3270.h index f1f5269..dc1c5f9 100644 --- a/src/include/pw3270.h +++ b/src/include/pw3270.h @@ -83,6 +83,8 @@ LIB3270_EXPORT gboolean pw3270_get_boolean(GtkWidget *widget, const gchar *group, const gchar *key, gboolean def); LIB3270_EXPORT void pw3270_set_boolean(GtkWidget *widget, const gchar *group, const gchar *key, gint val); + LIB3270_EXPORT gchar * pw3270_get_datadir(const gchar *first_element, ...); + typedef enum pw3270_src { PW3270_SRC_ALL, /**< Screen contents */ diff --git a/src/plugins/rx3270/pluginmain.cc b/src/plugins/rx3270/pluginmain.cc index 694eb39..3723ff9 100644 --- a/src/plugins/rx3270/pluginmain.cc +++ b/src/plugins/rx3270/pluginmain.cc @@ -103,6 +103,7 @@ RexxThreadContext * threadContext; RexxOption options[25]; RexxContextExit exits[2]; + RexxLibraryPackage package; memset(options,0,sizeof(options)); memset(exits,0,sizeof(exits)); @@ -110,12 +111,28 @@ exits[0].sysexit_code = RXSIO; exits[0].handler = Rexx_IO_exit; + // http://www.oorexx.org/docs/rexxpg/c2539.htm + options[0].optionName = DIRECT_EXITS; options[0].option = (void *) exits; options[1].optionName = APPLICATION_DATA; options[1].option = (void *) &appdata; +// 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; + + options[3].optionName = EXTERNAL_CALL_PATH; + options[3].option = pw3270_get_datadir(NULL); + + trace("Rexxdir: \"%s\"",(gchar *) ((void *) options[3].option)); + if(!RexxCreateInterpreter(&instance, &threadContext, options)) { GtkWidget *dialog = gtk_message_dialog_new( GTK_WINDOW(gtk_widget_get_toplevel(widget)), @@ -198,6 +215,8 @@ trace("%s ends",__FUNCTION__); } + g_free(options[3].option); + } diff --git a/src/plugins/rx3270/rx3270.cls b/src/plugins/rx3270/rx3270.cls index 018a8ac..235bcc0 100644 --- a/src/plugins/rx3270/rx3270.cls +++ b/src/plugins/rx3270/rx3270.cls @@ -27,6 +27,8 @@ /* */ /*-------------------------------------------------------------------------------*/ +::requires "rx3270" LIBRARY + /*-------------------------------------------------------------------------------*/ /* 3270 class */ /*-------------------------------------------------------------------------------*/ diff --git a/src/plugins/rx3270/rx3270.h b/src/plugins/rx3270/rx3270.h index 3c85145..42f6ded 100644 --- a/src/plugins/rx3270/rx3270.h +++ b/src/plugins/rx3270/rx3270.h @@ -124,6 +124,8 @@ /*---[ Globals ]---------------------------------------------------------------------------------------------*/ + LIB3270_EXPORT RexxPackageEntry rx3270_package_entry; + /*--[ 3270 Session ]-----------------------------------------------------------------------------------------*/ #if defined (HAVE_GNUC_VISIBILITY) diff --git a/src/plugins/rx3270/rxapimain.cc b/src/plugins/rx3270/rxapimain.cc index 361de74..cc738a5 100644 --- a/src/plugins/rx3270/rxapimain.cc +++ b/src/plugins/rx3270/rxapimain.cc @@ -83,11 +83,13 @@ BOOL WINAPI DllMain(HANDLE hinst, DWORD dwcallpurpose, LPVOID lpvResvd) int librx3270_loaded(void) { + trace("%s",__FUNCTION__); return 0; } int librx3270_unloaded(void) { + trace("%s",__FUNCTION__); return 0; } @@ -167,7 +169,7 @@ RexxPackageEntry rx3270_package_entry = { STANDARD_PACKAGE_HEADER REXX_CURRENT_INTERPRETER_VERSION, // anything after 4.0.0 will work - "pw3270", // name of the package + "rx3270", // name of the package PACKAGE_VERSION, // package information NULL, // no load/unload functions NULL, diff --git a/src/pw3270/tools.c b/src/pw3270/tools.c index 40016c6..3292d26 100644 --- a/src/pw3270/tools.c +++ b/src/pw3270/tools.c @@ -185,3 +185,14 @@ LIB3270_EXPORT gchar * pw3270_get_filename(GtkWidget *widget, const gchar *group return filename; } + +LIB3270_EXPORT gchar * pw3270_get_datadir(const gchar *first_element, ...) +{ + va_list args; + gchar *path; + + va_start(args, first_element); + path = filename_from_va(first_element,args); + va_end(args); + return path; +} -- libgit2 0.21.2