Commit f7c3063e4d7c276e39bca89cc6ca3a182c5a4fa8

Authored by perry.werneck@gmail.com
1 parent 64b5457b

Testando efeito das ultimas atualizacoes na versao windows

@@ -147,11 +147,11 @@ Release: $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) $(foreach PLUGIN, $(PLUGI @@ -147,11 +147,11 @@ Release: $(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) $(foreach PLUGIN, $(PLUGI
147 $(foreach EXT, $(EXTENSIONS), $(EXT)) \ 147 $(foreach EXT, $(EXTENSIONS), $(EXT)) \
148 locale pixmaps filelist 148 locale pixmaps filelist
149 149
150 -$(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT): src/pw3270/* $(BINDIR)/Release@DLLDIR@/@DLLPREFIX@3270@DLLEXT@ $(DEPENDS) 150 +$(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT): src/pw3270/* $(BINDIR)/Release@DLLDIR@/lib3270@DLLEXT@ $(DEPENDS)
151 @$(MAKE) BINDIR="../../$(BINDIR)" LIB3270_LIBS="$(RLSLIB)" LIB3270_CFLAGS="-I../../src/include" -C src/pw3270 ../../$(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT) 151 @$(MAKE) BINDIR="../../$(BINDIR)" LIB3270_LIBS="$(RLSLIB)" LIB3270_CFLAGS="-I../../src/include" -C src/pw3270 ../../$(BINDIR)/Release/$(PACKAGE_TARNAME)$(EXEEXT)
152 152
153 -$(BINDIR)/Release@DLLDIR@/@DLLPREFIX@3270@DLLEXT@: src/lib3270/* src/include/lib3270/* src/include/* Makefile  
154 - @$(MAKE) BINRLS=../../.bin/Release@DLLDIR@ -C src/lib3270 ../../.bin/Release@DLLDIR@/@DLLPREFIX@3270@DLLEXT@ 153 +$(BINDIR)/Release@DLLDIR@/lib3270@DLLEXT@: src/lib3270/* src/include/lib3270/* src/include/* Makefile
  154 + @$(MAKE) BINRLS=../../.bin/Release@DLLDIR@ -C src/lib3270 ../../.bin/Release@DLLDIR@/lib3270@DLLEXT@
155 155
156 oxt: $(BINDIR)/$(PACKAGE_TARNAME).oxt 156 oxt: $(BINDIR)/$(PACKAGE_TARNAME).oxt
157 157
@@ -182,11 +182,11 @@ debian/lib3270-dev.install: Makefile @@ -182,11 +182,11 @@ debian/lib3270-dev.install: Makefile
182 Debug: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) \ 182 Debug: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) \
183 $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Debug/plugins/$(PLUGIN)@DLLEXT@) 183 $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Debug/plugins/$(PLUGIN)@DLLEXT@)
184 184
185 -$(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT): src/pw3270/* $(BINDIR)/Debug@DLLDIR@/@DLLPREFIX@3270@DLLEXT@ $(DEPENDS) 185 +$(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT): src/pw3270/* $(BINDIR)/Debug@DLLDIR@/lib3270@DLLEXT@ $(DEPENDS)
186 @$(MAKE) BINDIR="../../$(BINDIR)" LIB3270_LIBS="$(DBGLIB)" LIB3270_CFLAGS="-I../../src/include" -C src/pw3270 ../../$(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) 186 @$(MAKE) BINDIR="../../$(BINDIR)" LIB3270_LIBS="$(DBGLIB)" LIB3270_CFLAGS="-I../../src/include" -C src/pw3270 ../../$(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT)
187 187
188 -$(BINDIR)/Debug@DLLDIR@/@DLLPREFIX@3270@DLLEXT@: src/lib3270/* src/include/lib3270/* src/include/* Makefile  
189 - @$(MAKE) BINDBG=../../.bin/Debug@DLLDIR@ -C src/lib3270 ../../.bin/Debug@DLLDIR@/@DLLPREFIX@3270@DLLEXT@ 188 +$(BINDIR)/Debug@DLLDIR@/lib3270@DLLEXT@: src/lib3270/* src/include/lib3270/* src/include/* Makefile
  189 + @$(MAKE) BINDBG=../../.bin/Debug@DLLDIR@ -C src/lib3270 ../../.bin/Debug@DLLDIR@/lib3270@DLLEXT@
190 190
191 run: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) $(PACKAGE_NAME).png $(PACKAGE_NAME)-logo.png \ 191 run: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) $(PACKAGE_NAME).png $(PACKAGE_NAME)-logo.png \
192 $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Debug/plugins/$(PLUGIN)@DLLEXT@) 192 $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Debug/plugins/$(PLUGIN)@DLLEXT@)
@@ -289,7 +289,7 @@ install-plugins: $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Release/plugins/$(PLUGI @@ -289,7 +289,7 @@ install-plugins: $(foreach PLUGIN, $(PLUGINS), $(BINDIR)/Release/plugins/$(PLUGI
289 @$(MKDIR) $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugins 289 @$(MKDIR) $(DESTDIR)$(libdir)/$(PACKAGE_NAME)-plugins
290 @echo -e $(foreach PLUGIN, $(PLUGINS), $(MAKE) DESTDIR=$(DESTDIR) $(PLUGIN_RELEASE_ARGS) -C src/plugins/$(PLUGIN) install\\n ) | $(SHELL) 290 @echo -e $(foreach PLUGIN, $(PLUGINS), $(MAKE) DESTDIR=$(DESTDIR) $(PLUGIN_RELEASE_ARGS) -C src/plugins/$(PLUGIN) install\\n ) | $(SHELL)
291 291
292 -install-lib: $(BINDIR)/Release@DLLDIR@/@DLLPREFIX@3270@DLLEXT@ 292 +install-lib: $(BINDIR)/Release@DLLDIR@/lib3270@DLLEXT@
293 @$(MAKE) BINRLS="../../.bin/Release@DLLDIR@" -C src/lib3270 install 293 @$(MAKE) BINRLS="../../.bin/Release@DLLDIR@" -C src/lib3270 install
294 294
295 locale: $(foreach MO, $(basename $(LANG_FILES)), $(BINDIR)/Release/$(localedir)/$(notdir $(MO))/LC_MESSAGES/$(PACKAGE_NAME).mo) 295 locale: $(foreach MO, $(basename $(LANG_FILES)), $(BINDIR)/Release/$(localedir)/$(notdir $(MO))/LC_MESSAGES/$(PACKAGE_NAME).mo)
@@ -128,7 +128,7 @@ case "$host" in @@ -128,7 +128,7 @@ case "$host" in
128 SOCKET_LIBS="-lws2_32" 128 SOCKET_LIBS="-lws2_32"
129 CFLAGS="$CFLAGS -mms-bitfields" 129 CFLAGS="$CFLAGS -mms-bitfields"
130 localedir="locale" 130 localedir="locale"
131 - DLL_FLAGS="-shared -Wl,--add-stdcall-alias" 131 + DLL_FLAGS="-shared -Wl,--add-stdcall-alias,--enable-stdcall-fixup"
132 LDSOFLAGS="-Wl,-soname,\`basename \$@\`" 132 LDSOFLAGS="-Wl,-soname,\`basename \$@\`"
133 LDAPPFLAGS="-mwindows" 133 LDAPPFLAGS="-mwindows"
134 LDLIBFLAGS="-Wl,--output-def,\$@.def" 134 LDLIBFLAGS="-Wl,--output-def,\$@.def"
@@ -138,6 +138,7 @@ case "$host" in @@ -138,6 +138,7 @@ case "$host" in
138 LDARCH="" 138 LDARCH=""
139 PLUGINS="hllapi" 139 PLUGINS="hllapi"
140 APP_GUI_SRC="resources.rc" 140 APP_GUI_SRC="resources.rc"
  141 + DLLPREFIX=""
141 ;; 142 ;;
142 143
143 *-apple-*) 144 *-apple-*)
@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2013-04-22 09:22-0300\n" 8 +"POT-Creation-Date: 2013-04-22 18:10-0300\n"
9 "PO-Revision-Date: 2013-04-22 09:32-0300\n" 9 "PO-Revision-Date: 2013-04-22 09:32-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Português <>\n" 11 "Language-Team: Português <>\n"
@@ -200,7 +200,7 @@ msgstr &quot;Sobre a segurança&quot; @@ -200,7 +200,7 @@ msgstr &quot;Sobre a segurança&quot;
200 msgid "Action failed" 200 msgid "Action failed"
201 msgstr "Ação falhou" 201 msgstr "Ação falhou"
202 202
203 -#: ui/00default.xml:328 203 +#: ui/00default.xml:64
204 msgid "Add to copy" 204 msgid "Add to copy"
205 msgstr "Adicionar à cópia" 205 msgstr "Adicionar à cópia"
206 206
@@ -208,7 +208,7 @@ msgstr &quot;Adicionar à cópia&quot; @@ -208,7 +208,7 @@ msgstr &quot;Adicionar à cópia&quot;
208 msgid "Add/Remove _CR at end of line" 208 msgid "Add/Remove _CR at end of line"
209 msgstr "Adicionar/Remover _CR no final da linha" 209 msgstr "Adicionar/Remover _CR no final da linha"
210 210
211 -#: ui/00default.xml:396 211 +#: ui/00default.xml:132
212 msgid "Alert sound" 212 msgid "Alert sound"
213 msgstr "Aviso sonoro" 213 msgstr "Aviso sonoro"
214 214
@@ -221,7 +221,7 @@ msgstr &quot;&quot; @@ -221,7 +221,7 @@ msgstr &quot;&quot;
221 msgid "Application name" 221 msgid "Application name"
222 msgstr "Nome da aplicação" 222 msgstr "Nome da aplicação"
223 223
224 -#: ui/10keypad.xml:155 224 +#: ui/10keypad.xml:467
225 msgid "Attn" 225 msgid "Attn"
226 msgstr "Attn" 226 msgstr "Attn"
227 227
@@ -238,7 +238,7 @@ msgstr &quot;Divergência nos números de série da autoridade e emissor &quot; @@ -238,7 +238,7 @@ msgstr &quot;Divergência nos números de série da autoridade e emissor &quot;
238 msgid "Authority and subject key identifier mismatch" 238 msgid "Authority and subject key identifier mismatch"
239 msgstr "Authority and subject key identifier mismatch" 239 msgstr "Authority and subject key identifier mismatch"
240 240
241 -#: ui/00default.xml:391 241 +#: ui/00default.xml:127
242 msgid "Auto-Reconnect" 242 msgid "Auto-Reconnect"
243 msgstr "Reconectar automaticamente" 243 msgstr "Reconectar automaticamente"
244 244
@@ -262,11 +262,11 @@ msgstr &quot;Versão winsock inválida&quot; @@ -262,11 +262,11 @@ msgstr &quot;Versão winsock inválida&quot;
262 msgid "Black" 262 msgid "Black"
263 msgstr "Preto" 263 msgstr "Preto"
264 264
265 -#: ui/00default.xml:389 265 +#: ui/00default.xml:125
266 msgid "Blank Fill" 266 msgid "Blank Fill"
267 msgstr "Completar com espaços" 267 msgstr "Completar com espaços"
268 268
269 -#: ui/00default.xml:382 269 +#: ui/00default.xml:118
270 msgid "Blinking Cursor" 270 msgid "Blinking Cursor"
271 msgstr "Cursor piscante" 271 msgstr "Cursor piscante"
272 272
@@ -274,7 +274,7 @@ msgstr &quot;Cursor piscante&quot; @@ -274,7 +274,7 @@ msgstr &quot;Cursor piscante&quot;
274 msgid "Blue" 274 msgid "Blue"
275 msgstr "Azul" 275 msgstr "Azul"
276 276
277 -#: ui/00default.xml:392 277 +#: ui/00default.xml:128
278 msgid "Bold" 278 msgid "Bold"
279 msgstr "Negrito" 279 msgstr "Negrito"
280 280
@@ -282,7 +282,7 @@ msgstr &quot;Negrito&quot; @@ -282,7 +282,7 @@ msgstr &quot;Negrito&quot;
282 msgid "Brazilian Public Software Portal" 282 msgid "Brazilian Public Software Portal"
283 msgstr "Portal do Software Público Brasileiro" 283 msgstr "Portal do Software Público Brasileiro"
284 284
285 -#: ui/10keypad.xml:156 285 +#: ui/10keypad.xml:468
286 msgid "Break" 286 msgid "Break"
287 msgstr "Break" 287 msgstr "Break"
288 288
@@ -474,7 +474,7 @@ msgstr &quot;Tabela de tradução tem %d entradas, precisa de 256&quot; @@ -474,7 +474,7 @@ msgstr &quot;Tabela de tradução tem %d entradas, precisa de 256&quot;
474 msgid "Charset has more than 256 entries" 474 msgid "Charset has more than 256 entries"
475 msgstr "Tabela de tradução tem mais de 256 caracteres" 475 msgstr "Tabela de tradução tem mais de 256 caracteres"
476 476
477 -#: ui/10keypad.xml:147 477 +#: ui/00default.xml:79
478 msgid "Clear" 478 msgid "Clear"
479 msgstr "Limpar" 479 msgstr "Limpar"
480 480
@@ -486,7 +486,7 @@ msgstr &quot;Tema de cores:&quot; @@ -486,7 +486,7 @@ msgstr &quot;Tema de cores:&quot;
486 msgid "Color setup" 486 msgid "Color setup"
487 msgstr "Configuração de cores" 487 msgstr "Configuração de cores"
488 488
489 -#: ui/00default.xml:371 489 +#: ui/00default.xml:107
490 msgid "Colors" 490 msgid "Colors"
491 msgstr "Cores" 491 msgstr "Cores"
492 492
@@ -494,7 +494,7 @@ msgstr &quot;Cores&quot; @@ -494,7 +494,7 @@ msgstr &quot;Cores&quot;
494 msgid "Complete" 494 msgid "Complete"
495 msgstr "Completo" 495 msgstr "Completo"
496 496
497 -#: ui/00default.xml:381 497 +#: ui/00default.xml:117
498 msgid "Connect on startup" 498 msgid "Connect on startup"
499 msgstr "Conectar ao iniciar" 499 msgstr "Conectar ao iniciar"
500 500
@@ -502,19 +502,19 @@ msgstr &quot;Conectar ao iniciar&quot; @@ -502,19 +502,19 @@ msgstr &quot;Conectar ao iniciar&quot;
502 msgid "Connection reset by peer" 502 msgid "Connection reset by peer"
503 msgstr "Conexão foi cancelada pelo servidor" 503 msgstr "Conexão foi cancelada pelo servidor"
504 504
505 -#: ui/00default.xml:325 505 +#: ui/00default.xml:61
506 msgid "Copy" 506 msgid "Copy"
507 msgstr "Copiar" 507 msgstr "Copiar"
508 508
509 -#: ui/99debug.xml:200 509 +#: ui/99debug.xml:566
510 msgid "Copy as HTML" 510 msgid "Copy as HTML"
511 msgstr "Copiar como HTML" 511 msgstr "Copiar como HTML"
512 512
513 -#: ui/00default.xml:326 513 +#: ui/00default.xml:62
514 msgid "Copy as table" 514 msgid "Copy as table"
515 msgstr "Copiar como tabela" 515 msgstr "Copiar como tabela"
516 516
517 -#: colors.c:418 ui/00default.xml:388 517 +#: colors.c:418 ui/00default.xml:124
518 msgid "Cross hair cursor" 518 msgid "Cross hair cursor"
519 msgstr "Cursor mira" 519 msgstr "Cursor mira"
520 520
@@ -527,7 +527,7 @@ msgstr &quot;Atual (%s)&quot; @@ -527,7 +527,7 @@ msgstr &quot;Atual (%s)&quot;
527 msgid "Custom colors" 527 msgid "Custom colors"
528 msgstr "Cores personalizadas" 528 msgstr "Cores personalizadas"
529 529
530 -#: ui/00default.xml:329 530 +#: ui/00default.xml:65
531 msgid "Cut" 531 msgid "Cut"
532 msgstr "Recortar" 532 msgstr "Recortar"
533 533
@@ -539,7 +539,7 @@ msgstr &quot;Cilindros&quot; @@ -539,7 +539,7 @@ msgstr &quot;Cilindros&quot;
539 msgid "DFT B_uffer size:" 539 msgid "DFT B_uffer size:"
540 msgstr "Tamanho do b_uffer DFT:" 540 msgstr "Tamanho do b_uffer DFT:"
541 541
542 -#: ui/99debug.xml:205 542 +#: ui/99debug.xml:571
543 msgid "DS Trace" 543 msgid "DS Trace"
544 msgstr "DS Trace" 544 msgstr "DS Trace"
545 545
@@ -555,11 +555,11 @@ msgstr &quot;Verde Escuro&quot; @@ -555,11 +555,11 @@ msgstr &quot;Verde Escuro&quot;
555 msgid "Data conversion error" 555 msgid "Data conversion error"
556 msgstr "Erro na conversão de dados" 556 msgstr "Erro na conversão de dados"
557 557
558 -#: ui/99debug.xml:213 558 +#: ui/99debug.xml:579
559 msgid "Debug" 559 msgid "Debug"
560 msgstr "Depuração" 560 msgstr "Depuração"
561 561
562 -#: ui/99debug.xml:215 562 +#: ui/99debug.xml:581
563 msgid "Debug window updates" 563 msgid "Debug window updates"
564 msgstr "Mostrar atualizações de janela" 564 msgstr "Mostrar atualizações de janela"
565 565
@@ -567,7 +567,7 @@ msgstr &quot;Mostrar atualizações de janela&quot; @@ -567,7 +567,7 @@ msgstr &quot;Mostrar atualizações de janela&quot;
567 msgid "Default" 567 msgid "Default"
568 msgstr "Padrão" 568 msgstr "Padrão"
569 569
570 -#: ui/00default.xml:345 570 +#: ui/00default.xml:81
571 msgid "Delete field" 571 msgid "Delete field"
572 msgstr "Apagar campo" 572 msgstr "Apagar campo"
573 573
@@ -599,7 +599,7 @@ msgstr &quot;Nome do servidor em branco&quot; @@ -599,7 +599,7 @@ msgstr &quot;Nome do servidor em branco&quot;
599 msgid "Empty port name" 599 msgid "Empty port name"
600 msgstr "Porta em branco" 600 msgstr "Porta em branco"
601 601
602 -#: ui/10keypad.xml:151 602 +#: ui/10keypad.xml:463
603 msgid "" 603 msgid ""
604 "Erase\n" 604 "Erase\n"
605 "EOF" 605 "EOF"
@@ -607,7 +607,7 @@ msgstr &quot;&quot; @@ -607,7 +607,7 @@ msgstr &quot;&quot;
607 "Apagar\n" 607 "Apagar\n"
608 "Campo" 608 "Campo"
609 609
610 -#: ui/10keypad.xml:152 610 +#: ui/10keypad.xml:464
611 msgid "" 611 msgid ""
612 "Erase\n" 612 "Erase\n"
613 "Input" 613 "Input"
@@ -615,15 +615,15 @@ msgstr &quot;&quot; @@ -615,15 +615,15 @@ msgstr &quot;&quot;
615 "Apagar\n" 615 "Apagar\n"
616 "Campos" 616 "Campos"
617 617
618 -#: ui/00default.xml:344 618 +#: ui/00default.xml:80
619 msgid "Erase input" 619 msgid "Erase input"
620 msgstr "Apagar campos" 620 msgstr "Apagar campos"
621 621
622 -#: ui/00default.xml:346 622 +#: ui/00default.xml:82
623 msgid "Erase to end of field" 623 msgid "Erase to end of field"
624 msgstr "Apagar até o final do campo" 624 msgstr "Apagar até o final do campo"
625 625
626 -#: ui/00default.xml:347 626 +#: ui/00default.xml:83
627 msgid "Erase to end of line" 627 msgid "Erase to end of line"
628 msgstr "Apagar até o final da linha" 628 msgstr "Apagar até o final da linha"
629 629
@@ -666,11 +666,11 @@ msgstr &quot;Erro lendo %s&quot; @@ -666,11 +666,11 @@ msgstr &quot;Erro lendo %s&quot;
666 msgid "Error resolving %s: %s" 666 msgid "Error resolving %s: %s"
667 msgstr "Erro ao resolver %s: %s" 667 msgstr "Erro ao resolver %s: %s"
668 668
669 -#: ui/99debug.xml:207 669 +#: ui/99debug.xml:573
670 msgid "Event Trace" 670 msgid "Event Trace"
671 msgstr "Trace de eventos" 671 msgstr "Trace de eventos"
672 672
673 -#: ui/rexx.xml:260 673 +#: ui/rexx.xml:626
674 msgid "External Rexx script" 674 msgid "External Rexx script"
675 msgstr "Script rexx externo" 675 msgstr "Script rexx externo"
676 676
@@ -718,11 +718,11 @@ msgstr &quot;Format error in certificate&#39;s notAfter field&quot; @@ -718,11 +718,11 @@ msgstr &quot;Format error in certificate&#39;s notAfter field&quot;
718 msgid "Format error in certificate's notBefore field" 718 msgid "Format error in certificate's notBefore field"
719 msgstr "Format error in certificate's notBefore field" 719 msgstr "Format error in certificate's notBefore field"
720 720
721 -#: ui/00default.xml:385 721 +#: ui/00default.xml:121
722 msgid "Full Screen" 722 msgid "Full Screen"
723 msgstr "Tela cheia" 723 msgstr "Tela cheia"
724 724
725 -#: ui/10functions.xml:35 725 +#: ui/10functions.xml:347
726 msgid "Function bar" 726 msgid "Function bar"
727 msgstr "Barra de funções" 727 msgstr "Barra de funções"
728 728
@@ -767,7 +767,7 @@ msgstr &quot;HTTP Proxy: EOF inesperado&quot; @@ -767,7 +767,7 @@ msgstr &quot;HTTP Proxy: EOF inesperado&quot;
767 msgid "HTTP Proxy: unrecognized reply" 767 msgid "HTTP Proxy: unrecognized reply"
768 msgstr "HTTP Proxy: Resposta desconhecida" 768 msgstr "HTTP Proxy: Resposta desconhecida"
769 769
770 -#: ui/00default.xml:406 770 +#: ui/00default.xml:142
771 msgid "Help" 771 msgid "Help"
772 msgstr "Ajuda" 772 msgstr "Ajuda"
773 773
@@ -828,7 +828,7 @@ msgstr &quot;Comprimento de frame inválido&quot; @@ -828,7 +828,7 @@ msgstr &quot;Comprimento de frame inválido&quot;
828 msgid "Informations" 828 msgid "Informations"
829 msgstr "Informações" 829 msgstr "Informações"
830 830
831 -#: ui/00default.xml:401 831 +#: ui/00default.xml:137
832 msgid "Input method" 832 msgid "Input method"
833 msgstr "Método de entrada" 833 msgstr "Método de entrada"
834 834
@@ -875,7 +875,7 @@ msgstr &quot;Sintaxe de proxy inválida&quot; @@ -875,7 +875,7 @@ msgstr &quot;Sintaxe de proxy inválida&quot;
875 msgid "Invalid proxy type '%.*s'" 875 msgid "Invalid proxy type '%.*s'"
876 msgstr "Tipo de proxy invalido '%.*s'" 876 msgstr "Tipo de proxy invalido '%.*s'"
877 877
878 -#: ui/00default.xml:394 878 +#: ui/00default.xml:130
879 msgid "Keep selected" 879 msgid "Keep selected"
880 msgstr "Manter selecionado" 880 msgstr "Manter selecionado"
881 881
@@ -891,7 +891,7 @@ msgstr &quot;Teclado está bloqueado&quot; @@ -891,7 +891,7 @@ msgstr &quot;Teclado está bloqueado&quot;
891 msgid "LRECL:" 891 msgid "LRECL:"
892 msgstr "LRECL:" 892 msgstr "LRECL:"
893 893
894 -#: ui/10keypad.xml:101 894 +#: ui/10keypad.xml:413
895 msgid "Lateral keypad" 895 msgid "Lateral keypad"
896 msgstr "Barra lateral" 896 msgstr "Barra lateral"
897 897
@@ -908,7 +908,7 @@ msgstr &quot;Faltando &#39;]&#39;&quot; @@ -908,7 +908,7 @@ msgstr &quot;Faltando &#39;]&#39;&quot;
908 msgid "Model %d (%s)" 908 msgid "Model %d (%s)"
909 msgstr "Modelo %d (%s)" 909 msgstr "Modelo %d (%s)"
910 910
911 -#: ui/00default.xml:383 911 +#: ui/00default.xml:119
912 msgid "Monocase" 912 msgid "Monocase"
913 msgstr "Só Maiúsculas" 913 msgstr "Só Maiúsculas"
914 914
@@ -944,7 +944,7 @@ msgstr &quot;Erro de rede&quot; @@ -944,7 +944,7 @@ msgstr &quot;Erro de rede&quot;
944 msgid "Network startup error" 944 msgid "Network startup error"
945 msgstr "Erro ao iniciar a rede" 945 msgstr "Erro ao iniciar a rede"
946 946
947 -#: ui/00default.xml:453 947 +#: ui/00default.xml:189
948 msgid "Next field" 948 msgid "Next field"
949 msgstr "Próximo campo" 949 msgstr "Próximo campo"
950 950
@@ -1021,111 +1021,111 @@ msgstr &quot;Outro (VM/CMS)&quot; @@ -1021,111 +1021,111 @@ msgstr &quot;Outro (VM/CMS)&quot;
1021 msgid "Out of memory" 1021 msgid "Out of memory"
1022 msgstr "Memória insuficiente" 1022 msgstr "Memória insuficiente"
1023 1023
1024 -#: ui/10keypad.xml:138 1024 +#: ui/10keypad.xml:450
1025 msgid "PA1" 1025 msgid "PA1"
1026 msgstr "PA1" 1026 msgstr "PA1"
1027 1027
1028 -#: ui/10keypad.xml:139 1028 +#: ui/10keypad.xml:451
1029 msgid "PA2" 1029 msgid "PA2"
1030 msgstr "PA2" 1030 msgstr "PA2"
1031 1031
1032 -#: ui/10keypad.xml:140 1032 +#: ui/10keypad.xml:452
1033 msgid "PA3" 1033 msgid "PA3"
1034 msgstr "PA3" 1034 msgstr "PA3"
1035 1035
1036 -#: ui/10functions.xml:36 1036 +#: ui/10functions.xml:348
1037 msgid "PF1" 1037 msgid "PF1"
1038 msgstr "PF1" 1038 msgstr "PF1"
1039 1039
1040 -#: ui/10functions.xml:45 1040 +#: ui/10functions.xml:357
1041 msgid "PF10" 1041 msgid "PF10"
1042 msgstr "PF10" 1042 msgstr "PF10"
1043 1043
1044 -#: ui/10functions.xml:46 1044 +#: ui/10functions.xml:358
1045 msgid "PF11" 1045 msgid "PF11"
1046 msgstr "PF11" 1046 msgstr "PF11"
1047 1047
1048 -#: ui/10functions.xml:47 1048 +#: ui/10functions.xml:359
1049 msgid "PF12" 1049 msgid "PF12"
1050 msgstr "PF12" 1050 msgstr "PF12"
1051 1051
1052 -#: ui/10functions.xml:50 1052 +#: ui/10functions.xml:362
1053 msgid "PF13" 1053 msgid "PF13"
1054 msgstr "PF13" 1054 msgstr "PF13"
1055 1055
1056 -#: ui/10functions.xml:51 1056 +#: ui/10functions.xml:363
1057 msgid "PF14" 1057 msgid "PF14"
1058 msgstr "PF14" 1058 msgstr "PF14"
1059 1059
1060 -#: ui/10functions.xml:52 1060 +#: ui/10functions.xml:364
1061 msgid "PF15" 1061 msgid "PF15"
1062 msgstr "PF15" 1062 msgstr "PF15"
1063 1063
1064 -#: ui/10functions.xml:53 1064 +#: ui/10functions.xml:365
1065 msgid "PF16" 1065 msgid "PF16"
1066 msgstr "PF16" 1066 msgstr "PF16"
1067 1067
1068 -#: ui/10functions.xml:54 1068 +#: ui/10functions.xml:366
1069 msgid "PF17" 1069 msgid "PF17"
1070 msgstr "PF17" 1070 msgstr "PF17"
1071 1071
1072 -#: ui/10functions.xml:55 1072 +#: ui/10functions.xml:367
1073 msgid "PF18" 1073 msgid "PF18"
1074 msgstr "PF18" 1074 msgstr "PF18"
1075 1075
1076 -#: ui/10functions.xml:56 1076 +#: ui/10functions.xml:368
1077 msgid "PF19" 1077 msgid "PF19"
1078 msgstr "PF19" 1078 msgstr "PF19"
1079 1079
1080 -#: ui/10functions.xml:37 1080 +#: ui/10functions.xml:349
1081 msgid "PF2" 1081 msgid "PF2"
1082 msgstr "PF2" 1082 msgstr "PF2"
1083 1083
1084 -#: ui/10functions.xml:57 1084 +#: ui/10functions.xml:369
1085 msgid "PF20" 1085 msgid "PF20"
1086 msgstr "PF20" 1086 msgstr "PF20"
1087 1087
1088 -#: ui/10functions.xml:58 1088 +#: ui/10functions.xml:370
1089 msgid "PF21" 1089 msgid "PF21"
1090 msgstr "PF21" 1090 msgstr "PF21"
1091 1091
1092 -#: ui/10functions.xml:59 1092 +#: ui/10functions.xml:371
1093 msgid "PF22" 1093 msgid "PF22"
1094 msgstr "PF22" 1094 msgstr "PF22"
1095 1095
1096 -#: ui/10functions.xml:60 1096 +#: ui/10functions.xml:372
1097 msgid "PF23" 1097 msgid "PF23"
1098 msgstr "PF23" 1098 msgstr "PF23"
1099 1099
1100 -#: ui/10functions.xml:61 1100 +#: ui/10functions.xml:373
1101 msgid "PF24" 1101 msgid "PF24"
1102 msgstr "PF24" 1102 msgstr "PF24"
1103 1103
1104 -#: ui/10functions.xml:38 1104 +#: ui/10functions.xml:350
1105 msgid "PF3" 1105 msgid "PF3"
1106 msgstr "PF3" 1106 msgstr "PF3"
1107 1107
1108 -#: ui/10functions.xml:39 1108 +#: ui/10functions.xml:351
1109 msgid "PF4" 1109 msgid "PF4"
1110 msgstr "PF4" 1110 msgstr "PF4"
1111 1111
1112 -#: ui/10functions.xml:40 1112 +#: ui/10functions.xml:352
1113 msgid "PF5" 1113 msgid "PF5"
1114 msgstr "PF5" 1114 msgstr "PF5"
1115 1115
1116 -#: ui/10functions.xml:41 1116 +#: ui/10functions.xml:353
1117 msgid "PF6" 1117 msgid "PF6"
1118 msgstr "PF6" 1118 msgstr "PF6"
1119 1119
1120 -#: ui/10functions.xml:42 1120 +#: ui/10functions.xml:354
1121 msgid "PF7" 1121 msgid "PF7"
1122 msgstr "PF7" 1122 msgstr "PF7"
1123 1123
1124 -#: ui/10functions.xml:43 1124 +#: ui/10functions.xml:355
1125 msgid "PF8" 1125 msgid "PF8"
1126 msgstr "PF8" 1126 msgstr "PF8"
1127 1127
1128 -#: ui/10functions.xml:44 1128 +#: ui/10functions.xml:356
1129 msgid "PF9" 1129 msgid "PF9"
1130 msgstr "PF9" 1130 msgstr "PF9"
1131 1131
@@ -1142,15 +1142,15 @@ msgstr &quot;Erro de interpretação em %s&quot; @@ -1142,15 +1142,15 @@ msgstr &quot;Erro de interpretação em %s&quot;
1142 msgid "Passthru Proxy: send error" 1142 msgid "Passthru Proxy: send error"
1143 msgstr "Passthru Proxy: Erro ao enviar" 1143 msgstr "Passthru Proxy: Erro ao enviar"
1144 1144
1145 -#: ui/00default.xml:330 1145 +#: ui/00default.xml:66
1146 msgid "Paste" 1146 msgid "Paste"
1147 msgstr "Colar" 1147 msgstr "Colar"
1148 1148
1149 -#: ui/00default.xml:331 1149 +#: ui/00default.xml:67
1150 msgid "Paste next" 1150 msgid "Paste next"
1151 msgstr "Colar próximo" 1151 msgstr "Colar próximo"
1152 1152
1153 -#: ui/00default.xml:334 1153 +#: ui/00default.xml:70
1154 msgid "Paste text file" 1154 msgid "Paste text file"
1155 msgstr "Colar arquivo texto" 1155 msgstr "Colar arquivo texto"
1156 1156
@@ -1158,7 +1158,7 @@ msgstr &quot;Colar arquivo texto&quot; @@ -1158,7 +1158,7 @@ msgstr &quot;Colar arquivo texto&quot;
1158 msgid "Paste text file contents" 1158 msgid "Paste text file contents"
1159 msgstr "Colar conteúdo de arquivo texto" 1159 msgstr "Colar conteúdo de arquivo texto"
1160 1160
1161 -#: ui/00default.xml:387 1161 +#: ui/00default.xml:123
1162 msgid "Paste with left margin" 1162 msgid "Paste with left margin"
1163 msgstr "Colar com margem esquerda" 1163 msgstr "Colar com margem esquerda"
1164 1164
@@ -1174,7 +1174,7 @@ msgstr &quot;Caminho para os arquivos de dados da aplicação&quot; @@ -1174,7 +1174,7 @@ msgstr &quot;Caminho para os arquivos de dados da aplicação&quot;
1174 msgid "Pink" 1174 msgid "Pink"
1175 msgstr "Rosa" 1175 msgstr "Rosa"
1176 1176
1177 -#: ui/00default.xml:452 1177 +#: ui/00default.xml:188
1178 msgid "Previous field" 1178 msgid "Previous field"
1179 msgstr "Campo anterior" 1179 msgstr "Campo anterior"
1180 1180
@@ -1182,11 +1182,11 @@ msgstr &quot;Campo anterior&quot; @@ -1182,11 +1182,11 @@ msgstr &quot;Campo anterior&quot;
1182 msgid "Primary space:" 1182 msgid "Primary space:"
1183 msgstr "Primary space:" 1183 msgstr "Primary space:"
1184 1184
1185 -#: ui/00default.xml:313 1185 +#: ui/00default.xml:49
1186 msgid "Print" 1186 msgid "Print"
1187 msgstr "Imprimir" 1187 msgstr "Imprimir"
1188 1188
1189 -#: ui/00default.xml:315 1189 +#: ui/00default.xml:51
1190 msgid "Print copy" 1190 msgid "Print copy"
1191 msgstr "Imprimir cópia" 1191 msgstr "Imprimir cópia"
1192 1192
@@ -1194,7 +1194,7 @@ msgstr &quot;Imprimir cópia&quot; @@ -1194,7 +1194,7 @@ msgstr &quot;Imprimir cópia&quot;
1194 msgid "Print operation failed" 1194 msgid "Print operation failed"
1195 msgstr "Operação de impressão falhou" 1195 msgstr "Operação de impressão falhou"
1196 1196
1197 -#: ui/00default.xml:314 1197 +#: ui/00default.xml:50
1198 msgid "Print selected" 1198 msgid "Print selected"
1199 msgstr "Imprimir seleção" 1199 msgstr "Imprimir seleção"
1200 1200
@@ -1202,7 +1202,7 @@ msgstr &quot;Imprimir seleção&quot; @@ -1202,7 +1202,7 @@ msgstr &quot;Imprimir seleção&quot;
1202 msgid "Print selection box" 1202 msgid "Print selection box"
1203 msgstr "Imprimir marca de seleção" 1203 msgstr "Imprimir marca de seleção"
1204 1204
1205 -#: print.c:754 ui/00default.xml:372 1205 +#: print.c:754 ui/00default.xml:108
1206 msgid "Print settings" 1206 msgid "Print settings"
1207 msgstr "Configurações de impressão" 1207 msgstr "Configurações de impressão"
1208 1208
@@ -1290,7 +1290,7 @@ msgstr &quot;RPQ: can&#39;t resolve &#39;%s&#39;: %s&quot; @@ -1290,7 +1290,7 @@ msgstr &quot;RPQ: can&#39;t resolve &#39;%s&#39;: %s&quot;
1290 msgid "RPQ: gethostbyname error" 1290 msgid "RPQ: gethostbyname error"
1291 msgstr "RPQ: Erro em gethostbyname" 1291 msgstr "RPQ: Erro em gethostbyname"
1292 1292
1293 -#: ui/00default.xml:318 1293 +#: ui/00default.xml:54
1294 msgid "Receive file" 1294 msgid "Receive file"
1295 msgstr "Receber arquivo" 1295 msgstr "Receber arquivo"
1296 1296
@@ -1306,27 +1306,27 @@ msgstr &quot;Formato de registro&quot; @@ -1306,27 +1306,27 @@ msgstr &quot;Formato de registro&quot;
1306 msgid "Red" 1306 msgid "Red"
1307 msgstr "Vermelho" 1307 msgstr "Vermelho"
1308 1308
1309 -#: ui/99debug.xml:214 1309 +#: ui/99debug.xml:580
1310 msgid "Reload buffer contents" 1310 msgid "Reload buffer contents"
1311 msgstr "Recarregar conteúdo do buffer" 1311 msgstr "Recarregar conteúdo do buffer"
1312 1312
1313 -#: ui/00default.xml:339 1313 +#: ui/00default.xml:75
1314 msgid "Remove selection" 1314 msgid "Remove selection"
1315 msgstr "Remover seleção" 1315 msgstr "Remover seleção"
1316 1316
1317 -#: ui/00default.xml:340 1317 +#: ui/00default.xml:76
1318 msgid "Reselect" 1318 msgid "Reselect"
1319 msgstr "Reselecionar" 1319 msgstr "Reselecionar"
1320 1320
1321 -#: ui/10keypad.xml:148 1321 +#: ui/10keypad.xml:460
1322 msgid "Reset" 1322 msgid "Reset"
1323 msgstr "Reset" 1323 msgstr "Reset"
1324 1324
1325 -#: ui/00default.xml:386 1325 +#: ui/00default.xml:122
1326 msgid "Resize on alternate screen" 1326 msgid "Resize on alternate screen"
1327 msgstr "Mudar tamanho do terminal em tela alternativa" 1327 msgstr "Mudar tamanho do terminal em tela alternativa"
1328 1328
1329 -#: ui/00default.xml:454 1329 +#: ui/00default.xml:190
1330 msgid "Return" 1330 msgid "Return"
1331 msgstr "Return" 1331 msgstr "Return"
1332 1332
@@ -1487,7 +1487,7 @@ msgstr &quot;&quot; @@ -1487,7 +1487,7 @@ msgstr &quot;&quot;
1487 "SSL_write:\n" 1487 "SSL_write:\n"
1488 "%s" 1488 "%s"
1489 1489
1490 -#: ui/00default.xml:310 1490 +#: ui/00default.xml:46
1491 msgid "Save copy" 1491 msgid "Save copy"
1492 msgstr "Salvar cópia" 1492 msgstr "Salvar cópia"
1493 1493
@@ -1495,7 +1495,7 @@ msgstr &quot;Salvar cópia&quot; @@ -1495,7 +1495,7 @@ msgstr &quot;Salvar cópia&quot;
1495 msgid "Save copy to file" 1495 msgid "Save copy to file"
1496 msgstr "Salvar cópia para arquivo" 1496 msgstr "Salvar cópia para arquivo"
1497 1497
1498 -#: ui/00default.xml:308 1498 +#: ui/00default.xml:44
1499 msgid "Save screen" 1499 msgid "Save screen"
1500 msgstr "Salvar tela" 1500 msgstr "Salvar tela"
1501 1501
@@ -1503,7 +1503,7 @@ msgstr &quot;Salvar tela&quot; @@ -1503,7 +1503,7 @@ msgstr &quot;Salvar tela&quot;
1503 msgid "Save screen to file" 1503 msgid "Save screen to file"
1504 msgstr "Salvar tela para arquivo" 1504 msgstr "Salvar tela para arquivo"
1505 1505
1506 -#: ui/00default.xml:309 1506 +#: ui/00default.xml:45
1507 msgid "Save selected" 1507 msgid "Save selected"
1508 msgstr "Salvar seleção" 1508 msgstr "Salvar seleção"
1509 1509
@@ -1511,15 +1511,20 @@ msgstr &quot;Salvar seleção&quot; @@ -1511,15 +1511,20 @@ msgstr &quot;Salvar seleção&quot;
1511 msgid "Save selection to file" 1511 msgid "Save selection to file"
1512 msgstr "Salvar seleção para arquivo" 1512 msgstr "Salvar seleção para arquivo"
1513 1513
1514 -#: ui/99debug.xml:206 1514 +#: ui/99debug.xml:572
1515 msgid "Screen Trace" 1515 msgid "Screen Trace"
1516 msgstr "Trace de tela" 1516 msgstr "Trace de tela"
1517 1517
1518 -#: ui/00default.xml:378 1518 +#: ui/00default.xml:114
1519 msgid "Screen size" 1519 msgid "Screen size"
1520 msgstr "Tamanho da tela" 1520 msgstr "Tamanho da tela"
1521 1521
1522 -#: ui/rexx.xml:260 1522 +#: ui/09scripts.xml:297
  1523 +#, fuzzy
  1524 +msgid "Script"
  1525 +msgstr "Scripts"
  1526 +
  1527 +#: ui/00default.xml:89
1523 msgid "Scripts" 1528 msgid "Scripts"
1524 msgstr "Scripts" 1529 msgstr "Scripts"
1525 1530
@@ -1531,15 +1536,15 @@ msgstr &quot;Secondary space:&quot; @@ -1531,15 +1536,15 @@ msgstr &quot;Secondary space:&quot;
1531 msgid "Secure connection was successful." 1536 msgid "Secure connection was successful."
1532 msgstr "Conexão segura efetuada com sucesso." 1537 msgstr "Conexão segura efetuada com sucesso."
1533 1538
1534 -#: ui/00default.xml:338 1539 +#: ui/00default.xml:74
1535 msgid "Select Field" 1540 msgid "Select Field"
1536 msgstr "Selecionar campo" 1541 msgstr "Selecionar campo"
1537 1542
1538 -#: ui/00default.xml:337 1543 +#: ui/00default.xml:73
1539 msgid "Select all" 1544 msgid "Select all"
1540 msgstr "Selecionar tudo" 1545 msgstr "Selecionar tudo"
1541 1546
1542 -#: ui/00default.xml:390 1547 +#: ui/00default.xml:126
1543 msgid "Select by rectangles" 1548 msgid "Select by rectangles"
1544 msgstr "Seleção retangular" 1549 msgstr "Seleção retangular"
1545 1550
@@ -1551,7 +1556,7 @@ msgstr &quot;Selecione arquivo a receber&quot; @@ -1551,7 +1556,7 @@ msgstr &quot;Selecione arquivo a receber&quot;
1551 msgid "Select file to send" 1556 msgid "Select file to send"
1552 msgstr "Selecione arquivo a enviar" 1557 msgstr "Selecione arquivo a enviar"
1553 1558
1554 -#: ui/00default.xml:375 1559 +#: ui/00default.xml:111
1555 msgid "Select font" 1560 msgid "Select font"
1556 msgstr "Selecione fonte" 1561 msgstr "Selecione fonte"
1557 1562
@@ -1575,7 +1580,7 @@ msgstr &quot;Certificado auto assinado&quot; @@ -1575,7 +1580,7 @@ msgstr &quot;Certificado auto assinado&quot;
1575 msgid "Self signed certificate in certificate chain" 1580 msgid "Self signed certificate in certificate chain"
1576 msgstr "Certificado auto assinado na cadeia de certificados" 1581 msgstr "Certificado auto assinado na cadeia de certificados"
1577 1582
1578 -#: ui/00default.xml:319 1583 +#: ui/00default.xml:55
1579 msgid "Send file" 1584 msgid "Send file"
1580 msgstr "Enviar arquivo" 1585 msgstr "Enviar arquivo"
1581 1586
@@ -1587,7 +1592,7 @@ msgstr &quot;Enviar arquivo para o servidor&quot; @@ -1587,7 +1592,7 @@ msgstr &quot;Enviar arquivo para o servidor&quot;
1587 msgid "Send messages to syslog" 1592 msgid "Send messages to syslog"
1588 msgstr "Enviar mensagens para o log do sistema" 1593 msgstr "Enviar mensagens para o log do sistema"
1589 1594
1590 -#: ui/00default.xml:318 1595 +#: ui/00default.xml:54
1591 msgid "Send/Receive" 1596 msgid "Send/Receive"
1592 msgstr "Enviar/Receber" 1597 msgstr "Enviar/Receber"
1593 1598
@@ -1595,7 +1600,7 @@ msgstr &quot;Enviar/Receber&quot; @@ -1595,7 +1600,7 @@ msgstr &quot;Enviar/Receber&quot;
1595 msgid "Session name" 1600 msgid "Session name"
1596 msgstr "Nome da sessão" 1601 msgstr "Nome da sessão"
1597 1602
1598 -#: ui/00default.xml:356 1603 +#: ui/00default.xml:92
1599 msgid "Set hostname" 1604 msgid "Set hostname"
1600 msgstr "Selecione servidor" 1605 msgstr "Selecione servidor"
1601 1606
@@ -1611,19 +1616,19 @@ msgstr &quot;Desativa toggles&quot; @@ -1611,19 +1616,19 @@ msgstr &quot;Desativa toggles&quot;
1611 msgid "Set toggles ON" 1616 msgid "Set toggles ON"
1612 msgstr "Ativa toggles" 1617 msgstr "Ativa toggles"
1613 1618
1614 -#: ui/00default.xml:371 1619 +#: ui/00default.xml:107
1615 msgid "Settings" 1620 msgid "Settings"
1616 msgstr "Configurações" 1621 msgstr "Configurações"
1617 1622
1618 -#: ui/00default.xml:393 1623 +#: ui/00default.xml:129
1619 msgid "Show Underline" 1624 msgid "Show Underline"
1620 msgstr "Mostrar sublinhado" 1625 msgstr "Mostrar sublinhado"
1621 1626
1622 -#: ui/99debug.xml:213 1627 +#: ui/99debug.xml:579
1623 msgid "Show test pattern" 1628 msgid "Show test pattern"
1624 msgstr "Mostrar padrão de teste" 1629 msgstr "Mostrar padrão de teste"
1625 1630
1626 -#: ui/00default.xml:395 1631 +#: ui/00default.xml:131
1627 msgid "Smart paste" 1632 msgid "Smart paste"
1628 msgstr "Colar inteligente" 1633 msgstr "Colar inteligente"
1629 1634
@@ -1671,6 +1676,18 @@ msgstr &quot;T_otal&quot; @@ -1671,6 +1676,18 @@ msgstr &quot;T_otal&quot;
1671 msgid "Terminal colors" 1676 msgid "Terminal colors"
1672 msgstr "Cores do terminal" 1677 msgstr "Cores do terminal"
1673 1678
  1679 +#: ui/09scripts.xml:298
  1680 +msgid "Teste01"
  1681 +msgstr "Teste01"
  1682 +
  1683 +#: ui/09scripts.xml:302
  1684 +msgid "Teste02"
  1685 +msgstr "Teste02"
  1686 +
  1687 +#: ui/09scripts.xml:306
  1688 +msgid "Teste03"
  1689 +msgstr "Teste03"
  1690 +
1674 #: host.c:216 1691 #: host.c:216
1675 msgid "Text before '['" 1692 msgid "Text before '['"
1676 msgstr "Texto antes de '['" 1693 msgstr "Texto antes de '['"
@@ -1902,15 +1919,15 @@ msgid &quot;&quot; @@ -1902,15 +1919,15 @@ msgid &quot;&quot;
1902 "This version of %s was built without support for secure sockets layer (SSL)." 1919 "This version of %s was built without support for secure sockets layer (SSL)."
1903 msgstr "Esta versão do %s foi gerada sem suporte para conexões seguras (SSL)." 1920 msgstr "Esta versão do %s foi gerada sem suporte para conexões seguras (SSL)."
1904 1921
1905 -#: ui/00default.xml:412 1922 +#: ui/00default.xml:148
1906 msgid "Toolbar" 1923 msgid "Toolbar"
1907 msgstr "Barra de ferramentas" 1924 msgstr "Barra de ferramentas"
1908 1925
1909 -#: ui/99debug.xml:205 1926 +#: ui/99debug.xml:571
1910 msgid "Trace" 1927 msgid "Trace"
1911 msgstr "Trace" 1928 msgstr "Trace"
1912 1929
1913 -#: ui/00default.xml:384 1930 +#: ui/00default.xml:120
1914 msgid "Track Cursor" 1931 msgid "Track Cursor"
1915 msgstr "Mostrar posição do cursor" 1932 msgstr "Mostrar posição do cursor"
1916 1933
@@ -2118,7 +2135,7 @@ msgstr &quot;Unsupported passthru host session&quot; @@ -2118,7 +2135,7 @@ msgstr &quot;Unsupported passthru host session&quot;
2118 msgid "Unsupported socks 4 proxy" 2135 msgid "Unsupported socks 4 proxy"
2119 msgstr "Unsupported socks 4 proxy" 2136 msgstr "Unsupported socks 4 proxy"
2120 2137
2121 -#: ui/00default.xml:397 2138 +#: ui/00default.xml:133
2122 msgid "Use +/- for field navigation" 2139 msgid "Use +/- for field navigation"
2123 msgstr "Usar teclas +/- para navegar por campos" 2140 msgstr "Usar teclas +/- para navegar por campos"
2124 2141
@@ -2131,7 +2148,7 @@ msgstr &quot;Variável&quot; @@ -2131,7 +2148,7 @@ msgstr &quot;Variável&quot;
2131 msgid "Version %s - Revision %s" 2148 msgid "Version %s - Revision %s"
2132 msgstr "Versão %s - Revisão %s" 2149 msgstr "Versão %s - Revisão %s"
2133 2150
2134 -#: ui/99debug.xml:208 2151 +#: ui/99debug.xml:574
2135 msgid "View Field Delimiters" 2152 msgid "View Field Delimiters"
2136 msgstr "Mostrar delimitadores de campo" 2153 msgstr "Mostrar delimitadores de campo"
2137 2154
@@ -2159,7 +2176,7 @@ msgstr &quot;Europa ocidental (ISO 8859-1)&quot; @@ -2159,7 +2176,7 @@ msgstr &quot;Europa ocidental (ISO 8859-1)&quot;
2159 msgid "White" 2176 msgid "White"
2160 msgstr "Branco" 2177 msgstr "Branco"
2161 2178
2162 -#: ui/00default.xml:423 2179 +#: ui/00default.xml:159
2163 msgid "Window" 2180 msgid "Window"
2164 msgstr "Janela" 2181 msgstr "Janela"
2165 2182
@@ -2227,19 +2244,19 @@ msgstr &quot;_Procurar&quot; @@ -2227,19 +2244,19 @@ msgstr &quot;_Procurar&quot;
2227 msgid "_Color table:" 2244 msgid "_Color table:"
2228 msgstr "Tabela de cores:" 2245 msgstr "Tabela de cores:"
2229 2246
2230 -#: ui/00default.xml:366 2247 +#: ui/00default.xml:102
2231 msgid "_Connect" 2248 msgid "_Connect"
2232 msgstr "_Conectar" 2249 msgstr "_Conectar"
2233 2250
2234 -#: ui/00default.xml:367 2251 +#: ui/00default.xml:103
2235 msgid "_Disconnect" 2252 msgid "_Disconnect"
2236 msgstr "_Desconectar" 2253 msgstr "_Desconectar"
2237 2254
2238 -#: ui/99debug.xml:200 2255 +#: ui/00default.xml:61
2239 msgid "_Edit" 2256 msgid "_Edit"
2240 msgstr "_Editar" 2257 msgstr "_Editar"
2241 2258
2242 -#: ui/rexx.xml:256 2259 +#: ui/00default.xml:36
2243 msgid "_File" 2260 msgid "_File"
2244 msgstr "_Arquivo" 2261 msgstr "_Arquivo"
2245 2262
@@ -2267,11 +2284,11 @@ msgstr &quot;Nome do _Host:&quot; @@ -2267,11 +2284,11 @@ msgstr &quot;Nome do _Host:&quot;
2267 msgid "_Local file name:" 2284 msgid "_Local file name:"
2268 msgstr "Arquivo _local:" 2285 msgstr "Arquivo _local:"
2269 2286
2270 -#: ui/00default.xml:356 2287 +#: ui/00default.xml:92
2271 msgid "_Network" 2288 msgid "_Network"
2272 msgstr "_Rede" 2289 msgstr "_Rede"
2273 2290
2274 -#: ui/00default.xml:381 2291 +#: ui/00default.xml:117
2275 msgid "_Options" 2292 msgid "_Options"
2276 msgstr "_Opções" 2293 msgstr "_Opções"
2277 2294
@@ -2299,7 +2316,7 @@ msgstr &quot;Arquivo _texto&quot; @@ -2299,7 +2316,7 @@ msgstr &quot;Arquivo _texto&quot;
2299 msgid "_To" 2316 msgid "_To"
2300 msgstr "_Para" 2317 msgstr "_Para"
2301 2318
2302 -#: ui/rexx.xml:258 2319 +#: ui/00default.xml:87
2303 msgid "_View" 2320 msgid "_View"
2304 msgstr "_Exibir" 2321 msgstr "_Exibir"
2305 2322
@@ -2346,19 +2363,6 @@ msgid &quot;unknown error&quot; @@ -2346,19 +2363,6 @@ msgid &quot;unknown error&quot;
2346 msgstr "Erro desconhecido" 2363 msgstr "Erro desconhecido"
2347 2364
2348 #, fuzzy 2365 #, fuzzy
2349 -#~ msgid "Script"  
2350 -#~ msgstr "Scripts"  
2351 -  
2352 -#~ msgid "Teste01"  
2353 -#~ msgstr "Teste01"  
2354 -  
2355 -#~ msgid "Teste02"  
2356 -#~ msgstr "Teste02"  
2357 -  
2358 -#~ msgid "Teste03"  
2359 -#~ msgstr "Teste03"  
2360 -  
2361 -#, fuzzy  
2362 #~ msgid "Cross hair Cursor" 2366 #~ msgid "Cross hair Cursor"
2363 #~ msgstr "Cursor mira" 2367 #~ msgstr "Cursor mira"
2364 2368
@@ -61,7 +61,7 @@ SubSection &quot;@PACKAGE@&quot; SecMain @@ -61,7 +61,7 @@ SubSection &quot;@PACKAGE@&quot; SecMain
61 file "/oname=$INSTDIR\@PACKAGE@.exe" ".bin\Release\@PACKAGE@.exe" 61 file "/oname=$INSTDIR\@PACKAGE@.exe" ".bin\Release\@PACKAGE@.exe"
62 file "/oname=$INSTDIR\@PACKAGE@.ico" "src\pw3270\@PACKAGE@.ico" 62 file "/oname=$INSTDIR\@PACKAGE@.ico" "src\pw3270\@PACKAGE@.ico"
63 file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" ".bin\Release\lib3270.dll.@PACKAGE_VERSION@" 63 file "/oname=$INSTDIR\lib3270.dll.@PACKAGE_VERSION@" ".bin\Release\lib3270.dll.@PACKAGE_VERSION@"
64 - file "/oname=$INSTDIR\libpw3270.dll.@PACKAGE_VERSION@" ".bin\Release\libpw3270.dll.@PACKAGE_VERSION@" 64 + file "/oname=$INSTDIR\pw3270.dll.@PACKAGE_VERSION@" ".bin\Release\pw3270.dll.@PACKAGE_VERSION@"
65 65
66 # Configuration files 66 # Configuration files
67 file "/oname=$INSTDIR\@PACKAGE@-logo.png" "src\pw3270\@PACKAGE@-logo.png" 67 file "/oname=$INSTDIR\@PACKAGE@-logo.png" "src\pw3270\@PACKAGE@-logo.png"
src/lib3270/Makefile.in
@@ -108,30 +108,30 @@ include sources.mak @@ -108,30 +108,30 @@ include sources.mak
108 108
109 #---[ Misc targets ]----------------------------------------------------------- 109 #---[ Misc targets ]-----------------------------------------------------------
110 110
111 -Release: $(BINRLS)/@DLLPREFIX@3270@DLLEXT@ 111 +Release: $(BINRLS)/lib3270@DLLEXT@
112 112
113 install: Release 113 install: Release
114 $(MKDIR) $(DESTDIR)$(libdir) 114 $(MKDIR) $(DESTDIR)$(libdir)
115 - $(INSTALL_PROGRAM) $(BINRLS)/@DLLPREFIX@3270@DLLEXT@.@VERSION@ $(DESTDIR)$(libdir)  
116 - $(LN_S) @DLLPREFIX@3270@DLLEXT@.@VERSION@ $(DESTDIR)$(libdir)/@DLLPREFIX@3270@DLLEXT@.@MAJOR_VERSION@  
117 - $(LN_S) @DLLPREFIX@3270@DLLEXT@.@MAJOR_VERSION@ $(DESTDIR)$(libdir)/@DLLPREFIX@3270@DLLEXT@ 115 + $(INSTALL_PROGRAM) $(BINRLS)/lib3270@DLLEXT@.@VERSION@ $(DESTDIR)$(libdir)
  116 + $(LN_S) lib3270@DLLEXT@.@VERSION@ $(DESTDIR)$(libdir)/lib3270@DLLEXT@.@MAJOR_VERSION@
  117 + $(LN_S) lib3270@DLLEXT@.@MAJOR_VERSION@ $(DESTDIR)$(libdir)/lib3270@DLLEXT@
118 118
119 -Debug: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@ 119 +Debug: $(BINDBG)/lib3270@DLLEXT@
120 120
121 -$(BINDBG)/@DLLPREFIX@3270@DLLEXT@: $(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@ 121 +$(BINDBG)/lib3270@DLLEXT@: $(BINDBG)/lib3270@DLLEXT@.@VERSION@
122 @rm -f $@ 122 @rm -f $@
123 - @cd $(BINDBG) && $(LN_S) @DLLPREFIX@3270@DLLEXT@.@VERSION@ @DLLPREFIX@3270@DLLEXT@ 123 + @cd $(BINDBG) && $(LN_S) lib3270@DLLEXT@.@VERSION@ lib3270@DLLEXT@
124 124
125 -$(BINDBG)/@DLLPREFIX@3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@) 125 +$(BINDBG)/lib3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJDBG)/$(SRC)@OBJEXT@)
126 @echo " CCLD `basename $@`" 126 @echo " CCLD `basename $@`"
127 @$(MKDIR) `dirname $@` 127 @$(MKDIR) `dirname $@`
128 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS) 128 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS)
129 129
130 -$(BINRLS)/@DLLPREFIX@3270@DLLEXT@: $(BINRLS)/@DLLPREFIX@3270@DLLEXT@.@VERSION@ 130 +$(BINRLS)/lib3270@DLLEXT@: $(BINRLS)/lib3270@DLLEXT@.@VERSION@
131 @rm -f $@ 131 @rm -f $@
132 - @cd $(BINRLS) && $(LN_S) @DLLPREFIX@3270@DLLEXT@.@VERSION@ @DLLPREFIX@3270@DLLEXT@ 132 + @cd $(BINRLS) && $(LN_S) lib3270@DLLEXT@.@VERSION@ lib3270@DLLEXT@
133 133
134 -$(BINRLS)/@DLLPREFIX@3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@) 134 +$(BINRLS)/lib3270@DLLEXT@.@VERSION@: $(foreach SRC, $(basename $(SOURCES)), $(OBJRLS)/$(SRC)@OBJEXT@)
135 @echo " CCLD `basename $@`" 135 @echo " CCLD `basename $@`"
136 @$(MKDIR) `dirname $@` 136 @$(MKDIR) `dirname $@`
137 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS) 137 @$(LD) $(DLL_FLAGS) $(LDFLAGS) @LDSOFLAGS@ @LDLIBFLAGS@ -o $@ $^ $(LIBS)
@@ -145,9 +145,9 @@ $(BINDBG)/testprogram$(EXEEXT): $(OBJDBG)/testprogram.o $(foreach SRC, $(basenam @@ -145,9 +145,9 @@ $(BINDBG)/testprogram$(EXEEXT): $(OBJDBG)/testprogram.o $(foreach SRC, $(basenam
145 $(DEBDIR)/lib3270.install: Makefile 145 $(DEBDIR)/lib3270.install: Makefile
146 @echo " GEN `basename $@`" 146 @echo " GEN `basename $@`"
147 @$(MKDIR) `dirname $@` 147 @$(MKDIR) `dirname $@`
148 - @echo "$(libdir)/@DLLPREFIX@3270@DLLEXT@.@VERSION@" > $@  
149 - @echo "$(libdir)/@DLLPREFIX@3270@DLLEXT@.@MAJOR_VERSION@" >> $@  
150 - @echo "$(libdir)/@DLLPREFIX@3270@DLLEXT@" >> $@ 148 + @echo "$(libdir)/lib3270@DLLEXT@.@VERSION@" > $@
  149 + @echo "$(libdir)/lib3270@DLLEXT@.@MAJOR_VERSION@" >> $@
  150 + @echo "$(libdir)/lib3270@DLLEXT@" >> $@
151 151
152 $(BINDIR)/pot/lib3270.pot: $(foreach SRC, $(basename $(SOURCES)), $(TMPDIR)/pot/$(SRC).pot) 152 $(BINDIR)/pot/lib3270.pot: $(foreach SRC, $(basename $(SOURCES)), $(TMPDIR)/pot/$(SRC).pot)
153 @rm -f $@ 153 @rm -f $@
src/plugins/hllapi/calls.c
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) 26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
27 * 27 *
28 */ 28 */
29 - 29 +
30 #include <windows.h> 30 #include <windows.h>
31 #include <lib3270.h> 31 #include <lib3270.h>
32 #include <malloc.h> 32 #include <malloc.h>
@@ -34,30 +34,30 @@ @@ -34,30 +34,30 @@
34 #include <errno.h> 34 #include <errno.h>
35 #include <pw3270/hllapi.h> 35 #include <pw3270/hllapi.h>
36 #include <stdio.h> 36 #include <stdio.h>
37 - #include <lib3270/log.h> 37 + #include <lib3270/log.h>
38 #include "client.h" 38 #include "client.h"
39 -  
40 - #undef trace 39 +
  40 + #undef trace
41 #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } } 41 #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } }
42 42
43 /*--[ Globals ]--------------------------------------------------------------------------------------*/ 43 /*--[ Globals ]--------------------------------------------------------------------------------------*/
44 -  
45 - HMODULE hModule = NULL; 44 +
  45 + HMODULE hModule = NULL;
46 void * hSession = NULL; 46 void * hSession = NULL;
47 47
48 -  
49 - static void * (*session_new)(const char *model) = NULL; 48 +
  49 + static void * (*session_new)(const char *model) = NULL;
50 static void (*session_free)(void *h) = NULL; 50 static void (*session_free)(void *h) = NULL;
51 static const char * (*get_revision)(void) = NULL; 51 static const char * (*get_revision)(void) = NULL;
52 static int (*host_connect)(void *h,const char *n, int wait) = NULL; 52 static int (*host_connect)(void *h,const char *n, int wait) = NULL;
53 static int (*host_is_connected)(void *h) = NULL; 53 static int (*host_is_connected)(void *h) = NULL;
54 - static int (*wait_for_ready)(void *h, int seconds) = NULL; 54 + static int (*wait_for_ready)(void *h, int seconds) = NULL;
55 static void (*host_disconnect)(void *h) = NULL; 55 static void (*host_disconnect)(void *h) = NULL;
56 static int (*script_sleep)(void *h, int seconds) = NULL; 56 static int (*script_sleep)(void *h, int seconds) = NULL;
57 static LIB3270_MESSAGE (*get_message)(void *h) = NULL; 57 static LIB3270_MESSAGE (*get_message)(void *h) = NULL;
58 - static char * (*get_text)(void *h, int row, int col, int len) = NULL; 58 + static char * (*get_text)(void *h, int row, int col, int len) = NULL;
59 static char * (*get_text_at_offset)(void *h, int offset, int len) = NULL; 59 static char * (*get_text_at_offset)(void *h, int offset, int len) = NULL;
60 - 60 +
61 static void * (*release_memory)(void *p) = NULL; 61 static void * (*release_memory)(void *p) = NULL;
62 static int (*action_enter)(void *h) = NULL; 62 static int (*action_enter)(void *h) = NULL;
63 static int (*set_text_at)(void *h, int row, int col, const unsigned char *str) = NULL; 63 static int (*set_text_at)(void *h, int row, int col, const unsigned char *str) = NULL;
@@ -70,15 +70,15 @@ @@ -70,15 +70,15 @@
70 static int (*erase_eof)(void *hSession) = NULL; 70 static int (*erase_eof)(void *hSession) = NULL;
71 static int (*do_print)(void *h) = NULL; 71 static int (*do_print)(void *h) = NULL;
72 72
73 - static const struct _entry_point  
74 - {  
75 - void **call;  
76 - void * pipe;  
77 - const char * name;  
78 - } entry_point[] =  
79 - {  
80 - { (void **) &session_new, (void *) hllapi_pipe_init, "lib3270_session_new" },  
81 - { (void **) &session_free, (void *) hllapi_pipe_deinit, "lib3270_session_free" }, 73 + static const struct _entry_point
  74 + {
  75 + void **call;
  76 + void * pipe;
  77 + const char * name;
  78 + } entry_point[] =
  79 + {
  80 + { (void **) &session_new, (void *) hllapi_pipe_init, "lib3270_session_new" },
  81 + { (void **) &session_free, (void *) hllapi_pipe_deinit, "lib3270_session_free" },
82 { (void **) &get_revision, (void *) hllapi_pipe_get_revision, "lib3270_get_revision" }, 82 { (void **) &get_revision, (void *) hllapi_pipe_get_revision, "lib3270_get_revision" },
83 { (void **) &host_connect, (void *) hllapi_pipe_connect, "lib3270_connect" }, 83 { (void **) &host_connect, (void *) hllapi_pipe_connect, "lib3270_connect" },
84 { (void **) &host_disconnect, (void *) hllapi_pipe_disconnect, "lib3270_disconnect" }, 84 { (void **) &host_disconnect, (void *) hllapi_pipe_disconnect, "lib3270_disconnect" },
@@ -99,201 +99,201 @@ @@ -99,201 +99,201 @@
99 { (void **) &emulate_input, (void *) hllapi_pipe_emulate_input, "lib3270_emulate_input" }, 99 { (void **) &emulate_input, (void *) hllapi_pipe_emulate_input, "lib3270_emulate_input" },
100 { (void **) &erase_eof, (void *) hllapi_pipe_erase_eof, "lib3270_eraseeof" }, 100 { (void **) &erase_eof, (void *) hllapi_pipe_erase_eof, "lib3270_eraseeof" },
101 { (void **) &do_print, (void *) hllapi_pipe_print, "lib3270_print" }, 101 { (void **) &do_print, (void *) hllapi_pipe_print, "lib3270_print" },
102 -  
103 - { NULL, NULL, NULL }  
104 - };  
105 -  
106 -// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx  
107 -#ifndef LOAD_LIBRARY_SEARCH_DEFAULT_DIRS  
108 - #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000  
109 -#endif // LOAD_LIBRARY_SEARCH_DEFAULT_DIRS  
110 -  
111 -#ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR  
112 - #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100  
113 -#endif // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR  
114 - 102 +
  103 + { NULL, NULL, NULL }
  104 + };
  105 +
  106 +// http://msdn.microsoft.com/en-us/library/windows/desktop/ms684179(v=vs.85).aspx
  107 +#ifndef LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
  108 + #define LOAD_LIBRARY_SEARCH_DEFAULT_DIRS 0x00001000
  109 +#endif // LOAD_LIBRARY_SEARCH_DEFAULT_DIRS
  110 +
  111 +#ifndef LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
  112 + #define LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR 0x00000100
  113 +#endif // LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR
  114 +
115 /*--[ Implement ]------------------------------------------------------------------------------------*/ 115 /*--[ Implement ]------------------------------------------------------------------------------------*/
116 -  
117 - __declspec (dllexport) DWORD __stdcall hllapi_init(LPSTR mode)  
118 - {  
119 - if(!mode)  
120 - return HLLAPI_STATUS_SYSTEM_ERROR;  
121 -  
122 - trace("%s(%s)",__FUNCTION__,(char *) mode);  
123 -  
124 - if(mode && *mode)  
125 - {  
126 - // Get pointers to the pipe based calls  
127 - int f;  
128 -  
129 - trace("%s: Loading pipe based calls",__FUNCTION__);  
130 - for(f=0;entry_point[f].name;f++)  
131 - *entry_point[f].call = entry_point[f].pipe;  
132 -  
133 - }  
134 - else  
135 - {  
136 - // Direct mode, load lib3270.dll, get pointers to the calls 116 +
  117 + __declspec (dllexport) DWORD __stdcall hllapi_init(LPSTR mode)
  118 + {
  119 + if(!mode)
  120 + return HLLAPI_STATUS_SYSTEM_ERROR;
  121 +
  122 + trace("%s(%s)",__FUNCTION__,(char *) mode);
  123 +
  124 + if(mode && *mode)
  125 + {
  126 + // Get pointers to the pipe based calls
  127 + int f;
  128 +
  129 + trace("%s: Loading pipe based calls",__FUNCTION__);
  130 + for(f=0;entry_point[f].name;f++)
  131 + *entry_point[f].call = entry_point[f].pipe;
  132 +
  133 + }
  134 + else
  135 + {
  136 + // Direct mode, load lib3270.dll, get pointers to the calls
137 static const char *dllname = "lib3270.dll." PACKAGE_VERSION; 137 static const char *dllname = "lib3270.dll." PACKAGE_VERSION;
138 -  
139 - int f;  
140 - HMODULE kernel;  
141 - HANDLE cookie = NULL;  
142 - DWORD rc;  
143 - HANDLE (*AddDllDirectory)(PCWSTR NewDirectory);  
144 - BOOL (*RemoveDllDirectory)(HANDLE Cookie);  
145 - UINT errorMode;  
146 - char datadir[4096];  
147 -  
148 - trace("hModule=%p",hModule);  
149 - if(hModule)  
150 - return -EBUSY;  
151 -  
152 - kernel = LoadLibrary("kernel32.dll");  
153 - AddDllDirectory = (HANDLE (*)(PCWSTR)) GetProcAddress(kernel,"AddDllDirectory");  
154 - RemoveDllDirectory = (BOOL (*)(HANDLE)) GetProcAddress(kernel,"RemoveDllDirectory");  
155 - 138 +
  139 + int f;
  140 + HMODULE kernel;
  141 + HANDLE cookie = NULL;
  142 + DWORD rc;
  143 + HANDLE (*AddDllDirectory)(PCWSTR NewDirectory);
  144 + BOOL (*RemoveDllDirectory)(HANDLE Cookie);
  145 + UINT errorMode;
  146 + char datadir[4096];
  147 +
  148 + trace("hModule=%p",hModule);
  149 + if(hModule)
  150 + return -EBUSY;
  151 +
  152 + kernel = LoadLibrary("kernel32.dll");
  153 + AddDllDirectory = (HANDLE (*)(PCWSTR)) GetProcAddress(kernel,"AddDllDirectory");
  154 + RemoveDllDirectory = (BOOL (*)(HANDLE)) GetProcAddress(kernel,"RemoveDllDirectory");
  155 +
156 // Notify user in case of error loading protocol DLL 156 // Notify user in case of error loading protocol DLL
157 - // http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx  
158 - errorMode = SetErrorMode(1);  
159 -  
160 - memset(datadir,' ',4095);  
161 - datadir[4095] = 0;  
162 -  
163 - if(hllapi_get_datadir(datadir))  
164 - {  
165 - char buffer[4096];  
166 - wchar_t path[4096];  
167 -  
168 - mbstowcs(path, datadir, 4095);  
169 - trace("Datadir=[%s] AddDllDirectory=%p RemoveDllDirectory=%p\n",datadir,AddDllDirectory,RemoveDllDirectory);  
170 - if(AddDllDirectory)  
171 - cookie = AddDllDirectory(path);  
172 -  
173 -#ifdef DEBUG  
174 - snprintf(buffer,4096,"%s\\.bin\\Debug\\%s",datadir,dllname);  
175 -#else  
176 - snprintf(buffer,4096,"%s\\%s",datadir,dllname);  
177 -#endif // DEBUG  
178 -  
179 - hModule = LoadLibrary(buffer);  
180 -  
181 - trace("%s hModule=%p rc=%d",buffer,hModule,(int) GetLastError());  
182 - 157 + // http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx
  158 + errorMode = SetErrorMode(1);
  159 +
  160 + memset(datadir,' ',4095);
  161 + datadir[4095] = 0;
  162 +
  163 + if(hllapi_get_datadir(datadir))
  164 + {
  165 + char buffer[4096];
  166 + wchar_t path[4096];
  167 +
  168 + mbstowcs(path, datadir, 4095);
  169 + trace("Datadir=[%s] AddDllDirectory=%p RemoveDllDirectory=%p\n",datadir,AddDllDirectory,RemoveDllDirectory);
  170 + if(AddDllDirectory)
  171 + cookie = AddDllDirectory(path);
  172 +
  173 +#ifdef DEBUG
  174 + snprintf(buffer,4096,"%s\\.bin\\Debug\\%s",datadir,dllname);
  175 +#else
  176 + snprintf(buffer,4096,"%s\\%s",datadir,dllname);
  177 +#endif // DEBUG
  178 +
  179 + hModule = LoadLibrary(buffer);
  180 +
  181 + trace("%s hModule=%p rc=%d",buffer,hModule,(int) GetLastError());
  182 +
183 if(hModule == NULL) 183 if(hModule == NULL)
184 { 184 {
185 // Enable DLL error popup and try again with full path 185 // Enable DLL error popup and try again with full path
186 SetErrorMode(0); 186 SetErrorMode(0);
187 - hModule = LoadLibraryEx(buffer,NULL,LOAD_LIBRARY_SEARCH_DEFAULT_DIRS|LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);  
188 - }  
189 -  
190 - rc = GetLastError();  
191 -  
192 - trace("%s hModule=%p rc=%d",buffer,hModule,(int) rc);  
193 - }  
194 - else  
195 - {  
196 - hModule = LoadLibrary(dllname);  
197 - rc = GetLastError();  
198 - }  
199 -  
200 - SetErrorMode(errorMode);  
201 -  
202 - trace("%s hModule=%p rc=%d",dllname,hModule,(int) rc);  
203 -  
204 - if(cookie && RemoveDllDirectory)  
205 - RemoveDllDirectory(cookie);  
206 -  
207 - if(kernel)  
208 - FreeLibrary(kernel);  
209 -  
210 - if(!hModule)  
211 - return rc;  
212 -  
213 - // Get library entry pointers  
214 - for(f=0;entry_point[f].name;f++)  
215 - {  
216 - void *ptr = (void *) GetProcAddress(hModule,entry_point[f].name);  
217 -  
218 - trace("%d %s=%p\n",f,entry_point[f].name,ptr);  
219 -  
220 - if(!ptr)  
221 - {  
222 - trace("Can´t load \"%s\"\n",entry_point[f].name);  
223 - hllapi_deinit();  
224 - return -ENOENT;  
225 - }  
226 - *entry_point[f].call = ptr;  
227 - }  
228 -  
229 - }  
230 - // Get session handle  
231 - hSession = session_new((const char *) mode);  
232 - trace("%s ok hSession=%p\n",__FUNCTION__,hSession);  
233 -  
234 - return hSession ? 0 : -1; 187 + hModule = LoadLibraryEx(buffer,NULL,LOAD_LIBRARY_SEARCH_DEFAULT_DIRS|LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR);
  188 + }
  189 +
  190 + rc = GetLastError();
  191 +
  192 + trace("%s hModule=%p rc=%d",buffer,hModule,(int) rc);
  193 + }
  194 + else
  195 + {
  196 + hModule = LoadLibrary(dllname);
  197 + rc = GetLastError();
  198 + }
  199 +
  200 + SetErrorMode(errorMode);
  201 +
  202 + trace("%s hModule=%p rc=%d",dllname,hModule,(int) rc);
  203 +
  204 + if(cookie && RemoveDllDirectory)
  205 + RemoveDllDirectory(cookie);
  206 +
  207 + if(kernel)
  208 + FreeLibrary(kernel);
  209 +
  210 + if(!hModule)
  211 + return rc;
  212 +
  213 + // Get library entry pointers
  214 + for(f=0;entry_point[f].name;f++)
  215 + {
  216 + void *ptr = (void *) GetProcAddress(hModule,entry_point[f].name);
  217 +
  218 + trace("%d %s=%p\n",f,entry_point[f].name,ptr);
  219 +
  220 + if(!ptr)
  221 + {
  222 + trace("Can´t load \"%s\"\n",entry_point[f].name);
  223 + hllapi_deinit();
  224 + return -ENOENT;
  225 + }
  226 + *entry_point[f].call = ptr;
  227 + }
  228 +
  229 + }
  230 + // Get session handle
  231 + hSession = session_new((const char *) mode);
  232 + trace("%s ok hSession=%p\n",__FUNCTION__,hSession);
  233 +
  234 + return hSession ? 0 : -1;
  235 + }
  236 +
  237 + __declspec (dllexport) DWORD __stdcall hllapi_deinit(void)
  238 + {
  239 + int f;
  240 +
  241 + // Release session
  242 + if(hSession && session_free)
  243 + session_free(hSession);
  244 +
  245 + for(f=0;entry_point[f].name;f++)
  246 + *entry_point[f].call = NULL;
  247 +
  248 + if(hModule != NULL)
  249 + {
  250 + FreeLibrary(hModule);
  251 + hModule = NULL;
  252 + }
  253 +
  254 + return 0;
  255 + }
  256 +
  257 + __declspec (dllexport) DWORD __stdcall hllapi_get_revision(void)
  258 + {
  259 + if(!get_revision)
  260 + return 0;
  261 + return (DWORD) atoi(get_revision());
  262 + }
  263 +
  264 + __declspec (dllexport) DWORD __stdcall hllapi_connect(LPSTR uri, WORD wait)
  265 + {
  266 + if(!(host_connect && hSession && uri))
  267 + return HLLAPI_STATUS_SYSTEM_ERROR;
  268 +
  269 + return host_connect(hSession,uri,wait);
  270 + }
  271 +
  272 + __declspec (dllexport) DWORD __stdcall hllapi_is_connected(void)
  273 + {
  274 + if(!(host_is_connected && hSession))
  275 + return HLLAPI_STATUS_SYSTEM_ERROR;
  276 +
  277 + return host_is_connected(hSession);
235 } 278 }
236 -  
237 - __declspec (dllexport) DWORD __stdcall hllapi_deinit(void)  
238 - {  
239 - int f;  
240 -  
241 - // Release session  
242 - if(hSession && session_free)  
243 - session_free(hSession);  
244 -  
245 - for(f=0;entry_point[f].name;f++)  
246 - *entry_point[f].call = NULL;  
247 -  
248 - if(hModule != NULL)  
249 - {  
250 - FreeLibrary(hModule);  
251 - hModule = NULL;  
252 - }  
253 -  
254 - return 0;  
255 - }  
256 -  
257 - __declspec (dllexport) DWORD __stdcall hllapi_get_revision(void)  
258 - {  
259 - if(!get_revision)  
260 - return 0;  
261 - return (DWORD) atoi(get_revision());  
262 - }  
263 -  
264 - __declspec (dllexport) DWORD __stdcall hllapi_connect(LPSTR uri, WORD wait)  
265 - {  
266 - if(!(host_connect && hSession && uri))  
267 - return HLLAPI_STATUS_SYSTEM_ERROR;  
268 -  
269 - return host_connect(hSession,uri,wait);  
270 - }  
271 -  
272 - __declspec (dllexport) DWORD __stdcall hllapi_is_connected(void)  
273 - {  
274 - if(!(host_is_connected && hSession))  
275 - return HLLAPI_STATUS_SYSTEM_ERROR;  
276 -  
277 - return host_is_connected(hSession);  
278 - }  
279 279
280 __declspec (dllexport) DWORD __stdcall hllapi_get_state(void) 280 __declspec (dllexport) DWORD __stdcall hllapi_get_state(void)
281 { 281 {
282 - switch(hllapi_get_message_id())  
283 - { 282 + switch(hllapi_get_message_id())
  283 + {
284 case LIB3270_MESSAGE_NONE: /* 0 - No message */ 284 case LIB3270_MESSAGE_NONE: /* 0 - No message */
285 - return HLLAPI_STATUS_SUCCESS;  
286 -  
287 - case LIB3270_MESSAGE_DISCONNECTED: /* 4 - Disconnected from host */  
288 - return HLLAPI_STATUS_DISCONNECTED;  
289 -  
290 - case LIB3270_MESSAGE_MINUS:  
291 - case LIB3270_MESSAGE_PROTECTED:  
292 - case LIB3270_MESSAGE_NUMERIC:  
293 - case LIB3270_MESSAGE_OVERFLOW:  
294 - case LIB3270_MESSAGE_INHIBIT:  
295 - case LIB3270_MESSAGE_KYBDLOCK:  
296 - return HLLAPI_STATUS_KEYBOARD_LOCKED; 285 + return HLLAPI_STATUS_SUCCESS;
  286 +
  287 + case LIB3270_MESSAGE_DISCONNECTED: /* 4 - Disconnected from host */
  288 + return HLLAPI_STATUS_DISCONNECTED;
  289 +
  290 + case LIB3270_MESSAGE_MINUS:
  291 + case LIB3270_MESSAGE_PROTECTED:
  292 + case LIB3270_MESSAGE_NUMERIC:
  293 + case LIB3270_MESSAGE_OVERFLOW:
  294 + case LIB3270_MESSAGE_INHIBIT:
  295 + case LIB3270_MESSAGE_KYBDLOCK:
  296 + return HLLAPI_STATUS_KEYBOARD_LOCKED;
297 297
298 case LIB3270_MESSAGE_SYSWAIT: 298 case LIB3270_MESSAGE_SYSWAIT:
299 case LIB3270_MESSAGE_TWAIT: 299 case LIB3270_MESSAGE_TWAIT:
@@ -301,152 +301,152 @@ @@ -301,152 +301,152 @@
301 case LIB3270_MESSAGE_X: 301 case LIB3270_MESSAGE_X:
302 case LIB3270_MESSAGE_RESOLVING: 302 case LIB3270_MESSAGE_RESOLVING:
303 case LIB3270_MESSAGE_CONNECTING: 303 case LIB3270_MESSAGE_CONNECTING:
304 - return HLLAPI_STATUS_WAITING;  
305 - } 304 + return HLLAPI_STATUS_WAITING;
  305 + }
306 306
307 return HLLAPI_STATUS_SYSTEM_ERROR; 307 return HLLAPI_STATUS_SYSTEM_ERROR;
308 } 308 }
309 -  
310 - __declspec (dllexport) DWORD __stdcall hllapi_disconnect(void)  
311 - {  
312 - if(!(host_disconnect && hSession))  
313 - return HLLAPI_STATUS_SYSTEM_ERROR;  
314 -  
315 - host_disconnect(hSession);  
316 -  
317 - return 0;  
318 - }  
319 -  
320 - __declspec (dllexport) DWORD __stdcall hllapi_wait_for_ready(WORD seconds)  
321 - {  
322 - if(!(wait_for_ready && hSession))  
323 - return HLLAPI_STATUS_SYSTEM_ERROR;  
324 -  
325 - trace("%s seconds=%d\n", __FUNCTION__, (int) seconds);  
326 -  
327 - return (DWORD) wait_for_ready(hSession,(int) seconds);  
328 - }  
329 -  
330 - __declspec (dllexport) DWORD __stdcall hllapi_wait(WORD seconds)  
331 - {  
332 - if(!(script_sleep && hSession))  
333 - return HLLAPI_STATUS_SYSTEM_ERROR;  
334 -  
335 - return (DWORD) script_sleep(hSession,(int) seconds);  
336 - }  
337 -  
338 - __declspec (dllexport) DWORD __stdcall hllapi_get_message_id(void)  
339 - {  
340 - if(!(get_message && hSession))  
341 - return HLLAPI_STATUS_SYSTEM_ERROR;  
342 - return (DWORD) get_message(hSession);  
343 - }  
344 -  
345 - __declspec (dllexport) DWORD __stdcall hllapi_get_screen_at(WORD row, WORD col, LPSTR buffer)  
346 - {  
347 - char * text;  
348 - int len;  
349 -  
350 - if(!(get_text && release_memory && hSession))  
351 - return HLLAPI_STATUS_SYSTEM_ERROR;  
352 -  
353 - trace("%s row=%d col=%d buffer=%p",__FUNCTION__,row,col,buffer);  
354 - len = strlen(buffer);  
355 -  
356 - trace(" len=%d",len);  
357 -  
358 - text = get_text(hSession,row,col,len);  
359 -  
360 - trace(" text=%p errno=%d %s\n",text,errno,strerror(errno));  
361 - 309 +
  310 + __declspec (dllexport) DWORD __stdcall hllapi_disconnect(void)
  311 + {
  312 + if(!(host_disconnect && hSession))
  313 + return HLLAPI_STATUS_SYSTEM_ERROR;
  314 +
  315 + host_disconnect(hSession);
  316 +
  317 + return 0;
  318 + }
  319 +
  320 + __declspec (dllexport) DWORD __stdcall hllapi_wait_for_ready(WORD seconds)
  321 + {
  322 + if(!(wait_for_ready && hSession))
  323 + return HLLAPI_STATUS_SYSTEM_ERROR;
  324 +
  325 + trace("%s seconds=%d\n", __FUNCTION__, (int) seconds);
  326 +
  327 + return (DWORD) wait_for_ready(hSession,(int) seconds);
  328 + }
  329 +
  330 + __declspec (dllexport) DWORD __stdcall hllapi_wait(WORD seconds)
  331 + {
  332 + if(!(script_sleep && hSession))
  333 + return HLLAPI_STATUS_SYSTEM_ERROR;
  334 +
  335 + return (DWORD) script_sleep(hSession,(int) seconds);
  336 + }
  337 +
  338 + __declspec (dllexport) DWORD __stdcall hllapi_get_message_id(void)
  339 + {
  340 + if(!(get_message && hSession))
  341 + return HLLAPI_STATUS_SYSTEM_ERROR;
  342 + return (DWORD) get_message(hSession);
  343 + }
  344 +
  345 + __declspec (dllexport) DWORD __stdcall hllapi_get_screen_at(WORD row, WORD col, LPSTR buffer)
  346 + {
  347 + char * text;
  348 + int len;
  349 +
  350 + if(!(get_text && release_memory && hSession))
  351 + return HLLAPI_STATUS_SYSTEM_ERROR;
  352 +
  353 + trace("%s row=%d col=%d buffer=%p",__FUNCTION__,row,col,buffer);
  354 + len = strlen(buffer);
  355 +
  356 + trace(" len=%d",len);
  357 +
  358 + text = get_text(hSession,row,col,len);
  359 +
  360 + trace(" text=%p errno=%d %s\n",text,errno,strerror(errno));
  361 +
362 if(!text) 362 if(!text)
363 { 363 {
364 int rc = hllapi_get_state(); 364 int rc = hllapi_get_state();
365 return rc == HLLAPI_STATUS_SUCCESS ? -1 : rc; 365 return rc == HLLAPI_STATUS_SUCCESS ? -1 : rc;
366 } 366 }
367 - 367 +
368 strncpy(buffer,text,len); 368 strncpy(buffer,text,len);
369 - release_memory(text);  
370 -  
371 - trace("text:\n%s\n",buffer);  
372 -  
373 - return HLLAPI_STATUS_SUCCESS;  
374 - }  
375 -  
376 - __declspec (dllexport) DWORD __stdcall hllapi_enter(void)  
377 - {  
378 - if(!(action_enter && hSession))  
379 - return HLLAPI_STATUS_SYSTEM_ERROR;  
380 -  
381 - return (DWORD) action_enter(hSession);  
382 - }  
383 -  
384 - __declspec (dllexport) DWORD __stdcall hllapi_set_text_at(WORD row, WORD col, LPSTR text)  
385 - {  
386 - if(!(set_text_at && hSession))  
387 - return HLLAPI_STATUS_SYSTEM_ERROR;  
388 -  
389 - return (DWORD) set_text_at(hSession,row,col,(const unsigned char *) text);  
390 - }  
391 -  
392 - __declspec (dllexport) DWORD __stdcall hllapi_cmp_text_at(WORD row, WORD col, LPSTR text)  
393 - {  
394 - if(!(cmp_text_at && hSession))  
395 - return HLLAPI_STATUS_SYSTEM_ERROR;  
396 -  
397 - return (DWORD) cmp_text_at(hSession,row,col,(const char *) text);  
398 - }  
399 -  
400 - __declspec (dllexport) DWORD __stdcall hllapi_pfkey(WORD key)  
401 - {  
402 - if(!(pfkey && hSession))  
403 - return HLLAPI_STATUS_SYSTEM_ERROR;  
404 - 369 + release_memory(text);
  370 +
  371 + trace("text:\n%s\n",buffer);
  372 +
  373 + return HLLAPI_STATUS_SUCCESS;
  374 + }
  375 +
  376 + __declspec (dllexport) DWORD __stdcall hllapi_enter(void)
  377 + {
  378 + if(!(action_enter && hSession))
  379 + return HLLAPI_STATUS_SYSTEM_ERROR;
  380 +
  381 + return (DWORD) action_enter(hSession);
  382 + }
  383 +
  384 + __declspec (dllexport) DWORD __stdcall hllapi_set_text_at(WORD row, WORD col, LPSTR text)
  385 + {
  386 + if(!(set_text_at && hSession))
  387 + return HLLAPI_STATUS_SYSTEM_ERROR;
  388 +
  389 + return (DWORD) set_text_at(hSession,row,col,(const unsigned char *) text);
  390 + }
  391 +
  392 + __declspec (dllexport) DWORD __stdcall hllapi_cmp_text_at(WORD row, WORD col, LPSTR text)
  393 + {
  394 + if(!(cmp_text_at && hSession))
  395 + return HLLAPI_STATUS_SYSTEM_ERROR;
  396 +
  397 + return (DWORD) cmp_text_at(hSession,row,col,(const char *) text);
  398 + }
  399 +
  400 + __declspec (dllexport) DWORD __stdcall hllapi_pfkey(WORD key)
  401 + {
  402 + if(!(pfkey && hSession))
  403 + return HLLAPI_STATUS_SYSTEM_ERROR;
  404 +
405 return (DWORD) pfkey(hSession,key); 405 return (DWORD) pfkey(hSession,key);
406 - } 406 + }
  407 +
  408 + __declspec (dllexport) DWORD __stdcall hllapi_pakey(WORD key)
  409 + {
  410 + if(!(pfkey && hSession))
  411 + return HLLAPI_STATUS_SYSTEM_ERROR;
407 412
408 - __declspec (dllexport) DWORD __stdcall hllapi_pakey(WORD key)  
409 - {  
410 - if(!(pfkey && hSession))  
411 - return HLLAPI_STATUS_SYSTEM_ERROR;  
412 -  
413 return (DWORD) pakey(hSession,key); 413 return (DWORD) pakey(hSession,key);
414 - }  
415 -  
416 - __declspec (dllexport) DWORD __stdcall hllapi_get_datadir(LPSTR datadir)  
417 - {  
418 - HKEY hKey = 0;  
419 - unsigned long datalen = strlen(datadir);  
420 -  
421 - *datadir = 0;  
422 -  
423 - if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\pw3270",0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS)  
424 - { 414 + }
  415 +
  416 + __declspec (dllexport) DWORD __stdcall hllapi_get_datadir(LPSTR datadir)
  417 + {
  418 + HKEY hKey = 0;
  419 + unsigned long datalen = strlen(datadir);
  420 +
  421 + *datadir = 0;
  422 +
  423 + if(RegOpenKeyEx(HKEY_LOCAL_MACHINE,"Software\\pw3270",0,KEY_QUERY_VALUE,&hKey) == ERROR_SUCCESS)
  424 + {
425 unsigned long datatype; // #defined in winnt.h (predefined types 0-11) 425 unsigned long datatype; // #defined in winnt.h (predefined types 0-11)
426 - if(RegQueryValueExA(hKey,"datadir",NULL,&datatype,(LPBYTE) datadir,&datalen) != ERROR_SUCCESS)  
427 - *datadir = 0; 426 + if(RegQueryValueExA(hKey,"datadir",NULL,&datatype,(LPBYTE) datadir,&datalen) != ERROR_SUCCESS)
  427 + *datadir = 0;
428 RegCloseKey(hKey); 428 RegCloseKey(hKey);
429 } 429 }
430 -  
431 - return *datadir;  
432 - }  
433 - 430 +
  431 + return *datadir;
  432 + }
  433 +
434 __declspec (dllexport) DWORD __stdcall hllapi_setcursor(WORD pos) 434 __declspec (dllexport) DWORD __stdcall hllapi_setcursor(WORD pos)
435 { 435 {
436 - if(!(setcursor && hSession))  
437 - return HLLAPI_STATUS_SYSTEM_ERROR;  
438 - trace("%s(%d)",__FUNCTION__,pos); 436 + if(!(setcursor && hSession))
  437 + return HLLAPI_STATUS_SYSTEM_ERROR;
  438 + trace("%s(%d)",__FUNCTION__,pos);
439 return setcursor(hSession,pos-1); 439 return setcursor(hSession,pos-1);
440 - } 440 + }
441 441
442 __declspec (dllexport) DWORD __stdcall hllapi_getcursor() 442 __declspec (dllexport) DWORD __stdcall hllapi_getcursor()
443 { 443 {
444 - if(!(getcursor && hSession))  
445 - return HLLAPI_STATUS_SYSTEM_ERROR; 444 + if(!(getcursor && hSession))
  445 + return HLLAPI_STATUS_SYSTEM_ERROR;
446 return getcursor(hSession)+1; 446 return getcursor(hSession)+1;
447 - }  
448 -  
449 - __declspec (dllexport) DWORD __stdcall hllapi_get_screen(WORD offset, LPSTR buffer, WORD len) 447 + }
  448 +
  449 + __declspec (dllexport) DWORD __stdcall hllapi_get_screen(WORD offset, LPSTR buffer, WORD len)
450 { 450 {
451 size_t szBuffer = strlen(buffer); 451 size_t szBuffer = strlen(buffer);
452 char * text; 452 char * text;
@@ -465,16 +465,18 @@ @@ -465,16 +465,18 @@
465 465
466 hllapi_free(text); 466 hllapi_free(text);
467 467
468 - return HLLAPI_STATUS_SUCCESS;  
469 - } 468 + return HLLAPI_STATUS_SUCCESS;
  469 + }
470 470
471 __declspec (dllexport) DWORD __stdcall hllapi_emulate_input(LPSTR buffer, WORD len, WORD pasting) 471 __declspec (dllexport) DWORD __stdcall hllapi_emulate_input(LPSTR buffer, WORD len, WORD pasting)
472 { 472 {
473 473
474 - if(!(emulate_input && hSession)) 474 + if(!(emulate_input && hSession))
475 return HLLAPI_STATUS_DISCONNECTED; 475 return HLLAPI_STATUS_DISCONNECTED;
476 - trace("%s",__FUNCTION__);  
477 - emulate_input(hSession, buffer, len, pasting); 476 + trace("%s(%s)",__FUNCTION__,(char *) buffer);
  477 +
  478 + if(buffer && *buffer)
  479 + emulate_input(hSession, buffer, len, pasting);
478 480
479 return HLLAPI_STATUS_SUCCESS; 481 return HLLAPI_STATUS_SUCCESS;
480 } 482 }
@@ -483,9 +485,9 @@ @@ -483,9 +485,9 @@
483 { 485 {
484 if(!erase_eof && hSession) 486 if(!erase_eof && hSession)
485 return HLLAPI_STATUS_SYSTEM_ERROR; 487 return HLLAPI_STATUS_SYSTEM_ERROR;
486 - trace("%s",__FUNCTION__); 488 + trace("%s",__FUNCTION__);
487 return erase_eof(hSession); 489 return erase_eof(hSession);
488 - } 490 + }
489 491
490 __declspec (dllexport) DWORD __stdcall hllapi_print(void) 492 __declspec (dllexport) DWORD __stdcall hllapi_print(void)
491 { 493 {
@@ -493,14 +495,14 @@ @@ -493,14 +495,14 @@
493 return HLLAPI_STATUS_SYSTEM_ERROR; 495 return HLLAPI_STATUS_SYSTEM_ERROR;
494 496
495 return do_print(hSession); 497 return do_print(hSession);
496 - } 498 + }
497 499
498 char * hllapi_get_string(int offset, size_t len) 500 char * hllapi_get_string(int offset, size_t len)
499 { 501 {
500 - if(!(get_text_at_offset && hSession))  
501 - return NULL;  
502 -  
503 - return get_text_at_offset(hSession,offset-1,len); 502 + if(!(get_text_at_offset && hSession))
  503 + return NULL;
  504 +
  505 + return get_text_at_offset(hSession,offset-1,len);
504 } 506 }
505 507
506 void hllapi_free(void *p) 508 void hllapi_free(void *p)
src/plugins/hllapi/client.h
@@ -26,36 +26,36 @@ @@ -26,36 +26,36 @@
26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) 26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
27 * 27 *
28 */ 28 */
29 - 29 +
30 #include <windows.h> 30 #include <windows.h>
31 #include <pw3270/hllapi.h> 31 #include <pw3270/hllapi.h>
32 - 32 +
33 #ifndef ETIMEDOUT 33 #ifndef ETIMEDOUT
34 #define ETIMEDOUT 1238 34 #define ETIMEDOUT 1238
35 #endif // ETIMEDOUT 35 #endif // ETIMEDOUT
36 -  
37 - #define PIPE_BUFFER_LENGTH 8192  
38 - 36 +
  37 + #define PIPE_BUFFER_LENGTH 8192
  38 +
39 #define set_active(x) /* x */ 39 #define set_active(x) /* x */
40 -  
41 - void * hllapi_pipe_init(const char *id);  
42 - void hllapi_pipe_deinit(void *h);  
43 - const char * hllapi_pipe_get_revision(void);  
44 - void hllapi_pipe_release_memory(void *p); 40 +
  41 + void * hllapi_pipe_init(const char *id);
  42 + void hllapi_pipe_deinit(void *h);
  43 + const char * hllapi_pipe_get_revision(void);
  44 + void hllapi_pipe_release_memory(void *p);
45 int hllapi_pipe_connect(void *h, const char *n, int wait); 45 int hllapi_pipe_connect(void *h, const char *n, int wait);
46 - void hllapi_pipe_disconnect(void *h);  
47 - LIB3270_MESSAGE hllapi_pipe_get_message(void *h);  
48 - char * hllapi_pipe_get_text_at(void *h, int row, int col, int len); 46 + void hllapi_pipe_disconnect(void *h);
  47 + LIB3270_MESSAGE hllapi_pipe_get_message(void *h);
  48 + char * hllapi_pipe_get_text_at(void *h, int row, int col, int len);
49 char * hllapi_pipe_get_text(void *h, int offset, int len); 49 char * hllapi_pipe_get_text(void *h, int offset, int len);
50 - int hllapi_pipe_enter(void *h);  
51 - int hllapi_pipe_erase_eof(void *h);  
52 - int hllapi_pipe_set_text_at(void *h, int row, int col, const unsigned char *str);  
53 - int hllapi_pipe_cmp_text_at(void *h, int row, int col, const char *text);  
54 - int hllapi_pipe_pfkey(void *h, int key);  
55 - int hllapi_pipe_pakey(void *h, int key);  
56 - int hllapi_pipe_wait_for_ready(void *h, int seconds);  
57 - int hllapi_pipe_sleep(void *h, int seconds);  
58 - int hllapi_pipe_is_connected(void *h); 50 + int hllapi_pipe_enter(void *h);
  51 + int hllapi_pipe_erase_eof(void *h);
  52 + int hllapi_pipe_set_text_at(void *h, int row, int col, const unsigned char *str);
  53 + int hllapi_pipe_cmp_text_at(void *h, int row, int col, const char *text);
  54 + int hllapi_pipe_pfkey(void *h, int key);
  55 + int hllapi_pipe_pakey(void *h, int key);
  56 + int hllapi_pipe_wait_for_ready(void *h, int seconds);
  57 + int hllapi_pipe_sleep(void *h, int seconds);
  58 + int hllapi_pipe_is_connected(void *h);
59 int hllapi_pipe_getcursor(void *h); 59 int hllapi_pipe_getcursor(void *h);
60 int hllapi_pipe_setcursor(void *h, int baddr); 60 int hllapi_pipe_setcursor(void *h, int baddr);
61 int hllapi_pipe_emulate_input(void *hSession, const char *s, int len, int pasting); 61 int hllapi_pipe_emulate_input(void *hSession, const char *s, int len, int pasting);
@@ -65,4 +65,4 @@ @@ -65,4 +65,4 @@
65 void hllapi_free(void *p); 65 void hllapi_free(void *p);
66 66
67 67
68 - 68 +
src/plugins/hllapi/hllapi.c
@@ -32,12 +32,12 @@ @@ -32,12 +32,12 @@
32 #include <string.h> 32 #include <string.h>
33 #include <errno.h> 33 #include <errno.h>
34 #include <pw3270/hllapi.h> 34 #include <pw3270/hllapi.h>
35 - #include <stdio.h> 35 + #include <stdio.h>
36 #include <time.h> 36 #include <time.h>
37 #include <lib3270/log.h> 37 #include <lib3270/log.h>
38 #include "client.h" 38 #include "client.h"
39 -  
40 - #undef trace 39 +
  40 + #undef trace
41 #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } } 41 #define trace( fmt, ... ) { FILE *out = fopen("c:\\Users\\Perry\\hllapi.log","a"); if(out) { fprintf(out, "%s(%d) " fmt "\n", __FILE__, __LINE__, __VA_ARGS__ ); fclose(out); } }
42 42
43 /*--[ Prototipes ]-----------------------------------------------------------------------------------*/ 43 /*--[ Prototipes ]-----------------------------------------------------------------------------------*/
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
69 { HLLAPI_CMD_DISCONNECTPS, disconnect_ps }, 69 { HLLAPI_CMD_DISCONNECTPS, disconnect_ps },
70 { HLLAPI_CMD_GETREVISION, get_library_revision }, 70 { HLLAPI_CMD_GETREVISION, get_library_revision },
71 { HLLAPI_CMD_QUERYCURSOR, get_cursor_position }, 71 { HLLAPI_CMD_QUERYCURSOR, get_cursor_position },
72 - { HLLAPI_CMD_SETCURSOR, set_cursor_position }, 72 + { HLLAPI_CMD_SETCURSOR, set_cursor_position },
73 { HLLAPI_CMD_COPYPSTOSTR, copy_ps_to_str }, 73 { HLLAPI_CMD_COPYPSTOSTR, copy_ps_to_str },
74 { HLLAPI_CMD_INPUTSTRING, input_string }, 74 { HLLAPI_CMD_INPUTSTRING, input_string },
75 { HLLAPI_CMD_WAIT, wait_system }, 75 { HLLAPI_CMD_WAIT, wait_system },
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 static const char control_char = '@'; 84 static const char control_char = '@';
85 85
86 /*--[ Implement ]------------------------------------------------------------------------------------*/ 86 /*--[ Implement ]------------------------------------------------------------------------------------*/
87 - 87 +
88 #ifdef _WIN32 88 #ifdef _WIN32
89 __declspec (dllexport) int __stdcall hllapi(LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc) 89 __declspec (dllexport) int __stdcall hllapi(LPWORD func, LPSTR buffer, LPWORD length, LPWORD rc)
90 #else 90 #else
@@ -92,17 +92,17 @@ @@ -92,17 +92,17 @@
92 #endif // _WIN32 92 #endif // _WIN32
93 { 93 {
94 int f; 94 int f;
95 -  
96 - trace("%s(%d)",__FUNCTION__,*func);  
97 - 95 +
  96 + trace("%s(%d)",__FUNCTION__,*func);
  97 +
98 for(f=0;f< (sizeof (hllapi_call) / sizeof ((hllapi_call)[0]));f++) 98 for(f=0;f< (sizeof (hllapi_call) / sizeof ((hllapi_call)[0]));f++)
99 { 99 {
100 if(hllapi_call[f].func == *func) 100 if(hllapi_call[f].func == *func)
101 return hllapi_call[f].exec(buffer,length,rc); 101 return hllapi_call[f].exec(buffer,length,rc);
102 - }  
103 - 102 + }
  103 +
104 return invalid_request(buffer, length, rc); 104 return invalid_request(buffer, length, rc);
105 -} 105 +}
106 106
107 static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc) 107 static int invalid_request(char *buffer, unsigned short *length, unsigned short *rc)
108 { 108 {
@@ -111,33 +111,33 @@ static int invalid_request(char *buffer, unsigned short *length, unsigned short @@ -111,33 +111,33 @@ static int invalid_request(char *buffer, unsigned short *length, unsigned short
111 } 111 }
112 112
113 static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc) 113 static int connect_ps(char *buffer, unsigned short *length, unsigned short *rc)
114 -{  
115 - char *tempbuffer = NULL;  
116 -  
117 - trace("%s: len=%d buflen=%d",__FUNCTION__,*length,strlen(buffer));  
118 -  
119 - if(strlen(buffer) > *length)  
120 - buffer[*length] = 0;  
121 -  
122 - if(!strrchr(buffer,':'))  
123 - {  
124 - int sz = strlen(buffer);  
125 -  
126 - tempbuffer = malloc(sz+2);  
127 - strcpy(tempbuffer,buffer);  
128 - tempbuffer[sz-1] = ':';  
129 - tempbuffer[sz] = buffer[sz-1];  
130 - tempbuffer[sz+1] = 0;  
131 - buffer = tempbuffer;  
132 - } 114 +{
  115 + char *tempbuffer = NULL;
  116 +
  117 + trace("%s: len=%d buflen=%d",__FUNCTION__,*length,strlen(buffer));
  118 +
  119 + if(strlen(buffer) > *length)
  120 + buffer[*length] = 0;
  121 +
  122 + if(!strrchr(buffer,':'))
  123 + {
  124 + int sz = strlen(buffer);
  125 +
  126 + tempbuffer = malloc(sz+2);
  127 + strcpy(tempbuffer,buffer);
  128 + tempbuffer[sz-1] = ':';
  129 + tempbuffer[sz] = buffer[sz-1];
  130 + tempbuffer[sz+1] = 0;
  131 + buffer = tempbuffer;
  132 + }
133 133
134 if(hllapi_init(buffer) == 0) 134 if(hllapi_init(buffer) == 0)
135 *rc = HLLAPI_STATUS_SUCCESS; 135 *rc = HLLAPI_STATUS_SUCCESS;
136 else 136 else
137 - *rc = HLLAPI_STATUS_UNAVAILABLE;  
138 -  
139 - if(tempbuffer)  
140 - free(tempbuffer); 137 + *rc = HLLAPI_STATUS_UNAVAILABLE;
  138 +
  139 + if(tempbuffer)
  140 + free(tempbuffer);
141 141
142 return 0; 142 return 0;
143 } 143 }
@@ -155,32 +155,32 @@ static int get_library_revision(char *buffer, unsigned short *length, unsigned s @@ -155,32 +155,32 @@ static int get_library_revision(char *buffer, unsigned short *length, unsigned s
155 } 155 }
156 156
157 static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) 157 static int get_cursor_position(char *buffer, unsigned short *length, unsigned short *rc)
158 -{ 158 +{
159 int pos = hllapi_getcursor(); 159 int pos = hllapi_getcursor();
160 -  
161 - trace("%s(%d)",__FUNCTION__,pos);  
162 -  
163 - if(pos < 0)  
164 - return -1;  
165 -  
166 - *rc = pos; 160 +
  161 + trace("%s(%d)",__FUNCTION__,pos);
  162 +
  163 + if(pos < 0)
  164 + return -1;
  165 +
  166 + *rc = pos;
167 return 0; 167 return 0;
168 } 168 }
169 169
170 static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc) 170 static int set_cursor_position(char *buffer, unsigned short *length, unsigned short *rc)
171 -{ 171 +{
172 trace("%s(%d)",__FUNCTION__,*rc); 172 trace("%s(%d)",__FUNCTION__,*rc);
173 *rc = hllapi_setcursor(*rc); 173 *rc = hllapi_setcursor(*rc);
174 return 0; 174 return 0;
175 } 175 }
176 176
177 -static int copy_ps_to_str(char *buffer, unsigned short *length, unsigned short *rc)  
178 -{  
179 - // Length Length of the target data string.  
180 - // PS Position Position within the host presentation space of the first byte in your target data string.  
181 - return hllapi_get_screen(*rc,buffer,*length); 177 +static int copy_ps_to_str(char *buffer, unsigned short *length, unsigned short *rc)
  178 +{
  179 + // Length Length of the target data string.
  180 + // PS Position Position within the host presentation space of the first byte in your target data string.
  181 + return hllapi_get_screen(*rc,buffer,*length);
182 } 182 }
183 - 183 +
184 static int input_string(char *input, unsigned short *length, unsigned short *rc) 184 static int input_string(char *input, unsigned short *length, unsigned short *rc)
185 { 185 {
186 size_t szText; 186 size_t szText;
@@ -203,6 +203,8 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc) @@ -203,6 +203,8 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc)
203 203
204 *rc = 0; 204 *rc = 0;
205 205
  206 + trace("input[%s]",text);
  207 +
206 if(strchr(text,control_char)) 208 if(strchr(text,control_char))
207 { 209 {
208 // Convert control char 210 // Convert control char
@@ -213,6 +215,7 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc) @@ -213,6 +215,7 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc)
213 { 215 {
214 *(ptr++) = 0; 216 *(ptr++) = 0;
215 217
  218 + trace("input[%s]",buffer);
216 hllapi_emulate_input(buffer,-1,0); 219 hllapi_emulate_input(buffer,-1,0);
217 220
218 switch(*(ptr++)) 221 switch(*(ptr++))
@@ -282,7 +285,8 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc) @@ -282,7 +285,8 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc)
282 285
283 } 286 }
284 287
285 - hllapi_emulate_input(buffer,-1,0); 288 + if(*buffer)
  289 + hllapi_emulate_input(buffer,-1,0);
