Commit 4aec5185ef648944e3702e6d4c3f11396f27bd88
1 parent
dfe54d12
Exists in
master
and in
3 other branches
Cleaning unused methods.
Showing
7 changed files
with
38 additions
and
34 deletions
Show diff stats
src/core/ctlr.c
@@ -126,28 +126,25 @@ void ctlr_init(H3270 *session, unsigned GNUC_UNUSED(cmask)) | @@ -126,28 +126,25 @@ void ctlr_init(H3270 *session, unsigned GNUC_UNUSED(cmask)) | ||
126 | } | 126 | } |
127 | 127 | ||
128 | /** | 128 | /** |
129 | - * @brief Reinitialize the emulated 3270 hardware. | 129 | + * @brief Reinitialize the emulated 3270 hardware on model change |
130 | */ | 130 | */ |
131 | -void ctlr_reinit(H3270 *session, unsigned cmask) | 131 | +void ctlr_model_changed(H3270 *session) |
132 | { | 132 | { |
133 | - if (cmask & MODEL_CHANGE) | ||
134 | - { | ||
135 | - /* Allocate buffers */ | ||
136 | - struct lib3270_ea *tmp; | ||
137 | - size_t sz = (session->max.rows * session->max.cols); | 133 | + // Allocate buffers |
134 | + struct lib3270_ea *tmp; | ||
135 | + size_t sz = (session->max.rows * session->max.cols); | ||
138 | 136 | ||
139 | - session->buffer[0] = tmp = lib3270_calloc(sizeof(struct lib3270_ea), sz+1, session->buffer[0]); | ||
140 | - session->ea_buf = tmp + 1; | 137 | + session->buffer[0] = tmp = lib3270_calloc(sizeof(struct lib3270_ea), sz+1, session->buffer[0]); |
138 | + session->ea_buf = tmp + 1; | ||
141 | 139 | ||
142 | - session->buffer[1] = tmp = lib3270_calloc(sizeof(struct lib3270_ea),sz+1,session->buffer[1]); | ||
143 | - session->aea_buf = tmp + 1; | 140 | + session->buffer[1] = tmp = lib3270_calloc(sizeof(struct lib3270_ea),sz+1,session->buffer[1]); |
141 | + session->aea_buf = tmp + 1; | ||
144 | 142 | ||
145 | - session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); | ||
146 | - session->zero_buf = lib3270_calloc(sizeof(struct lib3270_ea),sz,session->zero_buf); | 143 | + session->text = lib3270_calloc(sizeof(struct lib3270_text),sz,session->text); |
144 | + session->zero_buf = lib3270_calloc(sizeof(struct lib3270_ea),sz,session->zero_buf); | ||
147 | 145 | ||
148 | - session->cursor_addr = 0; | ||
149 | - session->buffer_addr = 0; | ||
150 | - } | 146 | + session->cursor_addr = 0; |
147 | + session->buffer_addr = 0; | ||
151 | } | 148 | } |
152 | 149 | ||
153 | void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) | 150 | void ctlr_set_rows_cols(H3270 *session, int mn, int ovc, int ovr) |
src/core/model.c
@@ -72,7 +72,7 @@ | @@ -72,7 +72,7 @@ | ||
72 | } | 72 | } |
73 | 73 | ||
74 | ctlr_set_rows_cols(hSession, hSession->model_num, ovc, ovr); | 74 | ctlr_set_rows_cols(hSession, hSession->model_num, ovc, ovr); |
75 | - ctlr_reinit(hSession,MODEL_CHANGE); | 75 | + ctlr_model_changed(hSession); |
76 | screen_update(hSession,0,hSession->view.rows*hSession->view.cols); | 76 | screen_update(hSession,0,hSession->view.rows*hSession->view.cols); |
77 | 77 | ||
78 | return 0; | 78 | return 0; |
@@ -232,7 +232,7 @@ int lib3270_set_model(H3270 *hSession, const char *model) | @@ -232,7 +232,7 @@ int lib3270_set_model(H3270 *hSession, const char *model) | ||
232 | } | 232 | } |
233 | 233 | ||
234 | ctlr_set_rows_cols(hSession, model_number, ovc, ovr); | 234 | ctlr_set_rows_cols(hSession, model_number, ovc, ovr); |
235 | - ctlr_reinit(hSession,MODEL_CHANGE); | 235 | + ctlr_model_changed(hSession); |
236 | screen_update(hSession,0,hSession->view.rows*hSession->view.cols); | 236 | screen_update(hSession,0,hSession->view.rows*hSession->view.cols); |
237 | 237 | ||
238 | return 0; | 238 | return 0; |
src/core/screen.c
@@ -154,7 +154,7 @@ int screen_init(H3270 *session) | @@ -154,7 +154,7 @@ int screen_init(H3270 *session) | ||
154 | 154 | ||
155 | /* Set up the controller. */ | 155 | /* Set up the controller. */ |
156 | ctlr_init(session,-1); | 156 | ctlr_init(session,-1); |
157 | - ctlr_reinit(session,-1); | 157 | + ctlr_model_changed(session); |
158 | 158 | ||
159 | /* Finish screen initialization. */ | 159 | /* Finish screen initialization. */ |
160 | session->cbk.suspend(session); | 160 | session->cbk.suspend(session); |
src/core/telnet.c
@@ -41,6 +41,10 @@ | @@ -41,6 +41,10 @@ | ||
41 | #include <windows.h> | 41 | #include <windows.h> |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | +#ifdef __MINGW32__ | ||
45 | + #include <sys/time.h> | ||
46 | +#endif | ||
47 | + | ||
44 | #ifndef ANDROID | 48 | #ifndef ANDROID |
45 | #include <stdlib.h> | 49 | #include <stdlib.h> |
46 | #endif // !ANDROID | 50 | #endif // !ANDROID |
@@ -2312,6 +2316,7 @@ void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, in | @@ -2312,6 +2316,7 @@ void trace_netdata(H3270 *hSession, char direction, unsigned const char *buf, in | ||
2312 | double tdiff; | 2316 | double tdiff; |
2313 | 2317 | ||
2314 | (void) gettimeofday(&ts, (struct timezone *)NULL); | 2318 | (void) gettimeofday(&ts, (struct timezone *)NULL); |
2319 | + | ||
2315 | if (IN_3270) | 2320 | if (IN_3270) |
2316 | { | 2321 | { |
2317 | tdiff = ((1.0e6 * (double)(ts.tv_sec - hSession->ds_ts.tv_sec)) + | 2322 | tdiff = ((1.0e6 * (double)(ts.tv_sec - hSession->ds_ts.tv_sec)) + |
src/core/windows/util.c
@@ -235,7 +235,8 @@ LIB3270_EXPORT const char * lib3270_win32_local_charset(void) | @@ -235,7 +235,8 @@ LIB3270_EXPORT const char * lib3270_win32_local_charset(void) | ||
235 | #define SECS_BETWEEN_EPOCHS 11644473600ULL | 235 | #define SECS_BETWEEN_EPOCHS 11644473600ULL |
236 | #define SECS_TO_100NS 10000000ULL /* 10^7 */ | 236 | #define SECS_TO_100NS 10000000ULL /* 10^7 */ |
237 | 237 | ||
238 | -int gettimeofday(struct timeval *tv, void GNUC_UNUSED(*ignored)) | 238 | +/* |
239 | +int gettimeofday(struct timeval *tv, struct timezone GNUC_UNUSED(*ignored)) | ||
239 | { | 240 | { |
240 | FILETIME t; | 241 | FILETIME t; |
241 | ULARGE_INTEGER u; | 242 | ULARGE_INTEGER u; |
@@ -243,11 +244,12 @@ int gettimeofday(struct timeval *tv, void GNUC_UNUSED(*ignored)) | @@ -243,11 +244,12 @@ int gettimeofday(struct timeval *tv, void GNUC_UNUSED(*ignored)) | ||
243 | GetSystemTimeAsFileTime(&t); | 244 | GetSystemTimeAsFileTime(&t); |
244 | memcpy(&u, &t, sizeof(ULARGE_INTEGER)); | 245 | memcpy(&u, &t, sizeof(ULARGE_INTEGER)); |
245 | 246 | ||
246 | - /* Isolate seconds and move epochs. */ | 247 | + // Isolate seconds and move epochs. |
247 | tv->tv_sec = (DWORD)((u.QuadPart / SECS_TO_100NS) - SECS_BETWEEN_EPOCHS); | 248 | tv->tv_sec = (DWORD)((u.QuadPart / SECS_TO_100NS) - SECS_BETWEEN_EPOCHS); |
248 | tv->tv_usec = (u.QuadPart % SECS_TO_100NS) / 10ULL; | 249 | tv->tv_usec = (u.QuadPart % SECS_TO_100NS) / 10ULL; |
249 | return 0; | 250 | return 0; |
250 | } | 251 | } |
252 | +*/ | ||
251 | 253 | ||
252 | LIB3270_EXPORT char * lib3270_get_installation_path() | 254 | LIB3270_EXPORT char * lib3270_get_installation_path() |
253 | { | 255 | { |
src/include/ctlrc.h
@@ -54,7 +54,7 @@ LIB3270_INTERNAL void ctlr_erase_all_unprotected(H3270 *hSession); | @@ -54,7 +54,7 @@ LIB3270_INTERNAL void ctlr_erase_all_unprotected(H3270 *hSession); | ||
54 | LIB3270_INTERNAL void ctlr_init(H3270 *session, unsigned cmask); | 54 | LIB3270_INTERNAL void ctlr_init(H3270 *session, unsigned cmask); |
55 | LIB3270_INTERNAL void ctlr_read_buffer(H3270 *session, unsigned char aid_byte); | 55 | LIB3270_INTERNAL void ctlr_read_buffer(H3270 *session, unsigned char aid_byte); |
56 | LIB3270_INTERNAL void ctlr_read_modified(H3270 *hSession, unsigned char aid_byte, Boolean all); | 56 | LIB3270_INTERNAL void ctlr_read_modified(H3270 *hSession, unsigned char aid_byte, Boolean all); |
57 | -LIB3270_INTERNAL void ctlr_reinit(H3270 *session, unsigned cmask); | 57 | +LIB3270_INTERNAL void ctlr_model_changed(H3270 *session); |
58 | LIB3270_INTERNAL void ctlr_scroll(H3270 *hSession); | 58 | LIB3270_INTERNAL void ctlr_scroll(H3270 *hSession); |
59 | LIB3270_INTERNAL void ctlr_wrapping_memmove(H3270 *session, int baddr_to, int baddr_from, int count); | 59 | LIB3270_INTERNAL void ctlr_wrapping_memmove(H3270 *session, int baddr_to, int baddr_from, int count); |
60 | LIB3270_INTERNAL enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean erase); | 60 | LIB3270_INTERNAL enum pds ctlr_write(H3270 *hSession, unsigned char buf[], int buflen, Boolean erase); |
src/include/lib3270-internals.h
@@ -166,11 +166,11 @@ LIB3270_INTERNAL const char * build_rpq_revision; | @@ -166,11 +166,11 @@ LIB3270_INTERNAL const char * build_rpq_revision; | ||
166 | 166 | ||
167 | /** | 167 | /** |
168 | * @brief toggle names | 168 | * @brief toggle names |
169 | - */ | 169 | + */ /* |
170 | struct toggle_name { | 170 | struct toggle_name { |
171 | const char *name; | 171 | const char *name; |
172 | int index; | 172 | int index; |
173 | -}; | 173 | +}; */ |
174 | 174 | ||
175 | /// @brief State macros | 175 | /// @brief State macros |
176 | #define PCONNECTED lib3270_pconnected(hSession) | 176 | #define PCONNECTED lib3270_pconnected(hSession) |
@@ -205,13 +205,13 @@ struct toggle_name { | @@ -205,13 +205,13 @@ struct toggle_name { | ||
205 | #define Replace(var, value) { lib3270_free(var); var = (value); }; | 205 | #define Replace(var, value) { lib3270_free(var); var = (value); }; |
206 | 206 | ||
207 | /// @brief Configuration change masks. | 207 | /// @brief Configuration change masks. |
208 | -#define NO_CHANGE 0x0000 /// @brief no change | ||
209 | -#define MODEL_CHANGE 0x0001 /// @brief screen dimensions changed | ||
210 | -#define FONT_CHANGE 0x0002 /// @brief emulator font changed | ||
211 | -#define COLOR_CHANGE 0x0004 /// @brief color scheme or 3278/9 mode changed | ||
212 | -#define SCROLL_CHANGE 0x0008 /// @brief scrollbar snapped on or off | ||
213 | -#define CHARSET_CHANGE 0x0010 /// @brief character set changed | ||
214 | -#define ALL_CHANGE 0xffff /// @brief everything changed | 208 | +//#define NO_CHANGE 0x0000 /// @brief no change |
209 | +// #define MODEL_CHANGE 0x0001 /// @brief screen dimensions changed | ||
210 | +//#define FONT_CHANGE 0x0002 /// @brief emulator font changed | ||
211 | +//#define COLOR_CHANGE 0x0004 /// @brief color scheme or 3278/9 mode changed | ||
212 | +//#define SCROLL_CHANGE 0x0008 /// @brief scrollbar snapped on or off | ||
213 | +//#define CHARSET_CHANGE 0x0010 /// @brief character set changed | ||
214 | +// #define ALL_CHANGE 0xffff /// @brief everything changed | ||
215 | 215 | ||
216 | /* Portability macros */ | 216 | /* Portability macros */ |
217 | 217 | ||
@@ -234,13 +234,13 @@ struct toggle_name { | @@ -234,13 +234,13 @@ struct toggle_name { | ||
234 | #define DFT_BUF (4 * 1024) | 234 | #define DFT_BUF (4 * 1024) |
235 | #endif /*]*/ | 235 | #endif /*]*/ |
236 | 236 | ||
237 | -/* DBCS Preedit Types */ | ||
238 | -#if defined(X3270_DBCS) /*[*/ | 237 | +/* DBCS Preedit Types */ /* |
238 | +#if defined(X3270_DBCS) | ||
239 | #define PT_ROOT "Root" | 239 | #define PT_ROOT "Root" |
240 | #define PT_OVER_THE_SPOT "OverTheSpot" | 240 | #define PT_OVER_THE_SPOT "OverTheSpot" |
241 | #define PT_OFF_THE_SPOT "OffTheSpot" | 241 | #define PT_OFF_THE_SPOT "OffTheSpot" |
242 | #define PT_ON_THE_SPOT "OnTheSpot" | 242 | #define PT_ON_THE_SPOT "OnTheSpot" |
243 | -#endif /*]*/ | 243 | +#endif */ |
244 | 244 | ||
245 | /** | 245 | /** |
246 | * @brief input key type | 246 | * @brief input key type |