Commit 0058af6446e9ea42327a6fe96831d445f5b2af22
1 parent
664bf35c
Exists in
master
Incluindo estrutura de sessao na macro de definicao de actions
Showing
9 changed files
with
42 additions
and
42 deletions
Show diff stats
latest/src/gtk2/action_calls.c
@@ -234,7 +234,7 @@ | @@ -234,7 +234,7 @@ | ||
234 | { | 234 | { |
235 | unselect(); | 235 | unselect(); |
236 | if(PCONNECTED) | 236 | if(PCONNECTED) |
237 | - lib3270_enter(); | 237 | + lib3270_enter(hSession); |
238 | else | 238 | else |
239 | action_connect(action); | 239 | action_connect(action); |
240 | } | 240 | } |
@@ -480,7 +480,7 @@ | @@ -480,7 +480,7 @@ | ||
480 | { | 480 | { |
481 | Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled"); | 481 | Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled"); |
482 | if(TOGGLED_KP_ALTERNATIVE) | 482 | if(TOGGLED_KP_ALTERNATIVE) |
483 | - lib3270_tab(); | 483 | + lib3270_tab(hSession); |
484 | else | 484 | else |
485 | ParseInput("+"); | 485 | ParseInput("+"); |
486 | 486 | ||
@@ -490,7 +490,7 @@ | @@ -490,7 +490,7 @@ | ||
490 | { | 490 | { |
491 | Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled"); | 491 | Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled"); |
492 | if(TOGGLED_KP_ALTERNATIVE) | 492 | if(TOGGLED_KP_ALTERNATIVE) |
493 | - lib3270_backtab(); | 493 | + lib3270_backtab(hSession); |
494 | else | 494 | else |
495 | ParseInput("-"); | 495 | ParseInput("-"); |
496 | } | 496 | } |
latest/src/gtk2/actions1.c
@@ -300,7 +300,7 @@ | @@ -300,7 +300,7 @@ | ||
300 | 300 | ||
301 | if(!TOGGLED_KEEP_SELECTED) | 301 | if(!TOGGLED_KEEP_SELECTED) |
302 | unselect(); | 302 | unselect(); |
303 | - lib3270_pfkey((int) id); | 303 | + lib3270_pfkey(NULL,(int) id); |
304 | } | 304 | } |
305 | 305 | ||
306 | static void action_pakey(GtkAction *action, gpointer id) | 306 | static void action_pakey(GtkAction *action, gpointer id) |
@@ -309,7 +309,7 @@ | @@ -309,7 +309,7 @@ | ||
309 | 309 | ||
310 | if(!TOGGLED_KEEP_SELECTED) | 310 | if(!TOGGLED_KEEP_SELECTED) |
311 | unselect(); | 311 | unselect(); |
312 | - lib3270_pakey((int) id); | 312 | + lib3270_pakey(NULL,(int) id); |
313 | } | 313 | } |
314 | 314 | ||
315 | gboolean check_key_action(GtkWidget *widget, GdkEventKey *event) | 315 | gboolean check_key_action(GtkWidget *widget, GdkEventKey *event) |
latest/src/gtk2/mouse.c
@@ -197,7 +197,7 @@ | @@ -197,7 +197,7 @@ | ||
197 | if(length < 4 ) | 197 | if(length < 4 ) |
198 | { | 198 | { |
199 | int function = CheckForFunction(start,length-1); | 199 | int function = CheckForFunction(start,length-1); |
200 | - if(!lib3270_pfkey(function)) | 200 | + if(!lib3270_pfkey(hSession,function)) |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | start++; | 203 | start++; |
@@ -232,7 +232,7 @@ | @@ -232,7 +232,7 @@ | ||
232 | if(length < 3) | 232 | if(length < 3) |
233 | { | 233 | { |
234 | int function = CheckForFunction(baddr,length); | 234 | int function = CheckForFunction(baddr,length); |
235 | - if(!lib3270_pfkey(function)) | 235 | + if(!lib3270_pfkey(hSession,function)) |
236 | return; | 236 | return; |
237 | } | 237 | } |
238 | 238 |
latest/src/include/lib3270/actions.h
@@ -30,24 +30,24 @@ | @@ -30,24 +30,24 @@ | ||
30 | * | 30 | * |
31 | */ | 31 | */ |
32 | 32 | ||
33 | - #define DECLARE_LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void); | ||
34 | - #define LIB3270_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void) | 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 | 35 | ||
36 | // Clear actions - When called the selected area is cleared | 36 | // Clear actions - When called the selected area is cleared |
37 | - #define DECLARE_LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void); | ||
38 | - #define LIB3270_CLEAR_SELECTION_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void) | 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 | 39 | ||
40 | // Single key actions | 40 | // Single key actions |
41 | - #define DECLARE_LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void); | ||
42 | - #define LIB3270_KEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (void) | 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 | 43 | ||
44 | // Cursor actions | 44 | // Cursor actions |
45 | - #define DECLARE_LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (void); | ||
46 | - #define LIB3270_CURSOR_ACTION( name ) LIB3270_EXPORT int lib3270_cursor_ ## name (void) | 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 | 47 | ||
48 | // PF & PA key actions | 48 | // PF & PA key actions |
49 | - #define DECLARE_LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (int key); | ||
50 | - #define LIB3270_FKEY_ACTION( name ) LIB3270_EXPORT int lib3270_ ## name (int key) | 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 | 51 | ||
52 | 52 | ||
53 | // Load action table entries | 53 | // Load action table entries |
latest/src/jni/pw3270_jni.c
@@ -271,7 +271,7 @@ JNIEXPORT jboolean JNICALL Java_pw3270_terminal_queryStringAt(JNIEnv *env, jobje | @@ -271,7 +271,7 @@ JNIEXPORT jboolean JNICALL Java_pw3270_terminal_queryStringAt(JNIEnv *env, jobje | ||
271 | JNIEXPORT jint JNICALL Java_pw3270_terminal_sendEnterKey(JNIEnv *env, jobject obj) | 271 | JNIEXPORT jint JNICALL Java_pw3270_terminal_sendEnterKey(JNIEnv *env, jobject obj) |
272 | { | 272 | { |
273 | CHECK_FOR_TERMINAL_STATUS | 273 | CHECK_FOR_TERMINAL_STATUS |
274 | - return lib3270_enter(); | 274 | + return lib3270_enter(NULL); |
275 | } | 275 | } |
276 | 276 | ||
277 | JNIEXPORT jint JNICALL Java_pw3270_terminal_setStringAt(JNIEnv *env, jobject obj, jint row, jint col, jstring j_str) | 277 | 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, | @@ -299,7 +299,7 @@ JNIEXPORT jint JNICALL Java_pw3270_terminal_sendPFKey(JNIEnv *env, jobject obj, | ||
299 | { | 299 | { |
300 | CHECK_FOR_TERMINAL_STATUS | 300 | CHECK_FOR_TERMINAL_STATUS |
301 | 301 | ||
302 | - return lib3270_pfkey(key); | 302 | + return lib3270_pfkey(NULL,key); |
303 | } | 303 | } |
304 | 304 | ||
305 | JNIEXPORT jint JNICALL Java_pw3270_terminal_waitForTerminalReady(JNIEnv *env, jobject obj, jint timeout) | 305 | JNIEXPORT jint JNICALL Java_pw3270_terminal_waitForTerminalReady(JNIEnv *env, jobject obj, jint timeout) |
latest/src/lib/ft_cut.c
@@ -428,7 +428,7 @@ cut_data_request(void) | @@ -428,7 +428,7 @@ cut_data_request(void) | ||
428 | ft_update_length(); | 428 | ft_update_length(); |
429 | expanded_length += count; | 429 | expanded_length += count; |
430 | 430 | ||
431 | - lib3270_enter(); | 431 | + lib3270_enter(&h3270); |
432 | } | 432 | } |
433 | 433 | ||
434 | /* | 434 | /* |
@@ -513,7 +513,7 @@ cut_data(void) | @@ -513,7 +513,7 @@ cut_data(void) | ||
513 | static void cut_ack(void) | 513 | static void cut_ack(void) |
514 | { | 514 | { |
515 | trace_ds("> FT ACK\n"); | 515 | trace_ds("> FT ACK\n"); |
516 | - lib3270_enter(); | 516 | + lib3270_enter(&h3270); |
517 | } | 517 | } |
518 | 518 | ||
519 | /* | 519 | /* |
@@ -532,7 +532,7 @@ cut_abort(const char *s, unsigned short reason) | @@ -532,7 +532,7 @@ cut_abort(const char *s, unsigned short reason) | ||
532 | ctlr_add(RO_REASON_CODE+1, LOW8(reason), 0); | 532 | ctlr_add(RO_REASON_CODE+1, LOW8(reason), 0); |
533 | trace_ds("> FT CONTROL_CODE ABORT\n"); | 533 | trace_ds("> FT CONTROL_CODE ABORT\n"); |
534 | 534 | ||
535 | - lib3270_pfkey(2); | 535 | + lib3270_pfkey(&h3270,2); |
536 | 536 | ||
537 | /* Update the in-progress pop-up. */ | 537 | /* Update the in-progress pop-up. */ |
538 | ft_aborting(); | 538 | ft_aborting(); |
latest/src/lib/kybd.c
@@ -3251,7 +3251,7 @@ do_pa(unsigned n) | @@ -3251,7 +3251,7 @@ do_pa(unsigned n) | ||
3251 | return; | 3251 | return; |
3252 | } | 3252 | } |
3253 | 3253 | ||
3254 | - lib3270_pakey(n); | 3254 | + lib3270_pakey(&h3270,n); |
3255 | 3255 | ||
3256 | } | 3256 | } |
3257 | 3257 | ||
@@ -3263,7 +3263,7 @@ static void do_pf(unsigned n) | @@ -3263,7 +3263,7 @@ static void do_pf(unsigned n) | ||
3263 | return; | 3263 | return; |
3264 | } | 3264 | } |
3265 | 3265 | ||
3266 | - lib3270_pfkey(n); | 3266 | + lib3270_pfkey(&h3270,n); |
3267 | } | 3267 | } |
3268 | 3268 | ||
3269 | /* | 3269 | /* |
@@ -3410,7 +3410,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3410,7 +3410,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3410 | case BASE: | 3410 | case BASE: |
3411 | switch (c) { | 3411 | switch (c) { |
3412 | case '\b': | 3412 | case '\b': |
3413 | - lib3270_cursor_left(); | 3413 | + lib3270_cursor_left(&h3270); |
3414 | skipped = False; | 3414 | skipped = False; |
3415 | break; | 3415 | break; |
3416 | case '\f': | 3416 | case '\f': |
@@ -3418,7 +3418,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3418,7 +3418,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3418 | key_ACharacter((unsigned char) ' ', | 3418 | key_ACharacter((unsigned char) ' ', |
3419 | KT_STD, ia, &skipped); | 3419 | KT_STD, ia, &skipped); |
3420 | } else { | 3420 | } else { |
3421 | - lib3270_clear(); | 3421 | + lib3270_clear(&h3270); |
3422 | skipped = False; | 3422 | skipped = False; |
3423 | if (IN_3270) | 3423 | if (IN_3270) |
3424 | return len-1; | 3424 | return len-1; |
@@ -3427,11 +3427,11 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3427,11 +3427,11 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3427 | case '\n': | 3427 | case '\n': |
3428 | if (pasting) { | 3428 | if (pasting) { |
3429 | if (!skipped) | 3429 | if (!skipped) |
3430 | - lib3270_cursor_newline(); | 3430 | + lib3270_cursor_newline(&h3270); |
3431 | // action_internal(Newline_action,ia, CN, CN); | 3431 | // action_internal(Newline_action,ia, CN, CN); |
3432 | skipped = False; | 3432 | skipped = False; |
3433 | } else { | 3433 | } else { |
3434 | - lib3270_enter(); | 3434 | + lib3270_enter(&h3270); |
3435 | skipped = False; | 3435 | skipped = False; |
3436 | if (IN_3270) | 3436 | if (IN_3270) |
3437 | return len-1; | 3437 | return len-1; |
@@ -3440,7 +3440,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3440,7 +3440,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3440 | case '\r': /* ignored */ | 3440 | case '\r': /* ignored */ |
3441 | break; | 3441 | break; |
3442 | case '\t': | 3442 | case '\t': |
3443 | - lib3270_tab(); | 3443 | + lib3270_tab(&h3270); |
3444 | skipped = False; | 3444 | skipped = False; |
3445 | break; | 3445 | break; |
3446 | case '\\': /* backslashes are NOT special when | 3446 | case '\\': /* backslashes are NOT special when |
@@ -3506,13 +3506,13 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3506,13 +3506,13 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3506 | state = BASE; | 3506 | state = BASE; |
3507 | break; | 3507 | break; |
3508 | case 'b': | 3508 | case 'b': |
3509 | - lib3270_cursor_left(); | 3509 | + lib3270_cursor_left(&h3270); |
3510 | // action_internal(Left_action, ia, CN, CN); | 3510 | // action_internal(Left_action, ia, CN, CN); |
3511 | skipped = False; | 3511 | skipped = False; |
3512 | state = BASE; | 3512 | state = BASE; |
3513 | break; | 3513 | break; |
3514 | case 'f': | 3514 | case 'f': |
3515 | - lib3270_clear(); | 3515 | + lib3270_clear(&h3270); |
3516 | skipped = False; | 3516 | skipped = False; |
3517 | state = BASE; | 3517 | state = BASE; |
3518 | if (IN_3270) | 3518 | if (IN_3270) |
@@ -3520,7 +3520,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3520,7 +3520,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3520 | else | 3520 | else |
3521 | break; | 3521 | break; |
3522 | case 'n': | 3522 | case 'n': |
3523 | - lib3270_enter(); | 3523 | + lib3270_enter(&h3270); |
3524 | skipped = False; | 3524 | skipped = False; |
3525 | state = BASE; | 3525 | state = BASE; |
3526 | if (IN_3270) | 3526 | if (IN_3270) |
@@ -3532,19 +3532,19 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | @@ -3532,19 +3532,19 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting) | ||
3532 | break; | 3532 | break; |
3533 | 3533 | ||
3534 | case 'r': | 3534 | case 'r': |
3535 | - lib3270_cursor_newline(); | 3535 | + lib3270_cursor_newline(&h3270); |
3536 | // action_internal(Newline_action, ia, CN, CN); | 3536 | // action_internal(Newline_action, ia, CN, CN); |
3537 | skipped = False; | 3537 | skipped = False; |
3538 | state = BASE; | 3538 | state = BASE; |
3539 | break; | 3539 | break; |
3540 | 3540 | ||
3541 | case 't': | 3541 | case 't': |
3542 | - lib3270_tab(); | 3542 | + lib3270_tab(&h3270); |
3543 | skipped = False; | 3543 | skipped = False; |
3544 | state = BASE; | 3544 | state = BASE; |
3545 | break; | 3545 | break; |
3546 | case 'T': | 3546 | case 'T': |
3547 | - lib3270_tab(); | 3547 | + lib3270_tab(&h3270); |
3548 | skipped = False; | 3548 | skipped = False; |
3549 | state = BASE; | 3549 | state = BASE; |
3550 | break; | 3550 | break; |
latest/src/lib/macros.c
@@ -189,7 +189,7 @@ | @@ -189,7 +189,7 @@ | ||
189 | switch(argc) | 189 | switch(argc) |
190 | { | 190 | { |
191 | case 1: | 191 | case 1: |
192 | - lib3270_enter(); | 192 | + lib3270_enter(hSession); |
193 | break; | 193 | break; |
194 | 194 | ||
195 | case 2: | 195 | case 2: |
@@ -256,7 +256,7 @@ | @@ -256,7 +256,7 @@ | ||
256 | errno = EINVAL; | 256 | errno = EINVAL; |
257 | return NULL; | 257 | return NULL; |
258 | } | 258 | } |
259 | - snprintf(ret,9,"%d",lib3270_pfkey(atoi(argv[1]))); | 259 | + snprintf(ret,9,"%d",lib3270_pfkey(hSession,atoi(argv[1]))); |
260 | return strdup(ret); | 260 | return strdup(ret); |
261 | } | 261 | } |
262 | 262 | ||
@@ -268,7 +268,7 @@ | @@ -268,7 +268,7 @@ | ||
268 | errno = EINVAL; | 268 | errno = EINVAL; |
269 | return NULL; | 269 | return NULL; |
270 | } | 270 | } |
271 | - snprintf(ret,9,"%d",lib3270_pakey(atoi(argv[1]))); | 271 | + snprintf(ret,9,"%d",lib3270_pakey(hSession,atoi(argv[1]))); |
272 | return strdup(ret); | 272 | return strdup(ret); |
273 | } | 273 | } |
274 | 274 | ||
@@ -280,7 +280,7 @@ | @@ -280,7 +280,7 @@ | ||
280 | errno = EINVAL; | 280 | errno = EINVAL; |
281 | return NULL; | 281 | return NULL; |
282 | } | 282 | } |
283 | - snprintf(ret,9,"%d",lib3270_enter()); | 283 | + snprintf(ret,9,"%d",lib3270_enter(hSession)); |
284 | return strdup(ret); | 284 | return strdup(ret); |
285 | } | 285 | } |
286 | 286 |
latest/src/plugins/rexx/screen.c
@@ -71,7 +71,7 @@ | @@ -71,7 +71,7 @@ | ||
71 | switch(Argc) | 71 | switch(Argc) |
72 | { | 72 | { |
73 | case 0: | 73 | case 0: |
74 | - lib3270_enter(); | 74 | + lib3270_enter(NULL); |
75 | break; | 75 | break; |
76 | 76 | ||
77 | case 1: | 77 | case 1: |
@@ -448,7 +448,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A | @@ -448,7 +448,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A | ||
448 | else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) | 448 | else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) |
449 | rc = EINVAL; | 449 | rc = EINVAL; |
450 | else | 450 | else |
451 | - rc = lib3270_enter(); | 451 | + rc = lib3270_enter(NULL); |
452 | 452 | ||
453 | RunPendingEvents(1); | 453 | RunPendingEvents(1); |
454 | 454 | ||
@@ -480,7 +480,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A | @@ -480,7 +480,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A | ||
480 | else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) | 480 | else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK) |
481 | rc = EINVAL; | 481 | rc = EINVAL; |
482 | else | 482 | else |
483 | - rc = lib3270_pfkey(atoi(Argv[0].strptr)); | 483 | + rc = lib3270_pfkey(NULL,atoi(Argv[0].strptr)); |
484 | 484 | ||
485 | if(!rc) | 485 | if(!rc) |
486 | { | 486 | { |