Commit 58b3a2e8ebd73e8704ab5571b49646ba4bc42f3f

Authored by perry.werneck@gmail.com
1 parent 0e1033e8
Exists in master

Movendo flags da OIA para a estrutura de controle de sessao

latest/src/include/lib3270.h
@@ -95,8 +95,23 @@ @@ -95,8 +95,23 @@
95 LIB3270_TOGGLE_SMART_PASTE, 95 LIB3270_TOGGLE_SMART_PASTE,
96 96
97 LIB3270_TOGGLE_COUNT 97 LIB3270_TOGGLE_COUNT
  98 +
98 } LIB3270_TOGGLE; 99 } LIB3270_TOGGLE;
99 100
  101 + typedef enum _lib3270_flag
  102 + {
  103 + LIB3270_FLAG_BOXSOLID,
  104 + LIB3270_FLAG_UNDERA,
  105 + LIB3270_FLAG_SECURE,
  106 + LIB3270_FLAG_TYPEAHEAD,
  107 + LIB3270_FLAG_PRINTER,
  108 + LIB3270_FLAG_REVERSE,
  109 + LIB3270_FLAG_SCRIPT,
  110 +
  111 + LIB3270_FLAG_COUNT
  112 +
  113 + } LIB3270_FLAG;
  114 +
