diff --git a/src/include/3270ds.h b/src/include/3270ds.h index c4d9bd1..ace5e8d 100644 --- a/src/include/3270ds.h +++ b/src/include/3270ds.h @@ -1,23 +1,30 @@ /* - * Modifications Copyright 1993, 1994, 1995, 1999, 2000, 2002, 2003, 2004, - * 2005 by Paul Mattes. - * RPQNAMES modifications Copyright 2004 by Don Russell. - * Original X11 Port Copyright 1990 by Jeff Sparkes. - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, - * provided that the above copyright notice appear in all copies and that - * both that copyright notice and this permission notice appear in - * supporting documentation. + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a + * aplicativos mainframe. Registro no INPI sob o nome G3270. * - * Copyright 1989 by Georgia Tech Research Corporation, Atlanta, GA 30332. - * All Rights Reserved. GTRC hereby grants public use of this software. - * Derivative works based on this software must incorporate this copyright - * notice. + * Copyright (C) <2008> + * + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela + * Free Software Foundation. + * + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para + * obter mais detalhes. + * + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este + * programa; se não, escreva para a Free Software Foundation, Inc., 51 Franklin + * St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Este programa está nomeado como lib3270.h e possui - linhas de código. + * + * Contatos: + * + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) * - * x3270, c3270, s3270, tcl3270 and pr3287 are distributed in the hope that - * they will be useful, but WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * file LICENSE for more details. */ /** diff --git a/src/include/lib3270.h b/src/include/lib3270.h index f5261b7..45a976a 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -279,18 +279,34 @@ */ typedef enum lib3270_cstate { - LIB3270_NOT_CONNECTED, /**< @brief no socket, disconnected */ - LIB3270_RESOLVING, /**< @brief resolving hostname */ - LIB3270_PENDING, /**< @brief connection pending */ - LIB3270_CONNECTED_INITIAL, /**< @brief connected, no mode yet */ - LIB3270_CONNECTED_ANSI, /**< @brief connected in NVT ANSI mode */ - LIB3270_CONNECTED_3270, /**< @brief connected in old-style 3270 mode */ - LIB3270_CONNECTED_INITIAL_E, /**< @brief connected in TN3270E mode, unnegotiated */ - LIB3270_CONNECTED_NVT, /**< @brief connected in TN3270E mode, NVT mode */ - LIB3270_CONNECTED_SSCP, /**< @brief connected in TN3270E mode, SSCP-LU mode */ - LIB3270_CONNECTED_TN3270E /**< @brief connected in TN3270E mode, 3270 mode */ + LIB3270_NOT_CONNECTED, ///< @brief no socket, disconnected + LIB3270_RESOLVING, ///< @brief resolving hostname + LIB3270_PENDING, ///< @brief connection pending + LIB3270_CONNECTED_INITIAL, ///< @brief connected, no mode yet + LIB3270_CONNECTED_ANSI, ///< @brief connected in NVT ANSI mode + LIB3270_CONNECTED_3270, ///< @brief connected in old-style 3270 mode + LIB3270_CONNECTED_INITIAL_E, ///< @brief connected in TN3270E mode, unnegotiated + LIB3270_CONNECTED_NVT, ///< @brief connected in TN3270E mode, NVT mode + LIB3270_CONNECTED_SSCP, ///< @brief connected in TN3270E mode, SSCP-LU mode + LIB3270_CONNECTED_TN3270E ///< @brief connected in TN3270E mode, 3270 mode } LIB3270_CSTATE; + /** + * @brief Field attributes. + */ + typedef enum lib3270_field_attribute + { + LIB3270_FIELD_ATTRIBUTE_PRINTABLE = 0xc0, ///< @brief these make the character "printable" + LIB3270_FIELD_ATTRIBUTE_PROTECT = 0x20, ///< @brief unprotected (0) / protected (1) + LIB3270_FIELD_ATTRIBUTE_NUMERIC = 0x10, ///< @brief alphanumeric (0) / numeric (1) + LIB3270_FIELD_ATTRIBUTE_INTENSITY = 0x0c, ///< @brief display/selector pen detectable: + LIB3270_FIELD_ATTRIBUTE_INT_NORM_NSEL = 0x00, ///< @brief 00 normal, non-detect + LIB3270_FIELD_ATTRIBUTE_INT_NORM_SEL = 0x04, ///< @brief 01 normal, detectable + LIB3270_FIELD_ATTRIBUTE_INT_HIGH_SEL = 0x08, ///< @brief 10 intensified, detectable + LIB3270_FIELD_ATTRIBUTE_INT_ZERO_NSEL = 0x0c, ///< @brief 11 nondisplay, non-detect + LIB3270_FIELD_ATTRIBUTE_RESERVED = 0x02, ///< @brief must be 0 + LIB3270_FIELD_ATTRIBUTE_MODIFIED = 0x01 ///< @brief modified (1) + } LIB3270_FIELD_ATTRIBUTE; /** * @brief Host options @@ -1149,7 +1165,15 @@ */ LIB3270_EXPORT int lib3270_field_addr(H3270 *hSession, int baddr); - LIB3270_EXPORT int lib3270_field_attribute(H3270 *hSession, int baddr); + /** + * @brief Get field attribute for a given buffer address. + * + * @param hSession Session handle. + * @param addr Buffer address of the field. + * + * @return field attribute or -1 when failed (sets errno). + */ + LIB3270_EXPORT int lib3270_get_field_attribute(H3270 *hSession, int baddr); /** * @brief Get the length of the field at given buffer address. diff --git a/src/include/lib3270/selection.h b/src/include/lib3270/selection.h index bc81ed9..1b23317 100644 --- a/src/include/lib3270/selection.h +++ b/src/include/lib3270/selection.h @@ -43,9 +43,9 @@ * */ typedef struct _lib3270_selection_element { - unsigned char chr; ///< @brief Element character - unsigned short flags; ///< @brief Element colors & visual state. - unsigned char attributes; ///< @brief 3270 attributes. + unsigned char chr; ///< @brief Element character. + unsigned short flags; ///< @brief Element colors & visual state. @see LIB3270_ATTR + unsigned char field_attributes; ///< @brief Field attribute. @see LIB3270_FIELD_ATTRIBUTE } lib3270_selection_element; /** diff --git a/src/lib3270/ctlr.c b/src/lib3270/ctlr.c index 34a3979..9c254a3 100644 --- a/src/lib3270/ctlr.c +++ b/src/lib3270/ctlr.c @@ -514,7 +514,7 @@ LIB3270_EXPORT int lib3270_field_addr(H3270 *hSession, int baddr) return -1; } -LIB3270_EXPORT int lib3270_field_attribute(H3270 *hSession, int baddr) +LIB3270_EXPORT int lib3270_get_field_attribute(H3270 *hSession, int baddr) { int sbaddr; diff --git a/src/lib3270/selection/get.c b/src/lib3270/selection/get.c index 2e94552..0a62896 100644 --- a/src/lib3270/selection/get.c +++ b/src/lib3270/selection/get.c @@ -182,9 +182,9 @@ LIB3270_EXPORT lib3270_selection * lib3270_get_selection(H3270 *hSession, int cu fa = hSession->ea_buf[baddr].fa; } - selection->contents[dstaddr].chr = (hSession->text[baddr].chr ? hSession->text[baddr].chr : ' '); - selection->contents[dstaddr].flags = hSession->text[baddr].attr; - selection->contents[dstaddr].attributes = fa; + selection->contents[dstaddr].chr = (hSession->text[baddr].chr ? hSession->text[baddr].chr : ' '); + selection->contents[dstaddr].flags = hSession->text[baddr].attr; + selection->contents[dstaddr].field_attributes = fa; if(cut && !FA_IS_PROTECTED(fa)) { clear_chr(hSession,baddr); -- libgit2 0.21.2