From 0058af6446e9ea42327a6fe96831d445f5b2af22 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Thu, 9 Feb 2012 10:33:34 +0000 Subject: [PATCH] Incluindo estrutura de sessao na macro de definicao de actions --- latest/src/gtk2/action_calls.c | 6 +++--- latest/src/gtk2/actions1.c | 4 ++-- latest/src/gtk2/mouse.c | 4 ++-- latest/src/include/lib3270/actions.h | 20 ++++++++++---------- latest/src/jni/pw3270_jni.c | 4 ++-- latest/src/lib/ft_cut.c | 6 +++--- latest/src/lib/kybd.c | 26 +++++++++++++------------- latest/src/lib/macros.c | 8 ++++---- latest/src/plugins/rexx/screen.c | 6 +++--- 9 files changed, 42 insertions(+), 42 deletions(-) diff --git a/latest/src/gtk2/action_calls.c b/latest/src/gtk2/action_calls.c index f457cf8..ee539e7 100644 --- a/latest/src/gtk2/action_calls.c +++ b/latest/src/gtk2/action_calls.c @@ -234,7 +234,7 @@ { unselect(); if(PCONNECTED) - lib3270_enter(); + lib3270_enter(hSession); else action_connect(action); } @@ -480,7 +480,7 @@ { Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled"); if(TOGGLED_KP_ALTERNATIVE) - lib3270_tab(); + lib3270_tab(hSession); else ParseInput("+"); @@ -490,7 +490,7 @@ { Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled"); if(TOGGLED_KP_ALTERNATIVE) - lib3270_backtab(); + lib3270_backtab(hSession); else ParseInput("-"); } diff --git a/latest/src/gtk2/actions1.c b/latest/src/gtk2/actions1.c index 813e6e1..57b53ba 100644 --- a/latest/src/gtk2/actions1.c +++ b/latest/src/gtk2/actions1.c @@ -300,7 +300,7 @@ if(!TOGGLED_KEEP_SELECTED) unselect(); - lib3270_pfkey((int) id); + lib3270_pfkey(NULL,(int) id); } static void action_pakey(GtkAction *action, gpointer id) @@ -309,7 +309,7 @@ if(!TOGGLED_KEEP_SELECTED) unselect(); - lib3270_pakey((int) id); + lib3270_pakey(NULL,(int) id); } gboolean check_key_action(GtkWidget *widget, GdkEventKey *event) diff --git a/latest/src/gtk2/mouse.c b/latest/src/gtk2/mouse.c index f65410c..c3e2573 100644 --- a/latest/src/gtk2/mouse.c +++ b/latest/src/gtk2/mouse.c @@ -197,7 +197,7 @@ if(length < 4 ) { int function = CheckForFunction(start,length-1); - if(!lib3270_pfkey(function)) + if(!lib3270_pfkey(hSession,function)) return; } start++; @@ -232,7 +232,7 @@ if(length < 3) { int function = CheckForFunction(baddr,length); - if(!lib3270_pfkey(function)) + if(!lib3270_pfkey(hSession,function)) return; } diff --git a/latest/src/include/lib3270/actions.h b/latest/src/include/lib3270/actions.h index 9a97758..3bb011e 100644 --- a/latest/src/include/lib3270/actions.h +++ b/latest/src/include/lib3270/actions.h @@ -30,24 +30,24 @@ * */ - #define DECLARE_LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void); - #define LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void) + #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 (void); - #define LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void) + #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 (void); - #define LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void) + #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 (void); - #define LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (void) + #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 (int key); - #define LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (int key) + #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 diff --git a/latest/src/jni/pw3270_jni.c b/latest/src/jni/pw3270_jni.c index 96d105c..ea67e00 100644 --- a/latest/src/jni/pw3270_jni.c +++ b/latest/src/jni/pw3270_jni.c @@ -271,7 +271,7 @@ JNIEXPORT jboolean JNICALL Java_pw3270_terminal_queryStringAt(JNIEnv *env, jobje JNIEXPORT jint JNICALL Java_pw3270_terminal_sendEnterKey(JNIEnv *env, jobject obj) { CHECK_FOR_TERMINAL_STATUS - return lib3270_enter(); + return lib3270_enter(NULL); } JNIEXPORT jint JNICALL Java_pw3270_terminal_setStringAt(JNIEnv *env, jobject obj, jint row, jint col, jstring j_str) @@ -299,7 +299,7 @@ JNIEXPORT jint JNICALL Java_pw3270_terminal_sendPFKey(JNIEnv *env, jobject obj, { CHECK_FOR_TERMINAL_STATUS - return lib3270_pfkey(key); + return lib3270_pfkey(NULL,key); } JNIEXPORT jint JNICALL Java_pw3270_terminal_waitForTerminalReady(JNIEnv *env, jobject obj, jint timeout) diff --git a/latest/src/lib/ft_cut.c b/latest/src/lib/ft_cut.c index 3dd65d8..f4b9818 100644 --- a/latest/src/lib/ft_cut.c +++ b/latest/src/lib/ft_cut.c @@ -428,7 +428,7 @@ cut_data_request(void) ft_update_length(); expanded_length += count; - lib3270_enter(); + lib3270_enter(&h3270); } /* @@ -513,7 +513,7 @@ cut_data(void) static void cut_ack(void) { trace_ds("> FT ACK\n"); - lib3270_enter(); + lib3270_enter(&h3270); } /* @@ -532,7 +532,7 @@ cut_abort(const char *s, unsigned short reason) ctlr_add(RO_REASON_CODE+1, LOW8(reason), 0); trace_ds("> FT CONTROL_CODE ABORT\n"); - lib3270_pfkey(2); + lib3270_pfkey(&h3270,2); /* Update the in-progress pop-up. */ ft_aborting(); diff --git a/latest/src/lib/kybd.c b/latest/src/lib/kybd.c index d8f278a..35bb7af 100644 --- a/latest/src/lib/kybd.c +++ b/latest/src/lib/kybd.c @@ -3251,7 +3251,7 @@ do_pa(unsigned n) return; } - lib3270_pakey(n); + lib3270_pakey(&h3270,n); } @@ -3263,7 +3263,7 @@ static void do_pf(unsigned n) return; } - lib3270_pfkey(n); + lib3270_pfkey(&h3270,n); } /* @@ -3410,7 +3410,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) case BASE: switch (c) { case '\b': - lib3270_cursor_left(); + lib3270_cursor_left(&h3270); skipped = False; break; case '\f': @@ -3418,7 +3418,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) key_ACharacter((unsigned char) ' ', KT_STD, ia, &skipped); } else { - lib3270_clear(); + lib3270_clear(&h3270); skipped = False; if (IN_3270) return len-1; @@ -3427,11 +3427,11 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) case '\n': if (pasting) { if (!skipped) - lib3270_cursor_newline(); + lib3270_cursor_newline(&h3270); // action_internal(Newline_action,ia, CN, CN); skipped = False; } else { - lib3270_enter(); + lib3270_enter(&h3270); skipped = False; if (IN_3270) return len-1; @@ -3440,7 +3440,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) case '\r': /* ignored */ break; case '\t': - lib3270_tab(); + lib3270_tab(&h3270); skipped = False; break; case '\\': /* backslashes are NOT special when @@ -3506,13 +3506,13 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) state = BASE; break; case 'b': - lib3270_cursor_left(); + lib3270_cursor_left(&h3270); // action_internal(Left_action, ia, CN, CN); skipped = False; state = BASE; break; case 'f': - lib3270_clear(); + lib3270_clear(&h3270); skipped = False; state = BASE; if (IN_3270) @@ -3520,7 +3520,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) else break; case 'n': - lib3270_enter(); + lib3270_enter(&h3270); skipped = False; state = BASE; if (IN_3270) @@ -3532,19 +3532,19 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) break; case 'r': - lib3270_cursor_newline(); + lib3270_cursor_newline(&h3270); // action_internal(Newline_action, ia, CN, CN); skipped = False; state = BASE; break; case 't': - lib3270_tab(); + lib3270_tab(&h3270); skipped = False; state = BASE; break; case 'T': - lib3270_tab(); + lib3270_tab(&h3270); skipped = False; state = BASE; break; diff --git a/latest/src/lib/macros.c b/latest/src/lib/macros.c index 931b8cc..0601492 100644 --- a/latest/src/lib/macros.c +++ b/latest/src/lib/macros.c @@ -189,7 +189,7 @@ switch(argc) { case 1: - lib3270_enter(); + lib3270_enter(hSession); break; case 2: @@ -256,7 +256,7 @@ errno = EINVAL; return NULL; } - snprintf(ret,9,"%d",lib3270_pfkey(atoi(argv[1]))); + snprintf(ret,9,"%d",lib3270_pfkey(hSession,atoi(argv[1]))); return strdup(ret); } @@ -268,7 +268,7 @@ errno = EINVAL; return NULL; } - snprintf(ret,9,"%d",lib3270_pakey(atoi(argv[1]))); + snprintf(ret,9,"%d",lib3270_pakey(hSession,atoi(argv[1]))); return strdup(ret); } @@ -280,7 +280,7 @@ errno = EINVAL; return NULL; } - snprintf(ret,9,"%d",lib3270_enter()); + snprintf(ret,9,"%d",lib3270_enter(hSession)); return strdup(ret); } diff --git a/latest/src/plugins/rexx/screen.c b/latest/src/plugins/rexx/screen.c index 6315d14..c53c41d 100644 --- a/latest/src/plugins/rexx/screen.c +++ b/latest/src/plugins/rexx/screen.c @@ -71,7 +71,7 @@ switch(Argc) { case 0: - lib3270_enter(); + lib3270_enter(NULL); break; case 1: @@ -448,7 +448,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) rc = EINVAL; else - rc = lib3270_enter(); + rc = lib3270_enter(NULL); RunPendingEvents(1); @@ -480,7 +480,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) rc = EINVAL; else - rc = lib3270_pfkey(atoi(Argv[0].strptr)); + rc = lib3270_pfkey(NULL,atoi(Argv[0].strptr)); if(!rc) { -- libgit2 0.21.2