Commit 0058af6446e9ea42327a6fe96831d445f5b2af22

Authored by perry.werneck@gmail.com
1 parent 664bf35c
Exists in master

Incluindo estrutura de sessao na macro de definicao de actions

latest/src/gtk2/action_calls.c
... ... @@ -234,7 +234,7 @@
234 234 {
235 235 unselect();
236 236 if(PCONNECTED)
237   - lib3270_enter();
  237 + lib3270_enter(hSession);
238 238 else
239 239 action_connect(action);
240 240 }
... ... @@ -480,7 +480,7 @@
480 480 {
481 481 Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled");
482 482 if(TOGGLED_KP_ALTERNATIVE)
483   - lib3270_tab();
  483 + lib3270_tab(hSession);
484 484 else
485 485 ParseInput("+");
486 486  
... ... @@ -490,7 +490,7 @@
490 490 {
491 491 Trace("%s - KPAlternative is %s",__FUNCTION__,TOGGLED_KP_ALTERNATIVE ? "Enabled" : "Disabled");
492 492 if(TOGGLED_KP_ALTERNATIVE)
493   - lib3270_backtab();
  493 + lib3270_backtab(hSession);
494 494 else
495 495 ParseInput("-");
496 496 }
... ...
latest/src/gtk2/actions1.c
... ... @@ -300,7 +300,7 @@
300 300  
301 301 if(!TOGGLED_KEEP_SELECTED)
302 302 unselect();
303   - lib3270_pfkey((int) id);
  303 + lib3270_pfkey(NULL,(int) id);
304 304 }
305 305  
306 306 static void action_pakey(GtkAction *action, gpointer id)
... ... @@ -309,7 +309,7 @@
309 309  
310 310 if(!TOGGLED_KEEP_SELECTED)
311 311 unselect();
312   - lib3270_pakey((int) id);
  312 + lib3270_pakey(NULL,(int) id);
313 313 }
314 314  
315 315 gboolean check_key_action(GtkWidget *widget, GdkEventKey *event)
... ...
latest/src/gtk2/mouse.c
... ... @@ -197,7 +197,7 @@
197 197 if(length < 4 )
198 198 {
199 199 int function = CheckForFunction(start,length-1);
200   - if(!lib3270_pfkey(function))
  200 + if(!lib3270_pfkey(hSession,function))
201 201 return;
202 202 }
203 203 start++;
... ... @@ -232,7 +232,7 @@
232 232 if(length < 3)
233 233 {
234 234 int function = CheckForFunction(baddr,length);
235   - if(!lib3270_pfkey(function))
  235 + if(!lib3270_pfkey(hSession,function))
236 236 return;
237 237 }
238 238  
... ...
latest/src/include/lib3270/actions.h
... ... @@ -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 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 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 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 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 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 271 JNIEXPORT jint JNICALL Java_pw3270_terminal_sendEnterKey(JNIEnv *env, jobject obj)
272 272 {
273 273 CHECK_FOR_TERMINAL_STATUS
274   - return lib3270_enter();
  274 + return lib3270_enter(NULL);
275 275 }
276 276  
277 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 299 {
300 300 CHECK_FOR_TERMINAL_STATUS
301 301  
302   - return lib3270_pfkey(key);
  302 + return lib3270_pfkey(NULL,key);
303 303 }
304 304  
305 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 428 ft_update_length();
429 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 513 static void cut_ack(void)
514 514 {
515 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 532 ctlr_add(RO_REASON_CODE+1, LOW8(reason), 0);
533 533 trace_ds("> FT CONTROL_CODE ABORT\n");
534 534  
535   - lib3270_pfkey(2);
  535 + lib3270_pfkey(&h3270,2);
536 536  
537 537 /* Update the in-progress pop-up. */
538 538 ft_aborting();
... ...
latest/src/lib/kybd.c
... ... @@ -3251,7 +3251,7 @@ do_pa(unsigned n)
3251 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 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 3410 case BASE:
3411 3411 switch (c) {
3412 3412 case '\b':
3413   - lib3270_cursor_left();
  3413 + lib3270_cursor_left(&h3270);
3414 3414 skipped = False;
3415 3415 break;
3416 3416 case '\f':
... ... @@ -3418,7 +3418,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting)
3418 3418 key_ACharacter((unsigned char) ' ',
3419 3419 KT_STD, ia, &skipped);
3420 3420 } else {
3421   - lib3270_clear();
  3421 + lib3270_clear(&h3270);
3422 3422 skipped = False;
3423 3423 if (IN_3270)
3424 3424 return len-1;
... ... @@ -3427,11 +3427,11 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting)
3427 3427 case '\n':
3428 3428 if (pasting) {
3429 3429 if (!skipped)
3430   - lib3270_cursor_newline();
  3430 + lib3270_cursor_newline(&h3270);
3431 3431 // action_internal(Newline_action,ia, CN, CN);
3432 3432 skipped = False;
3433 3433 } else {
3434   - lib3270_enter();
  3434 + lib3270_enter(&h3270);
3435 3435 skipped = False;
3436 3436 if (IN_3270)
3437 3437 return len-1;
... ... @@ -3440,7 +3440,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting)
3440 3440 case '\r': /* ignored */
3441 3441 break;
3442 3442 case '\t':
3443   - lib3270_tab();
  3443 + lib3270_tab(&h3270);
