Commit eba1b48d6f9f5457361e3479b6b98dceff99a579

Authored by Perry Werneck
1 parent 51082be8

Adding unsigned int properties.

src/include/lib3270/properties.h
@@ -44,13 +44,22 @@ @@ -44,13 +44,22 @@
44 44
45 typedef struct _lib3270_int_property 45 typedef struct _lib3270_int_property
46 { 46 {
47 - const char * name; ///< @brief Property name.  
48 - const char * description; ///< @brief Property description.  
49 - int (*get)(H3270 *hSession); ///< @brief Get value.  
50 - int (*set)(H3270 *hSession, int value); ///< @brief Set value. 47 + const char * name; ///< @brief Property name.
  48 + const char * description; ///< @brief Property description.
  49 + int (*get)(H3270 *hSession); ///< @brief Get value.
  50 + int (*set)(H3270 *hSession, int value); ///< @brief Set value.
51 51
52 } LIB3270_INT_PROPERTY; 52 } LIB3270_INT_PROPERTY;
53 53
  54 + typedef struct _lib3270_uint_property
  55 + {
  56 + const char * name; ///< @brief Property name.
  57 + const char * description; ///< @brief Property description.
  58 + unsigned int (*get)(H3270 *hSession); ///< @brief Get value.
  59 + unsigned int (*set)(H3270 *hSession, unsigned int value); ///< @brief Set value.
  60 +
  61 + } LIB3270_UINT_PROPERTY;
  62 +
