Commit 58b3a2e8ebd73e8704ab5571b49646ba4bc42f3f
1 parent
0e1033e8
Exists in
master
Movendo flags da OIA para a estrutura de controle de sessao
Showing
7 changed files
with
49 additions
and
29 deletions
Show diff stats
latest/src/include/lib3270.h
... | ... | @@ -95,8 +95,23 @@ |
95 | 95 | LIB3270_TOGGLE_SMART_PASTE, |
96 | 96 | |
97 | 97 | LIB3270_TOGGLE_COUNT |
98 | + | |
98 | 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 | 115 | #include <lib3270/api.h> |
101 | 116 | |
102 | 117 | /** |
... | ... | @@ -241,6 +256,7 @@ |
241 | 256 | LIB3270_EXPORT const char * lib3270_get_luname(H3270 *h); |
242 | 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 | 262 | #endif // LIB3270_H_INCLUDED | ... | ... |
latest/src/include/lib3270/api.h
... | ... | @@ -183,18 +183,14 @@ |
183 | 183 | |
184 | 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 | 195 | struct lib3270_state_callback; |
200 | 196 | |
... | ... | @@ -232,6 +228,8 @@ |
232 | 228 | |
233 | 229 | STATUS_CODE oia_status; |
234 | 230 | |
231 | + unsigned char oia_flag[LIB3270_FLAG_COUNT]; | |
232 | + | |
235 | 233 | unsigned short current_port; |
236 | 234 | |
237 | 235 | // screen info | ... | ... |
latest/src/lib/ft.c
latest/src/lib/ft_dft.c
latest/src/lib/log.c
1 | -/* | |
1 | +/* | |
2 | 2 | * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 |
3 | 3 | * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a |
4 | 4 | * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. |
5 | - * | |
5 | + * | |
6 | 6 | * Copyright (C) <2008> <Banco do Brasil S.A.> |
7 | - * | |
7 | + * | |
8 | 8 | * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob |
9 | 9 | * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela |
10 | 10 | * Free Software Foundation. |
11 | - * | |
11 | + * | |
12 | 12 | * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER |
13 | 13 | * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO |
14 | 14 | * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para |
15 | 15 | * obter mais detalhes. |
16 | - * | |
16 | + * | |
17 | 17 | * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este |
18 | 18 | * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple |
19 | 19 | * Place, Suite 330, Boston, MA, 02111-1307, USA |
20 | - * | |
20 | + * | |
21 | 21 | * Este programa está nomeado como log.c e possui 151 linhas de código. |
22 | - * | |
23 | - * Contatos: | |
24 | - * | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | 25 | * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) |
26 | 26 | * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) |
27 | 27 | * licinio@bb.com.br (Licínio Luis Branco) |
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | #include <time.h> |
39 | 39 | #include <fcntl.h> |
40 | 40 | #include <lib3270/config.h> |
41 | -#include <lib3270/api.h> | |
41 | +#include <lib3270.h> | |
42 | 42 | |
43 | 43 | /*---[ Constants ]------------------------------------------------------------------------------------------*/ |
44 | 44 | ... | ... |
latest/src/lib/macros.c
latest/src/lib/screen.c
... | ... | @@ -481,12 +481,18 @@ LIB3270_EXPORT int lib3270_set_cursor_address(H3270 *h, int baddr) |
481 | 481 | |
482 | 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 | 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 | 498 | void status_ctlr_done(H3270 *session) | ... | ... |