Commit 147e18757bc93372807fc7cd16bffcf25c88906b
1 parent
725b8136
Exists in
master
and in
3 other branches
Adding host-type property as an unsigned int value for saving in the
session properties.
Showing
2 changed files
with
34 additions
and
12 deletions
Show diff stats
src/core/properties/string.c
... | ... | @@ -79,19 +79,19 @@ |
79 | 79 | }, |
80 | 80 | |
81 | 81 | { |
82 | - .name = "model", // Property name. | |
82 | + .name = "model", // Property name. | |
83 | 83 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
84 | - .description = N_( "Model name" ), // Property description. | |
85 | - .get = lib3270_get_model_name, // Get value. | |
86 | - .set = lib3270_set_model_name // Set value. | |
84 | + .description = N_( "Model name" ), // Property description. | |
85 | + .get = lib3270_get_model_name, // Get value. | |
86 | + .set = lib3270_set_model_name // Set value. | |
87 | 87 | }, |
88 | 88 | |
89 | 89 | { |
90 | - .name = "hosttype", // Property name. | |
90 | + .name = "host_type_name", // Property name. | |
91 | 91 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
92 | - .description = N_( "Host type name" ), // Property description. | |
93 | - .get = lib3270_get_host_type_name, // Get value. | |
94 | - .set = lib3270_set_host_type_by_name // Set value. | |
92 | + .description = N_( "Host type name" ), // Property description. | |
93 | + .get = lib3270_get_host_type_name, // Get value. | |
94 | + .set = lib3270_set_host_type_by_name // Set value. | |
95 | 95 | }, |
96 | 96 | |
97 | 97 | { | ... | ... |
src/core/properties/unsigned.c
... | ... | @@ -54,17 +54,39 @@ |
54 | 54 | return NULL; |
55 | 55 | } |
56 | 56 | |
57 | +int lib3270_set_host_type_number(H3270 *hSession, unsigned int host_type) | |
58 | +{ | |
59 | + FAIL_IF_ONLINE(hSession); | |
60 | + hSession->host_type = host_type; | |
61 | + return 0; | |
62 | +} | |
63 | + | |
64 | +static unsigned int lib3270_get_host_type_number(const H3270 *hSession) | |
65 | +{ | |
66 | + return (unsigned int) hSession->host_type; | |
67 | +} | |
68 | + | |
57 | 69 | const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) |
58 | 70 | { |
59 | 71 | |
60 | 72 | static const LIB3270_UINT_PROPERTY properties[] = { |
61 | 73 | |
62 | 74 | { |
63 | - .name = "color_type", // Property name. | |
75 | + .name = "color_type", // Property name. | |
76 | + .default_value = 16, // Default value for the property. | |
77 | + .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. | |
78 | + .description = N_( "The color type" ), // Property description. | |
79 | + .get = lib3270_get_color_type, // Get value. | |
80 | + .set = lib3270_set_color_type // Set value. | |
81 | + }, | |
82 | + | |
83 | + { | |
84 | + .name = "host_type", // Property name. | |
85 | + .default_value = (unsigned int) LIB3270_HOST_S390, | |
64 | 86 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
65 | - .description = N_( "The color type" ), // Property description. | |
66 | - .get = lib3270_get_color_type, // Get value. | |
67 | - .set = lib3270_set_color_type // Set value. | |
87 | + .description = N_( "Host type number" ), // Property description. | |
88 | + .get = lib3270_get_host_type_number, // Get value. | |
89 | + .set = lib3270_set_host_type_number // Set value. | |
68 | 90 | }, |
69 | 91 | |
70 | 92 | { | ... | ... |