Commit fdc4726a2dd599de0a46895739e47c28cf3f85be
1 parent
c2d597d2
Exists in
develop
Updating property methods.
Showing
4 changed files
with
75 additions
and
83 deletions
Show diff stats
src/core/properties/boolean.c
| 1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | |
| 2 | + | |
| 1 | 3 | /* |
| 2 | - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | - * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. | |
| 5 | - * | |
| 6 | - * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | - * | |
| 8 | - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | - * Free Software Foundation. | |
| 11 | - * | |
| 12 | - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | - * obter mais detalhes. | |
| 4 | + * Copyright (C) 2008 Banco do Brasil S.A. | |
| 16 | 5 | * |
| 17 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 6 | + * This program is free software: you can redistribute it and/or modify | |
| 7 | + * it under the terms of the GNU Lesser General Public License as published | |
| 8 | + * by the Free Software Foundation, either version 3 of the License, or | |
| 9 | + * (at your option) any later version. | |
| 20 | 10 | * |
| 21 | - * Este programa está nomeado como - e possui - linhas de código. | |
| 11 | + * This program is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | + * GNU General Public License for more details. | |
| 22 | 15 | * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License | |
| 17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* | |
| 23 | 21 | * Contatos: |
| 24 | 22 | * |
| 25 | 23 | * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | ... | ... |
src/core/properties/string.c
| 1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | |
| 2 | + | |
| 1 | 3 | /* |
| 2 | - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | - * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. | |
| 5 | - * | |
| 6 | - * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | - * | |
| 8 | - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | - * Free Software Foundation. | |
| 4 | + * Copyright (C) 2008 Banco do Brasil S.A. | |
| 11 | 5 | * |
| 12 | - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | - * obter mais detalhes. | |
| 6 | + * This program is free software: you can redistribute it and/or modify | |
| 7 | + * it under the terms of the GNU Lesser General Public License as published | |
| 8 | + * by the Free Software Foundation, either version 3 of the License, or | |
| 9 | + * (at your option) any later version. | |
| 16 | 10 | * |
| 17 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como - e possui - linhas de código. | |
| 11 | + * This program is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | + * GNU General Public License for more details. | |
| 22 | 15 | * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License | |
| 17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* | |
| 23 | 21 | * Contatos: |
| 24 | 22 | * |
| 25 | 23 | * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) |
| ... | ... | @@ -38,23 +36,19 @@ |
| 38 | 36 | #include <lib3270/ssl.h> |
| 39 | 37 | #include <lib3270/trace.h> |
| 40 | 38 | |
| 41 | -static const char * get_version(const H3270 GNUC_UNUSED(*hSession)) { | |
| 42 | - return lib3270_get_version(); | |
| 43 | -} | |
| 44 | - | |
| 45 | -static const char * get_revision(const H3270 GNUC_UNUSED(*hSession)) { | |
| 46 | - return lib3270_get_revision(); | |
| 47 | -} | |
| 48 | - | |
| 49 | -static const char * lib3270_get_termtype(const H3270 *hSession) { | |
| 39 | +LIB3270_EXPORT const char * lib3270_get_termtype(const H3270 *hSession) { | |
| 50 | 40 | return hSession->termtype; |
| 51 | 41 | } |
| 52 | 42 | |
| 53 | -static const char * lib3270_get_termname(const H3270 *hSession) { | |
| 43 | +LIB3270_EXPORT const char * lib3270_get_termname(const H3270 *hSession) { | |
| 54 | 44 | return hSession->termname; |
| 55 | 45 | } |
| 56 | 46 | |
| 57 | 47 | LIB3270_EXPORT const LIB3270_STRING_PROPERTY * lib3270_get_string_properties_list(void) { |
| 48 | + | |
| 49 | + auto const char * get_version(const H3270 GNUC_UNUSED(*hSession)); | |
| 50 | + auto const char * get_revision(const H3270 GNUC_UNUSED(*hSession)); | |
| 51 | + | |
| 58 | 52 | static const LIB3270_STRING_PROPERTY properties[] = { |
| 59 | 53 | |
| 60 | 54 | { |
| ... | ... | @@ -124,28 +118,18 @@ LIB3270_EXPORT const LIB3270_STRING_PROPERTY * lib3270_get_string_properties_lis |
| 124 | 118 | |
| 125 | 119 | { |
| 126 | 120 | .name = "version", // Property name. |
| 127 | - .description = N_( "lib3270 version" ), // Property description. | |
| 121 | + .description = N_( "Protocol library version" ), // Property description. | |
| 128 | 122 | .get = get_version, // Get value. |
| 129 | 123 | .set = NULL // Set value. |
| 130 | 124 | }, |
| 131 | 125 | |
| 132 | 126 | { |
| 133 | - .name = "revision", // Property name. | |
| 134 | - .description = N_( "lib3270 revision" ), // Property description. | |
| 135 | - .get = get_revision, // Get value. | |
| 136 | - .set = NULL // Set value. | |
| 127 | + .name = "revision", // Property name. | |
| 128 | + .description = N_( "Protocol library revision" ), // Property description. | |
| 129 | + .get = get_revision, // Get value. | |
| 130 | + .set = NULL // Set value. | |
| 137 | 131 | }, |
| 138 | 132 | |
| 139 | - /* | |
| 140 | - { | |
| 141 | - .name = "crl_url", // Property name. | |
| 142 | - .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. | |
| 143 | - .description = N_( "URL for the certificate revocation list" ), // Property description. | |
| 144 | - .get = lib3270_crl_get_url, // Get value. | |
| 145 | - .set = lib3270_crl_set_url, // Set value. | |
| 146 | - }, | |
| 147 | - */ | |
| 148 | - | |
| 149 | 133 | { |
| 150 | 134 | .name = "crl_preferred_protocol", // Property name. |
| 151 | 135 | .group = LIB3270_ACTION_GROUP_OFFLINE, // Property group. |
| ... | ... | @@ -208,6 +192,14 @@ LIB3270_EXPORT const LIB3270_STRING_PROPERTY * lib3270_get_string_properties_lis |
| 208 | 192 | |
| 209 | 193 | }; |
| 210 | 194 | |
| 195 | + const char * get_version(const H3270 GNUC_UNUSED(*hSession)) { | |
| 196 | + return lib3270_get_version(); | |
| 197 | + } | |
| 198 | + | |
| 199 | + const char * get_revision(const H3270 GNUC_UNUSED(*hSession)) { | |
| 200 | + return lib3270_get_revision(); | |
| 201 | + } | |
| 202 | + | |
| 211 | 203 | return properties; |
| 212 | 204 | |
| 213 | 205 | } | ... | ... |
src/core/properties/unsigned.c
| 1 | +/* SPDX-License-Identifier: LGPL-3.0-or-later */ | |
| 2 | + | |
| 1 | 3 | /* |
| 2 | - * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
| 3 | - * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
| 4 | - * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. | |
| 5 | - * | |
| 6 | - * Copyright (C) <2008> <Banco do Brasil S.A.> | |
| 7 | - * | |
| 8 | - * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
| 9 | - * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
| 10 | - * Free Software Foundation. | |
| 4 | + * Copyright (C) 2008 Banco do Brasil S.A. | |
| 11 | 5 | * |
| 12 | - * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
| 13 | - * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
| 14 | - * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
| 15 | - * obter mais detalhes. | |
| 6 | + * This program is free software: you can redistribute it and/or modify | |
| 7 | + * it under the terms of the GNU Lesser General Public License as published | |
| 8 | + * by the Free Software Foundation, either version 3 of the License, or | |
| 9 | + * (at your option) any later version. | |
| 16 | 10 | * |
| 17 | - * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
| 18 | - * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin | |
| 19 | - * St, Fifth Floor, Boston, MA 02110-1301 USA | |
| 20 | - * | |
| 21 | - * Este programa está nomeado como - e possui - linhas de código. | |
| 11 | + * This program is distributed in the hope that it will be useful, | |
| 12 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 13 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 14 | + * GNU General Public License for more details. | |
| 22 | 15 | * |
| 16 | + * You should have received a copy of the GNU Lesser General Public License | |
| 17 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. | |
| 18 | + */ | |
| 19 | + | |
| 20 | +/* | |
| 23 | 21 | * Contatos: |
| 24 | 22 | * |
| 25 | 23 | * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) |
| ... | ... | @@ -34,10 +32,6 @@ |
| 34 | 32 | #include <lib3270/properties.h> |
| 35 | 33 | #include <lib3270/keyboard.h> |
| 36 | 34 | |
| 37 | -unsigned int lib3270_get_kybdlock_as_int(const H3270 *hSession) { | |
| 38 | - return (unsigned int) lib3270_get_keyboard_lock_state(hSession); | |
| 39 | -} | |
| 40 | - | |
| 41 | 35 | const LIB3270_UINT_PROPERTY * lib3270_unsigned_property_get_by_name(const char *name) { |
| 42 | 36 | size_t ix; |
| 43 | 37 | const LIB3270_UINT_PROPERTY * list = lib3270_get_unsigned_properties_list(); |
| ... | ... | @@ -72,6 +66,8 @@ LIB3270_EXPORT int lib3270_set_auto_reconnect(H3270 *hSession, unsigned int time |
| 72 | 66 | |
| 73 | 67 | const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) { |
| 74 | 68 | |
| 69 | + auto unsigned int lib3270_get_kybdlock_as_int(const H3270 *hSession); | |
| 70 | + | |
| 75 | 71 | static const LIB3270_UINT_PROPERTY properties[] = { |
| 76 | 72 | |
| 77 | 73 | { |
| ... | ... | @@ -179,6 +175,10 @@ const LIB3270_UINT_PROPERTY * lib3270_get_unsigned_properties_list(void) { |
| 179 | 175 | } |
| 180 | 176 | }; |
| 181 | 177 | |
| 178 | + unsigned int lib3270_get_kybdlock_as_int(const H3270 *hSession) { | |
| 179 | + return (unsigned int) lib3270_get_keyboard_lock_state(hSession); | |
| 180 | + } | |
| 181 | + | |
| 182 | 182 | return properties; |
| 183 | 183 | } |
| 184 | 184 | ... | ... |
src/include/lib3270/properties.h
| ... | ... | @@ -305,6 +305,8 @@ LIB3270_EXPORT unsigned int lib3270_get_auto_reconnect(const H3270 *hSession); |
| 305 | 305 | LIB3270_EXPORT const char * lib3270_get_connection_state_as_string(const H3270 *hSession); |
| 306 | 306 | LIB3270_EXPORT const char * lib3270_get_program_message_as_string(const H3270 *hSession); |
| 307 | 307 | LIB3270_EXPORT const char * lib3270_get_ssl_state_as_string(const H3270 * hSession); |
| 308 | +LIB3270_EXPORT const char * lib3270_get_termtype(const H3270 *hSession); | |
| 309 | +LIB3270_EXPORT const char * lib3270_get_termname(const H3270 *hSession); | |
| 308 | 310 | |
| 309 | 311 | #ifdef __cplusplus |
| 310 | 312 | } | ... | ... |