From 834eada6c19385e4456a047265dbc3502ab53ac2 Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Tue, 10 Dec 2013 10:22:42 +0000 Subject: [PATCH] Small fixes in the API --- options.c | 10 ++++++++++ session.c | 3 +++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/options.c b/options.c index 8aca9f0..588b62e 100644 --- a/options.c +++ b/options.c @@ -77,6 +77,16 @@ LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt) hSession->options = opt; } +LIB3270_EXPORT unsigned short lib3270_get_color_type(H3270 *hSession) +{ + CHECK_SESSION_HANDLE(hSession); + + trace("******************* %d",hSession->colors); + + return hSession->mono ? 2 : hSession->colors; +} + + LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colortype) { CHECK_SESSION_HANDLE(hSession); diff --git a/session.c b/session.c index ec16fdd..7ddde39 100644 --- a/session.c +++ b/session.c @@ -303,6 +303,9 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char hSession->saved_wraparound_mode = 1; hSession->once_cset = -1; hSession->state = LIB3270_ANSI_STATE_DATA; + hSession->options = LIB3270_OPTION_DEFAULTS; + hSession->colors = 16; + hSession->m3279 = 1; for(f=0;f<4;f++) hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; -- libgit2 0.21.2