286 290
287 } 291 }
288 else 292 else
@@ -295,40 +299,40 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc) @@ -295,40 +299,40 @@ static int input_string(char *input, unsigned short *length, unsigned short *rc)
295 return 0; 299 return 0;
296 } 300 }
297 301
298 -static int search_ps(char *buffer, unsigned short *length, unsigned short *ps)  
299 -{  
300 - /*  
301 - * Data String Target string for search.  
302 - * Length Length of the target data string. Overridden in EOT mode.  
303 - * PS Position Position within the host presentation space where the search is to begin (SRCHFRWD option) or to end  
304 - * (SRCHBKWD option). Overridden in SRCHALL (default) mode.  
305 - *  
306 - * Return in *ps:  
307 - *  
308 - * = 0 The string was not found.  
309 - * > 0 The string was found at the indicated host presentation space position.  
310 - *  
311 - * Return code:  
312 - *  
313 - * 0 The Search Presentation Space function was successful.  
314 - * 1 Your program is not connected to a host session.  
315 - * 2 An error was made in specifying parameters.  
316 - * 7 The host presentation space position is not valid.  
317 - * 9 A system error was encountered.  
318 - * 24 The search string was not found.  
319 - *  
320 - */ 302 +static int search_ps(char *buffer, unsigned short *length, unsigned short *ps)
  303 +{
  304 + /*
  305 + * Data String Target string for search.
  306 + * Length Length of the target data string. Overridden in EOT mode.
  307 + * PS Position Position within the host presentation space where the search is to begin (SRCHFRWD option) or to end
  308 + * (SRCHBKWD option). Overridden in SRCHALL (default) mode.
  309 + *
  310 + * Return in *ps:
  311 + *
  312 + * = 0 The string was not found.
  313 + * > 0 The string was found at the indicated host presentation space position.
  314 + *
  315 + * Return code:
  316 + *
  317 + * 0 The Search Presentation Space function was successful.
  318 + * 1 Your program is not connected to a host session.
  319 + * 2 An error was made in specifying parameters.
  320 + * 7 The host presentation space position is not valid.
  321 + * 9 A system error was encountered.
  322 + * 24 The search string was not found.
  323 + *
  324 + */
321 size_t szBuffer = strlen(buffer); 325 size_t szBuffer = strlen(buffer);
322 char * text; 326 char * text;
323 - int rc = -1;  
324 -  
325 - if(*length < szBuffer)  
326 - szBuffer = *length; 327 + int rc = -1;
  328 +
  329 + if(*length < szBuffer)
  330 + szBuffer = *length;
327 331
328 332
329 text = hllapi_get_string(*ps,szBuffer); 333 text = hllapi_get_string(*ps,szBuffer);
330 if(!text) 334 if(!text)
331 - return HLLAPI_STATUS_SYSTEM_ERROR; 335 + return HLLAPI_STATUS_SYSTEM_ERROR;
332 336
333 if(strncmp(text,buffer,szBuffer)) 337 if(strncmp(text,buffer,szBuffer))
334 { 338 {
@@ -344,18 +348,18 @@ static int search_ps(char *buffer, unsigned short *length, unsigned short *ps) @@ -344,18 +348,18 @@ static int search_ps(char *buffer, unsigned short *length, unsigned short *ps)
344 } 348 }
345 349
346 hllapi_free(text); 350 hllapi_free(text);
347 -  
348 - return rc; 351 +
  352 + return rc;
349 } 353 }
350 -  
351 -static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc)  
352 -{  
353 - /*  
354 - * Data String Preallocated target string the size of your host presentation space. This can vary depending on how your host presentation space is configured. When the Set Session Parameters (9) function with the EAB option is issued, the length of the data string must be at least twice the length of the presentation space.  
355 - * DBCS Only: When the EAD option is specified, the length of the data string must be at least three times the length of the presentation space. When both the EAB and EAD options are specified, the length of the data string must be at least four times the length of the presentation space.  
356 - *  
357 - * Length NA (the length of the host presentation space is implied).  
358 - * PS Position NA. 354 +
  355 +static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc)
  356 +{
  357 + /*
  358 + * Data String Preallocated target string the size of your host presentation space. This can vary depending on how your host presentation space is configured. When the Set Session Parameters (9) function with the EAB option is issued, the length of the data string must be at least twice the length of the presentation space.
  359 + * DBCS Only: When the EAD option is specified, the length of the data string must be at least three times the length of the presentation space. When both the EAB and EAD options are specified, the length of the data string must be at least four times the length of the presentation space.
  360 + *
  361 + * Length NA (the length of the host presentation space is implied).
  362 + * PS Position NA.
359 * 363 *
360 * Return values: 364 * Return values:
361 * 365 *
@@ -363,10 +367,10 @@ static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) @@ -363,10 +367,10 @@ static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc)
363 * 1 Your program is not connected to a host session. 367 * 1 Your program is not connected to a host session.
364 * 4 The host presentation space contents were copied. The connected host presentation space was waiting for host response. 368 * 4 The host presentation space contents were copied. The connected host presentation space was waiting for host response.
365 * 5 The host presentation space was copied. The keyboard was locked. 369 * 5 The host presentation space was copied. The keyboard was locked.
366 - * 9 A system error was encountered.  
367 - *  
368 - */  
369 - size_t szBuffer = strlen(buffer); 370 + * 9 A system error was encountered.
  371 + *
  372 + */
  373 + size_t szBuffer = strlen(buffer);
370 char * text; 374 char * text;
371 375
372 if(!hllapi_is_connected()) 376 if(!hllapi_is_connected())
@@ -382,42 +386,42 @@ static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc) @@ -382,42 +386,42 @@ static int copy_ps(char *buffer, unsigned short *length, unsigned short *rc)
382 hllapi_free(text); 386 hllapi_free(text);
383 387
384 return hllapi_get_state(); 388 return hllapi_get_state();
385 -}  
386 -  
387 -static int wait_system(char *buffer, unsigned short *length, unsigned short *rc)  
388 -{  
389 - /*  
390 - * Checks the status of the host-connected presentation space. If the session is  
391 - * waiting for a host response (indicated by XCLOCK (X []) or XSYSTEM), the Wait  
392 - * function causes HLLAPI to wait up to 1 minute to see if the condition clears.  
393 - *  
394 - */  
395 -  
396 - /*  
397 - * Return Code Definition  
398 - *  
399 - * 0 The keyboard is unlocked and ready for input.  
400 - * 1 Your application program is not connected to a valid session.  
401 - * 4 Timeout while still in XCLOCK (X []) or XSYSTEM.  
402 - * 5 The keyboard is locked.  
403 - * 9 A system error was encountered.  
404 - *  
405 - */  
406 - time_t end = time(0) + 3600;  
407 -  
408 - while(time(0) < end) 389 +}
  390 +
  391 +static int wait_system(char *buffer, unsigned short *length, unsigned short *rc)
  392 +{
  393 + /*
  394 + * Checks the status of the host-connected presentation space. If the session is
  395 + * waiting for a host response (indicated by XCLOCK (X []) or XSYSTEM), the Wait
  396 + * function causes HLLAPI to wait up to 1 minute to see if the condition clears.
  397 + *
  398 + */
  399 +
  400 + /*
  401 + * Return Code Definition
  402 + *
  403 + * 0 The keyboard is unlocked and ready for input.
  404 + * 1 Your application program is not connected to a valid session.
  405 + * 4 Timeout while still in XCLOCK (X []) or XSYSTEM.
  406 + * 5 The keyboard is locked.
  407 + * 9 A system error was encountered.
  408 + *
  409 + */
  410 + time_t end = time(0) + 3600;
  411 +
  412 + while(time(0) < end)
409 { 413 {
410 int state = hllapi_get_state(); 414 int state = hllapi_get_state();
411 415
412 if(state != HLLAPI_STATUS_WAITING) 416 if(state != HLLAPI_STATUS_WAITING)
413 - return state;  
414 -  
415 - if(hllapi_wait(1))  
416 - return HLLAPI_STATUS_SYSTEM_ERROR;  
417 -  
418 - }  
419 -  
420 - return HLLAPI_STATUS_TIMEOUT; 417 + return state;
  418 +
  419 + if(hllapi_wait(1))
  420 + return HLLAPI_STATUS_SYSTEM_ERROR;
  421 +
  422 + }
  423 +
  424 + return HLLAPI_STATUS_TIMEOUT;
421 } 425 }
422 426
423 static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps) 427 static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps)
@@ -440,10 +444,10 @@ static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps @@ -440,10 +444,10 @@ static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps
440 * 9 A system error was encountered. 444 * 9 A system error was encountered.
441 * 445 *
442 */ 446 */
443 - size_t szText = strlen(text);  
444 -  
445 - if(*length < szText)  
446 - szText = *length; 447 + size_t szText = strlen(text);
  448 +
  449 + if(*length < szText)
  450 + szText = *length;
