From e3de3fcbf5ceae04f7fbbc02da2b4558e46b5165 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Fri, 29 Jan 2021 14:17:58 -0300 Subject: [PATCH] Refactoring file transfer module. --- src/core/ft/ft.c | 11 ++++++++++- src/include/lib3270/filetransfer.h | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/core/ft/ft.c b/src/core/ft/ft.c index 17e9de2..ff3df09 100644 --- a/src/core/ft/ft.c +++ b/src/core/ft/ft.c @@ -345,6 +345,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); if(!hSession->ft) return errno = EINVAL; + hSession->ft->lrecl = lrecl; return 0; } @@ -356,6 +357,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); if(!hSession->ft) return errno = EINVAL; + hSession->ft->blksize = blksize; return 0; } @@ -367,6 +369,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); if(!hSession->ft) return errno = EINVAL; + hSession->ft->primspace = primspace; return 0; } @@ -378,17 +381,23 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); if(!hSession->ft) return errno = EINVAL; + hSession->ft->secspace = secspace; return 0; } - LIB3270_EXPORT int lib3270_ft_set_option(H3270 *hSession, LIB3270_FT_OPTION option) + LIB3270_EXPORT int lib3270_ft_set_options(H3270 *hSession, LIB3270_FT_OPTION options) { CHECK_SESSION_HANDLE(hSession); if(!hSession->ft) return errno = EINVAL; + hSession->ft->ascii_flag = (options & LIB3270_FT_OPTION_ASCII) ? 1 : 0; + hSession->ft->cr_flag = (options & LIB3270_FT_OPTION_CRLF) ? 1 : 0; + hSession->ft->remap_flag = (options & LIB3270_FT_OPTION_REMAP) ? 1 : 0; + hSession->ft->unix_text = (options & LIB3270_FT_OPTION_UNIX) ? 1 : 0; + hSession->ft->flags |= options; return 0; } diff --git a/src/include/lib3270/filetransfer.h b/src/include/lib3270/filetransfer.h index f7561bf..1921b29 100644 --- a/src/include/lib3270/filetransfer.h +++ b/src/include/lib3270/filetransfer.h @@ -207,7 +207,7 @@ LIB3270_EXPORT int lib3270_set_dft_buffersize(H3270 *hSession, int dft_buffersize); - LIB3270_EXPORT int lib3270_ft_set_option(H3270 *hSession, LIB3270_FT_OPTION option); + LIB3270_EXPORT int lib3270_ft_set_options(H3270 *hSession, LIB3270_FT_OPTION options); /** * @brief Send file. -- libgit2 0.21.2