From 7efab0c3e286f9d3c9bbe524f2c61e0a8743513b Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Mon, 11 Mar 2013 18:53:32 +0000 Subject: [PATCH] Implementando sinal e callback para impressão do conteúdo da tela --- session.c | 7 +++++++ util.c | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/session.c b/session.c index ae32dd6..8c518ad 100644 --- a/session.c +++ b/session.c @@ -138,6 +138,12 @@ static void set_cursor(H3270 *session, LIB3270_CURSOR id) { } +static int print(H3270 *session) +{ + lib3270_write_log(session, "print", "%s", "Printing is unavailable"); + return -1; +} + static void message(H3270 *session, LIB3270_NOTIFY id , const char *title, const char *msg, const char *text) { #ifdef ANDROID @@ -203,6 +209,7 @@ static void lib3270_session_init(H3270 *hSession, const char *model) hSession->update_status = (void (*)(H3270 *, LIB3270_STATUS)) nop_int; hSession->autostart = nop; hSession->set_timer = set_timer; + hSession->print = print; // Set the defaults. hSession->extended = 1; diff --git a/util.c b/util.c index 44612f7..5895599 100644 --- a/util.c +++ b/util.c @@ -1020,5 +1020,7 @@ int gettimeofday(struct timeval *tv, void *ignored) LIB3270_EXPORT int lib3270_print(H3270 *h) { - return -1; + CHECK_SESSION_HANDLE(h); + trace("%s(%p)",__FUNCTION__,h); + return h->print(h); } -- libgit2 0.21.2