447 451
448 if(!szText) 452 if(!szText)
449 return 2; 453 return 2;
@@ -454,18 +458,18 @@ static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps @@ -454,18 +458,18 @@ static int copy_str_to_ps(char *text, unsigned short *length, unsigned short *ps
454 break; 458 break;
455 459
456 case LIB3270_MESSAGE_DISCONNECTED: 460 case LIB3270_MESSAGE_DISCONNECTED:
457 - return HLLAPI_STATUS_DISCONNECTED;  
458 -  
459 - case LIB3270_MESSAGE_MINUS:  
460 - case LIB3270_MESSAGE_PROTECTED:  
461 - case LIB3270_MESSAGE_NUMERIC:  
462 - case LIB3270_MESSAGE_OVERFLOW:  
463 - case LIB3270_MESSAGE_INHIBIT:  
464 - case LIB3270_MESSAGE_KYBDLOCK: 461 + return HLLAPI_STATUS_DISCONNECTED;
  462 +
  463 + case LIB3270_MESSAGE_MINUS:
  464 + case LIB3270_MESSAGE_PROTECTED:
  465 + case LIB3270_MESSAGE_NUMERIC:
  466 + case LIB3270_MESSAGE_OVERFLOW:
  467 + case LIB3270_MESSAGE_INHIBIT:
  468 + case LIB3270_MESSAGE_KYBDLOCK:
465 return HLLAPI_STATUS_KEYBOARD_LOCKED; 469 return HLLAPI_STATUS_KEYBOARD_LOCKED;
466 470
467 default: 471 default:
468 - return HLLAPI_STATUS_SYSTEM_ERROR; 472 + return HLLAPI_STATUS_SYSTEM_ERROR;
469 } 473 }
470 474
471 return hllapi_emulate_input(text,szText,0); 475 return hllapi_emulate_input(text,szText,0);
src/plugins/hllapi/pluginmain.c
@@ -30,13 +30,15 @@ @@ -30,13 +30,15 @@
30 * Hélio Passos 30 * Hélio Passos
31 * 31 *
32 */ 32 */
33 -  
34 - #include "server.h" #include <pw3270/plugin.h>  
35 - #include <pw3270/ipcpackets.h> 33 +
  34 + #include "server.h"
  35 + #include <pw3270/plugin.h>
  36 + #include <pw3270/v3270.h>
  37 + #include <pw3270/ipcpackets.h>
