Commit 834eada6c19385e4456a047265dbc3502ab53ac2
1 parent
c84d55f2
Exists in
master
and in
3 other branches
Small fixes in the API
Showing
2 changed files
with
13 additions
and
0 deletions
Show diff stats
options.c
| @@ -77,6 +77,16 @@ LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt) | @@ -77,6 +77,16 @@ LIB3270_EXPORT void lib3270_set_options(H3270 *hSession, LIB3270_OPTION opt) | ||
| 77 | hSession->options = opt; | 77 | hSession->options = opt; |
| 78 | } | 78 | } |
| 79 | 79 | ||
| 80 | +LIB3270_EXPORT unsigned short lib3270_get_color_type(H3270 *hSession) | ||
| 81 | +{ | ||
| 82 | + CHECK_SESSION_HANDLE(hSession); | ||
| 83 | + | ||
| 84 | + trace("******************* %d",hSession->colors); | ||
| 85 | + | ||
| 86 | + return hSession->mono ? 2 : hSession->colors; | ||
| 87 | +} | ||
| 88 | + | ||
| 89 | + | ||
| 80 | LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colortype) | 90 | LIB3270_EXPORT int lib3270_set_color_type(H3270 *hSession, unsigned short colortype) |
| 81 | { | 91 | { |
| 82 | CHECK_SESSION_HANDLE(hSession); | 92 | CHECK_SESSION_HANDLE(hSession); |
session.c
| @@ -303,6 +303,9 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char | @@ -303,6 +303,9 @@ static void lib3270_session_init(H3270 *hSession, const char *model, const char | ||
| 303 | hSession->saved_wraparound_mode = 1; | 303 | hSession->saved_wraparound_mode = 1; |
| 304 | hSession->once_cset = -1; | 304 | hSession->once_cset = -1; |
| 305 | hSession->state = LIB3270_ANSI_STATE_DATA; | 305 | hSession->state = LIB3270_ANSI_STATE_DATA; |
| 306 | + hSession->options = LIB3270_OPTION_DEFAULTS; | ||
| 307 | + hSession->colors = 16; | ||
| 308 | + hSession->m3279 = 1; | ||
| 306 | 309 | ||
| 307 | for(f=0;f<4;f++) | 310 | for(f=0;f<4;f++) |
| 308 | hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; | 311 | hSession->csd[f] = hSession->saved_csd[f] = LIB3270_ANSI_CSD_US; |