From 1effce0c48a3ab3d2ad88bf3be5f5ac1a7162ed7 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 4 Apr 2013 12:10:02 +0000 Subject: [PATCH] Incluindo metodo "test" no rexx, pequenos ajustes na biblioteca --- configure.ac | 10 ++++++---- po/pt_BR.po | 216 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------ pw3270.cbp | 2 +- pw3270.spec.in | 43 ++++++++++++++++++++++++++++++++++--------- src/include/lib3270.h | 7 ++++--- src/include/plugin.mak.in | 14 ++++++++++++++ src/lib3270/screen.c | 2 +- src/lib3270/state.c | 6 ++++++ src/lib3270/telnet.c | 5 +++++ src/plugins/rx3270/Makefile.in | 14 +++++++++++++- src/plugins/rx3270/local.cc | 18 +++++++++--------- src/plugins/rx3270/pluginmain.cc | 18 +++++++++--------- src/plugins/rx3270/rexx_methods.cc | 39 +++++++++++++++++++++++++++++++++++---- src/plugins/rx3270/rx3270.cls | 1 + src/plugins/rx3270/rx3270.h | 7 ++++--- src/plugins/rx3270/sample/object.rex | 20 +++++++++++++++++--- 16 files changed, 267 insertions(+), 155 deletions(-) diff --git a/configure.ac b/configure.ac index 82f2042..7a9b7b2 100644 --- a/configure.ac +++ b/configure.ac @@ -405,6 +405,7 @@ if test "$app_cv_rexx" == "yes"; then fi fi else + REXX_HOME="\${datarootdir}/ooRexx" AC_DEFINE(HAVE_REXX) AC_CHECK_HEADER(oorexxapi.h, AC_DEFINE(HAVE_OOREXXAPI_H)) AC_PATH_TOOL([REXXC], [rexxc], [cp], `$REXXCONFIG --prefix`/bin ) @@ -413,10 +414,6 @@ if test "$app_cv_rexx" == "yes"; then fi fi -if test "$app_cv_registry" == "yes"; then - AC_DEFINE(HAVE_WIN_REGISTRY) -fi - if test "$app_cv_rexx" == "yes"; then PLUGINS="$PLUGINS rx3270" fi @@ -425,6 +422,7 @@ AC_SUBST(REXXC) AC_SUBST(REXXCONFIG) AC_SUBST(REXX_CFLAGS) AC_SUBST(REXX_LIBS) +AC_SUBST(REXX_HOME) #--[ Libreoffice ]-------------------------------------------------------------------------------------------------------------------------------------------- @@ -483,6 +481,10 @@ AC_SUBST(LIB3270_REQUIRES) #--[ Misc options ]------------------------------------------------------------------------------------------------------------------------------------------- +if test "$app_cv_registry" == "yes"; then + AC_DEFINE(HAVE_WIN_REGISTRY) +fi + AC_SUBST(MAJOR_VERSION,"$(echo $VERSION | cut -d. -f1)") AC_SUBST(HOST_CC) AC_SUBST(EXEEXT) diff --git a/po/pt_BR.po b/po/pt_BR.po index 88e4a95..12fac06 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-04-02 13:33-0300\n" +"POT-Creation-Date: 2013-04-04 08:20-0300\n" "PO-Revision-Date: 2013-04-01 10:06-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português <>\n" @@ -200,7 +200,7 @@ msgstr "Sobre a segurança" msgid "Action failed" msgstr "Ação falhou" -#: ui/00default.xml:64 +#: ui/00default.xml:286 msgid "Add to copy" msgstr "Adicionar à cópia" @@ -208,7 +208,7 @@ msgstr "Adicionar à cópia" msgid "Add/Remove _CR at end of line" msgstr "Adicionar/Remover _CR no final da linha" -#: ui/00default.xml:132 +#: ui/00default.xml:354 msgid "Alert sound" msgstr "Aviso sonoro" @@ -221,7 +221,7 @@ msgstr "" msgid "Application name" msgstr "Nome da aplicação" -#: ui/10keypad.xml:417 +#: ui/10keypad.xml:155 msgid "Attn" msgstr "Attn" @@ -238,7 +238,7 @@ msgstr "Divergência nos números de série da autoridade e emissor " msgid "Authority and subject key identifier mismatch" msgstr "Authority and subject key identifier mismatch" -#: ui/00default.xml:127 +#: ui/00default.xml:349 msgid "Auto-Reconnect" msgstr "Reconectar automaticamente" @@ -262,11 +262,11 @@ msgstr "Versão winsock inválida" msgid "Black" msgstr "Preto" -#: ui/00default.xml:125 +#: ui/00default.xml:347 msgid "Blank Fill" msgstr "Completar com espaços" -#: ui/00default.xml:118 +#: ui/00default.xml:340 msgid "Blinking Cursor" msgstr "Cursor piscante" @@ -274,7 +274,7 @@ msgstr "Cursor piscante" msgid "Blue" msgstr "Azul" -#: ui/00default.xml:128 +#: ui/00default.xml:350 msgid "Bold" msgstr "Negrito" @@ -282,7 +282,7 @@ msgstr "Negrito" msgid "Brazilian Public Software Portal" msgstr "Portal do Software Público Brasileiro" -#: ui/10keypad.xml:418 +#: ui/10keypad.xml:156 msgid "Break" msgstr "Break" @@ -474,7 +474,7 @@ msgstr "Tabela de tradução tem %d entradas, precisa de 256" msgid "Charset has more than 256 entries" msgstr "Tabela de tradução tem mais de 256 caracteres" -#: ui/00default.xml:79 +#: ui/10keypad.xml:147 msgid "Clear" msgstr "Limpar" @@ -486,7 +486,7 @@ msgstr "Tema de cores:" msgid "Color setup" msgstr "Configuração de cores" -#: ui/00default.xml:107 +#: ui/00default.xml:329 msgid "Colors" msgstr "Cores" @@ -494,7 +494,7 @@ msgstr "Cores" msgid "Complete" msgstr "Completo" -#: ui/00default.xml:117 +#: ui/00default.xml:339 msgid "Connect on startup" msgstr "Conectar ao iniciar" @@ -502,19 +502,19 @@ msgstr "Conectar ao iniciar" msgid "Connection reset by peer" msgstr "Conexão foi cancelada pelo servidor" -#: ui/00default.xml:61 +#: ui/00default.xml:283 msgid "Copy" msgstr "Copiar" -#: ui/99debug.xml:462 +#: ui/99debug.xml:200 msgid "Copy as HTML" msgstr "Copiar como HTML" -#: ui/00default.xml:62 +#: ui/00default.xml:284 msgid "Copy as table" msgstr "Copiar como tabela" -#: colors.c:418 ui/00default.xml:124 +#: colors.c:418 ui/00default.xml:346 msgid "Cross hair cursor" msgstr "Cursor mira" @@ -527,7 +527,7 @@ msgstr "Atual (%s)" msgid "Custom colors" msgstr "Cores personalizadas" -#: ui/00default.xml:65 +#: ui/00default.xml:287 msgid "Cut" msgstr "Recortar" @@ -539,7 +539,7 @@ msgstr "Cilindros" msgid "DFT B_uffer size:" msgstr "Tamanho do b_uffer DFT:" -#: ui/99debug.xml:467 +#: ui/99debug.xml:205 msgid "DS Trace" msgstr "DS Trace" @@ -555,11 +555,11 @@ msgstr "Verde Escuro" msgid "Data conversion error" msgstr "Erro na conversão de dados" -#: ui/99debug.xml:475 +#: ui/99debug.xml:213 msgid "Debug" msgstr "Depuração" -#: ui/99debug.xml:477 +#: ui/99debug.xml:215 msgid "Debug window updates" msgstr "Mostrar atualizações de janela" @@ -567,7 +567,7 @@ msgstr "Mostrar atualizações de janela" msgid "Default" msgstr "Padrão" -#: ui/00default.xml:81 +#: ui/00default.xml:303 msgid "Delete field" msgstr "Apagar campo" @@ -599,7 +599,7 @@ msgstr "Nome do servidor em branco" msgid "Empty port name" msgstr "Porta em branco" -#: ui/10keypad.xml:413 +#: ui/10keypad.xml:151 msgid "" "Erase\n" "EOF" @@ -607,7 +607,7 @@ msgstr "" "Apagar\n" "Campo" -#: ui/10keypad.xml:414 +#: ui/10keypad.xml:152 msgid "" "Erase\n" "Input" @@ -615,15 +615,15 @@ msgstr "" "Apagar\n" "Campos" -#: ui/00default.xml:80 +#: ui/00default.xml:302 msgid "Erase input" msgstr "Apagar campos" -#: ui/00default.xml:82 +#: ui/00default.xml:304 msgid "Erase to end of field" msgstr "Apagar até o final do campo" -#: ui/00default.xml:83 +#: ui/00default.xml:305 msgid "Erase to end of line" msgstr "Apagar até o final da linha" @@ -666,7 +666,7 @@ msgstr "Erro lendo %s" msgid "Error resolving %s: %s" msgstr "Erro ao resolver %s: %s" -#: ui/99debug.xml:469 +#: ui/99debug.xml:207 msgid "Event Trace" msgstr "Trace de eventos" @@ -714,11 +714,11 @@ msgstr "Format error in certificate's notAfter field" msgid "Format error in certificate's notBefore field" msgstr "Format error in certificate's notBefore field" -#: ui/00default.xml:121 +#: ui/00default.xml:343 msgid "Full Screen" msgstr "Tela cheia" -#: ui/10functions.xml:297 +#: ui/10functions.xml:35 msgid "Function bar" msgstr "Barra de funções" @@ -763,7 +763,7 @@ msgstr "HTTP Proxy: EOF inesperado" msgid "HTTP Proxy: unrecognized reply" msgstr "HTTP Proxy: Resposta desconhecida" -#: ui/00default.xml:142 +#: ui/00default.xml:364 msgid "Help" msgstr "Ajuda" @@ -824,7 +824,7 @@ msgstr "Comprimento de frame inválido" msgid "Informations" msgstr "Informações" -#: ui/00default.xml:137 +#: ui/00default.xml:359 msgid "Input method" msgstr "Método de entrada" @@ -871,7 +871,7 @@ msgstr "Sintaxe de proxy inválida" msgid "Invalid proxy type '%.*s'" msgstr "Tipo de proxy invalido '%.*s'" -#: ui/00default.xml:130 +#: ui/00default.xml:352 msgid "Keep selected" msgstr "Manter selecionado" @@ -887,7 +887,7 @@ msgstr "Teclado está bloqueado" msgid "LRECL:" msgstr "LRECL:" -#: ui/10keypad.xml:363 +#: ui/10keypad.xml:101 msgid "Lateral keypad" msgstr "Barra lateral" @@ -904,7 +904,7 @@ msgstr "Faltando ']'" msgid "Model %d (%s)" msgstr "Modelo %d (%s)" -#: ui/00default.xml:119 +#: ui/00default.xml:341 msgid "Monocase" msgstr "Só Maiúsculas" @@ -940,7 +940,7 @@ msgstr "Erro de rede" msgid "Network startup error" msgstr "Erro ao iniciar a rede" -#: ui/00default.xml:189 +#: ui/00default.xml:411 msgid "Next field" msgstr "Próximo campo" @@ -1017,111 +1017,111 @@ msgstr "Outro (VM/CMS)" msgid "Out of memory" msgstr "Memória insuficiente" -#: ui/10keypad.xml:400 +#: ui/10keypad.xml:138 msgid "PA1" msgstr "PA1" -#: ui/10keypad.xml:401 +#: ui/10keypad.xml:139 msgid "PA2" msgstr "PA2" -#: ui/10keypad.xml:402 +#: ui/10keypad.xml:140 msgid "PA3" msgstr "PA3" -#: ui/10functions.xml:298 +#: ui/10functions.xml:36 msgid "PF1" msgstr "PF1" -#: ui/10functions.xml:307 +#: ui/10functions.xml:45 msgid "PF10" msgstr "PF10" -#: ui/10functions.xml:308 +#: ui/10functions.xml:46 msgid "PF11" msgstr "PF11" -#: ui/10functions.xml:309 +#: ui/10functions.xml:47 msgid "PF12" msgstr "PF12" -#: ui/10functions.xml:312 +#: ui/10functions.xml:50 msgid "PF13" msgstr "PF13" -#: ui/10functions.xml:313 +#: ui/10functions.xml:51 msgid "PF14" msgstr "PF14" -#: ui/10functions.xml:314 +#: ui/10functions.xml:52 msgid "PF15" msgstr "PF15" -#: ui/10functions.xml:315 +#: ui/10functions.xml:53 msgid "PF16" msgstr "PF16" -#: ui/10functions.xml:316 +#: ui/10functions.xml:54 msgid "PF17" msgstr "PF17" -#: ui/10functions.xml:317 +#: ui/10functions.xml:55 msgid "PF18" msgstr "PF18" -#: ui/10functions.xml:318 +#: ui/10functions.xml:56 msgid "PF19" msgstr "PF19" -#: ui/10functions.xml:299 +#: ui/10functions.xml:37 msgid "PF2" msgstr "PF2" -#: ui/10functions.xml:319 +#: ui/10functions.xml:57 msgid "PF20" msgstr "PF20" -#: ui/10functions.xml:320 +#: ui/10functions.xml:58 msgid "PF21" msgstr "PF21" -#: ui/10functions.xml:321 +#: ui/10functions.xml:59 msgid "PF22" msgstr "PF22" -#: ui/10functions.xml:322 +#: ui/10functions.xml:60 msgid "PF23" msgstr "PF23" -#: ui/10functions.xml:323 +#: ui/10functions.xml:61 msgid "PF24" msgstr "PF24" -#: ui/10functions.xml:300 +#: ui/10functions.xml:38 msgid "PF3" msgstr "PF3" -#: ui/10functions.xml:301 +#: ui/10functions.xml:39 msgid "PF4" msgstr "PF4" -#: ui/10functions.xml:302 +#: ui/10functions.xml:40 msgid "PF5" msgstr "PF5" -#: ui/10functions.xml:303 +#: ui/10functions.xml:41 msgid "PF6" msgstr "PF6" -#: ui/10functions.xml:304 +#: ui/10functions.xml:42 msgid "PF7" msgstr "PF7" -#: ui/10functions.xml:305 +#: ui/10functions.xml:43 msgid "PF8" msgstr "PF8" -#: ui/10functions.xml:306 +#: ui/10functions.xml:44 msgid "PF9" msgstr "PF9" @@ -1138,15 +1138,15 @@ msgstr "Erro de interpretação em %s" msgid "Passthru Proxy: send error" msgstr "Passthru Proxy: Erro ao enviar" -#: ui/00default.xml:66 +#: ui/00default.xml:288 msgid "Paste" msgstr "Colar" -#: ui/00default.xml:67 +#: ui/00default.xml:289 msgid "Paste next" msgstr "Colar próximo" -#: ui/00default.xml:70 +#: ui/00default.xml:292 msgid "Paste text file" msgstr "Colar arquivo texto" @@ -1154,7 +1154,7 @@ msgstr "Colar arquivo texto" msgid "Paste text file contents" msgstr "Colar conteúdo de arquivo texto" -#: ui/00default.xml:123 +#: ui/00default.xml:345 msgid "Paste with left margin" msgstr "Colar com margem esquerda" @@ -1170,7 +1170,7 @@ msgstr "Caminho para os arquivos de dados da aplicação" msgid "Pink" msgstr "Rosa" -#: ui/00default.xml:188 +#: ui/00default.xml:410 msgid "Previous field" msgstr "Campo anterior" @@ -1178,11 +1178,11 @@ msgstr "Campo anterior" msgid "Primary space:" msgstr "Primary space:" -#: ui/00default.xml:49 +#: ui/00default.xml:271 msgid "Print" msgstr "Imprimir" -#: ui/00default.xml:51 +#: ui/00default.xml:273 msgid "Print copy" msgstr "Imprimir cópia" @@ -1190,7 +1190,7 @@ msgstr "Imprimir cópia" msgid "Print operation failed" msgstr "Operação de impressão falhou" -#: ui/00default.xml:50 +#: ui/00default.xml:272 msgid "Print selected" msgstr "Imprimir seleção" @@ -1198,7 +1198,7 @@ msgstr "Imprimir seleção" msgid "Print selection box" msgstr "Imprimir marca de seleção" -#: print.c:754 ui/00default.xml:108 +#: print.c:754 ui/00default.xml:330 msgid "Print settings" msgstr "Configurações de impressão" @@ -1286,7 +1286,7 @@ msgstr "RPQ: can't resolve '%s': %s" msgid "RPQ: gethostbyname error" msgstr "RPQ: Erro em gethostbyname" -#: ui/00default.xml:54 +#: ui/00default.xml:276 msgid "Receive file" msgstr "Receber arquivo" @@ -1302,27 +1302,27 @@ msgstr "Formato de registro" msgid "Red" msgstr "Vermelho" -#: ui/99debug.xml:476 +#: ui/99debug.xml:214 msgid "Reload buffer contents" msgstr "Recarregar conteúdo do buffer" -#: ui/00default.xml:75 +#: ui/00default.xml:297 msgid "Remove selection" msgstr "Remover seleção" -#: ui/00default.xml:76 +#: ui/00default.xml:298 msgid "Reselect" msgstr "Reselecionar" -#: ui/10keypad.xml:410 +#: ui/10keypad.xml:148 msgid "Reset" msgstr "Reset" -#: ui/00default.xml:122 +#: ui/00default.xml:344 msgid "Resize on alternate screen" msgstr "Mudar tamanho do terminal em tela alternativa" -#: ui/00default.xml:190 +#: ui/00default.xml:412 msgid "Return" msgstr "Return" @@ -1483,7 +1483,7 @@ msgstr "" "SSL_write:\n" "%s" -#: ui/00default.xml:46 +#: ui/00default.xml:268 msgid "Save copy" msgstr "Salvar cópia" @@ -1491,7 +1491,7 @@ msgstr "Salvar cópia" msgid "Save copy to file" msgstr "Salvar cópia para arquivo" -#: ui/00default.xml:44 +#: ui/00default.xml:266 msgid "Save screen" msgstr "Salvar tela" @@ -1499,7 +1499,7 @@ msgstr "Salvar tela" msgid "Save screen to file" msgstr "Salvar tela para arquivo" -#: ui/00default.xml:45 +#: ui/00default.xml:267 msgid "Save selected" msgstr "Salvar seleção" @@ -1507,15 +1507,15 @@ msgstr "Salvar seleção" msgid "Save selection to file" msgstr "Salvar seleção para arquivo" -#: ui/99debug.xml:468 +#: ui/99debug.xml:206 msgid "Screen Trace" msgstr "Trace de tela" -#: ui/00default.xml:114 +#: ui/00default.xml:336 msgid "Screen size" msgstr "Tamanho da tela" -#: ui/00default.xml:89 +#: ui/00default.xml:311 msgid "Scripts" msgstr "Scripts" @@ -1527,15 +1527,15 @@ msgstr "Secondary space:" msgid "Secure connection was successful." msgstr "Conexão segura efetuada com sucesso." -#: ui/00default.xml:74 +#: ui/00default.xml:296 msgid "Select Field" msgstr "Selecionar campo" -#: ui/00default.xml:73 +#: ui/00default.xml:295 msgid "Select all" msgstr "Selecionar tudo" -#: ui/00default.xml:126 +#: ui/00default.xml:348 msgid "Select by rectangles" msgstr "Seleção retangular" @@ -1547,7 +1547,7 @@ msgstr "Selecione arquivo a receber" msgid "Select file to send" msgstr "Selecione arquivo a enviar" -#: ui/00default.xml:111 +#: ui/00default.xml:333 msgid "Select font" msgstr "Selecione fonte" @@ -1571,7 +1571,7 @@ msgstr "Certificado auto assinado" msgid "Self signed certificate in certificate chain" msgstr "Certificado auto assinado na cadeia de certificados" -#: ui/00default.xml:55 +#: ui/00default.xml:277 msgid "Send file" msgstr "Enviar arquivo" @@ -1583,7 +1583,7 @@ msgstr "Enviar arquivo para o servidor" msgid "Send messages to syslog" msgstr "Enviar mensagens para o log do sistema" -#: ui/00default.xml:54 +#: ui/00default.xml:276 msgid "Send/Receive" msgstr "Enviar/Receber" @@ -1591,7 +1591,7 @@ msgstr "Enviar/Receber" msgid "Session name" msgstr "Nome da sessão" -#: ui/00default.xml:92 +#: ui/00default.xml:314 msgid "Set hostname" msgstr "Selecione servidor" @@ -1607,19 +1607,19 @@ msgstr "Desativa toggles" msgid "Set toggles ON" msgstr "Ativa toggles" -#: ui/00default.xml:107 +#: ui/00default.xml:329 msgid "Settings" msgstr "Configurações" -#: ui/00default.xml:129 +#: ui/00default.xml:351 msgid "Show Underline" msgstr "Mostrar sublinhado" -#: ui/99debug.xml:475 +#: ui/99debug.xml:213 msgid "Show test pattern" msgstr "Mostrar padrão de teste" -#: ui/00default.xml:131 +#: ui/00default.xml:353 msgid "Smart paste" msgstr "Colar inteligente" @@ -1898,15 +1898,15 @@ msgid "" "This version of %s was built without support for secure sockets layer (SSL)." msgstr "Esta versão do %s foi gerada sem suporte para conexões seguras (SSL)." -#: ui/00default.xml:148 +#: ui/00default.xml:370 msgid "Toolbar" msgstr "Barra de ferramentas" -#: ui/99debug.xml:467 +#: ui/99debug.xml:205 msgid "Trace" msgstr "Trace" -#: ui/00default.xml:120 +#: ui/00default.xml:342 msgid "Track Cursor" msgstr "Mostrar posição do cursor" @@ -2113,7 +2113,7 @@ msgstr "Unsupported passthru host session" msgid "Unsupported socks 4 proxy" msgstr "Unsupported socks 4 proxy" -#: ui/00default.xml:133 +#: ui/00default.xml:355 msgid "Use +/- for field navigation" msgstr "Usar teclas +/- para navegar por campos" @@ -2126,7 +2126,7 @@ msgstr "Variável" msgid "Version %s - Revision %s" msgstr "Versão %s - Revisão %s" -#: ui/99debug.xml:470 +#: ui/99debug.xml:208 msgid "View Field Delimiters" msgstr "Mostrar delimitadores de campo" @@ -2154,7 +2154,7 @@ msgstr "Europa ocidental (ISO 8859-1)" msgid "White" msgstr "Branco" -#: ui/00default.xml:159 +#: ui/00default.xml:381 msgid "Window" msgstr "Janela" @@ -2222,19 +2222,19 @@ msgstr "_Procurar" msgid "_Color table:" msgstr "Tabela de cores:" -#: ui/00default.xml:102 +#: ui/00default.xml:324 msgid "_Connect" msgstr "_Conectar" -#: ui/00default.xml:103 +#: ui/00default.xml:325 msgid "_Disconnect" msgstr "_Desconectar" -#: ui/00default.xml:61 +#: ui/99debug.xml:200 msgid "_Edit" msgstr "_Editar" -#: ui/00default.xml:36 +#: ui/00default.xml:258 msgid "_File" msgstr "_Arquivo" @@ -2262,11 +2262,11 @@ msgstr "Nome do _Host:" msgid "_Local file name:" msgstr "Arquivo _local:" -#: ui/00default.xml:92 +#: ui/00default.xml:314 msgid "_Network" msgstr "_Rede" -#: ui/00default.xml:117 +#: ui/00default.xml:339 msgid "_Options" msgstr "_Opções" @@ -2294,7 +2294,7 @@ msgstr "Arquivo _texto" msgid "_To" msgstr "_Para" -#: ui/00default.xml:87 +#: ui/00default.xml:309 msgid "_View" msgstr "_Exibir" diff --git a/pw3270.cbp b/pw3270.cbp index 1eef358..ce8bdc5 100644 --- a/pw3270.cbp +++ b/pw3270.cbp @@ -279,7 +279,6 @@ - @@ -291,6 +290,7 @@ + diff --git a/pw3270.spec.in b/pw3270.spec.in index d72fbc2..3d89531 100644 --- a/pw3270.spec.in +++ b/pw3270.spec.in @@ -73,14 +73,14 @@ Requires: openssl shared-mime-info lib3270 = @PACKAGE_VERSION@ Provides: lib@PACKAGE@ = @PACKAGE_VERSION@ lib@PACKAGE@.so = @PACKAGE_VERSION@ Distribution: %_distro BuildRequires: autoconf >= 2.61 -BuildRequires: automake -BuildRequires: gcc-c++ -BuildRequires: sed -BuildRequires: pkgconfig -BuildRequires: %{_bldreq} -BuildRequires: gettext-devel -BuildRequires: findutils -BuildRequires: coreutils +BuildRequires: automake +BuildRequires: gcc-c++ +BuildRequires: sed +BuildRequires: pkgconfig +BuildRequires: %{_bldreq} +BuildRequires: gettext-devel +BuildRequires: findutils +BuildRequires: coreutils BuildRequires: desktop-file-utils BuildRequires: libreoffice-sdk @@ -141,6 +141,19 @@ This package provides 3270 access object to StarBasic. Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@ +%if 0%{?_ooRexx} +%package -n %{name}-rexx +Summary: %{name} extension & plugin for rexx scripting +Group: Development/Languages/Other +Requires: %{name} >= @PACKAGE_VERSION@ +Requires: ooRexx + +%description -n %{name}-rexx +This package provides Rexx class and associated libraries +allowing rexx scripts to access tn3270e hosts. + +Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@ +%endif #---[ Build & Install ]----------------------------------------------------------------------------------------------- @@ -153,7 +166,7 @@ autoconf export CFLAGS="$RPM_OPT_FLAGS" export CXXFLAGS="$RPM_OPT_FLAGS" export FFLAGS="$RPM_OPT_FLAGS" -export OFFICE_HOME=%{_libdir}/libreoffice +export OFFICE_HOME=%{_libdir}/libreoffice export OO_SDK_HOME=%{_libdir}/libreoffice/sdk %configure @@ -223,6 +236,13 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libreoffice/share/extensions/%{name}/pw3270.uno.rdb %{_libdir}/libreoffice/share/extensions/%{name}/pw3270.uno.so +%if 0%{?_ooRexx} +%files -n %{name}-rexx +%{_rexxlibdir}/librx3270.so.@VERSION@ +%{_rexxlibdir}/librx3270.so +%{_rexxclassdir}/rx3270.cls +%{_libdir}/@PACKAGE_NAME@-plugins/rx3270.so +%endif #---[ Scripts ]------------------------------------------------------------------------------------------------------- @@ -242,3 +262,8 @@ exit 0 /sbin/ldconfig exit 0 +%if 0%{?_ooRexx} +%postun -n %{name}-rexx +/sbin/ldconfig +exit 0 +%endif diff --git a/src/include/lib3270.h b/src/include/lib3270.h index f0c2d6d..2140152 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -707,11 +707,12 @@ LIB3270_EXPORT int lib3270_in_sscp(H3270 *h); LIB3270_EXPORT int lib3270_in_tn3270e(H3270 *h); LIB3270_EXPORT int lib3270_in_e(H3270 *h); - LIB3270_EXPORT int lib3270_lock_status(H3270 *h); - LIB3270_EXPORT int lib3270_is_ready(H3270 *h); - #define lib3270_is_connected(h) lib3270_in_tn3270e(h) + LIB3270_EXPORT int lib3270_is_ready(H3270 *h); + LIB3270_EXPORT int lib3270_is_connected(H3270 *h); + LIB3270_EXPORT int lib3270_is_secure(H3270 *h); + LIB3270_EXPORT LIB3270_MESSAGE lib3270_lock_status(H3270 *h); LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session); LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *session); diff --git a/src/include/plugin.mak.in b/src/include/plugin.mak.in index 22389dc..8e2c3b2 100644 --- a/src/include/plugin.mak.in +++ b/src/include/plugin.mak.in @@ -24,12 +24,21 @@ # erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) # +PACKAGE_NAME=@PACKAGE_NAME@ + #---[ Sources ]---------------------------------------------------------------- DEPENDS=*.h ../../include/*.h ../../include/lib3270/*.h Makefile #---[ Paths ]------------------------------------------------------------------ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +datarootdir=@datarootdir@ +localedir=@localedir@ + ROOTDIR ?= . OBJDIR ?= $(ROOTDIR)/.obj BINDIR ?= $(ROOTDIR)/.bin @@ -50,6 +59,11 @@ CXX=@CXX@ LD=@CC@ MSGCAT=@MSGCAT@ XGETTEXT=@XGETTEXT@ +LN_S=@LN_S@ + +INSTALL=@INSTALL@ +INSTALL_PROGRAM=@INSTALL_PROGRAM@ +INSTALL_DATA=@INSTALL_DATA@ #---[ Rules ]------------------------------------------------------------------ VERSION=@VERSION@ diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index 2e9cf24..8e8bf2f 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -536,7 +536,7 @@ LIB3270_EXPORT LIB3270_STATUS lib3270_get_program_message(H3270 *session) * @return 0 if the terminal is ready (no message, keyboard unlocked), LIB3270_MESSAGE if not * */ -LIB3270_EXPORT int lib3270_lock_status(H3270 *hSession) +LIB3270_EXPORT LIB3270_MESSAGE lib3270_lock_status(H3270 *hSession) { CHECK_SESSION_HANDLE(hSession); diff --git a/src/lib3270/state.c b/src/lib3270/state.c index 8522b6c..ed42b06 100644 --- a/src/lib3270/state.c +++ b/src/lib3270/state.c @@ -92,6 +92,12 @@ LIB3270_EXPORT int lib3270_in_tn3270e(H3270 *h) return (h->cstate == CONNECTED_TN3270E); } +LIB3270_EXPORT int lib3270_is_connected(H3270 *h) +{ + CHECK_SESSION_HANDLE(h); + return (h->cstate == CONNECTED_TN3270E); +} + LIB3270_EXPORT int lib3270_in_e(H3270 *h) { CHECK_SESSION_HANDLE(h); diff --git a/src/lib3270/telnet.c b/src/lib3270/telnet.c index cbfd520..423e510 100644 --- a/src/lib3270/telnet.c +++ b/src/lib3270/telnet.c @@ -3276,6 +3276,11 @@ LIB3270_EXPORT LIB3270_SSL_STATE lib3270_get_secure(H3270 *session) return session->secure; } +LIB3270_EXPORT int lib3270_is_secure(H3270 *hSession) +{ + return lib3270_get_secure(hSession) == LIB3270_SSL_SECURE; +} + LIB3270_EXPORT long lib3270_get_SSL_verify_result(H3270 *hSession) { CHECK_SESSION_HANDLE(hSession); diff --git a/src/plugins/rx3270/Makefile.in b/src/plugins/rx3270/Makefile.in index 3256db5..458ceed 100644 --- a/src/plugins/rx3270/Makefile.in +++ b/src/plugins/rx3270/Makefile.in @@ -43,6 +43,9 @@ CFLAGS=@REXX_CFLAGS@ include ../../include/plugin.mak +REXX_HOME=@REXX_HOME@ +REXXLIBDIR=$(libdir)/ooRexx + #---[ Debug Targets ]---------------------------------------------------------- $(BINDBG)/$(PLUGIN_NAME): $(foreach SRC, $(basename $(PLUGIN_SRC)), $(OBJDBG)/$(SRC).o) $(BINDBG)$(DLL_NAME) @@ -67,7 +70,16 @@ $(BINRLS)$(DLL_NAME).$(VERSION): $(foreach SRC, $(basename $(EXTAPI_SRC)), $(OBJ @$(MKDIR) `dirname $@` $(CXX) $(DLL_FLAGS) @LDSOFLAGS@ $(LDFLAGS) -o $@ $^ $(LIBS) $(LIB3270_LIBS) -install: +install: $(BINRLS)$(DLL_NAME).$(VERSION) $(BINRLS)/$(PLUGIN_NAME) + @$(MKDIR) $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugins + @$(INSTALL_PROGRAM) $(BINRLS)/$(PLUGIN_NAME) $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugins + + @$(MKDIR) $(DESTDIR)$(REXXLIBDIR) + @$(INSTALL_PROGRAM) $(BINRLS)$(DLL_NAME).$(VERSION) $(DESTDIR)$(REXXLIBDIR) + @$(LN_S) @DLLPREFIX@$(MODULE_NAME)@DLLEXT@.$(VERSION) $(DESTDIR)$(REXXLIBDIR)/@DLLPREFIX@$(MODULE_NAME)@DLLEXT@ + + @$(MKDIR) $(DESTDIR)$(REXX_HOME) + @$(INSTALL_PROGRAM) rx3270.cls $(DESTDIR)$(REXX_HOME) $(DEBDIR)/$(MODULE_NAME).install: Makefile @$(MKDIR) `dirname $@` diff --git a/src/plugins/rx3270/local.cc b/src/plugins/rx3270/local.cc index 72c242c..5e8102c 100644 --- a/src/plugins/rx3270/local.cc +++ b/src/plugins/rx3270/local.cc @@ -64,10 +64,10 @@ LIB3270_CSTATE get_cstate(void); int disconnect(void); int connect(const char *uri, bool wait = true); - int is_connected(void); - int is_ready(void); + bool is_connected(void); + bool is_ready(void); - int iterate(void); + int iterate(bool wait); int wait(int seconds); int wait_for_ready(int seconds); @@ -455,26 +455,26 @@ int dynamic::connect(const char *uri, bool wait) return _connect(hSession,uri,(int) wait); } -int dynamic::is_connected(void) +bool dynamic::is_connected(void) { if(!hModule) return -1; - return _is_connected(hSession); + return _is_connected(hSession) != 0; } -int dynamic::is_ready(void) +bool dynamic::is_ready(void) { if(!hModule) return -1; - return _is_ready(hSession); + return _is_ready(hSession) != 0; } -int dynamic::iterate(void) +int dynamic::iterate(bool wait) { if(!hModule) return -1; - _main_iterate(hSession,1); + _main_iterate(hSession,wait); return 0; } diff --git a/src/plugins/rx3270/pluginmain.cc b/src/plugins/rx3270/pluginmain.cc index d693609..9647763 100644 --- a/src/plugins/rx3270/pluginmain.cc +++ b/src/plugins/rx3270/pluginmain.cc @@ -42,10 +42,10 @@ LIB3270_CSTATE get_cstate(void); int disconnect(void); int connect(const char *uri, bool wait = true); - int is_connected(void); - int is_ready(void); + bool is_connected(void); + bool is_ready(void); - int iterate(void); + int iterate(bool wait); int wait(int seconds); int wait_for_ready(int seconds); @@ -114,17 +114,17 @@ return lib3270_connect(hSession,uri,wait); } - int plugin::is_connected(void) + bool plugin::is_connected(void) { - return lib3270_is_connected(hSession) ? 1 : 0; + return lib3270_is_connected(hSession) != 0; } - int plugin::iterate(void) + int plugin::iterate(bool wait) { if(!lib3270_is_connected(hSession)) return ENOTCONN; - lib3270_main_iterate(hSession,1); + lib3270_main_iterate(hSession,wait); return 0; } @@ -169,9 +169,9 @@ return lib3270_set_text_at(hSession,row,col,(const unsigned char *) str); } - int plugin::is_ready(void) + bool plugin::is_ready(void) { - return lib3270_is_ready(hSession); + return lib3270_is_ready(hSession) != 0; } int plugin::set_cursor_position(int row, int col) diff --git a/src/plugins/rx3270/rexx_methods.cc b/src/plugins/rx3270/rexx_methods.cc index 2eaf851..cec5b79 100644 --- a/src/plugins/rx3270/rexx_methods.cc +++ b/src/plugins/rx3270/rexx_methods.cc @@ -25,6 +25,11 @@ * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * + * + * Referencias: + * + * * http://www.oorexx.org/docs/rexxpg/x2950.htm + * */ #include "rx3270.h" @@ -73,19 +78,19 @@ RexxMethod2(int, rx3270_method_sleep, CSELF, sessionPtr, int, seconds) return hSession->wait(seconds); } -RexxMethod1(int, rx3270_method_is_connected, CSELF, sessionPtr) +RexxMethod1(logical_t, rx3270_method_is_connected, CSELF, sessionPtr) { rx3270 *hSession = (rx3270 *) sessionPtr; if(!hSession) - return -1; + return false; return hSession->is_connected(); } -RexxMethod1(int, rx3270_method_is_ready, CSELF, sessionPtr) +RexxMethod1(logical_t, rx3270_method_is_ready, CSELF, sessionPtr) { rx3270 *hSession = (rx3270 *) sessionPtr; if(!hSession) - return -1; + return false; return hSession->is_ready(); } @@ -266,3 +271,29 @@ RexxMethod3(int, rx3270_method_set_option, CSELF, sessionPtr, CSTRING, name, int } +RexxMethod4(logical_t, rx3270_method_test, CSELF, sessionPtr, CSTRING, key, int, row, int, col) +{ + rx3270 * hSession = (rx3270 *) sessionPtr; + + if(!hSession) + return false; + + if(!hSession->is_ready()) + hSession->iterate(false); + + if(hSession->is_ready()) + { + bool rc = false; + char * str = hSession->get_text_at(row,col,strlen(key)); + if(str) + { + char * text = hSession->get_3270_string(key); + rc = (strcasecmp(str,text) == 0); + free(text); + } + free(str); + return rc; + } + + return false; +} diff --git a/src/plugins/rx3270/rx3270.cls b/src/plugins/rx3270/rx3270.cls index 3f99b2d..339ac26 100644 --- a/src/plugins/rx3270/rx3270.cls +++ b/src/plugins/rx3270/rx3270.cls @@ -61,4 +61,5 @@ ::METHOD GETTEXTAT EXTERNAL "LIBRARY rx3270 rx3270_method_get_text_at" ::METHOD SETTEXTAT EXTERNAL "LIBRARY rx3270 rx3270_method_set_text_at" ::METHOD CMPTEXTAT EXTERNAL "LIBRARY rx3270 rx3270_method_cmp_text_at" +::METHOD TEST EXTERNAL "LIBRARY rx3270 rx3270_method_test" diff --git a/src/plugins/rx3270/rx3270.h b/src/plugins/rx3270/rx3270.h index 748e5fd..924986a 100644 --- a/src/plugins/rx3270/rx3270.h +++ b/src/plugins/rx3270/rx3270.h @@ -93,6 +93,7 @@ REXX_METHOD_PROTOTYPE(rx3270_method_screen_trace); REXX_METHOD_PROTOTYPE(rx3270_method_ds_trace); REXX_METHOD_PROTOTYPE(rx3270_method_set_option); + REXX_METHOD_PROTOTYPE(rx3270_method_test); /*---[ Globals ]---------------------------------------------------------------------------------------------*/ @@ -130,9 +131,9 @@ virtual int connect(const char *uri, bool wait = true) = 0; virtual int disconnect(void) = 0; - virtual int is_connected(void) = 0; - virtual int is_ready(void) = 0; - virtual int iterate(void) = 0; + virtual bool is_connected(void) = 0; + virtual bool is_ready(void) = 0; + virtual int iterate(bool wait = true) = 0; virtual int wait(int seconds) = 0; virtual int wait_for_ready(int seconds) = 0; virtual int set_cursor_position(int row, int col) = 0; diff --git a/src/plugins/rx3270/sample/object.rex b/src/plugins/rx3270/sample/object.rex index 4281ce4..5a40870 100644 --- a/src/plugins/rx3270/sample/object.rex +++ b/src/plugins/rx3270/sample/object.rex @@ -2,14 +2,28 @@ use arg uri host = .rx3270~new("") +host~ScreenTrace(1) -if host~connect(uri) <> 0 then +if host~connect(uri,1) <> 0 then do - say "Erro ao conectar em "||uri + say "Error connecting to "||uri return -1 end -host~sleep(20) +if host~WaitForReady(60) <> 0 then +do + say "Timeout waiting for terminal ready" +end + +say "Text(2,2,23)=["||host~GetTextAt(2,2,23)||"]" +say "Text(3,2,27)=["||host~GetTextAt(3,2,27)||"]" + +host~enter() +if host~WaitForReady(60) <> 0 then +do + say "Timeout waiting for terminal ready" +end + host~disconnect() -- libgit2 0.21.2