36 #include <lib3270/actions.h> 38 #include <lib3270/actions.h>
37 - 39 +
38 /*--[ Defines ]--------------------------------------------------------------------------------------*/ 40 /*--[ Defines ]--------------------------------------------------------------------------------------*/
39 - 41 +
40 #pragma pack(1) 42 #pragma pack(1)
41 43
42 typedef struct _pipe_source 44 typedef struct _pipe_source
@@ -57,16 +59,16 @@ @@ -57,16 +59,16 @@
57 } pipe_source; 59 } pipe_source;
58 60
59 #pragma pack() 61 #pragma pack()
60 - 62 +
61 63
62 /*--[ Globals ]--------------------------------------------------------------------------------------*/ 64 /*--[ Globals ]--------------------------------------------------------------------------------------*/
63 65
64 static const gchar control_char = '@'; 66 static const gchar control_char = '@';
65 67
66 /*--[ Implement ]------------------------------------------------------------------------------------*/ 68 /*--[ Implement ]------------------------------------------------------------------------------------*/
67 - 69 +
68 static void IO_accept(pipe_source *source) 70 static void IO_accept(pipe_source *source)
69 - { 71 + {
70 set_active(FALSE); 72 set_active(FALSE);
71 73
72 if(ConnectNamedPipe(source->hPipe,&source->overlap)) 74 if(ConnectNamedPipe(source->hPipe,&source->overlap))
@@ -133,157 +135,160 @@ @@ -133,157 +135,160 @@
133 135
134 return FALSE; 136 return FALSE;
135 } 137 }
136 -  
137 - static void send_text(pipe_source *source, char *text)  
138 - {  
139 - struct hllapi_packet_text *pkt;  
140 - DWORD szBlock;  
141 -  
142 - if(text)  
143 - {  
144 - szBlock = sizeof(struct hllapi_packet_text)+strlen(text);  
145 - pkt = g_malloc0(szBlock);  
146 - pkt->packet_id = 0;  
147 - strcpy(pkt->text,text);  
148 - lib3270_free(text);  
149 - }  
150 - else  
151 - {  
152 - szBlock = sizeof(struct hllapi_packet_text);  
153 - pkt = g_malloc0(szBlock);  
154 - pkt->packet_id = errno ? errno : -1;  
155 - }  
156 -  
157 - WriteFile(source->hPipe,pkt,szBlock,&szBlock,NULL);  
158 - 138 +
  139 + static void send_text(pipe_source *source, char *text)
  140 + {
  141 + struct hllapi_packet_text *pkt;
  142 + DWORD szBlock;
  143 +
  144 + if(text)
  145 + {
  146 + szBlock = sizeof(struct hllapi_packet_text)+strlen(text);
  147 + pkt = g_malloc0(szBlock);
  148 + pkt->packet_id = 0;
  149 + strcpy(pkt->text,text);
  150 + lib3270_free(text);
  151 + }
  152 + else
  153 + {
  154 + szBlock = sizeof(struct hllapi_packet_text);
  155 + pkt = g_malloc0(szBlock);
  156 + pkt->packet_id = errno ? errno : -1;
  157 + }
  158 +
  159 + WriteFile(source->hPipe,pkt,szBlock,&szBlock,NULL);
  160 +
159 g_free(pkt); 161 g_free(pkt);
160 - }  
161 -  
162 - static void send_result(pipe_source *source, int rc)  
163 - {  
164 - struct hllapi_packet_result pkt = { rc };  
165 - DWORD wrote = sizeof(pkt); 162 + }
  163 +
  164 + static void send_result(pipe_source *source, int rc)
  165 + {
  166 + struct hllapi_packet_result pkt = { rc };
  167 + DWORD wrote = sizeof(pkt);
166 WriteFile(source->hPipe,&pkt,wrote,&wrote,NULL); 168 WriteFile(source->hPipe,&pkt,wrote,&wrote,NULL);
167 - }  
168 - 169 + }
  170 +
