From eba1b48d6f9f5457361e3479b6b98dceff99a579 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 17 Jul 2019 10:50:08 -0300 Subject: [PATCH] Adding unsigned int properties. --- src/include/lib3270/properties.h | 27 ++++++++++++++++++++++----- src/lib3270/properties.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------- 2 files changed, 105 insertions(+), 61 deletions(-) diff --git a/src/include/lib3270/properties.h b/src/include/lib3270/properties.h index bdddf86..bd56699 100644 --- a/src/include/lib3270/properties.h +++ b/src/include/lib3270/properties.h @@ -44,13 +44,22 @@ typedef struct _lib3270_int_property { - const char * name; ///< @brief Property name. - const char * description; ///< @brief Property description. - int (*get)(H3270 *hSession); ///< @brief Get value. - int (*set)(H3270 *hSession, int value); ///< @brief Set value. + const char * name; ///< @brief Property name. + const char * description; ///< @brief Property description. + int (*get)(H3270 *hSession); ///< @brief Get value. + int (*set)(H3270 *hSession, int value); ///< @brief Set value. } LIB3270_INT_PROPERTY; + typedef struct _lib3270_uint_property + { + const char * name; ///< @brief Property name. + const char * description; ///< @brief Property description. + unsigned int (*get)(H3270 *hSession); ///< @brief Get value. + unsigned int (*set)(H3270 *hSession, unsigned int value); ///< @brief Set value. + + } LIB3270_UINT_PROPERTY; + typedef struct _lib3270_string_property { const char * name; ///< @brief Property name. @@ -69,7 +78,7 @@ LIB3270_EXPORT const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void); /** - * @brief Get lib3270 integer properties table. + * @brief Get lib3270 signed int properties table. * * @return The properties table. * @@ -77,6 +86,14 @@ LIB3270_EXPORT const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void); /** + * @brief Get lib3270 unsigned signed int properties table. + * + * @return The properties table. + * + */ + LIB3270_EXPORT const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void); + + /** * @brief Get lib3270 string properties table. * * @return The properties table. diff --git a/src/lib3270/properties.c b/src/lib3270/properties.c index 24791f4..81a1f25 100644 --- a/src/lib3270/properties.c +++ b/src/lib3270/properties.c @@ -61,7 +61,8 @@ return hSession->formatted != 0; } - const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) { + const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) + { static const LIB3270_INT_PROPERTY properties[] = { { @@ -101,85 +102,85 @@ { "pconnected", // Property name. - "", // Property description. + "", // Property description. lib3270_pconnected, // Get value. NULL // Set value. }, { - "half_connected", // Property name. - "", // Property description. - lib3270_half_connected, // Get value. - NULL // Set value. + "half_connected", // Property name. + "", // Property description. + lib3270_half_connected, // Get value. + NULL // Set value. }, { - "neither", // Property name. - "", // Property description. - lib3270_in_neither, // Get value. - NULL // Set value. + "neither", // Property name. + "", // Property description. + lib3270_in_neither, // Get value. + NULL // Set value. }, { - "ansi", // Property name. - "", // Property description. - lib3270_in_ansi, // Get value. - NULL // Set value. + "ansi", // Property name. + "", // Property description. + lib3270_in_ansi, // Get value. + NULL // Set value. }, { - "tn3270", // Property name. - N_( "State is 3270, TN3270e or SSCP" ), // Property description. - lib3270_in_3270, // Get value. - NULL // Set value. + "tn3270", // Property name. + N_( "State is 3270, TN3270e or SSCP" ), // Property description. + lib3270_in_3270, // Get value. + NULL // Set value. }, { - "sscp", // Property name. - "", // Property description. - lib3270_in_sscp, // Get value. - NULL // Set value. + "sscp", // Property name. + "", // Property description. + lib3270_in_sscp, // Get value. + NULL // Set value. }, { - "tn3270e", // Property name. - "", // Property description. - lib3270_in_tn3270e, // Get value. - NULL // Set value. + "tn3270e", // Property name. + "", // Property description. + lib3270_in_tn3270e, // Get value. + NULL // Set value. }, { - "e", // Property name. - N_( "Is terminal in the INITIAL_E state?" ), // Property description. - lib3270_in_e, // Get value. - NULL // Set value. + "e", // Property name. + N_( "Is terminal in the INITIAL_E state?" ), // Property description. + lib3270_in_e, // Get value. + NULL // Set value. }, { - "has_selection", // Property name. - N_( "Has selected area" ), // Property description. - lib3270_has_selection, // Get value. - NULL // Set value. + "has_selection", // Property name. + N_( "Has selected area" ), // Property description. + lib3270_has_selection, // Get value. + NULL // Set value. }, { - "starting", // Property name. - N_( "Is starting (no first screen)?" ), // Property description. - lib3270_is_starting, // Get value. - NULL // Set value. + "starting", // Property name. + N_( "Is starting (no first screen)?" ), // Property description. + lib3270_is_starting, // Get value. + NULL // Set value. }, { - "formatted", // Property name. - N_( "Formatted screen" ), // Property description. - lib3270_get_formatted, // Get value. - NULL // Set value. + "formatted", // Property name. + N_( "Formatted screen" ), // Property description. + lib3270_get_formatted, // Get value. + NULL // Set value. }, /* { "", // Property name. - "", // Property description. + "", // Property description. NULL, // Get value. NULL // Set value. }, @@ -198,29 +199,55 @@ } - const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void) { + const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) + { + + static const LIB3270_UINT_PROPERTY properties[] = { + + /* + { + "", // Property name. + "", // Property description. + NULL, // Get value. + NULL // Set value. + }, + */ + + { + NULL, + NULL, + NULL, + NULL + } + }; + + return properties; + } + + const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void) + { static const LIB3270_INT_PROPERTY properties[] = { { - "cursor_address", // Property name. - N_( "Cursor address" ), // Property description. - lib3270_get_cursor_address, // Get value. - lib3270_set_cursor_address // Set value. + "cursor_address", // Property name. + N_( "Cursor address" ), // Property description. + lib3270_get_cursor_address, // Get value. + lib3270_set_cursor_address // Set value. }, { - "model_number", // Property name. - N_( "The model number" ), // Property description. - lib3270_get_model_number, // Get value. - NULL // Set value. + "model_number", // Property name. + N_( "The model number" ), // Property description. + lib3270_get_model_number, // Get value. + NULL // Set value. }, { - "color_type", // Property name. - N_( "The color type" ), // Property description. - lib3270_get_color_type, // Get value. - lib3270_set_color_type // Set value. + "color_type", // Property name. + N_( "The color type" ), // Property description. + lib3270_get_color_type, // Get value. + lib3270_set_color_type // Set value. }, { -- libgit2 0.21.2