diff --git a/src/include/lib3270/action_table.h b/src/include/lib3270/action_table.h new file mode 100644 index 0000000..8fe91e6 --- /dev/null +++ b/src/include/lib3270/action_table.h @@ -0,0 +1,82 @@ +/* + * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA, 02111-1307, USA + * + * Este programa está nomeado como actions.h e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) + * licinio@bb.com.br (Licínio Luis Branco) + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) + * + */ + + /* + * Action call table. + * + * Usually this definitions are used to declare lib3270's action table but, + * if you redefine the creation macros it can be used to build a callback + * table for g_object_connect calls. + * + */ + + /* Keyboard actions */ + DECLARE_LIB3270_KEY_ACTION( enter ) + DECLARE_LIB3270_KEY_ACTION( tab ) + DECLARE_LIB3270_KEY_ACTION( backtab ) + + DECLARE_LIB3270_FKEY_ACTION( pfkey ) + DECLARE_LIB3270_FKEY_ACTION( pakey ) + + /* Cursor movement */ + DECLARE_LIB3270_CURSOR_ACTION( up ) + DECLARE_LIB3270_CURSOR_ACTION( down ) + DECLARE_LIB3270_CURSOR_ACTION( left ) + DECLARE_LIB3270_CURSOR_ACTION( right ) + DECLARE_LIB3270_CURSOR_ACTION( newline ) + + /* Misc actions */ + DECLARE_LIB3270_CLEAR_SELECTION_ACTION( reset ) + DECLARE_LIB3270_CLEAR_SELECTION_ACTION( clear ) + DECLARE_LIB3270_CLEAR_SELECTION_ACTION( eraseinput ) + + DECLARE_LIB3270_ACTION( firstfield ) + DECLARE_LIB3270_ACTION( eraseeof ) + DECLARE_LIB3270_ACTION( eraseeol ) + DECLARE_LIB3270_ACTION( erase ) + DECLARE_LIB3270_ACTION( delete ) + + DECLARE_LIB3270_ACTION( backspace ) + DECLARE_LIB3270_ACTION( previousword ) + DECLARE_LIB3270_ACTION( nextword ) + DECLARE_LIB3270_ACTION( fieldend ) + + DECLARE_LIB3270_ACTION( attn ) + DECLARE_LIB3270_ACTION( break ) + + DECLARE_LIB3270_ACTION( deleteword ) + DECLARE_LIB3270_ACTION( deletefield ) + DECLARE_LIB3270_ACTION( sysreq ) + + DECLARE_LIB3270_ACTION( testpattern ) + + diff --git a/src/include/lib3270/actions.h b/src/include/lib3270/actions.h new file mode 100644 index 0000000..3bb011e --- /dev/null +++ b/src/include/lib3270/actions.h @@ -0,0 +1,55 @@ +/* + * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA, 02111-1307, USA + * + * Este programa está nomeado como actions.h e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) + * licinio@bb.com.br (Licínio Luis Branco) + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) + * + */ + + #define DECLARE_LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession); + #define LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession) + + // Clear actions - When called the selected area is cleared + #define DECLARE_LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession); + #define LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession) + + // Single key actions + #define DECLARE_LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession); + #define LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession) + + // Cursor actions + #define DECLARE_LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (H3270 *hSession); + #define LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (H3270 *hSession) + + // PF & PA key actions + #define DECLARE_LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession, int key); + #define LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (H3270 *hSession, int key) + + + // Load action table entries + #include + diff --git a/src/include/lib3270/macros.h b/src/include/lib3270/macros.h new file mode 100644 index 0000000..d2ab7bd --- /dev/null +++ b/src/include/lib3270/macros.h @@ -0,0 +1,58 @@ +/* + * "Software PW3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA, 02111-1307, USA + * + * Este programa está nomeado como macros.h e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) + * licinio@bb.com.br (Licínio Luis Branco) + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) + * + */ + + #define DECLARE_LIB3270_MACRO( name ) LIB3270_EXPORT char * lib3270_macro_ ## name (H3270 *hSession, int argc, const char **argv); + #define LIB3270_MACRO( name ) LIB3270_EXPORT char * lib3270_macro_ ## name (H3270 *hSession, int argc, const char **argv) + + typedef struct _lib3270_macro_list + { + const char *name; + char *(*exec)(H3270 *session, int argc, const char **argv); + } LIB3270_MACRO_LIST; + + +/*---[ Macro entries ]---------------------------------------------------------------------------------*/ + + LIB3270_EXPORT const LIB3270_MACRO_LIST * get_3270_calls(void); + + DECLARE_LIB3270_MACRO( connect ) + DECLARE_LIB3270_MACRO( cstate ) + DECLARE_LIB3270_MACRO( disconnect ) + DECLARE_LIB3270_MACRO( encoding ) + DECLARE_LIB3270_MACRO( get ) + DECLARE_LIB3270_MACRO( luname ) + DECLARE_LIB3270_MACRO( set ) + DECLARE_LIB3270_MACRO( status ) + DECLARE_LIB3270_MACRO( pf ) + DECLARE_LIB3270_MACRO( pa ) + DECLARE_LIB3270_MACRO( enter ) + diff --git a/src/lib3270/XtGlue.c b/src/lib3270/XtGlue.c index 13fb553..19aba2d 100644 --- a/src/lib3270/XtGlue.c +++ b/src/lib3270/XtGlue.c @@ -33,6 +33,7 @@ /* glue for missing Xt code */ #include "globals.h" +#include "api.h" #if defined(_WIN32) /*[*/ #include "appres.h" #include "trace_dsc.h" @@ -43,7 +44,7 @@ #include #include #include -#include +// #include #include #include @@ -587,12 +588,6 @@ Free(void *p) } /* -char * -NewString(const char *s) -{ - return strcpy(Malloc(strlen(s) + 1), s); -} -*/ static struct { const char *name; @@ -794,18 +789,16 @@ static struct { { "thorn", XK_thorn }, { "ydiaeresis", XK_ydiaeresis }, - /* - * The following are, umm, hacks to allow symbolic names for - * control codes. - */ -#if !defined(_WIN32) /*[*/ + // The following are, umm, hacks to allow symbolic names for + // control codes. +#if !defined(_WIN32) { "BackSpace", 0x08 }, { "Tab", 0x09 }, { "Linefeed", 0x0a }, { "Return", 0x0d }, { "Escape", 0x1b }, { "Delete", 0x7f }, -#endif /*]*/ +#endif { (char *)NULL, NoSymbol } }; @@ -824,7 +817,6 @@ StringToKeysym(char *s) return NoSymbol; } -/* char * KeysymToString(KeySym k) { diff --git a/src/lib3270/api.h b/src/lib3270/api.h index 643e89a..6ac2da3 100644 --- a/src/lib3270/api.h +++ b/src/lib3270/api.h @@ -117,23 +117,6 @@ #define LUNAME_SIZE 16 #define FULL_MODEL_NAME_SIZE 13 - - /* State change IDs. */ - typedef enum _lib3270_state - { - LIB3270_STATE_RESOLVING, - LIB3270_STATE_HALF_CONNECT, - LIB3270_STATE_CONNECT, - LIB3270_STATE_3270_MODE, - LIB3270_STATE_LINE_MODE, - LIB3270_STATE_REMODEL, - LIB3270_STATE_PRINTER, - LIB3270_STATE_EXITING, - LIB3270_STATE_CHARSET, - - LIB3270_STATE_USER // Always the last one - } LIB3270_STATE; - #define ST_RESOLVING LIB3270_STATE_RESOLVING #define ST_HALF_CONNECT LIB3270_STATE_HALF_CONNECT #define ST_CONNECT LIB3270_STATE_CONNECT @@ -299,13 +282,6 @@ PW3270_DIALOG_USER } PW3270_DIALOG; - /** input key type */ - enum keytype - { - KT_STD, - KT_GE - }; - /** extended attributes */ struct ea { @@ -391,8 +367,6 @@ LIB3270_EXPORT int RegisterFTCallbacks(const struct filetransfer_callbacks *cbk); -// #define QueryCstate() lib3270_get_connection_state(NULL) - #define PCONNECTED lib3270_pconnected(NULL) #define HALF_CONNECTED lib3270_half_connected(NULL) #define CONNECTED lib3270_connected(NULL) @@ -406,45 +380,10 @@ #ifndef LIB3270 - LIB3270_EXPORT enum ft_state QueryFTstate(void); -// #define PCONNECTED ((int) QueryCstate() >= (int)RESOLVING) -// #define HALF_CONNECTED (QueryCstate() == RESOLVING || QueryCstate() == PENDING) -// #define CONNECTED ((int) QueryCstate() >= (int)CONNECTED_INITIAL) -// #define IN_NEITHER (QueryCstate() == CONNECTED_INITIAL) -// #define IN_ANSI (QueryCstate() == CONNECTED_ANSI || QueryCstate() == CONNECTED_NVT) -// #define IN_3270 (QueryCstate() == CONNECTED_3270 || QueryCstate() == CONNECTED_TN3270E || QueryCstate() == CONNECTED_SSCP) -// #define IN_SSCP (QueryCstate() == CONNECTED_SSCP) -// #define IN_TN3270E (QueryCstate() == CONNECTED_TN3270E) -// #define IN_E (QueryCstate() >= CONNECTED_INITIAL_E) - #endif - /* I/O processing */ - struct lib3270_io_callbacks - { - unsigned short sz; - - unsigned long (*AddTimeOut)(unsigned long interval_ms, H3270 *session, void (*proc)(H3270 *session)); - void (*RemoveTimeOut)(unsigned long timer); - - unsigned long (*AddInput)(int source, H3270 *session, void (*fn)(H3270 *session)); - void (*RemoveInput)(unsigned long id); - - unsigned long (*AddExcept)(int source, H3270 *session, void (*fn)(H3270 *session)); - - #if !defined(_WIN32) /*[*/ - unsigned long (*AddOutput)(int source, H3270 *session, void (*fn)(H3270 *session)); - #endif /*]*/ - - int (*callthread)(int(*callback)(H3270 *, void *), H3270 *session, void *parm); - - int (*Wait)(int seconds); - int (*RunPendingEvents)(int wait); - - }; - #define Register3270IOCallbacks(x) lib3270_register_io_handlers(x) @@ -608,12 +547,6 @@ LIB3270_EXPORT void screen_suspend(H3270 *session); LIB3270_EXPORT void screen_disp(H3270 *session); - /* Console calls */ - LIB3270_EXPORT HCONSOLE console_window_new(const char *title, const char *label); - LIB3270_EXPORT void console_window_delete(HCONSOLE hwnd); - LIB3270_EXPORT int console_window_append(HCONSOLE hwnd, const char *fmt, ...); - LIB3270_EXPORT char * console_window_wait_for_user_entry(HCONSOLE hwnd); - /* Cursor calls */ #define cursor_get_addr(void) lib3270_get_cursor_address(NULL) #define cursor_set_addr(x) lib3270_set_cursor_address(NULL,x) @@ -625,7 +558,6 @@ #define host_reconnect(w) lib3270_reconnect(NULL,w) #define register_schange(tx,func) lib3270_register_schange(NULL,tx,func,NULL) - LIB3270_EXPORT void lib3270_register_schange(H3270 *h,LIB3270_STATE tx, void (*func)(H3270 *, int, void *),void *user_data); /* Console/Trace window */ LIB3270_EXPORT HCONSOLE console_window_new(const char *title, const char *label); diff --git a/src/lib3270/apl.c b/src/lib3270/apl.c index b63276e..b2985a2 100644 --- a/src/lib3270/apl.c +++ b/src/lib3270/apl.c @@ -39,7 +39,7 @@ #if defined(X3270_APL) /*[*/ -#include +// #include #include "aplc.h" diff --git a/src/lib3270/appres.h b/src/lib3270/appres.h index 71e26e2..48b5a51 100644 --- a/src/lib3270/appres.h +++ b/src/lib3270/appres.h @@ -20,7 +20,7 @@ * tcl3270. */ -#include +#include "toggle.h" /* Toggles */ diff --git a/src/lib3270/charset.c b/src/lib3270/charset.c index 2124435..386ee5c 100644 --- a/src/lib3270/charset.c +++ b/src/lib3270/charset.c @@ -58,7 +58,7 @@ #include #endif /*]*/ -#include +// #include #define EURO_SUFFIX "-euro" #define ES_SIZE (sizeof(EURO_SUFFIX) - 1) diff --git a/src/lib3270/ft_cut.c b/src/lib3270/ft_cut.c index f4b9818..0bb4e1b 100644 --- a/src/lib3270/ft_cut.c +++ b/src/lib3270/ft_cut.c @@ -41,7 +41,7 @@ #if defined(X3270_FT) /*[*/ -#include +// #include #include "appres.h" #include "ctlr.h" diff --git a/src/lib3270/globals.h b/src/lib3270/globals.h index 8b400b8..86a9fc4 100644 --- a/src/lib3270/globals.h +++ b/src/lib3270/globals.h @@ -33,6 +33,7 @@ /* Autoconf settings. */ #include /* autoconf settings */ #include /* lib3270 API calls and defs */ +#include "api.h" /* From glibconfig.h */ #if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) diff --git a/src/lib3270/glue.c b/src/lib3270/glue.c index c6093fa..c3e657e 100644 --- a/src/lib3270/glue.c +++ b/src/lib3270/glue.c @@ -83,7 +83,7 @@ #include "winversc.h" #endif /*]*/ -#include "session.h" +// #include "session.h" #if defined WIN32 BOOL WINAPI DllMain(HANDLE hinst, DWORD dwcallpurpose, LPVOID lpvResvd); diff --git a/src/lib3270/hostc.h b/src/lib3270/hostc.h index 8741912..47cd53f 100644 --- a/src/lib3270/hostc.h +++ b/src/lib3270/hostc.h @@ -17,7 +17,7 @@ * Global declarations for host.c. */ -#include +#include "api.h" /* struct host { diff --git a/src/lib3270/kybd.c b/src/lib3270/kybd.c index 68de745..fbd8a88 100644 --- a/src/lib3270/kybd.c +++ b/src/lib3270/kybd.c @@ -44,7 +44,7 @@ #if defined(X3270_APL) /*[*/ #define XK_APL #endif /*]*/ -#include +// #include #include #include "3270ds.h" @@ -76,7 +76,7 @@ #if defined(X3270_DBCS) /*[*/ #include "widec.h" #endif /*]*/ -#include +#include "api.h" /*#define KYBDLOCK_TRACE 1*/ @@ -3439,22 +3439,10 @@ LIB3270_EXPORT int lib3270_emulate_input(H3270 *session, char *s, int len, int p state = XGE; break; case '[': /* APL left bracket */ - if (pasting && appres.apl_mode) - key_ACharacter( - (unsigned char) XK_Yacute, - KT_GE, ia, &skipped); - else - key_ACharacter((unsigned char) c, - KT_STD, ia, &skipped); + key_ACharacter((unsigned char) c, KT_STD, ia, &skipped); break; case ']': /* APL right bracket */ - if (pasting && appres.apl_mode) - key_ACharacter( - (unsigned char) XK_diaeresis, - KT_GE, ia, &skipped); - else - key_ACharacter((unsigned char) c, - KT_STD, ia, &skipped); + key_ACharacter((unsigned char) c, KT_STD, ia, &skipped); break; default: #if defined(X3270_DBCS) /*[*/ diff --git a/src/lib3270/macros.c b/src/lib3270/macros.c index 901932c..ca6aba4 100644 --- a/src/lib3270/macros.c +++ b/src/lib3270/macros.c @@ -30,6 +30,7 @@ * */ + #include #include #include #include @@ -59,15 +60,6 @@ return macro_list; } -/* - static char * value_as_string(int val) - { - char buffer[10]; - snprintf(buffer,9,"%d",val); - return strdup(buffer); - } -*/ - static const char * get_state(H3270 *h) { #define DECLARE_XLAT_STATE(x) { x, #x } @@ -77,16 +69,16 @@ const char * ret; } xlat_state[] = { - DECLARE_XLAT_STATE( NOT_CONNECTED ), - DECLARE_XLAT_STATE( RESOLVING ), - DECLARE_XLAT_STATE( PENDING ), - DECLARE_XLAT_STATE( CONNECTED_INITIAL ), - DECLARE_XLAT_STATE( CONNECTED_ANSI ), - DECLARE_XLAT_STATE( CONNECTED_3270 ), - DECLARE_XLAT_STATE( CONNECTED_INITIAL_E ), - DECLARE_XLAT_STATE( CONNECTED_NVT ), - DECLARE_XLAT_STATE( CONNECTED_SSCP ), - DECLARE_XLAT_STATE( CONNECTED_TN3270E ) + DECLARE_XLAT_STATE( LIB3270_NOT_CONNECTED ), + DECLARE_XLAT_STATE( LIB3270_RESOLVING ), + DECLARE_XLAT_STATE( LIB3270_PENDING ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_INITIAL ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_ANSI ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_3270 ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_INITIAL_E ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_NVT ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_SSCP ), + DECLARE_XLAT_STATE( LIB3270_CONNECTED_TN3270E ) }; int f; @@ -182,7 +174,7 @@ { const char *str = NULL; - if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) + if(query_3270_terminal_status() != LIB3270_MESSAGE_NONE) { errno = EBUSY; return NULL; diff --git a/src/lib3270/paste.c b/src/lib3270/paste.c index 1453896..1620f75 100644 --- a/src/lib3270/paste.c +++ b/src/lib3270/paste.c @@ -39,7 +39,7 @@ #if defined(X3270_APL) /*[*/ #define XK_APL #endif /*]*/ -#include +//#include #include #include "3270ds.h" @@ -74,7 +74,7 @@ #if defined(X3270_DBCS) /*[*/ #include "widec.h" #endif /*]*/ -#include +#include "api.h" /*---[ Struct ]-------------------------------------------------------------------------------------------------*/ diff --git a/src/lib3270/print.c b/src/lib3270/print.c index f7613a1..05ad941 100644 --- a/src/lib3270/print.c +++ b/src/lib3270/print.c @@ -68,7 +68,7 @@ #include #endif /*]*/ -#include +#include "api.h" /* Statics */ diff --git a/src/lib3270/printer.c b/src/lib3270/printer.c index 903a570..65c6820 100644 --- a/src/lib3270/printer.c +++ b/src/lib3270/printer.c @@ -415,14 +415,14 @@ printer_start(const char *lu) !strcasecmp(subcommand, "wpr3287")) { char *pc; - pc = xs_buffer("%s%s", PROGRAM_BIN, subcommand); + pc = xs_buffer("%s%s", ".", subcommand); Free(subcommand); subcommand = pc; if (space) pc = xs_buffer("\"%s\" %s", subcommand, space + 1); else - pc = xs_buffer("\"%s%s\"", PROGRAM_BIN, cmd_text); + pc = xs_buffer("\"%s%s\"", ".", cmd_text); Free(cmd_text); cmd_text = pc; } diff --git a/src/lib3270/proxy.c b/src/lib3270/proxy.c index 7340e90..1caf971 100644 --- a/src/lib3270/proxy.c +++ b/src/lib3270/proxy.c @@ -56,7 +56,7 @@ #endif /*]*/ #endif /*]*/ -#include +#include "api.h" #include "3270ds.h" #include "popupsc.h" diff --git a/src/lib3270/resolver.c b/src/lib3270/resolver.c index eb66fbd..eecf4e8 100644 --- a/src/lib3270/resolver.c +++ b/src/lib3270/resolver.c @@ -60,7 +60,7 @@ #include #include -#include +#include "api.h" #include "resolverc.h" #include "w3miscc.h" diff --git a/src/lib3270/rpq.c b/src/lib3270/rpq.c index a91a9aa..9d10709 100644 --- a/src/lib3270/rpq.c +++ b/src/lib3270/rpq.c @@ -48,7 +48,7 @@ #include #endif /*]*/ -#include +#include "api.h" #include #include diff --git a/src/lib3270/screen.c b/src/lib3270/screen.c index 9ba3489..1368b31 100644 --- a/src/lib3270/screen.c +++ b/src/lib3270/screen.c @@ -60,7 +60,7 @@ #include "errno.h" #include "statusc.h" #include "togglesc.h" -#include +#include "api.h" #if defined(_WIN32) #include diff --git a/src/lib3270/sf.c b/src/lib3270/sf.c index 18c1386..f090617 100644 --- a/src/lib3270/sf.c +++ b/src/lib3270/sf.c @@ -62,7 +62,7 @@ #include "trace_dsc.h" #include "utilc.h" -#include +#include "api.h" /* Externals: ctlr.c */ // extern Boolean screen_alt; diff --git a/src/lib3270/statusc.h b/src/lib3270/statusc.h index 8189c84..f6053d7 100644 --- a/src/lib3270/statusc.h +++ b/src/lib3270/statusc.h @@ -13,7 +13,7 @@ /* c3270 verson of statusc.h */ -#include +#include "api.h" LIB3270_INTERNAL void status_compose(int on, unsigned char c, enum keytype keytype); LIB3270_INTERNAL void status_ctlr_done(H3270 *session); diff --git a/src/lib3270/telnet.c b/src/lib3270/telnet.c index 50288dc..13fa5a0 100644 --- a/src/lib3270/telnet.c +++ b/src/lib3270/telnet.c @@ -3392,11 +3392,11 @@ continue_tls(unsigned char *sbbuf, int len) #endif /*]*/ /* Return the local address for the socket. */ -int net_getsockname(const H3270 *h3270, void *buf, int *len) +int net_getsockname(const H3270 *session, void *buf, int *len) { - if (h3270->sock < 0) + if (session->sock < 0) return -1; - return getsockname(h3270->sock, buf, (socklen_t *)(void *)len); + return getsockname(session->sock, buf, (socklen_t *)(void *)len); } /* Return a text version of the current proxy type, or NULL. */ diff --git a/src/lib3270/toggle.h b/src/lib3270/toggle.h new file mode 100644 index 0000000..9210658 --- /dev/null +++ b/src/lib3270/toggle.h @@ -0,0 +1,94 @@ +/* + * "Software G3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. + * + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple + * Place, Suite 330, Boston, MA, 02111-1307, USA + * + * Este programa está nomeado como toggle.h e possui 77 linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas de Mendonça) + * licinio@bb.com.br (Licínio Luis Branco) + * kraucer@bb.com.br (Kraucer Fernandes Mazuco) + * macmiranda@bb.com.br (Marco Aurélio Caldas Miranda) + * + */ + +#ifndef TOGGLE3270_H_INCLUDED + + #define TOGGLE3270_H_INCLUDED 1 + + #include + + #define TT_INITIAL LIB3270_TOGGLE_TYPE_INITIAL + #define TT_INTERACTIVE LIB3270_TOGGLE_TYPE_INTERACTIVE + #define TT_ACTION LIB3270_TOGGLE_TYPE_ACTION + #define TT_FINAL LIB3270_TOGGLE_TYPE_FINAL + #define TT_UPDATE LIB3270_TOGGLE_TYPE_UPDATE + + #define MONOCASE LIB3270_TOGGLE_MONOCASE + #define ALT_CURSOR LIB3270_TOGGLE_ALT_CURSOR + #define CURSOR_BLINK LIB3270_TOGGLE_CURSOR_BLINK + #define SHOW_TIMING LIB3270_TOGGLE_SHOW_TIMING + #define CURSOR_POS LIB3270_TOGGLE_CURSOR_POS + #define DS_TRACE LIB3270_TOGGLE_DS_TRACE + #define SCROLL_BAR LIB3270_TOGGLE_SCROLL_BAR + #define LINE_WRAP LIB3270_TOGGLE_LINE_WRAP + #define BLANK_FILL LIB3270_TOGGLE_BLANK_FILL + #define SCREEN_TRACE LIB3270_TOGGLE_SCREEN_TRACE + #define EVENT_TRACE LIB3270_TOGGLE_EVENT_TRACE + #define MARGINED_PASTE LIB3270_TOGGLE_MARGINED_PASTE + #define RECTANGLE_SELECT LIB3270_TOGGLE_RECTANGLE_SELECT + #define CROSSHAIR LIB3270_TOGGLE_CROSSHAIR + #define VISIBLE_CONTROL LIB3270_TOGGLE_VISIBLE_CONTROL + #define AID_WAIT LIB3270_TOGGLE_AID_WAIT + #define FULL_SCREEN LIB3270_TOGGLE_FULL_SCREEN + #define RECONNECT LIB3270_TOGGLE_RECONNECT + #define INSERT LIB3270_TOGGLE_INSERT + #define KEYPAD LIB3270_TOGGLE_KEYPAD + #define SMART_PASTE LIB3270_TOGGLE_SMART_PASTE + #define N_TOGGLES LIB3270_TOGGLE_COUNT + + #define LIB3270_TOGGLE_ID LIB3270_TOGGLE + + + #define register_3270_toggle_monitor(ix,callback) lib3270_register_tchange(NULL,ix,callback) + + // LIB3270_EXPORT void register_3270_toggle_monitor(LIB3270_TOGGLE_ID ix, void (*callback)(int value, LIB3270_TOGGLE_TYPE reason)); +// LIB3270_EXPORT int lib3270_toggle(H3270 *session, LIB3270_TOGGLE_ID ix); + + LIB3270_EXPORT int set_3270_toggle(LIB3270_TOGGLE_ID ix, int value); + +// LIB3270_EXPORT const char * get_3270_toggle_name(LIB3270_TOGGLE_ID ix); +// LIB3270_EXPORT LIB3270_TOGGLE_ID get_3270_toggle_by_name(const char *name); + #define get_3270_toggle_by_name(x) lib3270_get_toggle_id(x) + + + LIB3270_EXPORT void update_toggle_actions(void); + + // Compatibility macros + #define register_tchange(ix,callback) register_3270_toggle_monitor(ix,callback) + #define do_toggle(ix) lib3270_toggle(NULL,ix) + + #define get_3270_toggle_name(ix) lib3270_get_toggle_name(ix) + #define get_toggle_name(ix) lib3270_get_toggle_name(ix) + #define set_toggle(ix,value) lib3270_set_toggle(NULL,ix,value) + #define get_toggle_by_name(name) lib3270_get_toggle_id(name) + +#endif /* TOGGLE3270_H_INCLUDED */ diff --git a/src/lib3270/toggles.c b/src/lib3270/toggles.c index 72f39f1..fbb66c5 100644 --- a/src/lib3270/toggles.c +++ b/src/lib3270/toggles.c @@ -49,10 +49,7 @@ #include "screenc.h" #include "trace_dsc.h" #include "togglesc.h" - -#if defined(LIB3270) - #include -#endif +#include "api.h" diff --git a/src/lib3270/utf8.c b/src/lib3270/utf8.c index 943d149..a93fe37 100644 --- a/src/lib3270/utf8.c +++ b/src/lib3270/utf8.c @@ -37,7 +37,7 @@ */ #include "globals.h" -#include +#include "api.h" #include "popupsc.h" #include "utf8c.h" diff --git a/src/lib3270/util.c b/src/lib3270/util.c index f4001a3..bf3a0e6 100644 --- a/src/lib3270/util.c +++ b/src/lib3270/util.c @@ -57,7 +57,7 @@ #include "resources.h" #include "utilc.h" -#include +#include "api.h" #define my_isspace(c) isspace((unsigned char)c) diff --git a/src/lib3270/xio.c b/src/lib3270/xio.c index a25be97..741f7a1 100644 --- a/src/lib3270/xio.c +++ b/src/lib3270/xio.c @@ -40,7 +40,7 @@ #include "actionsc.h" #include "hostc.h" #include "telnetc.h" -#include +#include "toggle.h" #include "utilc.h" #include "xioc.h" -- libgit2 0.21.2