54 typedef struct _lib3270_string_property 63 typedef struct _lib3270_string_property
55 { 64 {
56 const char * name; ///< @brief Property name. 65 const char * name; ///< @brief Property name.
@@ -69,7 +78,7 @@ @@ -69,7 +78,7 @@
69 LIB3270_EXPORT const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void); 78 LIB3270_EXPORT const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void);
70 79
71 /** 80 /**
72 - * @brief Get lib3270 integer properties table. 81 + * @brief Get lib3270 signed int properties table.
73 * 82 *
74 * @return The properties table. 83 * @return The properties table.
75 * 84 *
@@ -77,6 +86,14 @@ @@ -77,6 +86,14 @@
77 LIB3270_EXPORT const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void); 86 LIB3270_EXPORT const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void);
78 87
79 /** 88 /**
  89 + * @brief Get lib3270 unsigned signed int properties table.
  90 + *
  91 + * @return The properties table.
  92 + *
  93 + */
  94 + LIB3270_EXPORT const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void);
  95 +
  96 + /**
80 * @brief Get lib3270 string properties table. 97 * @brief Get lib3270 string properties table.
81 * 98 *
82 * @return The properties table. 99 * @return The properties table.
src/lib3270/properties.c
@@ -61,7 +61,8 @@ @@ -61,7 +61,8 @@
61 return hSession->formatted != 0; 61 return hSession->formatted != 0;
62 } 62 }
63 63
64 - const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void) { 64 + const LIB3270_INT_PROPERTY * lib3270_get_boolean_properties_list(void)
  65 + {
65 66
66 static const LIB3270_INT_PROPERTY properties[] = { 67 static const LIB3270_INT_PROPERTY properties[] = {
67 { 68 {
@@ -101,85 +102,85 @@ @@ -101,85 +102,85 @@
101 102
102 { 103 {
103 "pconnected", // Property name. 104 "pconnected", // Property name.
104 - "", // Property description. 105 + "", // Property description.
105 lib3270_pconnected, // Get value. 106 lib3270_pconnected, // Get value.
106 NULL // Set value. 107 NULL // Set value.
107 }, 108 },
108 109
109 { 110 {
110 - "half_connected", // Property name.  
111 - "", // Property description.  
112 - lib3270_half_connected, // Get value.  
113 - NULL // Set value. 111 + "half_connected", // Property name.
  112 + "", // Property description.
  113 + lib3270_half_connected, // Get value.
  114 + NULL // Set value.
114 }, 115 },
115 116
116 { 117 {
117 - "neither", // Property name.  
118 - "", // Property description.  
119 - lib3270_in_neither, // Get value.  
120 - NULL // Set value. 118 + "neither", // Property name.
  119 + "", // Property description.
  120 + lib3270_in_neither, // Get value.
  121 + NULL // Set value.
121 }, 122 },
122 123
123 { 124 {
124 - "ansi", // Property name.  
125 - "", // Property description.  
126 - lib3270_in_ansi, // Get value.  
127 - NULL // Set value. 125 + "ansi", // Property name.
  126 + "", // Property description.
  127 + lib3270_in_ansi, // Get value.
  128 + NULL // Set value.
128 }, 129 },
129 130
130 { 131 {
131 - "tn3270", // Property name.  
132 - N_( "State is 3270, TN3270e or SSCP" ), // Property description.  
133 - lib3270_in_3270, // Get value.  
134 - NULL // Set value. 132 + "tn3270", // Property name.
  133 + N_( "State is 3270, TN3270e or SSCP" ), // Property description.
  134 + lib3270_in_3270, // Get value.
  135 + NULL // Set value.
135 }, 136 },
136 137
137 { 138 {
138 - "sscp", // Property name.  
139 - "", // Property description.  
140 - lib3270_in_sscp, // Get value.  
141 - NULL // Set value. 139 + "sscp", // Property name.
  140 + "", // Property description.
  141 + lib3270_in_sscp, // Get value.
  142 + NULL // Set value.
142 }, 143 },
143 144
144 { 145 {
145 - "tn3270e", // Property name.  
146 - "", // Property description.  
147 - lib3270_in_tn3270e, // Get value.  
148 - NULL // Set value. 146 + "tn3270e", // Property name.
  147 + "", // Property description.
  148 + lib3270_in_tn3270e, // Get value.
  149 + NULL // Set value.
149 }, 150 },
150 151
151 { 152 {
152 - "e", // Property name.  
153 - N_( "Is terminal in the INITIAL_E state?" ), // Property description.  
154 - lib3270_in_e, // Get value.  
155 - NULL // Set value. 153 + "e", // Property name.
  154 + N_( "Is terminal in the INITIAL_E state?" ), // Property description.
  155 + lib3270_in_e, // Get value.
  156 + NULL // Set value.
156 }, 157 },
157 158
158 { 159 {
159 - "has_selection", // Property name.  
160 - N_( "Has selected area" ), // Property description.  
161 - lib3270_has_selection, // Get value.  
162 - NULL // Set value. 160 + "has_selection", // Property name.
  161 + N_( "Has selected area" ), // Property description.
  162 + lib3270_has_selection, // Get value.
  163 + NULL // Set value.
163 }, 164 },
164 165
165 { 166 {
166 - "starting", // Property name.  
167 - N_( "Is starting (no first screen)?" ), // Property description.  
168 - lib3270_is_starting, // Get value.  
169 - NULL // Set value. 167 + "starting", // Property name.
  168 + N_( "Is starting (no first screen)?" ), // Property description.
  169 + lib3270_is_starting, // Get value.
  170 + NULL // Set value.
170 }, 171 },
171 172
172 { 173 {
173 - "formatted", // Property name.  
174 - N_( "Formatted screen" ), // Property description.  
175 - lib3270_get_formatted, // Get value.  
176 - NULL // Set value. 174 + "formatted", // Property name.
  175 + N_( "Formatted screen" ), // Property description.
  176 + lib3270_get_formatted, // Get value.
  177 + NULL // Set value.
177 }, 178 },
178 179
179 /* 180 /*
180 { 181 {
181 "", // Property name. 182 "", // Property name.
182 - "", // Property description. 183 + "", // Property description.
183 NULL, // Get value. 184 NULL, // Get value.
184 NULL // Set value. 185 NULL // Set value.
185 }, 186 },
@@ -198,29 +199,55 @@ @@ -198,29 +199,55 @@
198 199
199 } 200 }
200 201
201 - const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void) { 202 + const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void)
  203 + {
  204 +
  205 + static const LIB3270_UINT_PROPERTY properties[] = {
  206 +
  207 + /*
  208 + {
  209 + "", // Property name.
  210 + "", // Property description.
  211 + NULL, // Get value.
  212 + NULL // Set value.
  213 + },
  214 + */
  215 +
  216 + {
  217 + NULL,
  218 + NULL,
  219 + NULL,
  220 + NULL
  221 + }
  222 + };
  223 +
  224 + return properties;
  225 + }
  226 +
  227 + const LIB3270_INT_PROPERTY * lib3270_get_int_properties_list(void)
  228 + {
202 229
203 static const LIB3270_INT_PROPERTY properties[] = { 230 static const LIB3270_INT_PROPERTY properties[] = {
204 231
205 { 232 {
206 - "cursor_address", // Property name.  
207 - N_( "Cursor address" ), // Property description.  
208 - lib3270_get_cursor_address, // Get value.  
209 - lib3270_set_cursor_address // Set value. 233 + "cursor_address", // Property name.
  234 + N_( "Cursor address" ), // Property description.
  235 + lib3270_get_cursor_address, // Get value.
  236 + lib3270_set_cursor_address // Set value.
210 }, 237 },
211 238
212 { 239 {
213 - "model_number", // Property name.  
214 - N_( "The model number" ), // Property description.  
215 - lib3270_get_model_number, // Get value.  
216 - NULL // Set value. 240 + "model_number", // Property name.
  241 + N_( "The model number" ), // Property description.
  242 + lib3270_get_model_number, // Get value.
  243 + NULL // Set value.
217 }, 244 },
218 245
219 { 246 {
220 - "color_type", // Property name.  
221 - N_( "The color type" ), // Property description.  
222 - lib3270_get_color_type, // Get value.  
223 - lib3270_set_color_type // Set value. 247 + "color_type", // Property name.
  248 + N_( "The color type" ), // Property description.
  249 + lib3270_get_color_type, // Get value.
  250 + lib3270_set_color_type // Set value.
224 }, 251 },
225 252
226 { 253 {