100 #include <lib3270/api.h> 115 #include <lib3270/api.h>
101 116
102 /** 117 /**
@@ -241,6 +256,7 @@ @@ -241,6 +256,7 @@
241 LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h); 256 LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h);
242 LIB3270_EXPORT const char * lib3270_get_host(H3270 *h); 257 LIB3270_EXPORT const char * lib3270_get_host(H3270 *h);
243 258
244 - 259 + #define lib3270_has_printer_session(h) (h->oia_flag[LIB3270_FLAG_PRINTER] != 0)
  260 + #define lib3270_has_active_script(h) (h->oia_flag[LIB3270_FLAG_SCRIPT] != 0)
245 261
246 #endif // LIB3270_H_INCLUDED 262 #endif // LIB3270_H_INCLUDED
latest/src/include/lib3270/api.h
@@ -183,18 +183,14 @@ @@ -183,18 +183,14 @@
183 183
184 } STATUS_CODE; 184 } STATUS_CODE;
185 185
186 - typedef enum _OIA_FLAG  
187 - {  
188 - OIA_FLAG_BOXSOLID,  
189 - OIA_FLAG_UNDERA,  
190 - OIA_FLAG_SECURE,  
191 - OIA_FLAG_TYPEAHEAD,  
192 - OIA_FLAG_PRINTER,  
193 - OIA_FLAG_REVERSE,  
194 -  
195 - OIA_FLAG_USER  
196 - } OIA_FLAG;  
197 - 186 + #define OIA_FLAG_BOXSOLID LIB3270_FLAG_BOXSOLID
  187 + #define OIA_FLAG_UNDERA LIB3270_FLAG_UNDERA
  188 + #define OIA_FLAG_SECURE LIB3270_FLAG_SECURE
  189 + #define OIA_FLAG_TYPEAHEAD LIB3270_FLAG_TYPEAHEAD
  190 + #define OIA_FLAG_PRINTER LIB3270_FLAG_PRINTER
  191 + #define OIA_FLAG_REVERSE LIB3270_FLAG_REVERSE
  192 + #define OIA_FLAG_USER LIB3270_FLAG_COUNT
  193 + #define OIA_FLAG LIB3270_FLAG
198 194
199 struct lib3270_state_callback; 195 struct lib3270_state_callback;
200 196
@@ -232,6 +228,8 @@ @@ -232,6 +228,8 @@
232 228
233 STATUS_CODE oia_status; 229 STATUS_CODE oia_status;
234 230
  231 + unsigned char oia_flag[LIB3270_FLAG_COUNT];
  232 +
235 unsigned short current_port; 233 unsigned short current_port;
236 234
237 // screen info 235 // screen info
latest/src/lib/ft.c
@@ -31,7 +31,7 @@ @@ -31,7 +31,7 @@
31 */ 31 */
32 32
33 #include <lib3270/config.h> 33 #include <lib3270/config.h>
34 -#include <lib3270/api.h> 34 +#include <lib3270.h>
35 #include "globals.h" 35 #include "globals.h"
36 36
37 #if defined(X3270_FT) 37 #if defined(X3270_FT)
latest/src/lib/ft_dft.c
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * File transfer: DFT-style data processing functions 36 * File transfer: DFT-style data processing functions
37 */ 37 */
38 38
39 -#include <lib3270/api.h> 39 +#include <lib3270.h>
40 #include "globals.h" 40 #include "globals.h"
41 41
42 #if defined(X3270_FT) /*[*/ 42 #if defined(X3270_FT) /*[*/
latest/src/lib/log.c
1 -/* 1 +/*
2 * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 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 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. Registro no INPI sob o nome G3270. 4 * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270.
5 - * 5 + *
6 * Copyright (C) <2008> <Banco do Brasil S.A.> 6 * Copyright (C) <2008> <Banco do Brasil S.A.>
7 - * 7 + *
8 * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob 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 9 * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
10 * Free Software Foundation. 10 * Free Software Foundation.
11 - * 11 + *
12 * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER 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 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 14 * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
15 * obter mais detalhes. 15 * obter mais detalhes.
16 - * 16 + *
17 * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este 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 18 * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
19 * Place, Suite 330, Boston, MA, 02111-1307, USA 19 * Place, Suite 330, Boston, MA, 02111-1307, USA
20 - * 20 + *
21 * Este programa está nomeado como log.c e possui 151 linhas de código. 21 * Este programa está nomeado como log.c e possui 151 linhas de código.
22 - *  
23 - * Contatos:  
24 - * 22 + *
  23 + * Contatos:
  24 + *
25 * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) 25 * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) 26 * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
27 * licinio@bb.com.br (Licínio Luis Branco) 27 * licinio@bb.com.br (Licínio Luis Branco)
@@ -38,7 +38,7 @@ @@ -38,7 +38,7 @@
38 #include <time.h> 38 #include <time.h>
39 #include <fcntl.h> 39 #include <fcntl.h>
40 #include <lib3270/config.h> 40 #include <lib3270/config.h>
41 -#include <lib3270/api.h> 41 +#include <lib3270.h>
42 42
43 /*---[ Constants ]------------------------------------------------------------------------------------------*/ 43 /*---[ Constants ]------------------------------------------------------------------------------------------*/
44 44
latest/src/lib/macros.c
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 32
33 #include <string.h> 33 #include <string.h>
34 #include <stdio.h> 34 #include <stdio.h>
35 - #include <lib3270/api.h> 35 + #include <lib3270.h>
36 #include <lib3270/macros.h> 36 #include <lib3270/macros.h>
37 37
38 #define LIB3270_MACRO_ENTRY( name ) { #name, lib3270_macro_ ## name } 38 #define LIB3270_MACRO_ENTRY( name ) { #name, lib3270_macro_ ## name }
latest/src/lib/screen.c
@@ -481,12 +481,18 @@ LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *h, int baddr) @@ -481,12 +481,18 @@ LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *h, int baddr)
481 481
482 /* Status line stuff. */ 482 /* Status line stuff. */
483 483
484 -void set_status(H3270 *session, OIA_FLAG id, Boolean on) 484 +void set_status(H3270 *session, LIB3270_FLAG id, Boolean on)
485 { 485 {
486 CHECK_SESSION_HANDLE(session); 486 CHECK_SESSION_HANDLE(session);
487 487
488 - if(session->set_oia)  
489 - session->set_oia(session,id,on); 488 + if(id < LIB3270_FLAG_COUNT)
  489 + {
  490 + session->oia_flag[id] = (on != 0);
  491 +
  492 + if(session->set_oia)
  493 + session->set_oia(session,id,on);
  494 + }
  495 +
490 } 496 }
491 497
492 void status_ctlr_done(H3270 *session) 498 void status_ctlr_done(H3270 *session)