Commit 7efab0c3e286f9d3c9bbe524f2c61e0a8743513b
1 parent
ad2110e0
Exists in
master
and in
3 other branches
Implementando sinal e callback para impressão do conteúdo da tela
Showing
2 changed files
with
10 additions
and
1 deletions
Show diff stats
session.c
@@ -138,6 +138,12 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id) | @@ -138,6 +138,12 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id) | ||
138 | { | 138 | { |
139 | } | 139 | } |
140 | 140 | ||
141 | +static int print(H3270 *session) | ||
142 | +{ | ||
143 | + lib3270_write_log(session, "print", "%s", "Printing is unavailable"); | ||
144 | + return -1; | ||
145 | +} | ||
146 | + | ||
141 | static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text) | 147 | static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text) |
142 | { | 148 | { |
143 | #ifdef ANDROID | 149 | #ifdef ANDROID |
@@ -203,6 +209,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | @@ -203,6 +209,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) | ||
203 | hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; | 209 | hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; |
204 | hSession->autostart = nop; | 210 | hSession->autostart = nop; |
205 | hSession->set_timer = set_timer; | 211 | hSession->set_timer = set_timer; |
212 | + hSession->print = print; | ||
206 | 213 | ||
207 | // Set the defaults. | 214 | // Set the defaults. |
208 | hSession->extended = 1; | 215 | hSession->extended = 1; |
util.c
@@ -1020,5 +1020,7 @@ int gettimeofday(struct timeval *tv, void *ignored) | @@ -1020,5 +1020,7 @@ int gettimeofday(struct timeval *tv, void *ignored) | ||
1020 | 1020 | ||
1021 | LIB3270_EXPORT int lib3270_print(H3270 *h) | 1021 | LIB3270_EXPORT int lib3270_print(H3270 *h) |
1022 | { | 1022 | { |
1023 | - return -1; | 1023 | + CHECK_SESSION_HANDLE(h); |
1024 | + trace("%s(%p)",__FUNCTION__,h); | ||
1025 | + return h->print(h); | ||
1024 | } | 1026 | } |