Commit 95b628bd0726f9543aa878f47508250a9cea9be5
1 parent
669d8ad6
Exists in
master
and in
2 other branches
spliting filetransfer set methods.
Showing
6 changed files
with
105 additions
and
76 deletions
Show diff stats
lib3270.cbp
| ... | ... | @@ -98,6 +98,9 @@ |
| 98 | 98 | <Unit filename="src/core/ft/ftmessages.c"> |
| 99 | 99 | <Option compilerVar="CC" /> |
| 100 | 100 | </Unit> |
| 101 | + <Unit filename="src/core/ft/set.c"> | |
| 102 | + <Option compilerVar="CC" /> | |
| 103 | + </Unit> | |
| 101 | 104 | <Unit filename="src/core/host.c"> |
| 102 | 105 | <Option compilerVar="CC" /> |
| 103 | 106 | </Unit> | ... | ... |
src/core/ft/ft.c
| ... | ... | @@ -328,70 +328,6 @@ static void set_ft_state(H3270FT *session, LIB3270_FT_STATE state); |
| 328 | 328 | return ftHandle; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - LIB3270_EXPORT int lib3270_ft_set_lrecl(H3270 *hSession, int lrecl) | |
| 332 | - { | |
| 333 | - CHECK_SESSION_HANDLE(hSession); | |
| 334 | - | |
| 335 | - if(!hSession->ft) | |
| 336 | - return errno = EINVAL; | |
| 337 | - | |
| 338 | - hSession->ft->lrecl = lrecl; | |
| 339 | - | |
| 340 | - return 0; | |
| 341 | - } | |
| 342 | - | |
| 343 | - LIB3270_EXPORT int lib3270_ft_set_blksize(H3270 *hSession, int blksize) | |
| 344 | - { | |
| 345 | - CHECK_SESSION_HANDLE(hSession); | |
| 346 | - | |
| 347 | - if(!hSession->ft) | |
| 348 | - return errno = EINVAL; | |
| 349 | - | |
| 350 | - hSession->ft->blksize = blksize; | |
| 351 | - | |
| 352 | - return 0; | |
| 353 | - } | |
| 354 | - | |
| 355 | - LIB3270_EXPORT int lib3270_ft_set_primspace(H3270 *hSession, int primspace) | |
| 356 | - { | |
| 357 | - CHECK_SESSION_HANDLE(hSession); | |
| 358 | - | |
| 359 | - if(!hSession->ft) | |
| 360 | - return errno = EINVAL; | |
| 361 | - | |
| 362 | - hSession->ft->primspace = primspace; | |
| 363 | - | |
| 364 | - return 0; | |
| 365 | - } | |
| 366 | - | |
| 367 | - LIB3270_EXPORT int lib3270_ft_set_secspace(H3270 *hSession, int secspace) | |
| 368 | - { | |
| 369 | - CHECK_SESSION_HANDLE(hSession); | |
| 370 | - | |
| 371 | - if(!hSession->ft) | |
| 372 | - return errno = EINVAL; | |
| 373 | - | |
| 374 | - hSession->ft->secspace = secspace; | |
| 375 | - | |
| 376 | - return 0; | |
| 377 | - } | |
| 378 | - | |
| 379 | - LIB3270_EXPORT int lib3270_ft_set_options(H3270 *hSession, LIB3270_FT_OPTION options) | |
| 380 | - { | |
| 381 | - CHECK_SESSION_HANDLE(hSession); | |
| 382 | - | |
| 383 | - if(!hSession->ft) | |
| 384 | - return errno = EINVAL; | |
| 385 | - | |
| 386 | - hSession->ft->ascii_flag = (options & LIB3270_FT_OPTION_ASCII) ? 1 : 0; | |
| 387 | - hSession->ft->cr_flag = (options & LIB3270_FT_OPTION_CRLF) ? 1 : 0; | |
| 388 | - hSession->ft->remap_flag = (options & LIB3270_FT_OPTION_REMAP) ? 1 : 0; | |
| 389 | - hSession->ft->unix_text = (options & LIB3270_FT_OPTION_UNIX) ? 1 : 0; | |
| 390 | - hSession->ft->flags |= options; | |
| 391 | - | |
| 392 | - return 0; | |
| 393 | - } | |
| 394 | - | |
| 395 | 331 | LIB3270_EXPORT int lib3270_reset_ft_callbacks(H3270 *hSession) |
| 396 | 332 | { |
| 397 | 333 | CHECK_SESSION_HANDLE(hSession); |
| ... | ... | @@ -762,7 +698,7 @@ LIB3270_EXPORT int lib3270_send(H3270 *hSession, const char *from, const char *t |
| 762 | 698 | if(hSession->ft) |
| 763 | 699 | return EBUSY; |
| 764 | 700 | |
| 765 | - return hSession->cbk.send(hSession,from,to,args); | |
| 701 | + return ENOTSUP; | |
| 766 | 702 | } |
| 767 | 703 | |
| 768 | 704 | LIB3270_EXPORT int lib3270_receive(H3270 *hSession, const char *from, const char *to, const char **args) |
| ... | ... | @@ -772,6 +708,6 @@ LIB3270_EXPORT int lib3270_receive(H3270 *hSession, const char *from, const char |
| 772 | 708 | if(hSession->ft) |
| 773 | 709 | return EBUSY; |
| 774 | 710 | |
| 775 | - return hSession->cbk.receive(hSession,from,to,args); | |
| 711 | + return ENOTSUP; | |
| 776 | 712 | } |
| 777 | 713 | ... | ... |
| ... | ... | @@ -0,0 +1,100 @@ |
| 1 | +/* | |
| 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. | |
| 16 | + * | |
| 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 set.c e possui - linhas de código. | |
| 22 | + * | |
| 23 | + * Contatos: | |
| 24 | + * | |
| 25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
| 26 | + * erico.mendonca@gmail.com (Erico Mascarenhas Mendonça) | |
| 27 | + * | |
| 28 | + */ | |
| 29 | + | |
| 30 | +#include <config.h> | |
| 31 | +#include <lib3270.h> | |
| 32 | +#include <lib3270/filetransfer.h> | |
| 33 | +#include <lib3270/log.h> | |
| 34 | +#include <internals.h> | |
| 35 | + | |
| 36 | +/*---[ Implement ]-------------------------------------------------------------------------------------------------------*/ | |
| 37 | + | |
| 38 | + LIB3270_EXPORT int lib3270_ft_set_lrecl(H3270 *hSession, int lrecl) | |
| 39 | + { | |
| 40 | + CHECK_SESSION_HANDLE(hSession); | |
| 41 | + | |
| 42 | + if(!hSession->ft) | |
| 43 | + return errno = EINVAL; | |
| 44 | + | |
| 45 | + hSession->ft->lrecl = lrecl; | |
| 46 | + | |
| 47 | + return 0; | |
| 48 | + } | |
| 49 | + | |
| 50 | + LIB3270_EXPORT int lib3270_ft_set_blksize(H3270 *hSession, int blksize) | |
| 51 | + { | |
| 52 | + CHECK_SESSION_HANDLE(hSession); | |
| 53 | + | |
| 54 | + if(!hSession->ft) | |
| 55 | + return errno = EINVAL; | |
| 56 | + | |
| 57 | + hSession->ft->blksize = blksize; | |
| 58 | + | |
| 59 | + return 0; | |
| 60 | + } | |
| 61 | + | |
| 62 | + LIB3270_EXPORT int lib3270_ft_set_primspace(H3270 *hSession, int primspace) | |
| 63 | + { | |
| 64 | + CHECK_SESSION_HANDLE(hSession); | |
| 65 | + | |
| 66 | + if(!hSession->ft) | |
| 67 | + return errno = EINVAL; | |
| 68 | + | |
| 69 | + hSession->ft->primspace = primspace; | |
| 70 | + | |
| 71 | + return 0; | |
| 72 | + } | |
| 73 | + | |
| 74 | + LIB3270_EXPORT int lib3270_ft_set_secspace(H3270 *hSession, int secspace) | |
| 75 | + { | |
| 76 | + CHECK_SESSION_HANDLE(hSession); | |
| 77 | + | |
| 78 | + if(!hSession->ft) | |
| 79 | + return errno = EINVAL; | |
| 80 | + | |
| 81 | + hSession->ft->secspace = secspace; | |
| 82 | + | |
| 83 | + return 0; | |
| 84 | + } | |
| 85 | + | |
| 86 | + LIB3270_EXPORT int lib3270_ft_set_options(H3270 *hSession, LIB3270_FT_OPTION options) | |
| 87 | + { | |
| 88 | + CHECK_SESSION_HANDLE(hSession); | |
| 89 | + | |
| 90 | + if(!hSession->ft) | |
| 91 | + return errno = EINVAL; | |
| 92 | + | |
| 93 | + hSession->ft->ascii_flag = (options & LIB3270_FT_OPTION_ASCII) ? 1 : 0; | |
| 94 | + hSession->ft->cr_flag = (options & LIB3270_FT_OPTION_CRLF) ? 1 : 0; | |
| 95 | + hSession->ft->remap_flag = (options & LIB3270_FT_OPTION_REMAP) ? 1 : 0; | |
| 96 | + hSession->ft->unix_text = (options & LIB3270_FT_OPTION_UNIX) ? 1 : 0; | |
| 97 | + hSession->ft->flags |= options; | |
| 98 | + | |
| 99 | + return 0; | |
| 100 | + } | ... | ... |
src/core/session.c
| ... | ... | @@ -254,10 +254,6 @@ static int default_action(H3270 GNUC_UNUSED(*hSession), const char GNUC_UNUSED(* |
| 254 | 254 | return ENOENT; |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | -static int default_ft(H3270 GNUC_UNUSED(*hSession), const char GNUC_UNUSED(*from), const char GNUC_UNUSED(*to), const char GNUC_UNUSED(**args)) { | |
| 258 | - return ENOTSUP; | |
| 259 | -} | |
| 260 | - | |
| 261 | 257 | void lib3270_reset_callbacks(H3270 *hSession) |
| 262 | 258 | { |
| 263 | 259 | // Default calls |
| ... | ... | @@ -288,8 +284,6 @@ void lib3270_reset_callbacks(H3270 *hSession) |
| 288 | 284 | hSession->cbk.update_url = default_update_url; |
| 289 | 285 | hSession->cbk.action = default_action; |
| 290 | 286 | hSession->cbk.reconnect = lib3270_reconnect; |
| 291 | - hSession->cbk.send = default_ft; | |
| 292 | - hSession->cbk.receive = default_ft; | |
| 293 | 287 | |
| 294 | 288 | lib3270_set_popup_handler(hSession, NULL); |
| 295 | 289 | ... | ... |
src/include/lib3270/filetransfer.h
src/include/lib3270/session.h
| ... | ... | @@ -81,9 +81,6 @@ |
| 81 | 81 | |
| 82 | 82 | int (*reconnect)(H3270 *hSession,int seconds); |
| 83 | 83 | |
| 84 | - int (*send)(H3270 *hSession, const char *from, const char *to, const char **args); | |
| 85 | - int (*receive)(H3270 *hSession, const char *from, const char *to, const char **args); | |
| 86 | - | |
| 87 | 84 | }; |
| 88 | 85 | |
| 89 | 86 | /** | ... | ... |