Commit 28ade9a4e6778157d4b936de00397e8c694b4546
1 parent
2c632cd7
Exists in
master
and in
1 other branch
Testing the new hllapi calls.
Showing
1 changed file
with
24 additions
and
1 deletions
Show diff stats
src/testprogram/testprogram.cc
| ... | ... | @@ -29,8 +29,11 @@ |
| 29 | 29 | |
| 30 | 30 | #include <iostream> |
| 31 | 31 | #include <getopt.h> |
| 32 | + #include <cstring> | |
| 32 | 33 | #include <lib3270/hllapi.h> |
| 33 | 34 | |
| 35 | + #define SCREEN_LENGTH 2000 | |
| 36 | + | |
| 34 | 37 | using namespace std; |
| 35 | 38 | |
| 36 | 39 | /*---[ Implement ]--------------------------------------------------------------------------------*/ |
| ... | ... | @@ -88,7 +91,27 @@ |
| 88 | 91 | return rc; |
| 89 | 92 | } |
| 90 | 93 | |
| 91 | - cout << "Host is " << (hllapi_is_connected() ? "connected" : "not connected") << endl; | |
| 94 | + if(hllapi_is_connected()) { | |
| 95 | + | |
| 96 | + cout << "Host is connected" << endl; | |
| 97 | + | |
| 98 | + char buffer[SCREEN_LENGTH+1]; | |
| 99 | + memset(buffer,' ',SCREEN_LENGTH); | |
| 100 | + buffer[SCREEN_LENGTH] = 0; | |
| 101 | + | |
| 102 | + rc = hllapi_get_screen(0,buffer,SCREEN_LENGTH); | |
| 103 | + cout << "hllapi_get_screen returns with rc=" << rc << " (" << hllapi_get_last_error() << ")" << endl; | |
| 104 | + | |
| 105 | + if(rc == HLLAPI_STATUS_SUCCESS) { | |
| 106 | + cout << endl << buffer << endl; | |
| 107 | + } | |
| 108 | + | |
| 109 | + } else { | |
| 110 | + | |
| 111 | + cout << "Host is not connected" << endl; | |
| 112 | + | |
| 113 | + | |
| 114 | + } | |
| 92 | 115 | |
| 93 | 116 | rc = hllapi_disconnect(); |
| 94 | 117 | if(rc) { | ... | ... |