3444 3444 skipped = False;
3445 3445 break;
3446 3446 case '\\': /* backslashes are NOT special when
... ... @@ -3506,13 +3506,13 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting)
3506 3506 state = BASE;
3507 3507 break;
3508 3508 case 'b':
3509   - lib3270_cursor_left();
  3509 + lib3270_cursor_left(&h3270);
3510 3510 // action_internal(Left_action, ia, CN, CN);
3511 3511 skipped = False;
3512 3512 state = BASE;
3513 3513 break;
3514 3514 case 'f':
3515   - lib3270_clear();
  3515 + lib3270_clear(&h3270);
3516 3516 skipped = False;
3517 3517 state = BASE;
3518 3518 if (IN_3270)
... ... @@ -3520,7 +3520,7 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting)
3520 3520 else
3521 3521 break;
3522 3522 case 'n':
3523   - lib3270_enter();
  3523 + lib3270_enter(&h3270);
3524 3524 skipped = False;
3525 3525 state = BASE;
3526 3526 if (IN_3270)
... ... @@ -3532,19 +3532,19 @@ LIB3270_EXPORT int emulate_input(char *s, int len, int pasting)
3532 3532 break;
3533 3533  
3534 3534 case 'r':
3535   - lib3270_cursor_newline();
  3535 + lib3270_cursor_newline(&h3270);
3536 3536 // action_internal(Newline_action, ia, CN, CN);
3537 3537 skipped = False;
3538 3538 state = BASE;
3539 3539 break;
3540 3540  
3541 3541 case 't':
3542   - lib3270_tab();
  3542 + lib3270_tab(&h3270);
3543 3543 skipped = False;
3544 3544 state = BASE;
3545 3545 break;
3546 3546 case 'T':
3547   - lib3270_tab();
  3547 + lib3270_tab(&h3270);
3548 3548 skipped = False;
3549 3549 state = BASE;
3550 3550 break;
... ...
latest/src/lib/macros.c
... ... @@ -189,7 +189,7 @@
189 189 switch(argc)
190 190 {
191 191 case 1:
192   - lib3270_enter();
  192 + lib3270_enter(hSession);
193 193 break;
194 194  
195 195 case 2:
... ... @@ -256,7 +256,7 @@
256 256 errno = EINVAL;
257 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 260 return strdup(ret);
261 261 }
262 262  
... ... @@ -268,7 +268,7 @@
268 268 errno = EINVAL;
269 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 272 return strdup(ret);
273 273 }
274 274  
... ... @@ -280,7 +280,7 @@
280 280 errno = EINVAL;
281 281 return NULL;
282 282 }
283   - snprintf(ret,9,"%d",lib3270_enter());
  283 + snprintf(ret,9,"%d",lib3270_enter(hSession));
284 284 return strdup(ret);
285 285 }
286 286  
... ...
latest/src/plugins/rexx/screen.c
... ... @@ -71,7 +71,7 @@
71 71 switch(Argc)
72 72 {
73 73 case 0:
74   - lib3270_enter();
  74 + lib3270_enter(NULL);
75 75 break;
76 76  
77 77 case 1:
... ... @@ -448,7 +448,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A
448 448 else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK)
449 449 rc = EINVAL;
450 450 else
451   - rc = lib3270_enter();
  451 + rc = lib3270_enter(NULL);
452 452  
453 453 RunPendingEvents(1);
454 454  
... ... @@ -480,7 +480,7 @@ RexxReturnCode REXXENTRY rx3270GetCursorPosition(PSZ Name, LONG Argc, RXSTRING A
480 480 else if(query_3270_terminal_status() != LIB3270_STATUS_BLANK)
481 481 rc = EINVAL;
482 482 else
483   - rc = lib3270_pfkey(atoi(Argv[0].strptr));
  483 + rc = lib3270_pfkey(NULL,atoi(Argv[0].strptr));
484 484  
485 485 if(!rc)
486 486 {
... ...