From 135681d7ccee15fcdebe901a5c8358f5d5c8f3f4 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Mon, 29 Oct 2012 19:00:45 +0000 Subject: [PATCH] Implementando options na caixa de diálogo de host --- api.h | 6 ++++-- host.c | 2 +- session.c | 12 ++++++++++++ sf.c | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/api.h b/api.h index 26aeea5..f30f6b7 100644 --- a/api.h +++ b/api.h @@ -299,7 +299,8 @@ #define CHAR_ATTR_UNCONVERTED LIB3270_ATTR_CG - struct lib3270_option +/* + struct _lib3270_option { const char *name; enum @@ -320,7 +321,8 @@ #define new_3270_session(m) lib3270_session_new(m) - LOCAL_EXTERN const struct lib3270_option * get_3270_option_table(int sz); + LOCAL_EXTERN const struct _lib3270_option * get_3270_option_table(int sz); +*/ /* Set/Get screen contents */ diff --git a/host.c b/host.c index fbd5263..45b6ad4 100644 --- a/host.c +++ b/host.c @@ -607,7 +607,7 @@ static int do_connect(H3270 *hSession, const char *n) */ int lib3270_connect(H3270 *hSession, const char *n, int wait) { - int rc; + int rc; CHECK_SESSION_HANDLE(hSession); diff --git a/session.c b/session.c index 1fabc5b..2f26953 100644 --- a/session.c +++ b/session.c @@ -453,3 +453,15 @@ LIB3270_EXPORT void * lib3270_get_widget(H3270 *h) CHECK_SESSION_HANDLE(h); return h->widget; } + +LIB3270_EXPORT LIB3270_OPTION lib3270_get_options(H3270 *hSession) +{ + CHECK_SESSION_HANDLE(hSession); + return hSession->options; +} + +LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt) +{ + CHECK_SESSION_HANDLE(hSession); + hSession->options = opt; +} diff --git a/sf.c b/sf.c index a5251d7..48cf776 100644 --- a/sf.c +++ b/sf.c @@ -820,7 +820,7 @@ static void do_qr_color(H3270 *hSession) trace_ds(hSession,"> QueryReply(Color)\n"); - color_max = hSession->color8 ? 8: 16; /* report on 8 or 16 colors */ + color_max = (hSession->options & LIB3270_OPTION_COLOR8) ? 8: 16; /* report on 8 or 16 colors */ space3270out(hSession,4 + 2*15); *hSession->obptr++ = 0x00; /* no options */ -- libgit2 0.21.2