Commit 1b44d89d839c0d4d672e31a95ae7d050f79cf612

Authored by Perry Werneck
1 parent 22a5863a

Adjustments in the action & property tables.

src/core/actions/actions.c
@@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
33 33
34 /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/ 34 /*---[ Implement ]------------------------------------------------------------------------------------------------------------*/
35 35
36 -LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_action(const char *name) 36 +const LIB3270_ACTION * lib3270_get_action(const char *name)
37 { 37 {
38 const LIB3270_ACTION * actions = lib3270_get_actions(); 38 const LIB3270_ACTION * actions = lib3270_get_actions();
39 size_t f; 39 size_t f;
@@ -50,7 +50,7 @@ LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_action(const char *name) @@ -50,7 +50,7 @@ LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_action(const char *name)
50 50
51 LIB3270_EXPORT int lib3270_action_is_activatable(const LIB3270_ACTION *action, H3270 *hSession) 51 LIB3270_EXPORT int lib3270_action_is_activatable(const LIB3270_ACTION *action, H3270 *hSession)
52 { 52 {
53 - return action->activatable(hSession); 53 + return action->activatable(hSession) > 0;
54 } 54 }
55 55
56 LIB3270_EXPORT int lib3270_action_activate(const LIB3270_ACTION *action, H3270 *hSession) 56 LIB3270_EXPORT int lib3270_action_activate(const LIB3270_ACTION *action, H3270 *hSession)
src/core/actions/table.c
@@ -68,7 +68,7 @@ @@ -68,7 +68,7 @@
68 * @brief Get LIB3270 action table; 68 * @brief Get LIB3270 action table;
69 * 69 *
70 */ 70 */
71 - LIB3270_EXPORT const LIB3270_ACTION * lib3270_get_actions() 71 + const LIB3270_ACTION * lib3270_get_actions()
72 { 72 {
73 73
74 static const LIB3270_ACTION actions[] = 74 static const LIB3270_ACTION actions[] =
src/core/util.c
@@ -614,7 +614,7 @@ LIB3270_EXPORT int lib3270_print_selected(H3270 *hSession) @@ -614,7 +614,7 @@ LIB3270_EXPORT int lib3270_print_selected(H3270 *hSession)
614 if(check_online_session(hSession)) 614 if(check_online_session(hSession))
615 return errno = ENOTCONN; 615 return errno = ENOTCONN;
616 616
617 - if(lib3270_has_selection(hSession)) 617 + if(hSession->selected)
618 return hSession->cbk.print(hSession,LIB3270_CONTENT_SELECTED); 618 return hSession->cbk.print(hSession,LIB3270_CONTENT_SELECTED);
619 619
620 return errno = ENODATA; 620 return errno = ENODATA;
@@ -651,7 +651,7 @@ LIB3270_EXPORT int lib3270_save_all(H3270 *hSession, const char *filename) @@ -651,7 +651,7 @@ LIB3270_EXPORT int lib3270_save_all(H3270 *hSession, const char *filename)
651 651
652 LIB3270_EXPORT int lib3270_save_selected(H3270 *hSession, const char *filename) 652 LIB3270_EXPORT int lib3270_save_selected(H3270 *hSession, const char *filename)
653 { 653 {
654 - if(lib3270_has_selection(hSession)) 654 + if(hSession->selected)
655 return lib3270_save(hSession,LIB3270_CONTENT_SELECTED,filename); 655 return lib3270_save(hSession,LIB3270_CONTENT_SELECTED,filename);
656 656
657 return errno = ENODATA; 657 return errno = ENODATA;
src/include/lib3270.h
@@ -1082,7 +1082,7 @@ @@ -1082,7 +1082,7 @@
1082 * 1082 *
1083 * @param hSession Session handle. 1083 * @param hSession Session handle.
1084 * 1084 *
1085 - * @return Non zero if the terminal has selected area, 0 if not. 1085 + * @return Greater than zero if the terminal has selected area, 0 if not.
1086 * 1086 *
1087 */ 1087 */
1088 LIB3270_EXPORT int lib3270_has_selection(const H3270 *hSession); 1088 LIB3270_EXPORT int lib3270_has_selection(const H3270 *hSession);
src/selection/selection.c
@@ -396,7 +396,7 @@ LIB3270_EXPORT int lib3270_has_selection(const H3270 *hSession) @@ -396,7 +396,7 @@ LIB3270_EXPORT int lib3270_has_selection(const H3270 *hSession)
396 if(check_online_session(hSession)) 396 if(check_online_session(hSession))
397 return 0; 397 return 0;
398 398
399 - return (hSession->selected != 0); 399 + return hSession->selected;
400 } 400 }
401 401
402 LIB3270_EXPORT int lib3270_get_selection_rectangle(H3270 *hSession, unsigned int *row, unsigned int *col, unsigned int *width, unsigned int *height) 402 LIB3270_EXPORT int lib3270_get_selection_rectangle(H3270 *hSession, unsigned int *row, unsigned int *col, unsigned int *width, unsigned int *height)