Commit a78dd24801ff41da7a0b3439f5e4ca4d0b0cef35
1 parent
1938b3a0
Exists in
master
and in
5 other branches
Implementando funções erase*
Showing
6 changed files
with
70 additions
and
8 deletions
Show diff stats
src/classlib/remote.cc
@@ -56,7 +56,10 @@ | @@ -56,7 +56,10 @@ | ||
56 | #define HLLAPI_PACKET_GET_CURSOR "getCursorAddress" | 56 | #define HLLAPI_PACKET_GET_CURSOR "getCursorAddress" |
57 | #define HLLAPI_PACKET_ENTER "enter" | 57 | #define HLLAPI_PACKET_ENTER "enter" |
58 | #define HLLAPI_PACKET_QUIT "quit" | 58 | #define HLLAPI_PACKET_QUIT "quit" |
59 | + #define HLLAPI_PACKET_ERASE "erase" | ||
59 | #define HLLAPI_PACKET_ERASE_EOF "eraseEOF" | 60 | #define HLLAPI_PACKET_ERASE_EOF "eraseEOF" |
61 | + #define HLLAPI_PACKET_ERASE_EOL "eraseEOL" | ||
62 | + #define HLLAPI_PACKET_ERASE_INPUT "eraseInput" | ||
60 | #define HLLAPI_PACKET_PRINT "print" | 63 | #define HLLAPI_PACKET_PRINT "print" |
61 | #define HLLAPI_PACKET_ASC2EBC "asc2ebc" | 64 | #define HLLAPI_PACKET_ASC2EBC "asc2ebc" |
62 | #define HLLAPI_PACKET_EBC2ASC "ebc2asc" | 65 | #define HLLAPI_PACKET_EBC2ASC "ebc2asc" |
@@ -1338,11 +1341,26 @@ | @@ -1338,11 +1341,26 @@ | ||
1338 | 1341 | ||
1339 | #endif // HAVE_DBUS | 1342 | #endif // HAVE_DBUS |
1340 | 1343 | ||
1344 | + int erase(void) | ||
1345 | + { | ||
1346 | + return query_intval(HLLAPI_PACKET_ERASE); | ||
1347 | + } | ||
1348 | + | ||
1341 | int erase_eof(void) | 1349 | int erase_eof(void) |
1342 | { | 1350 | { |
1343 | return query_intval(HLLAPI_PACKET_ERASE_EOF); | 1351 | return query_intval(HLLAPI_PACKET_ERASE_EOF); |
1344 | } | 1352 | } |
1345 | 1353 | ||
1354 | + int erase_eol(void) | ||
1355 | + { | ||
1356 | + return query_intval(HLLAPI_PACKET_ERASE_EOL); | ||
1357 | + } | ||
1358 | + | ||
1359 | + int erase_input(void) | ||
1360 | + { | ||
1361 | + return query_intval(HLLAPI_PACKET_ERASE_INPUT); | ||
1362 | + } | ||
1363 | + | ||
1346 | int print(void) | 1364 | int print(void) |
1347 | { | 1365 | { |
1348 | return query_intval(HLLAPI_PACKET_PRINT); | 1366 | return query_intval(HLLAPI_PACKET_PRINT); |
src/classlib/session.cc
@@ -532,22 +532,20 @@ | @@ -532,22 +532,20 @@ | ||
532 | 532 | ||
533 | switch(mode) { | 533 | switch(mode) { |
534 | case 0: | 534 | case 0: |
535 | - erase(); | ||
536 | - break; | 535 | + return erase(); |
537 | 536 | ||
538 | case 1: | 537 | case 1: |
539 | - erase_eof(); | ||
540 | - break; | 538 | + return erase_eof(); |
541 | 539 | ||
542 | case 2: | 540 | case 2: |
543 | - erase_eol(); | ||
544 | - break; | 541 | + return erase_eol(); |
545 | 542 | ||
546 | case 3: | 543 | case 3: |
547 | - erase_input(); | ||
548 | - break; | 544 | + return erase_input(); |
549 | 545 | ||
550 | } | 546 | } |
547 | + | ||
548 | + return -1; | ||
551 | } | 549 | } |
552 | 550 | ||
553 | 551 |
src/include/pw3270/ipcpackets.h
@@ -47,7 +47,10 @@ | @@ -47,7 +47,10 @@ | ||
47 | HLLAPI_PACKET_SET_CURSOR, | 47 | HLLAPI_PACKET_SET_CURSOR, |
48 | HLLAPI_PACKET_GET_CURSOR, | 48 | HLLAPI_PACKET_GET_CURSOR, |
49 | HLLAPI_PACKET_EMULATE_INPUT, | 49 | HLLAPI_PACKET_EMULATE_INPUT, |
50 | + HLLAPI_PACKET_ERASE, | ||
50 | HLLAPI_PACKET_ERASE_EOF, | 51 | HLLAPI_PACKET_ERASE_EOF, |
52 | + HLLAPI_PACKET_ERASE_EOL, | ||
53 | + HLLAPI_PACKET_ERASE_INPUT, | ||
51 | HLLAPI_PACKET_PRINT, | 54 | HLLAPI_PACKET_PRINT, |
52 | HLLAPI_PACKET_GET_CSTATE, | 55 | HLLAPI_PACKET_GET_CSTATE, |
53 | HLLAPI_PACKET_IS_READY, | 56 | HLLAPI_PACKET_IS_READY, |
src/java/plugin.cc
@@ -202,10 +202,22 @@ | @@ -202,10 +202,22 @@ | ||
202 | return lib3270_pakey(hSession,key); | 202 | return lib3270_pakey(hSession,key); |
203 | } | 203 | } |
204 | 204 | ||
205 | + int erase(void) { | ||
206 | + return lib3270_erase(hSession); | ||
207 | + } | ||
208 | + | ||
205 | int erase_eof(void) { | 209 | int erase_eof(void) { |
206 | return lib3270_eraseeof(hSession); | 210 | return lib3270_eraseeof(hSession); |
207 | } | 211 | } |
208 | 212 | ||
213 | + int erase_eol(void) { | ||
214 | + return lib3270_eraseeol(hSession); | ||
215 | + } | ||
216 | + | ||
217 | + int erase_input(void) { | ||
218 | + return lib3270_eraseinput(hSession); | ||
219 | + } | ||
220 | + | ||
209 | int print(void) { | 221 | int print(void) { |
210 | return lib3270_print(hSession); | 222 | return lib3270_print(hSession); |
211 | } | 223 | } |
src/plugins/hllapi/pluginmain.c
@@ -236,10 +236,22 @@ | @@ -236,10 +236,22 @@ | ||
236 | send_result(source,lib3270_print(lib3270_get_default_session_handle())); | 236 | send_result(source,lib3270_print(lib3270_get_default_session_handle())); |
237 | break; | 237 | break; |
238 | 238 | ||
239 | + case HLLAPI_PACKET_ERASE: | ||
240 | + send_result(source,lib3270_erase(lib3270_get_default_session_handle())); | ||
241 | + break; | ||
242 | + | ||
239 | case HLLAPI_PACKET_ERASE_EOF: | 243 | case HLLAPI_PACKET_ERASE_EOF: |
240 | send_result(source,lib3270_eraseeof(lib3270_get_default_session_handle())); | 244 | send_result(source,lib3270_eraseeof(lib3270_get_default_session_handle())); |
241 | break; | 245 | break; |
242 | 246 | ||
247 | + case HLLAPI_PACKET_ERASE_EOL: | ||
248 | + send_result(source,lib3270_eraseeol(lib3270_get_default_session_handle())); | ||
249 | + break; | ||
250 | + | ||
251 | + case HLLAPI_PACKET_ERASE_INPUT: | ||
252 | + send_result(source,lib3270_eraseinput(lib3270_get_default_session_handle())); | ||
253 | + break; | ||
254 | + | ||
243 | case HLLAPI_PACKET_PFKEY: | 255 | case HLLAPI_PACKET_PFKEY: |
244 | send_result(source,lib3270_pfkey( lib3270_get_default_session_handle(), | 256 | send_result(source,lib3270_pfkey( lib3270_get_default_session_handle(), |
245 | ((struct hllapi_packet_keycode *) source->buffer)->keycode)); | 257 | ((struct hllapi_packet_keycode *) source->buffer)->keycode)); |
src/plugins/rx3270/pluginmain.cc
@@ -116,7 +116,11 @@ | @@ -116,7 +116,11 @@ | ||
116 | int pfkey(int key); | 116 | int pfkey(int key); |
117 | int pakey(int key); | 117 | int pakey(int key); |
118 | 118 | ||
119 | + int erase(void); | ||
119 | int erase_eof(void); | 120 | int erase_eof(void); |
121 | + int erase_eol(void); | ||
122 | + int erase_input(void); | ||
123 | + | ||
120 | int print(void); | 124 | int print(void); |
121 | 125 | ||
122 | int get_field_start(int baddr = -1); | 126 | int get_field_start(int baddr = -1); |
@@ -765,11 +769,26 @@ string plugin::get_display_charset(void) | @@ -765,11 +769,26 @@ string plugin::get_display_charset(void) | ||
765 | return string(lib3270_get_display_charset(hSession)); | 769 | return string(lib3270_get_display_charset(hSession)); |
766 | } | 770 | } |
767 | 771 | ||
772 | +int plugin::erase(void) | ||
773 | +{ | ||
774 | + return lib3270_erase(hSession); | ||
775 | +} | ||
776 | + | ||
768 | int plugin::erase_eof(void) | 777 | int plugin::erase_eof(void) |
769 | { | 778 | { |
770 | return lib3270_eraseeof(hSession); | 779 | return lib3270_eraseeof(hSession); |
771 | } | 780 | } |
772 | 781 | ||
782 | +int plugin::erase_eol(void) | ||
783 | +{ | ||
784 | + return lib3270_eraseeol(hSession); | ||
785 | +} | ||
786 | + | ||
787 | +int plugin::erase_input(void) | ||
788 | +{ | ||
789 | + return lib3270_eraseinput(hSession); | ||
790 | +} | ||
791 | + | ||
773 | int plugin::print(void) | 792 | int plugin::print(void) |
774 | { | 793 | { |
775 | return lib3270_print(hSession); | 794 | return lib3270_print(hSession); |