From 1b44d89d839c0d4d672e31a95ae7d050f79cf612 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 30 Sep 2019 12:52:31 -0300 Subject: [PATCH] Adjustments in the action & property tables. --- src/core/actions/actions.c | 4 ++-- src/core/actions/table.c | 2 +- src/core/util.c | 4 ++-- src/include/lib3270.h | 2 +- src/selection/selection.c | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/actions/actions.c b/src/core/actions/actions.c index 32f3c9b..c83ead2 100644 --- a/src/core/actions/actions.c +++ b/src/core/actions/actions.c @@ -33,7 +33,7 @@ /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ -LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_action(const char *name) +const LIB3270_ACTION * lib3270_get_action(const char *name) { const LIB3270_ACTION * actions = lib3270_get_actions(); size_t f; @@ -50,7 +50,7 @@ LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_action(const char *name) LIB3270_EXPORT int lib3270_action_is_activatable(const LIB3270_ACTION *action, H3270 *hSession) { - return action->activatable(hSession); + return action->activatable(hSession) > 0; } LIB3270_EXPORT int lib3270_action_activate(const LIB3270_ACTION *action, H3270 *hSession) diff --git a/src/core/actions/table.c b/src/core/actions/table.c index 52c9806..c683d41 100644 --- a/src/core/actions/table.c +++ b/src/core/actions/table.c @@ -68,7 +68,7 @@ * @brief Get LIB3270 action table; * */ - LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_actions() + const LIB3270_ACTION * lib3270_get_actions() { static const LIB3270_ACTION actions[] = diff --git a/src/core/util.c b/src/core/util.c index 22ad2a5..67f44c3 100644 --- a/src/core/util.c +++ b/src/core/util.c @@ -614,7 +614,7 @@ LIB3270_EXPORT int lib3270_print_selected(H3270 *hSession) if(check_online_session(hSession)) return errno = ENOTCONN; - if(lib3270_has_selection(hSession)) + if(hSession->selected) return hSession->cbk.print(hSession,LIB3270_CONTENT_SELECTED); return errno = ENODATA; @@ -651,7 +651,7 @@ LIB3270_EXPORT int lib3270_save_all(H3270 *hSession, const char *filename) LIB3270_EXPORT int lib3270_save_selected(H3270 *hSession, const char *filename) { - if(lib3270_has_selection(hSession)) + if(hSession->selected) return lib3270_save(hSession,LIB3270_CONTENT_SELECTED,filename); return errno = ENODATA; diff --git a/src/include/lib3270.h b/src/include/lib3270.h index af3b97b..bdf9c2a 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -1082,7 +1082,7 @@ * * @param hSession Session handle. * - * @return Non zero if the terminal has selected area, 0 if not. + * @return Greater than zero if the terminal has selected area, 0 if not. * */ LIB3270_EXPORT int lib3270_has_selection(const H3270 *hSession); diff --git a/src/selection/selection.c b/src/selection/selection.c index 031a6b4..7e7c58a 100644 --- a/src/selection/selection.c +++ b/src/selection/selection.c @@ -396,7 +396,7 @@ LIB3270_EXPORT int lib3270_has_selection(const H3270 *hSession) if(check_online_session(hSession)) return 0; - return (hSession->selected != 0); + return hSession->selected; } LIB3270_EXPORT int lib3270_get_selection_rectangle(H3270 *hSession, unsigned int *row, unsigned int *col, unsigned int *width, unsigned int *height) -- libgit2 0.21.2