Commit e3de3fcbf5ceae04f7fbbc02da2b4558e46b5165
1 parent
c14c1477
Exists in
master
and in
2 other branches
Refactoring file transfer module.
Showing
2 changed files
with
11 additions
and
2 deletions
Show diff stats
src/core/ft/ft.c
| ... | ... | @@ -345,6 +345,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
| 345 | 345 | if(!hSession->ft) |
| 346 | 346 | return errno = EINVAL; |
| 347 | 347 | |
| 348 | + hSession->ft->lrecl = lrecl; | |
| 348 | 349 | |
| 349 | 350 | return 0; |
| 350 | 351 | } |
| ... | ... | @@ -356,6 +357,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
| 356 | 357 | if(!hSession->ft) |
| 357 | 358 | return errno = EINVAL; |
| 358 | 359 | |
| 360 | + hSession->ft->blksize = blksize; | |
| 359 | 361 | |
| 360 | 362 | return 0; |
| 361 | 363 | } |
| ... | ... | @@ -367,6 +369,7 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
| 367 | 369 | if(!hSession->ft) |
| 368 | 370 | return errno = EINVAL; |
| 369 | 371 | |
| 372 | + hSession->ft->primspace = primspace; | |
| 370 | 373 | |
| 371 | 374 | return 0; |
| 372 | 375 | } |
| ... | ... | @@ -378,17 +381,23 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
| 378 | 381 | if(!hSession->ft) |
| 379 | 382 | return errno = EINVAL; |
| 380 | 383 | |
| 384 | + hSession->ft->secspace = secspace; | |
| 381 | 385 | |
| 382 | 386 | return 0; |
| 383 | 387 | } |
| 384 | 388 | |
| 385 | - LIB3270_EXPORT int lib3270_ft_set_option(H3270 *hSession, LIB3270_FT_OPTION option) | |
| 389 | + LIB3270_EXPORT int lib3270_ft_set_options(H3270 *hSession, LIB3270_FT_OPTION options) | |
| 386 | 390 | { |
| 387 | 391 | CHECK_SESSION_HANDLE(hSession); |
| 388 | 392 | |
| 389 | 393 | if(!hSession->ft) |
| 390 | 394 | return errno = EINVAL; |
| 391 | 395 | |
| 396 | + hSession->ft->ascii_flag = (options & LIB3270_FT_OPTION_ASCII) ? 1 : 0; | |
| 397 | + hSession->ft->cr_flag = (options & LIB3270_FT_OPTION_CRLF) ? 1 : 0; | |
| 398 | + hSession->ft->remap_flag = (options & LIB3270_FT_OPTION_REMAP) ? 1 : 0; | |
| 399 | + hSession->ft->unix_text = (options & LIB3270_FT_OPTION_UNIX) ? 1 : 0; | |
| 400 | + hSession->ft->flags |= options; | |
| 392 | 401 | |
| 393 | 402 | return 0; |
| 394 | 403 | } | ... | ... |
src/include/lib3270/filetransfer.h
| ... | ... | @@ -207,7 +207,7 @@ |
| 207 | 207 | LIB3270_EXPORT int lib3270_set_dft_buffersize(H3270 *hSession, int dft_buffersize); |
| 208 | 208 | |
| 209 | 209 | |
| 210 | - LIB3270_EXPORT int lib3270_ft_set_option(H3270 *hSession, LIB3270_FT_OPTION option); | |
| 210 | + LIB3270_EXPORT int lib3270_ft_set_options(H3270 *hSession, LIB3270_FT_OPTION options); | |
| 211 | 211 | |
| 212 | 212 | /** |
| 213 | 213 | * @brief Send file. | ... | ... |