169 static void process_input(pipe_source *source, DWORD cbRead) 171 static void process_input(pipe_source *source, DWORD cbRead)
170 - {  
171 -  
172 - trace("%s id=%d",__FUNCTION__,((struct hllapi_packet_query *) source->buffer)->packet_id);  
173 -  
174 - switch(((struct hllapi_packet_query *) source->buffer)->packet_id)  
175 - {  
176 - case HLLAPI_PACKET_CONNECT:  
177 - send_result(source,lib3270_connect( lib3270_get_default_session_handle(),  
178 - ((struct hllapi_packet_connect *) source->buffer)->hostname, 172 + {
  173 +
  174 + trace("%s id=%d",__FUNCTION__,((struct hllapi_packet_query *) source->buffer)->packet_id);
  175 +
  176 + switch(((struct hllapi_packet_query *) source->buffer)->packet_id)
  177 + {
  178 + case HLLAPI_PACKET_CONNECT:
  179 + send_result(source,lib3270_connect( lib3270_get_default_session_handle(),
  180 + ((struct hllapi_packet_connect *) source->buffer)->hostname,
179 ((struct hllapi_packet_connect *) source->buffer)->wait)); 181 ((struct hllapi_packet_connect *) source->buffer)->wait));
180 - break;  
181 -  
182 - case HLLAPI_PACKET_DISCONNECT:  
183 - send_result(source,lib3270_disconnect(lib3270_get_default_session_handle()));  
184 - break;  
185 -  
186 - case HLLAPI_PACKET_GET_PROGRAM_MESSAGE:  
187 - send_result(source,lib3270_get_program_message(lib3270_get_default_session_handle()));  
188 - break;  
189 -  
190 - case HLLAPI_PACKET_IS_CONNECTED:  
191 - send_result(source,lib3270_in_tn3270e(lib3270_get_default_session_handle()));  
192 - break;  
193 -  
194 - case HLLAPI_PACKET_IS_READY:  
195 - send_result(source,lib3270_is_ready(lib3270_get_default_session_handle()));  
196 - break;  
197 -  
198 - case HLLAPI_PACKET_ENTER:  
199 - send_result(source,lib3270_enter(lib3270_get_default_session_handle()));  
200 - break;  
201 -  
202 - case HLLAPI_PACKET_PRINT:  
203 - send_result(source,lib3270_print(lib3270_get_default_session_handle()));  
204 - break;  
205 -  
206 - case HLLAPI_PACKET_ERASE_EOF:  
207 - send_result(source,lib3270_eraseeof(lib3270_get_default_session_handle()));  
208 - break;  
209 -  
210 - case HLLAPI_PACKET_PFKEY:  
211 - send_result(source,lib3270_pfkey( lib3270_get_default_session_handle(),  
212 - ((struct hllapi_packet_keycode *) source->buffer)->keycode));  
213 - break;  
214 -  
215 - case HLLAPI_PACKET_PAKEY:  
216 - send_result(source,lib3270_pakey( lib3270_get_default_session_handle(),  
217 - ((struct hllapi_packet_keycode *) source->buffer)->keycode));  
218 - break;  
219 -  
220 - case HLLAPI_PACKET_SET_CURSOR_POSITION:  
221 - send_result(source,lib3270_set_cursor_position( lib3270_get_default_session_handle(),  
222 - ((struct hllapi_packet_cursor *) source->buffer)->row,  
223 - ((struct hllapi_packet_cursor *) source->buffer)->col));  
224 - break;  
225 -  
226 - case HLLAPI_PACKET_SET_TEXT_AT:  
227 - send_result(source,lib3270_set_text_at( lib3270_get_default_session_handle(),  
228 - ((struct hllapi_packet_text_at *) source->buffer)->row,  
229 - ((struct hllapi_packet_text_at *) source->buffer)->col,  
230 - (unsigned char *) ((struct hllapi_packet_text_at *) source->buffer)->text));  
231 - break;  
232 -  
233 - case HLLAPI_PACKET_GET_TEXT_AT:  
234 - send_text(source,lib3270_get_text_at( lib3270_get_default_session_handle(),  
235 - ((struct hllapi_packet_at *) source->buffer)->row,  
236 - ((struct hllapi_packet_at *) source->buffer)->col,  
237 - ((struct hllapi_packet_at *) source->buffer)->len));  
238 - break;  
239 -  
240 - case HLLAPI_PACKET_GET_TEXT_AT_OFFSET:  
241 - send_text(source,lib3270_get_text( lib3270_get_default_session_handle(),  
242 - ((struct hllapi_packet_query_offset *) source->buffer)->addr,  
243 - ((struct hllapi_packet_query_offset *) source->buffer)->len));  
244 - break;  
245 -  
246 - case HLLAPI_PACKET_CMP_TEXT_AT:  
247 - send_result(source,lib3270_cmp_text_at( lib3270_get_default_session_handle(),  
248 - ((struct hllapi_packet_text_at *) source->buffer)->row,  
249 - ((struct hllapi_packet_text_at *) source->buffer)->col,  
250 - ((struct hllapi_packet_text_at *) source->buffer)->text));  
251 - break;  
252 -  
253 - case HLLAPI_PACKET_INPUT_STRING:  
254 - send_result(source,lib3270_input_string(lib3270_get_default_session_handle(),  
255 - (unsigned char *) ((struct hllapi_packet_text *) source->buffer)->text));  
256 - break; 182 + break;
  183 +
  184 + case HLLAPI_PACKET_DISCONNECT:
  185 + send_result(source,lib3270_disconnect(lib3270_get_default_session_handle()));
  186 + break;
  187 +
  188 + case HLLAPI_PACKET_GET_PROGRAM_MESSAGE:
  189 + send_result(source,lib3270_get_program_message(lib3270_get_default_session_handle()));
  190 + break;
  191 +
  192 + case HLLAPI_PACKET_IS_CONNECTED:
  193 + send_result(source,lib3270_in_tn3270e(lib3270_get_default_session_handle()));
  194 + break;
  195 +
  196 + case HLLAPI_PACKET_IS_READY:
  197 + send_result(source,lib3270_is_ready(lib3270_get_default_session_handle()));
  198 + break;
  199 +
  200 + case HLLAPI_PACKET_ENTER:
  201 + send_result(source,lib3270_enter(lib3270_get_default_session_handle()));
  202 + break;
  203 +
  204 + case HLLAPI_PACKET_PRINT:
  205 + send_result(source,lib3270_print(lib3270_get_default_session_handle()));
  206 + break;
  207 +
  208 + case HLLAPI_PACKET_ERASE_EOF:
  209 + send_result(source,lib3270_eraseeof(lib3270_get_default_session_handle()));
  210 + break;
  211 +
  212 + case HLLAPI_PACKET_PFKEY:
  213 + send_result(source,lib3270_pfkey( lib3270_get_default_session_handle(),
  214 + ((struct hllapi_packet_keycode *) source->buffer)->keycode));
  215 + break;
  216 +
  217 + case HLLAPI_PACKET_PAKEY:
  218 + send_result(source,lib3270_pakey( lib3270_get_default_session_handle(),
  219 + ((struct hllapi_packet_keycode *) source->buffer)->keycode));
  220 + break;
  221 +
  222 + case HLLAPI_PACKET_SET_CURSOR_POSITION:
  223 + send_result(source,lib3270_set_cursor_position( lib3270_get_default_session_handle(),
  224 + ((struct hllapi_packet_cursor *) source->buffer)->row,
  225 + ((struct hllapi_packet_cursor *) source->buffer)->col));
  226 + break;
  227 +
  228 + case HLLAPI_PACKET_SET_TEXT_AT:
  229 + send_result(source,lib3270_set_text_at( lib3270_get_default_session_handle(),
  230 + ((struct hllapi_packet_text_at *) source->buffer)->row,
  231 + ((struct hllapi_packet_text_at *) source->buffer)->col,
  232 + (unsigned char *) ((struct hllapi_packet_text_at *) source->buffer)->text));
  233 + break;
  234 +
  235 + case HLLAPI_PACKET_GET_TEXT_AT:
  236 + send_text(source,lib3270_get_text_at( lib3270_get_default_session_handle(),
  237 + ((struct hllapi_packet_at *) source->buffer)->row,
  238 + ((struct hllapi_packet_at *) source->buffer)->col,
  239 + ((struct hllapi_packet_at *) source->buffer)->len));
  240 + break;
  241 +
  242 + case HLLAPI_PACKET_GET_TEXT_AT_OFFSET:
  243 + send_text(source,lib3270_get_text( lib3270_get_default_session_handle(),
  244 + ((struct hllapi_packet_query_offset *) source->buffer)->addr,
  245 + ((struct hllapi_packet_query_offset *) source->buffer)->len));
  246 + break;
  247 +
  248 + case HLLAPI_PACKET_CMP_TEXT_AT:
  249 + send_result(source,lib3270_cmp_text_at( lib3270_get_default_session_handle(),
  250 + ((struct hllapi_packet_text_at *) source->buffer)->row,
  251 + ((struct hllapi_packet_text_at *) source->buffer)->col,
  252 + ((struct hllapi_packet_text_at *) source->buffer)->text));
  253 + break;
  254 +
  255 + case HLLAPI_PACKET_INPUT_STRING:
  256 + send_result(source,lib3270_input_string(lib3270_get_default_session_handle(),
  257 + (unsigned char *) ((struct hllapi_packet_text *) source->buffer)->text));
  258 + break;
257 259
258 case HLLAPI_PACKET_EMULATE_INPUT: 260 case HLLAPI_PACKET_EMULATE_INPUT:
259 - send_result(source,lib3270_emulate_input(lib3270_get_default_session_handle(), 261 + send_result(source,lib3270_emulate_input(lib3270_get_default_session_handle(),
260 (const char *) ((struct hllapi_packet_emulate_input *) source->buffer)->text, 262 (const char *) ((struct hllapi_packet_emulate_input *) source->buffer)->text,
261 (int) ((struct hllapi_packet_emulate_input *) source->buffer)->len, 263 (int) ((struct hllapi_packet_emulate_input *) source->buffer)->len,
262 (int) ((struct hllapi_packet_emulate_input *) source->buffer)->pasting)); 264 (int) ((struct hllapi_packet_emulate_input *) source->buffer)->pasting));
263 - break; 265 + break;
264 266
265 - case HLLAPI_PACKET_SET_CURSOR:  
266 - send_result(source,lib3270_set_cursor_address(lib3270_get_default_session_handle(),  
267 - ((struct hllapi_packet_addr *) source->buffer)->addr)); 267 + case HLLAPI_PACKET_SET_CURSOR:
  268 + send_result(source,lib3270_set_cursor_address(lib3270_get_default_session_handle(),
  269 + ((struct hllapi_packet_addr *) source->buffer)->addr));
268 break; 270 break;
269 271
270 case HLLAPI_PACKET_GET_CURSOR: 272 case HLLAPI_PACKET_GET_CURSOR:
271 - send_result(source,lib3270_get_cursor_address(lib3270_get_default_session_handle()));  
272 - break; 273 + send_result(source,lib3270_get_cursor_address(lib3270_get_default_session_handle()));
  274 + break;
273 275
274 case HLLAPI_PACKET_GET_CSTATE: 276 case HLLAPI_PACKET_GET_CSTATE:
275 - send_result(source,lib3270_get_connection_state(lib3270_get_default_session_handle()));  
276 - break;  
277 - case HLLAPI_PACKET_SET_TOGGLE:  
278 - send_result(source,lib3270_set_toggle(lib3270_get_default_session_handle(),  
279 - ((struct hllapi_packet_set *) source->buffer)->id, ((struct hllapi_packet_set *) source->buffer)->value)); break;  
280 - default:  
281 - send_result(source, EINVAL);  
282 - g_message("Invalid remote request (id=%d)",source->buffer[0]);  
283 - }  
284 - 277 + send_result(source,lib3270_get_connection_state(lib3270_get_default_session_handle()));
  278 + break;
  279 +
  280 + case HLLAPI_PACKET_SET_TOGGLE:
  281 + send_result(source,lib3270_set_toggle(lib3270_get_default_session_handle(),
  282 + ((struct hllapi_packet_set *) source->buffer)->id,
  283 + ((struct hllapi_packet_set *) source->buffer)->value));
  284 + break;
  285 + default:
  286 + send_result(source, EINVAL);
  287 + g_message("Invalid remote request (id=%d)",source->buffer[0]);
  288 + }
  289 +
285 } 290 }
286 - 291 +
287 static void read_input_pipe(pipe_source *source) 292 static void read_input_pipe(pipe_source *source)
288 { 293 {
289 DWORD cbRead = 0; 294 DWORD cbRead = 0;
@@ -332,7 +337,7 @@ @@ -332,7 +337,7 @@
332 } 337 }
333 338
334 } 339 }
335 - 340 +
336 static gboolean IO_dispatch(GSource *source, GSourceFunc callback, gpointer data) 341 static gboolean IO_dispatch(GSource *source, GSourceFunc callback, gpointer data)
337 { 342 {
338 /* 343 /*
@@ -378,8 +383,8 @@ @@ -378,8 +383,8 @@
378 ((pipe_source *) source)->state = PIPE_STATE_READ; 383 ((pipe_source *) source)->state = PIPE_STATE_READ;
379 break; 384 break;
380 385
381 - case PIPE_STATE_UNDEFINED:  
382 - break; 386 + case PIPE_STATE_UNDEFINED:
  387 + break;
383 388
384 //#ifdef DEBUG 389 //#ifdef DEBUG
385 // default: 390 // default:
@@ -445,12 +450,12 @@ @@ -445,12 +450,12 @@
445 450
446 for(id='A';id < 'Z';id++) 451 for(id='A';id < 'Z';id++)
447 { 452 {
448 - gchar * pipename = g_strdup_printf("\\\\.\\pipe\\%s_%c",pw3270_get_session_name(window),id);  
449 - gchar * ptr; 453 + gchar * pipename = g_strdup_printf("\\\\.\\pipe\\%s_%c",pw3270_get_session_name(window),id);
  454 + gchar * ptr;
450 HANDLE hPipe; 455 HANDLE hPipe;
451 -  
452 - for(ptr=pipename;*ptr;ptr++)  
453 - *ptr = g_ascii_tolower(*ptr); 456 +
  457 + for(ptr=pipename;*ptr;ptr++)
  458 + *ptr = g_ascii_tolower(*ptr);
454 459
455 hPipe = CreateNamedPipe( TEXT(pipename), // pipe name 460 hPipe = CreateNamedPipe( TEXT(pipename), // pipe name
456 PIPE_ACCESS_DUPLEX | // read/write access 461 PIPE_ACCESS_DUPLEX | // read/write access
@@ -477,9 +482,9 @@ @@ -477,9 +482,9 @@
477 IO_finalize, 482 IO_finalize,
478 IO_closure, 483 IO_closure,
479 NULL 484 NULL
480 - };  
481 - pipe_source * source;  
482 - gchar * session = g_strdup_printf("%s:%c",pw3270_get_session_name(window),id); 485 + };
  486 + pipe_source * source;
  487 + gchar * session = g_strdup_printf("%s:%c",pw3270_get_session_name(window),id);
483 488
484 pw3270_set_session_name(window,session); 489 pw3270_set_session_name(window,session);
485 g_free(session); 490 g_free(session);
@@ -499,17 +504,18 @@ @@ -499,17 +504,18 @@
499 } 504 }
500 505
501 popup_lasterror( "%s", _( "Can´t create remote control pipe" )); 506 popup_lasterror( "%s", _( "Can´t create remote control pipe" ));
502 - 507 +
503 return -1; 508 return -1;
504 } 509 }
505 510
506 LIB3270_EXPORT int pw3270_plugin_stop(GtkWidget *window) 511 LIB3270_EXPORT int pw3270_plugin_stop(GtkWidget *window)
507 { 512 {
508 - 513 +
509 return 0; 514 return 0;
510 } 515 }
511 - 516 +
512 G_GNUC_INTERNAL void set_active(gboolean on) 517 G_GNUC_INTERNAL void set_active(gboolean on)
513 { 518 {
  519 + trace("%s(%s)",__FUNCTION__,on ? "Active" : "Inactive");
514 v3270_set_script(v3270_get_default_widget(),'H',on); 520 v3270_set_script(v3270_get_default_widget(),'H',on);
515 } 521 }
src/plugins/hllapi/server.h
@@ -26,8 +26,8 @@ @@ -26,8 +26,8 @@
26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) 26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
27 * 27 *
28 */ 28 */
29 -  
30 - #include <lib3270/config.h> 29 +
  30 + #include <lib3270/config.h>
31 #define ENABLE_NLS 31 #define ENABLE_NLS
32 #define GETTEXT_PACKAGE PACKAGE_NAME 32 #define GETTEXT_PACKAGE PACKAGE_NAME
33 33
@@ -36,14 +36,14 @@ @@ -36,14 +36,14 @@
36 #include <gtk/gtk.h> 36 #include <gtk/gtk.h>
37 37
38 #include <lib3270.h> 38 #include <lib3270.h>
39 - #include <lib3270/log.h> 39 + #include <lib3270/log.h>
40 #include <pw3270.h> 40 #include <pw3270.h>
41 #include <pw3270/hllapi.h> 41 #include <pw3270/hllapi.h>
42 - 42 +
43 #include <windows.h> 43 #include <windows.h>
44 -  
45 - #define PIPE_BUFFER_LENGTH HLLAPI_MAXLENGTH+30  
46 - 44 +
  45 + #define PIPE_BUFFER_LENGTH HLLAPI_MAXLENGTH+30
  46 +
47 G_GNUC_INTERNAL void popup_lasterror(const gchar *fmt, ...); 47 G_GNUC_INTERNAL void popup_lasterror(const gchar *fmt, ...);
48 G_GNUC_INTERNAL void set_active(gboolean on); 48 G_GNUC_INTERNAL void set_active(gboolean on);
49 - 49 +
src/plugins/hllapi/testprogram.c
@@ -35,43 +35,43 @@ @@ -35,43 +35,43 @@
35 #define BUFFER_LENGTH 8000 35 #define BUFFER_LENGTH 8000
36 36
37 /*---[ Implement ]--------------------------------------------------------------------------------*/ 37 /*---[ Implement ]--------------------------------------------------------------------------------*/
38 - 38 +
39 int main(int numpar, char *param[]) 39 int main(int numpar, char *param[])
40 - {  
41 - const char *session = "pw3270:a";  
42 -  
43 - printf("init(%s)=%d\n",session,(int) hllapi_init((LPSTR) session));  
44 - printf("revision=%d\n",(int) hllapi_get_revision());  
45 - printf("connect=%d\n",(int) hllapi_connect("fandezhi.efglobe.com:23",0));  
46 - printf("wait=%d\n",(int) hllapi_wait(3));  
47 - printf("connected=%s\n",(int) hllapi_is_connected() ? "Yes" : "No");  
48 -  
49 -// printf("disconnect=%d\n",(int) hllapi_disconnect("fandezhi.efglobe.com:23",1));  
50 -  
51 -  
52 - printf("deinit=%d\n",(int) hllapi_deinit());  
53 -  
54 -/*  
55 - DWORD revision;  
56 - int rc;  
57 -  
58 - rc = hllapi_init("");  
59 - if(rc)  
60 - {  
61 - printf("Init exits with rc=%d\n",rc);  
62 - return rc;  
63 - }  
64 -  
65 - if(!hllapi_get_revision(&revision))  
66 - printf("Library revision is %d\n",(int) revision);  
67 -  
68 -  
69 - printf("Deinit exits with rc=%d\n",rc);  
70 - rc = hllapi_deinit();  
71 -*/ 40 + {
  41 + const char *session = "pw3270:a";
  42 +
  43 + printf("init(%s)=%d\n",session,(int) hllapi_init((LPSTR) session));
  44 + printf("revision=%d\n",(int) hllapi_get_revision());
  45 + printf("connect=%d\n",(int) hllapi_connect("fandezhi.efglobe.com:23",0));
  46 + printf("wait=%d\n",(int) hllapi_wait(3));
  47 + printf("connected=%s\n",(int) hllapi_is_connected() ? "Yes" : "No");
  48 +
  49 +// printf("disconnect=%d\n",(int) hllapi_disconnect("fandezhi.efglobe.com:23",1));
  50 +
  51 +
  52 + printf("deinit=%d\n",(int) hllapi_deinit());
  53 +
  54 +/*
  55 + DWORD revision;
  56 + int rc;
  57 +
  58 + rc = hllapi_init("");
  59 + if(rc)
  60 + {
  61 + printf("Init exits with rc=%d\n",rc);
  62 + return rc;
  63 + }
  64 +
  65 + if(!hllapi_get_revision(&revision))
  66 + printf("Library revision is %d\n",(int) revision);
  67 +
  68 +
  69 + printf("Deinit exits with rc=%d\n",rc);
  70 + rc = hllapi_deinit();
  71 +*/
72 return 0; 72 return 0;
73 - }  
74 - 73 + }
  74 +
75 /* 75 /*
76 int main(int numpar, char *param[]) 76 int main(int numpar, char *param[])
77 { 77 {
@@ -136,4 +136,4 @@ @@ -136,4 +136,4 @@
136 136
137 return 0; 137 return 0;
138 } 138 }
139 -*/ 139 +*/
src/plugins/rx3270/local.cc
@@ -234,18 +234,18 @@ dynamic::dynamic() @@ -234,18 +234,18 @@ dynamic::dynamic()
234 #ifdef WIN32 234 #ifdef WIN32
235 static const char *dllname = "lib3270.dll." PACKAGE_VERSION; 235 static const char *dllname = "lib3270.dll." PACKAGE_VERSION;
236 236
237 - int f;  
238 HMODULE kernel; 237 HMODULE kernel;
239 HANDLE cookie = NULL; 238 HANDLE cookie = NULL;
240 DWORD rc; 239 DWORD rc;
241 - HANDLE (*AddDllDirectory)(PCWSTR NewDirectory);  
242 - BOOL (*RemoveDllDirectory)(HANDLE Cookie); 240 + HANDLE WINAPI (*AddDllDirectory)(PCWSTR NewDirectory);
  241 + BOOL WINAPI (*RemoveDllDirectory)(HANDLE Cookie);
243 UINT errorMode; 242 UINT errorMode;
244 char datadir[4096]; 243 char datadir[4096];
  244 + char buffer[4096];
245 245
246 kernel = LoadLibrary("kernel32.dll"); 246 kernel = LoadLibrary("kernel32.dll");
247 - AddDllDirectory = (HANDLE (*)(PCWSTR)) GetProcAddress(kernel,"AddDllDirectory");  
248 - RemoveDllDirectory = (BOOL (*)(HANDLE)) GetProcAddress(kernel,"RemoveDllDirectory"); 247 + AddDllDirectory = (HANDLE WINAPI (*)(PCWSTR)) GetProcAddress(kernel,"AddDllDirectory");
  248 + RemoveDllDirectory = (BOOL WINAPI (*)(HANDLE)) GetProcAddress(kernel,"RemoveDllDirectory");
249 249
250 // Notify user in case of error loading protocol DLL 250 // Notify user in case of error loading protocol DLL
251 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx 251 // http://msdn.microsoft.com/en-us/library/windows/desktop/ms680621(v=vs.85).aspx
@@ -256,13 +256,15 @@ dynamic::dynamic() @@ -256,13 +256,15 @@ dynamic::dynamic()
256 256
257 if(get_datadir(datadir)) 257 if(get_datadir(datadir))
258 { 258 {
259 - char buffer[4096];  
260 - wchar_t path[4096];  
261 -  
262 - mbstowcs(path, datadir, 4095);  
263 trace("Datadir=[%s] AddDllDirectory=%p RemoveDllDirectory=%p\n",datadir,AddDllDirectory,RemoveDllDirectory); 259 trace("Datadir=[%s] AddDllDirectory=%p RemoveDllDirectory=%p\n",datadir,AddDllDirectory,RemoveDllDirectory);
  260 +
264 if(AddDllDirectory) 261 if(AddDllDirectory)
  262 + {
  263 + wchar_t *path = (wchar_t *) malloc(4096*sizeof(wchar_t));
  264 + mbstowcs(path, datadir, 4095);
265 cookie = AddDllDirectory(path); 265 cookie = AddDllDirectory(path);
  266 + free(path);
  267 + }
266 268
267 #ifdef DEBUG 269 #ifdef DEBUG
268 snprintf(buffer,4096,"%s\\.bin\\Debug\\%s",datadir,dllname); 270 snprintf(buffer,4096,"%s\\.bin\\Debug\\%s",datadir,dllname);
@@ -270,9 +272,10 @@ dynamic::dynamic() @@ -270,9 +272,10 @@ dynamic::dynamic()
270 snprintf(buffer,4096,"%s\\%s",datadir,dllname); 272 snprintf(buffer,4096,"%s\\%s",datadir,dllname);
271 #endif // DEBUG 273 #endif // DEBUG
272 274
  275 + trace("Loading [%s] [%s]",buffer,datadir);
273 hModule = LoadLibrary(buffer); 276 hModule = LoadLibrary(buffer);
274 277
275 - trace("%s hModule=%p rc=%d",buffer,hModule,(int) GetLastError()); 278 + trace("Module=%p rc=%d",hModule,(int) GetLastError());
276 279
277 if(hModule == NULL) 280 if(hModule == NULL)
278 { 281 {