From 8ffcbcc41841a5437b44ad88d2b748ee98dab0a0 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Mon, 25 Feb 2013 11:02:42 +0000 Subject: [PATCH] Acertando funções hllapi e empacotamento windows --- po/pt_BR.po | 2 +- src/include/pw3270/hllapi.h | 3 +++ src/plugins/dbus3270/Makefile.in | 4 ++-- src/plugins/remotectl/Makefile.in | 30 ++++++++++++++++++++++++++---- src/plugins/remotectl/calls.c | 34 ++++++++++++++++++++++++++++------ 5 files changed, 60 insertions(+), 13 deletions(-) diff --git a/po/pt_BR.po b/po/pt_BR.po index bb4a588..74ec9a7 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-02-21 17:02-0300\n" +"POT-Creation-Date: 2013-02-25 07:46-0300\n" "PO-Revision-Date: 2013-01-14 09:49-0200\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português <>\n" diff --git a/src/include/pw3270/hllapi.h b/src/include/pw3270/hllapi.h index c05c0c6..865f064 100644 --- a/src/include/pw3270/hllapi.h +++ b/src/include/pw3270/hllapi.h @@ -88,6 +88,9 @@ extern "C" { __declspec (dllexport) int __stdcall hllapi_cmp_text_at(LPWORD rc, WORD row, WORD col, LPSTR text); __declspec (dllexport) int __stdcall hllapi_wait_for_ready(LPWORD rc, WORD seconds); __declspec (dllexport) int __stdcall hllapi_wait(LPWORD rc, WORD seconds); + __declspec (dllexport) int __stdcall hllapi_pfkey(LPWORD rc, WORD key); + __declspec (dllexport) int __stdcall hllapi_pakey(LPWORD rc, WORD key); + #else LIB3270_EXPORT int hllapi(const unsigned long *func, char *str, unsigned short *length, unsigned short *rc); diff --git a/src/plugins/dbus3270/Makefile.in b/src/plugins/dbus3270/Makefile.in index c1b27dc..d5efe2e 100644 --- a/src/plugins/dbus3270/Makefile.in +++ b/src/plugins/dbus3270/Makefile.in @@ -84,14 +84,14 @@ ifeq ($(LIB3270_MODE),Debug) PW3270_LIBS="-L../../../.bin/Debug@DLLDIR@ -lpw3270" PW3270_CFLAGS="-I../../../src/include" LIB3270_LIBS="-L../../../.bin/Debug@DLLDIR@ -l3270" - LIB270_CFLAGS=-I../../../src/include + LIB3270_CFLAGS=-I../../../src/include endif ifeq ($(LIB3270_MODE),Release) PW3270_LIBS="-L../../../.bin/Release@DLLDIR@ -lpw3270" PW3270_CFLAGS="-I../../../src/include" LIB3270_LIBS="-L../../../.bin/Release@DLLDIR@ -l3270" - LIB270_CFLAGS=-I../../../src/include + LIB3270_CFLAGS=-I../../../src/include endif ifeq ($(LIB3270_MODE),Default) diff --git a/src/plugins/remotectl/Makefile.in b/src/plugins/remotectl/Makefile.in index 731c9fe..f3c67f6 100644 --- a/src/plugins/remotectl/Makefile.in +++ b/src/plugins/remotectl/Makefile.in @@ -58,20 +58,42 @@ XGETTEXT=@XGETTEXT@ DLL_FLAGS=@DLL_FLAGS@ DEBUG_CFLAGS=-DDEBUG=1 -g -Wall -PW3270_LIBS ?= `pkg-config --libs lib3270` -PW3270_CFLAGS ?= `pkg-config --cflags lib3270` +LIB3270_MODE ?= Default + +ifeq ($(LIB3270_MODE),Debug) + PW3270_LIBS=-L../../../.bin/Debug@DLLDIR@ -lpw3270 -l3270 + PW3270_CFLAGS=-I../../../src/include + LIB3270_LIBS=-L../../../.bin/Debug@DLLDIR@ -l3270 + LIB3270_CFLAGS=-I../../../src/include +endif + +ifeq ($(LIB3270_MODE),Release) + PW3270_LIBS=-L../../../.bin/Release@DLLDIR@ -lpw3270 -l3270 + PW3270_CFLAGS=-I../../../src/include + LIB3270_LIBS=-L../../../.bin/Release@DLLDIR@ -l3270 + LIB3270_CFLAGS=-I../../../src/include +endif + +ifeq ($(LIB3270_MODE),Default) + LIB3270_LIBS ?= `pkg-config --libs lib3270` + LIB3270_CFLAGS ?= `pkg-config --cflags lib3270` + PW3270_LIBS ?= `pkg-config --libs pw3270 lib3270` + PW3270_CFLAGS ?= `pkg-config --cflags pw3270 lib3270` +endif + + GTK_CFLAGS ?= @GTK_CFLAGS@ @GTKMAC_CFLAGS@ GTK_LIBS ?= @GTK_LIBS@ @GTKMAC_LIBS@ $(OBJDBG)/%.o: %.c $(DEPENDS) @echo " CC `basename $@`" @$(MKDIR) `dirname $@` - @$(CC) $(CFLAGS) $(DEBUG_CFLAGS) $(PW3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< + @$(CC) $(CFLAGS) $(DEBUG_CFLAGS) $(LIB3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< $(OBJRLS)/%.o: %.c $(DEPENDS) @echo " CC `basename $@`" @$(MKDIR) `dirname $@` - @$(CC) $(CFLAGS) $(PW3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< + @$(CC) $(CFLAGS) $(LIB3270_CFLAGS) $(GTK_CFLAGS) -o $@ -c $< #---[ Release targets ]-------------------------------------------------------- diff --git a/src/plugins/remotectl/calls.c b/src/plugins/remotectl/calls.c index d1aca5d..51af70f 100644 --- a/src/plugins/remotectl/calls.c +++ b/src/plugins/remotectl/calls.c @@ -52,12 +52,14 @@ static char * (*get_text)(H3270 *h, int row, int col, int len) = NULL; static void * (*release_memory)(void *p) = NULL; static int (*action_enter)(H3270 *h) = NULL; - static int (*set_text_at)(H3270 *h, int row, int col, const unsigned char *str) = NULL; + static int (*set_text_at)(H3270 *h, int row, int col, const unsigned char *str) = NULL; static int (*cmp_text_at)(H3270 *h, int row, int col, const char *text) = NULL; + static int (*pfkey)(H3270 *hSession, int key) = NULL; + static int (*pakey)(H3270 *hSession, int key) = NULL; static const struct _entry_point { - void **ptr; + void **call; const char * name; } entry_point[] = { @@ -74,6 +76,8 @@ { (void **) &action_enter, "lib3270_enter" }, { (void **) &set_text_at, "lib3270_set_string_at" }, { (void **) &cmp_text_at, "lib3270_cmp_text_at" }, + { (void **) &pfkey, "lib3270_pfkey" }, + { (void **) &pakey, "lib3270_pakey" }, { NULL, NULL } }; @@ -108,7 +112,7 @@ hllapi_deinit(); return ENOENT; } - *entry_point[f].ptr = ptr; + *entry_point[f].call = ptr; } // Get session handle @@ -117,7 +121,7 @@ return 0; } - // Set entry pointers to pipe based calls + // Set entry points to pipe based calls return -1; @@ -132,8 +136,7 @@ session_free(hSession); for(f=0;entry_point[f].name;f++) - *entry_point[f].ptr = NULL; - + *entry_point[f].call = NULL; if(hModule != NULL) { @@ -250,3 +253,22 @@ return 0; } + __declspec (dllexport) int __stdcall hllapi_pfkey(LPWORD rc, WORD key) + { + if(!(pfkey && hSession)) + return EINVAL; + + *rc = (WORD) pfkey(hSession,key); + + return 0; + } + + __declspec (dllexport) int __stdcall hllapi_pakey(LPWORD rc, WORD key) + { + if(!(pfkey && hSession)) + return EINVAL; + + *rc = (WORD) pakey(hSession,key); + + return 0; + } -- libgit2 0.21.2