diff --git a/src/include/plugin.mak.in b/src/include/plugin.mak.in index 40a3028..d4add82 100644 --- a/src/include/plugin.mak.in +++ b/src/include/plugin.mak.in @@ -44,6 +44,7 @@ OBJEXT = o MKDIR=@MKDIR_P@ CC=@CC@ +CXX=@CXX@ LD=@CC@ MSGCAT=@MSGCAT@ XGETTEXT=@XGETTEXT@ @@ -86,11 +87,20 @@ $(OBJDBG)/%.o: %.c $(DEPENDS) @$(MKDIR) `dirname $@` @$(CC) $(DLL_CFLAGS) $(CFLAGS) $(DEBUG_CFLAGS) $(PW3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< +$(OBJDBG)/%.o: %.cc $(DEPENDS) + @echo " CC `basename $@`" + @$(MKDIR) `dirname $@` + @$(CXX) $(DLL_CFLAGS) $(CFLAGS) $(DEBUG_CFLAGS) $(PW3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< + $(OBJRLS)/%.o: %.c $(DEPENDS) @echo " CC `basename $@`" @$(MKDIR) `dirname $@` @$(CC) $(DLL_CFLAGS) $(CFLAGS) $(PW3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< +$(OBJRLS)/%.o: %.cc $(DEPENDS) + @echo " CC `basename $@`" + @$(MKDIR) `dirname $@` + @$(CXX) $(DLL_CFLAGS) $(CFLAGS) $(PW3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< #---[ Targets ]---------------------------------------------------------------- diff --git a/src/include/pw3270/plugin.h b/src/include/pw3270/plugin.h index 66fac8f..abf2c21 100644 --- a/src/include/pw3270/plugin.h +++ b/src/include/pw3270/plugin.h @@ -36,11 +36,19 @@ #include #include +#ifdef __cplusplus + extern "C" { +#endif + LIB3270_EXPORT int pw3270_plugin_init(GtkWidget *window); LIB3270_EXPORT int pw3270_plugin_deinit(GtkWidget *window); LIB3270_EXPORT void pw3270_plugin_start(GtkWidget *window); LIB3270_EXPORT void pw3270_plugin_stop(GtkWidget *window); +#ifdef __cplusplus + } +#endif + #endif // PW3270_PLUGIN_INCLUDED diff --git a/src/plugins/rx3270/pluginmain.c b/src/plugins/rx3270/pluginmain.c deleted file mode 100644 index aca0f70..0000000 --- a/src/plugins/rx3270/pluginmain.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a - * aplicativos mainframe. Registro no INPI sob o nome G3270. - * - * Copyright (C) <2008> - * - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela - * Free Software Foundation. - * - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para - * obter mais detalhes. - * - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este - * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple - * Place, Suite 330, Boston, MA, 02111-1307, USA - * - * Este programa está nomeado como pluginmain.c e possui - linhas de código. - * - * Contatos: - * - * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) - * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) - * - */ - - #include - #include - - #include "rx3270.h" - -/*--[ Implement ]------------------------------------------------------------------------------------*/ - - LIB3270_EXPORT int pw3270_plugin_init(GtkWidget *window) - { - trace("%s called for window %p",__FUNCTION__,window); - - return 0; - } - diff --git a/src/plugins/rx3270/rx3270.h b/src/plugins/rx3270/rx3270.h index 6b3840e..c978040 100644 --- a/src/plugins/rx3270/rx3270.h +++ b/src/plugins/rx3270/rx3270.h @@ -32,6 +32,7 @@ #define RX3270_H_INCLUDED 1 #include + #include #include #include #include @@ -45,4 +46,10 @@ /*---[ Globals ]---------------------------------------------------------------------------------------------*/ +/*--[ Prototipes ]-------------------------------------------------------------------------------------------*/ + + LIB3270_EXPORT REXX_TYPED_ROUTINE_PROTOTYPE(rx3270version); + + + #endif // RX3270_H_INCLUDED diff --git a/src/plugins/rx3270/rxapimain.c b/src/plugins/rx3270/rxapimain.c index ae6468e..761a4a6 100644 --- a/src/plugins/rx3270/rxapimain.c +++ b/src/plugins/rx3270/rxapimain.c @@ -28,66 +28,32 @@ */ /* + * * Reference: * * http://www.oorexx.org/docs/rexxpg/x2950.htm * */ - #include - #include - #include - #include "rx3270.h" -// create function declarations for the linker -REXX_TYPED_ROUTINE_PROTOTYPE(rx3270LoadFuncs); -REXX_TYPED_ROUTINE_PROTOTYPE(rx3270DropFuncs); -REXX_TYPED_ROUTINE_PROTOTYPE(rx3270Version); - -/*--[ Globals ]--------------------------------------------------------------------------------------*/ - #if defined WIN32 - BOOL WINAPI DllMain(HANDLE hinst, DWORD dwcallpurpose, LPVOID lpvResvd); - static int librx3270_loaded(void); - static int librx3270_unloaded(void); + BOOL WINAPI DllMain(HANDLE hinst, DWORD dwcallpurpose, LPVOID lpvResvd); + static int librx3270_loaded(void); + static int librx3270_unloaded(void); #else - int librx3270_loaded(void) __attribute__((constructor)); - int librx3270_unloaded(void) __attribute__((destructor)); + int librx3270_loaded(void) __attribute__((constructor)); + int librx3270_unloaded(void) __attribute__((destructor)); #endif - -/*--[ Rexx Package description ]---------------------------------------------------------------------*/ - - -// now build the actual entry list -RexxRoutineEntry rx3270_functions[] = -{ - REXX_TYPED_ROUTINE(rx3270Version, rx3270Version), - REXX_LAST_ROUTINE() -}; - -RexxPackageEntry rx3270_package_entry = -{ - STANDARD_PACKAGE_HEADER - REXX_INTERPRETER_4_0_0, /**> anything after 4.0.0 will work */ - "RX3270", /**> name of the package */ - PACKAGE_VERSION, /**> package information */ - NULL, /**> no load/unload functions */ - NULL, /**> no load/unload functions */ - rx3270_functions, /**> the exported functions */ - NULL /**> no methods in rx3270. */ -}; - -// package loading stub. -OOREXX_GET_PACKAGE(rx3270); - /*--[ Implement ]------------------------------------------------------------------------------------*/ #if defined WIN32 BOOL WINAPI DllMain(HANDLE hinst, DWORD dwcallpurpose, LPVOID lpvResvd) { - switch(dwcallpurpose) - { +// Trace("%s - Library %s",__FUNCTION__,(dwcallpurpose == DLL_PROCESS_ATTACH) ? "Loaded" : "Unloaded"); + + switch(dwcallpurpose) + { case DLL_PROCESS_ATTACH: librx3270_loaded(); break; @@ -95,26 +61,49 @@ BOOL WINAPI DllMain(HANDLE hinst, DWORD dwcallpurpose, LPVOID lpvResvd) case DLL_PROCESS_DETACH: librx3270_unloaded(); break; - } - - return TRUE; + } + return TRUE; } -#endif // WIN32 +#endif int librx3270_loaded(void) { - trace("%s %s %s",__FUNCTION__,__DATE__,__TIME__); - return 0; + trace("%s",__FUNCTION__); + return 0; } int librx3270_unloaded(void) { trace("%s",__FUNCTION__); - return 0; + return 0; } -RexxRoutine0(CSTRING, rx3270Version) +RexxRoutine0(CSTRING, rx3270version) { - return "teste"; // lib3270_get_version(); + return "Teste"; } + +// now build the actual entry list +RexxRoutineEntry rx3270_functions[] = +{ + REXX_TYPED_ROUTINE(rx3270version, rx3270version), + REXX_LAST_METHOD() +}; + +RexxPackageEntry rxmath_package_entry = +{ + STANDARD_PACKAGE_HEADER + REXX_INTERPRETER_4_0_0, // anything after 4.0.0 will work + "RX3270", // name of the package + "5.0", // package information + NULL, // no load/unload functions + NULL, + rx3270_functions, // the exported functions + NULL // no methods in rxmath. +}; + +// package loading stub. +OOREXX_GET_PACKAGE(rx3270); + + -- libgit2 0.21.2