Commit f14824f1f3a00b6ecaa45c5cba9498eb5b86a383
1 parent
c411a5a5
Exists in
master
and in
5 other branches
Movendo includes que faltavam para o diretorio da lib, ajustes para a versao 5
Showing
29 changed files
with
336 additions
and
145 deletions
Show diff stats
... | ... | @@ -0,0 +1,82 @@ |
1 | +/* | |
2 | + * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
20 | + * | |
21 | + * Este programa está nomeado como actions.h e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
27 | + * licinio@bb.com.br (Licínio Luis Branco) | |
28 | + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
29 | + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) | |
30 | + * | |
31 | + */ | |
32 | + | |
33 | + /* | |
34 | + * Action call table. | |
35 | + * | |
36 | + * Usually this definitions are used to declare lib3270's action table but, | |
37 | + * if you redefine the creation macros it can be used to build a callback | |
38 | + * table for g_object_connect calls. | |
39 | + * | |
40 | + */ | |
41 | + | |
42 | + /* Keyboard actions */ | |
43 | + DECLARE_LIB3270_KEY_ACTION( enter ) | |
44 | + DECLARE_LIB3270_KEY_ACTION( tab ) | |
45 | + DECLARE_LIB3270_KEY_ACTION( backtab ) | |
46 | + | |
47 | + DECLARE_LIB3270_FKEY_ACTION( pfkey ) | |
48 | + DECLARE_LIB3270_FKEY_ACTION( pakey ) | |
49 | + | |
50 | + /* Cursor movement */ | |
51 | + DECLARE_LIB3270_CURSOR_ACTION( up ) | |
52 | + DECLARE_LIB3270_CURSOR_ACTION( down ) | |
53 | + DECLARE_LIB3270_CURSOR_ACTION( left ) | |
54 | + DECLARE_LIB3270_CURSOR_ACTION( right ) | |
55 | + DECLARE_LIB3270_CURSOR_ACTION( newline ) | |
56 | + | |
57 | + /* Misc actions */ | |
58 | + DECLARE_LIB3270_CLEAR_SELECTION_ACTION( reset ) | |
59 | + DECLARE_LIB3270_CLEAR_SELECTION_ACTION( clear ) | |
60 | + DECLARE_LIB3270_CLEAR_SELECTION_ACTION( eraseinput ) | |
61 | + | |
62 | + DECLARE_LIB3270_ACTION( firstfield ) | |
63 | + DECLARE_LIB3270_ACTION( eraseeof ) | |
64 | + DECLARE_LIB3270_ACTION( eraseeol ) | |
65 | + DECLARE_LIB3270_ACTION( erase ) | |
66 | + DECLARE_LIB3270_ACTION( delete ) | |
67 | + | |
68 | + DECLARE_LIB3270_ACTION( backspace ) | |
69 | + DECLARE_LIB3270_ACTION( previousword ) | |
70 | + DECLARE_LIB3270_ACTION( nextword ) | |
71 | + DECLARE_LIB3270_ACTION( fieldend ) | |
72 | + | |
73 | + DECLARE_LIB3270_ACTION( attn ) | |
74 | + DECLARE_LIB3270_ACTION( break ) | |
75 | + | |
76 | + DECLARE_LIB3270_ACTION( deleteword ) | |
77 | + DECLARE_LIB3270_ACTION( deletefield ) | |
78 | + DECLARE_LIB3270_ACTION( sysreq ) | |
79 | + | |
80 | + DECLARE_LIB3270_ACTION( testpattern ) | |
81 | + | |
82 | + | ... | ... |
... | ... | @@ -0,0 +1,55 @@ |
1 | +/* | |
2 | + * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
20 | + * | |
21 | + * Este programa está nomeado como actions.h e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
27 | + * licinio@bb.com.br (Licínio Luis Branco) | |
28 | + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
29 | + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) | |
30 | + * | |
31 | + */ | |
32 | + | |
33 | + #define DECLARE_LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession); | |
34 | + #define LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession) | |
35 | + | |
36 | + // Clear actions - When called the selected area is cleared | |
37 | + #define DECLARE_LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession); | |
38 | + #define LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession) | |
39 | + | |
40 | + // Single key actions | |
41 | + #define DECLARE_LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession); | |
42 | + #define LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession) | |
43 | + | |
44 | + // Cursor actions | |
45 | + #define DECLARE_LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (H3270 *hSession); | |
46 | + #define LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (H3270 *hSession) | |
47 | + | |
48 | + // PF & PA key actions | |
49 | + #define DECLARE_LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession, int key); | |
50 | + #define LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession, int key) | |
51 | + | |
52 | + | |
53 | + // Load action table entries | |
54 | + #include <lib3270/action_table.h> | |
55 | + | ... | ... |
... | ... | @@ -0,0 +1,58 @@ |
1 | +/* | |
2 | + * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
20 | + * | |
21 | + * Este programa está nomeado como macros.h e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
27 | + * licinio@bb.com.br (Licínio Luis Branco) | |
28 | + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
29 | + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) | |
30 | + * | |
31 | + */ | |
32 | + | |
33 | + #define DECLARE_LIB3270_MACRO( name ) LIB3270_EXPORT char * lib3270_macro_ ## name (H3270 *hSession, int argc, const char **argv); | |
34 | + #define LIB3270_MACRO( name ) LIB3270_EXPORT char * lib3270_macro_ ## name (H3270 *hSession, int argc, const char **argv) | |
35 | + | |
36 | + typedef struct _lib3270_macro_list | |
37 | + { | |
38 | + const char *name; | |
39 | + char *(*exec)(H3270 *session, int argc, const char **argv); | |
40 | + } LIB3270_MACRO_LIST; | |
41 | + | |
42 | + | |
43 | +/*---[ Macro entries ]---------------------------------------------------------------------------------*/ | |
44 | + | |
45 | + LIB3270_EXPORT const LIB3270_MACRO_LIST * get_3270_calls(void); | |
46 | + | |
47 | + DECLARE_LIB3270_MACRO( connect ) | |
48 | + DECLARE_LIB3270_MACRO( cstate ) | |
49 | + DECLARE_LIB3270_MACRO( disconnect ) | |
50 | + DECLARE_LIB3270_MACRO( encoding ) | |
51 | + DECLARE_LIB3270_MACRO( get ) | |
52 | + DECLARE_LIB3270_MACRO( luname ) | |
53 | + DECLARE_LIB3270_MACRO( set ) | |
54 | + DECLARE_LIB3270_MACRO( status ) | |
55 | + DECLARE_LIB3270_MACRO( pf ) | |
56 | + DECLARE_LIB3270_MACRO( pa ) | |
57 | + DECLARE_LIB3270_MACRO( enter ) | |
58 | + | ... | ... |
src/lib3270/XtGlue.c
... | ... | @@ -33,6 +33,7 @@ |
33 | 33 | /* glue for missing Xt code */ |
34 | 34 | |
35 | 35 | #include "globals.h" |
36 | +#include "api.h" | |
36 | 37 | #if defined(_WIN32) /*[*/ |
37 | 38 | #include "appres.h" |
38 | 39 | #include "trace_dsc.h" |
... | ... | @@ -43,7 +44,7 @@ |
43 | 44 | #include <stdlib.h> |
44 | 45 | #include <string.h> |
45 | 46 | #include <errno.h> |
46 | -#include <X11/keysym.h> | |
47 | +// #include <X11/keysym.h> | |
47 | 48 | |
48 | 49 | #include <sys/time.h> |
49 | 50 | #include <sys/types.h> |
... | ... | @@ -587,12 +588,6 @@ Free(void *p) |
587 | 588 | } |
588 | 589 | |
589 | 590 | /* |
590 | -char * | |
591 | -NewString(const char *s) | |
592 | -{ | |
593 | - return strcpy(Malloc(strlen(s) + 1), s); | |
594 | -} | |
595 | -*/ | |
596 | 591 | |
597 | 592 | static struct { |
598 | 593 | const char *name; |
... | ... | @@ -794,18 +789,16 @@ static struct { |
794 | 789 | { "thorn", XK_thorn }, |
795 | 790 | { "ydiaeresis", XK_ydiaeresis }, |
796 | 791 | |
797 | - /* | |
798 | - * The following are, umm, hacks to allow symbolic names for | |
799 | - * control codes. | |
800 | - */ | |
801 | -#if !defined(_WIN32) /*[*/ | |
792 | + // The following are, umm, hacks to allow symbolic names for | |
793 | + // control codes. | |
794 | +#if !defined(_WIN32) | |
802 | 795 | { "BackSpace", 0x08 }, |
803 | 796 | { "Tab", 0x09 }, |
804 | 797 | { "Linefeed", 0x0a }, |
805 | 798 | { "Return", 0x0d }, |
806 | 799 | { "Escape", 0x1b }, |
807 | 800 | { "Delete", 0x7f }, |
808 | -#endif /*]*/ | |
801 | +#endif | |
809 | 802 | |
810 | 803 | { (char *)NULL, NoSymbol } |
811 | 804 | }; |
... | ... | @@ -824,7 +817,6 @@ StringToKeysym(char *s) |
824 | 817 | return NoSymbol; |
825 | 818 | } |
826 | 819 | |
827 | -/* | |
828 | 820 | char * |
829 | 821 | KeysymToString(KeySym k) |
830 | 822 | { | ... | ... |
src/lib3270/api.h
... | ... | @@ -117,23 +117,6 @@ |
117 | 117 | #define LUNAME_SIZE 16 |
118 | 118 | #define FULL_MODEL_NAME_SIZE 13 |
119 | 119 | |
120 | - | |
121 | - /* State change IDs. */ | |
122 | - typedef enum _lib3270_state | |
123 | - { | |
124 | - LIB3270_STATE_RESOLVING, | |
125 | - LIB3270_STATE_HALF_CONNECT, | |
126 | - LIB3270_STATE_CONNECT, | |
127 | - LIB3270_STATE_3270_MODE, | |
128 | - LIB3270_STATE_LINE_MODE, | |
129 | - LIB3270_STATE_REMODEL, | |
130 | - LIB3270_STATE_PRINTER, | |
131 | - LIB3270_STATE_EXITING, | |
132 | - LIB3270_STATE_CHARSET, | |
133 | - | |
134 | - LIB3270_STATE_USER // Always the last one | |
135 | - } LIB3270_STATE; | |
136 | - | |
137 | 120 | #define ST_RESOLVING LIB3270_STATE_RESOLVING |
138 | 121 | #define ST_HALF_CONNECT LIB3270_STATE_HALF_CONNECT |
139 | 122 | #define ST_CONNECT LIB3270_STATE_CONNECT |
... | ... | @@ -299,13 +282,6 @@ |
299 | 282 | PW3270_DIALOG_USER |
300 | 283 | } PW3270_DIALOG; |
301 | 284 | |
302 | - /** input key type */ | |
303 | - enum keytype | |
304 | - { | |
305 | - KT_STD, | |
306 | - KT_GE | |
307 | - }; | |
308 | - | |
309 | 285 | /** extended attributes */ |
310 | 286 | struct ea |
311 | 287 | { |
... | ... | @@ -391,8 +367,6 @@ |
391 | 367 | |
392 | 368 | LIB3270_EXPORT int RegisterFTCallbacks(const struct filetransfer_callbacks *cbk); |
393 | 369 | |
394 | -// #define QueryCstate() lib3270_get_connection_state(NULL) | |
395 | - | |
396 | 370 | #define PCONNECTED lib3270_pconnected(NULL) |
397 | 371 | #define HALF_CONNECTED lib3270_half_connected(NULL) |
398 | 372 | #define CONNECTED lib3270_connected(NULL) |
... | ... | @@ -406,45 +380,10 @@ |
406 | 380 | |
407 | 381 | #ifndef LIB3270 |
408 | 382 | |
409 | - | |
410 | 383 | LIB3270_EXPORT enum ft_state QueryFTstate(void); |
411 | 384 | |
412 | -// #define PCONNECTED ((int) QueryCstate() >= (int)RESOLVING) | |
413 | -// #define HALF_CONNECTED (QueryCstate() == RESOLVING || QueryCstate() == PENDING) | |
414 | -// #define CONNECTED ((int) QueryCstate() >= (int)CONNECTED_INITIAL) | |
415 | -// #define IN_NEITHER (QueryCstate() == CONNECTED_INITIAL) | |
416 | -// #define IN_ANSI (QueryCstate() == CONNECTED_ANSI || QueryCstate() == CONNECTED_NVT) | |
417 | -// #define IN_3270 (QueryCstate() == CONNECTED_3270 || QueryCstate() == CONNECTED_TN3270E || QueryCstate() == CONNECTED_SSCP) | |
418 | -// #define IN_SSCP (QueryCstate() == CONNECTED_SSCP) | |
419 | -// #define IN_TN3270E (QueryCstate() == CONNECTED_TN3270E) | |
420 | -// #define IN_E (QueryCstate() >= CONNECTED_INITIAL_E) | |
421 | - | |
422 | 385 | #endif |
423 | 386 | |
424 | - /* I/O processing */ | |
425 | - struct lib3270_io_callbacks | |
426 | - { | |
427 | - unsigned short sz; | |
428 | - | |
429 | - unsigned long (*AddTimeOut)(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session)); | |
430 | - void (*RemoveTimeOut)(unsigned long timer); | |
431 | - | |
432 | - unsigned long (*AddInput)(int source, H3270 *session, void (*fn)(H3270 *session)); | |
433 | - void (*RemoveInput)(unsigned long id); | |
434 | - | |
435 | - unsigned long (*AddExcept)(int source, H3270 *session, void (*fn)(H3270 *session)); | |
436 | - | |
437 | - #if !defined(_WIN32) /*[*/ | |
438 | - unsigned long (*AddOutput)(int source, H3270 *session, void (*fn)(H3270 *session)); | |
439 | - #endif /*]*/ | |
440 | - | |
441 | - int (*callthread)(int(*callback)(H3270 *, void *), H3270 *session, void *parm); | |
442 | - | |
443 | - int (*Wait)(int seconds); | |
444 | - int (*RunPendingEvents)(int wait); | |
445 | - | |
446 | - }; | |
447 | - | |
448 | 387 | #define Register3270IOCallbacks(x) lib3270_register_io_handlers(x) |
449 | 388 | |
450 | 389 | |
... | ... | @@ -608,12 +547,6 @@ |
608 | 547 | LIB3270_EXPORT void screen_suspend(H3270 *session); |
609 | 548 | LIB3270_EXPORT void screen_disp(H3270 *session); |
610 | 549 | |
611 | - /* Console calls */ | |
612 | - LIB3270_EXPORT HCONSOLE console_window_new(const char *title, const char *label); | |
613 | - LIB3270_EXPORT void console_window_delete(HCONSOLE hwnd); | |
614 | - LIB3270_EXPORT int console_window_append(HCONSOLE hwnd, const char *fmt, ...); | |
615 | - LIB3270_EXPORT char * console_window_wait_for_user_entry(HCONSOLE hwnd); | |
616 | - | |
617 | 550 | /* Cursor calls */ |
618 | 551 | #define cursor_get_addr(void) lib3270_get_cursor_address(NULL) |
619 | 552 | #define cursor_set_addr(x) lib3270_set_cursor_address(NULL,x) |
... | ... | @@ -625,7 +558,6 @@ |
625 | 558 | #define host_reconnect(w) lib3270_reconnect(NULL,w) |
626 | 559 | |
627 | 560 | #define register_schange(tx,func) lib3270_register_schange(NULL,tx,func,NULL) |
628 | - LIB3270_EXPORT void lib3270_register_schange(H3270 *h,LIB3270_STATE tx, void (*func)(H3270 *, int, void *),void *user_data); | |
629 | 561 | |
630 | 562 | /* Console/Trace window */ |
631 | 563 | LIB3270_EXPORT HCONSOLE console_window_new(const char *title, const char *label); | ... | ... |
src/lib3270/apl.c
src/lib3270/appres.h
src/lib3270/charset.c
src/lib3270/ft_cut.c
src/lib3270/globals.h
src/lib3270/glue.c
src/lib3270/hostc.h
src/lib3270/kybd.c
... | ... | @@ -44,7 +44,7 @@ |
44 | 44 | #if defined(X3270_APL) /*[*/ |
45 | 45 | #define XK_APL |
46 | 46 | #endif /*]*/ |
47 | -#include <X11/keysym.h> | |
47 | +// #include <X11/keysym.h> | |
48 | 48 | |
49 | 49 | #include <fcntl.h> |
50 | 50 | #include "3270ds.h" |
... | ... | @@ -76,7 +76,7 @@ |
76 | 76 | #if defined(X3270_DBCS) /*[*/ |
77 | 77 | #include "widec.h" |
78 | 78 | #endif /*]*/ |
79 | -#include <lib3270/api.h> | |
79 | +#include "api.h" | |
80 | 80 | |
81 | 81 | |
82 | 82 | /*#define KYBDLOCK_TRACE 1*/ |
... | ... | @@ -3439,22 +3439,10 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p |
3439 | 3439 | state = XGE; |
3440 | 3440 | break; |
3441 | 3441 | case '[': /* APL left bracket */ |
3442 | - if (pasting && appres.apl_mode) | |
3443 | - key_ACharacter( | |
3444 | - (unsigned char) XK_Yacute, | |
3445 | - KT_GE, ia, &skipped); | |
3446 | - else | |
3447 | - key_ACharacter((unsigned char) c, | |
3448 | - KT_STD, ia, &skipped); | |
3442 | + key_ACharacter((unsigned char) c, KT_STD, ia, &skipped); | |
3449 | 3443 | break; |
3450 | 3444 | case ']': /* APL right bracket */ |
3451 | - if (pasting && appres.apl_mode) | |
3452 | - key_ACharacter( | |
3453 | - (unsigned char) XK_diaeresis, | |
3454 | - KT_GE, ia, &skipped); | |
3455 | - else | |
3456 | - key_ACharacter((unsigned char) c, | |
3457 | - KT_STD, ia, &skipped); | |
3445 | + key_ACharacter((unsigned char) c, KT_STD, ia, &skipped); | |
3458 | 3446 | break; |
3459 | 3447 | default: |
3460 | 3448 | #if defined(X3270_DBCS) /*[*/ | ... | ... |
src/lib3270/macros.c
... | ... | @@ -30,6 +30,7 @@ |
30 | 30 | * |
31 | 31 | */ |
32 | 32 | |
33 | + #include <errno.h> | |
33 | 34 | #include <string.h> |
34 | 35 | #include <stdio.h> |
35 | 36 | #include <lib3270.h> |
... | ... | @@ -59,15 +60,6 @@ |
59 | 60 | return macro_list; |
60 | 61 | } |
61 | 62 | |
62 | -/* | |
63 | - static char * value_as_string(int val) | |
64 | - { | |
65 | - char buffer[10]; | |
66 | - snprintf(buffer,9,"%d",val); | |
67 | - return strdup(buffer); | |
68 | - } | |
69 | -*/ | |
70 | - | |
71 | 63 | static const char * get_state(H3270 *h) |
72 | 64 | { |
73 | 65 | #define DECLARE_XLAT_STATE(x) { x, #x } |
... | ... | @@ -77,16 +69,16 @@ |
77 | 69 | const char * ret; |
78 | 70 | } xlat_state[] = |
79 | 71 | { |
80 | - DECLARE_XLAT_STATE( NOT_CONNECTED ), | |
81 | - DECLARE_XLAT_STATE( RESOLVING ), | |
82 | - DECLARE_XLAT_STATE( PENDING ), | |
83 | - DECLARE_XLAT_STATE( CONNECTED_INITIAL ), | |
84 | - DECLARE_XLAT_STATE( CONNECTED_ANSI ), | |
85 | - DECLARE_XLAT_STATE( CONNECTED_3270 ), | |
86 | - DECLARE_XLAT_STATE( CONNECTED_INITIAL_E ), | |
87 | - DECLARE_XLAT_STATE( CONNECTED_NVT ), | |
88 | - DECLARE_XLAT_STATE( CONNECTED_SSCP ), | |
89 | - DECLARE_XLAT_STATE( CONNECTED_TN3270E ) | |
72 | + DECLARE_XLAT_STATE( LIB3270_NOT_CONNECTED ), | |
73 | + DECLARE_XLAT_STATE( LIB3270_RESOLVING ), | |
74 | + DECLARE_XLAT_STATE( LIB3270_PENDING ), | |
75 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_INITIAL ), | |
76 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_ANSI ), | |
77 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_3270 ), | |
78 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_INITIAL_E ), | |
79 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_NVT ), | |
80 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_SSCP ), | |
81 | + DECLARE_XLAT_STATE( LIB3270_CONNECTED_TN3270E ) | |
90 | 82 | }; |
91 | 83 | |
92 | 84 | int f; |
... | ... | @@ -182,7 +174,7 @@ |
182 | 174 | { |
183 | 175 | const char *str = NULL; |
184 | 176 | |
185 | - if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) | |
177 | + if(query_3270_terminal_status() != LIB3270_MESSAGE_NONE) | |
186 | 178 | { |
187 | 179 | errno = EBUSY; |
188 | 180 | return NULL; | ... | ... |
src/lib3270/paste.c
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | #if defined(X3270_APL) /*[*/ |
40 | 40 | #define XK_APL |
41 | 41 | #endif /*]*/ |
42 | -#include <X11/keysym.h> | |
42 | +//#include <X11/keysym.h> | |
43 | 43 | |
44 | 44 | #include <fcntl.h> |
45 | 45 | #include "3270ds.h" |
... | ... | @@ -74,7 +74,7 @@ |
74 | 74 | #if defined(X3270_DBCS) /*[*/ |
75 | 75 | #include "widec.h" |
76 | 76 | #endif /*]*/ |
77 | -#include <lib3270/api.h> | |
77 | +#include "api.h" | |
78 | 78 | |
79 | 79 | /*---[ Struct ]-------------------------------------------------------------------------------------------------*/ |
80 | 80 | ... | ... |
src/lib3270/print.c
src/lib3270/printer.c
... | ... | @@ -415,14 +415,14 @@ printer_start(const char *lu) |
415 | 415 | !strcasecmp(subcommand, "wpr3287")) { |
416 | 416 | char *pc; |
417 | 417 | |
418 | - pc = xs_buffer("%s%s", PROGRAM_BIN, subcommand); | |
418 | + pc = xs_buffer("%s%s", ".", subcommand); | |
419 | 419 | Free(subcommand); |
420 | 420 | subcommand = pc; |
421 | 421 | |
422 | 422 | if (space) |
423 | 423 | pc = xs_buffer("\"%s\" %s", subcommand, space + 1); |
424 | 424 | else |
425 | - pc = xs_buffer("\"%s%s\"", PROGRAM_BIN, cmd_text); | |
425 | + pc = xs_buffer("\"%s%s\"", ".", cmd_text); | |
426 | 426 | Free(cmd_text); |
427 | 427 | cmd_text = pc; |
428 | 428 | } | ... | ... |
src/lib3270/proxy.c
src/lib3270/resolver.c
src/lib3270/rpq.c
src/lib3270/screen.c
src/lib3270/sf.c
src/lib3270/statusc.h
src/lib3270/telnet.c
... | ... | @@ -3392,11 +3392,11 @@ continue_tls(unsigned char *sbbuf, int len) |
3392 | 3392 | #endif /*]*/ |
3393 | 3393 | |
3394 | 3394 | /* Return the local address for the socket. */ |
3395 | -int net_getsockname(const H3270 *h3270, void *buf, int *len) | |
3395 | +int net_getsockname(const H3270 *session, void *buf, int *len) | |
3396 | 3396 | { |
3397 | - if (h3270->sock < 0) | |
3397 | + if (session->sock < 0) | |
3398 | 3398 | return -1; |
3399 | - return getsockname(h3270->sock, buf, (socklen_t *)(void *)len); | |
3399 | + return getsockname(session->sock, buf, (socklen_t *)(void *)len); | |
3400 | 3400 | } |
3401 | 3401 | |
3402 | 3402 | /* Return a text version of the current proxy type, or NULL. */ | ... | ... |
... | ... | @@ -0,0 +1,94 @@ |
1 | +/* | |
2 | + * "Software G3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
20 | + * | |
21 | + * Este programa está nomeado como toggle.h e possui 77 linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) | |
27 | + * licinio@bb.com.br (Licínio Luis Branco) | |
28 | + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) | |
29 | + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) | |
30 | + * | |
31 | + */ | |
32 | + | |
33 | +#ifndef TOGGLE3270_H_INCLUDED | |
34 | + | |
35 | + #define TOGGLE3270_H_INCLUDED 1 | |
36 | + | |
37 | + #include <lib3270.h> | |
38 | + | |
39 | + #define TT_INITIAL LIB3270_TOGGLE_TYPE_INITIAL | |
40 | + #define TT_INTERACTIVE LIB3270_TOGGLE_TYPE_INTERACTIVE | |
41 | + #define TT_ACTION LIB3270_TOGGLE_TYPE_ACTION | |
42 | + #define TT_FINAL LIB3270_TOGGLE_TYPE_FINAL | |
43 | + #define TT_UPDATE LIB3270_TOGGLE_TYPE_UPDATE | |
44 | + | |
45 | + #define MONOCASE LIB3270_TOGGLE_MONOCASE | |
46 | + #define ALT_CURSOR LIB3270_TOGGLE_ALT_CURSOR | |
47 | + #define CURSOR_BLINK LIB3270_TOGGLE_CURSOR_BLINK | |
48 | + #define SHOW_TIMING LIB3270_TOGGLE_SHOW_TIMING | |
49 | + #define CURSOR_POS LIB3270_TOGGLE_CURSOR_POS | |
50 | + #define DS_TRACE LIB3270_TOGGLE_DS_TRACE | |
51 | + #define SCROLL_BAR LIB3270_TOGGLE_SCROLL_BAR | |
52 | + #define LINE_WRAP LIB3270_TOGGLE_LINE_WRAP | |
53 | + #define BLANK_FILL LIB3270_TOGGLE_BLANK_FILL | |
54 | + #define SCREEN_TRACE LIB3270_TOGGLE_SCREEN_TRACE | |
55 | + #define EVENT_TRACE LIB3270_TOGGLE_EVENT_TRACE | |
56 | + #define MARGINED_PASTE LIB3270_TOGGLE_MARGINED_PASTE | |
57 | + #define RECTANGLE_SELECT LIB3270_TOGGLE_RECTANGLE_SELECT | |
58 | + #define CROSSHAIR LIB3270_TOGGLE_CROSSHAIR | |
59 | + #define VISIBLE_CONTROL LIB3270_TOGGLE_VISIBLE_CONTROL | |
60 | + #define AID_WAIT LIB3270_TOGGLE_AID_WAIT | |
61 | + #define FULL_SCREEN LIB3270_TOGGLE_FULL_SCREEN | |
62 | + #define RECONNECT LIB3270_TOGGLE_RECONNECT | |
63 | + #define INSERT LIB3270_TOGGLE_INSERT | |
64 | + #define KEYPAD LIB3270_TOGGLE_KEYPAD | |
65 | + #define SMART_PASTE LIB3270_TOGGLE_SMART_PASTE | |
66 | + #define N_TOGGLES LIB3270_TOGGLE_COUNT | |
67 | + | |
68 | + #define LIB3270_TOGGLE_ID LIB3270_TOGGLE | |
69 | + | |
70 | + | |
71 | + #define register_3270_toggle_monitor(ix,callback) lib3270_register_tchange(NULL,ix,callback) | |
72 | + | |
73 | + // LIB3270_EXPORT void register_3270_toggle_monitor(LIB3270_TOGGLE_ID ix, void (*callback)(int value, LIB3270_TOGGLE_TYPE reason)); | |
74 | +// LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE_ID ix); | |
75 | + | |
76 | + LIB3270_EXPORT int set_3270_toggle(LIB3270_TOGGLE_ID ix, int value); | |
77 | + | |
78 | +// LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix); | |
79 | +// LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name); | |
80 | + #define get_3270_toggle_by_name(x) lib3270_get_toggle_id(x) | |
81 | + | |
82 | + | |
83 | + LIB3270_EXPORT void update_toggle_actions(void); | |
84 | + | |
85 | + // Compatibility macros | |
86 | + #define register_tchange(ix,callback) register_3270_toggle_monitor(ix,callback) | |
87 | + #define do_toggle(ix) lib3270_toggle(NULL,ix) | |
88 | + | |
89 | + #define get_3270_toggle_name(ix) lib3270_get_toggle_name(ix) | |
90 | + #define get_toggle_name(ix) lib3270_get_toggle_name(ix) | |
91 | + #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value) | |
92 | + #define get_toggle_by_name(name) lib3270_get_toggle_id(name) | |
93 | + | |
94 | +#endif /* TOGGLE3270_H_INCLUDED */ | ... | ... |
src/lib3270/toggles.c
src/lib3270/utf8.c
src/lib3270/util.c