session.h
4.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/*
* "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
* (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
* aplicativos mainframe. Registro no INPI sob o nome G3270.
*
* Copyright (C) <2008> <Banco do Brasil S.A.>
*
* Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
* os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela
* Free Software Foundation.
*
* Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER
* GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO
* A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
* obter mais detalhes.
*
* Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
* programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple
* Place, Suite 330, Boston, MA, 02111-1307, USA
*
* Este programa está nomeado como session.h e possui - linhas de código.
*
* Contatos:
*
* perry.werneck@gmail.com (Alexandre Perry de Souza Werneck)
* erico.mendonca@gmail.com (Erico Mascarenhas Mendonça)
* licinio@bb.com.br (Licínio Luis Branco)
* kraucer@bb.com.br (Kraucer Fernandes Mazuco)
*
*/
#ifndef LIB3270_SESSION_H_INCLUDED
#define LIB3270_SESSION_H_INCLUDED 1
#define LIB3270_LUNAME_LENGTH 16
#define LIB3270_FULL_MODEL_NAME_LENGTH 13
struct _h3270
{
unsigned short sz; /**< Struct size */
// Connection info
int secure_connection;
int sock; /**< Network socket */
int net_sock;
LIB3270_CSTATE cstate; /**< Connection state */
#if defined(_WIN32) /*[*/
HANDLE sock_handle;
#endif /*]*/
char * hostname;
char * connected_type;
char * connected_lu;
char luname[LIB3270_LUNAME_LENGTH+1];
char full_model_name[LIB3270_FULL_MODEL_NAME_LENGTH+1];
char * model_name;
int model_num;
char * termtype;
char * current_host; /**< the hostname part, stripped of qualifiers, luname and port number */
char * full_current_host; /**< the entire string, for use in reconnecting */
char * reconnect_host;
char * qualified_host;
char auto_reconnect_inprogress;
LIB3270_MESSAGE oia_status;
unsigned char oia_flag[LIB3270_FLAG_COUNT];
unsigned short current_port;
// screen info
int ov_rows;
int ov_cols;
// int first_changed;
// int last_changed;
int maxROWS;
int maxCOLS;
unsigned short rows;
unsigned short cols;
int cursor_addr;
char flipped;
int screen_alt; /**< alternate screen? */
int is_altbuffer;
int formatted; /**< set in screen_disp */
// host.c
char std_ds_host;
char no_login_host;
char non_tn3270e_host;
char passthru_host;
char ssl_host;
char ever_3270;
// Widget info
void * widget;
// xio
unsigned long ns_read_id;
unsigned long ns_exception_id;
char reading;
char excepting;
/* State change callbacks. */
struct lib3270_state_callback *st_callbacks[LIB3270_STATE_USER];
struct lib3270_state_callback *st_last[LIB3270_STATE_USER];
/* Session based callbacks */
void (*configure)(H3270 *session, unsigned short rows, unsigned short cols);
void (*update)(H3270 *session, int baddr, unsigned char c, unsigned short attr, unsigned char cursor);
void (*changed)(H3270 *session, int bstart, int bend);
void (*update_cursor)(H3270 *session, unsigned short row, unsigned short col, unsigned char c, unsigned short attr);
void (*update_oia)(H3270 *session, LIB3270_FLAG id, unsigned char on);
void (*update_toggle)(H3270 *session, LIB3270_TOGGLE ix, unsigned char value, LIB3270_TOGGLE_TYPE reason, const char *name);
void (*update_luname)(H3270 *session, const char *name);
void (*update_status)(H3270 *session, LIB3270_MESSAGE id);
void (*update_connect)(H3270 *session, unsigned char connected);
void (*update_model)(H3270 *session, const char *name, int model, int rows, int cols);
void (*set_timer)(H3270 *session, unsigned char on);
void (*erase)(H3270 *session);
void (*cursor)(H3270 *session, LIB3270_CURSOR id);
};
#endif // LIB3270_SESSION_H_INCLUDED