Commit e6ca440dfc1012f613f7ef0f701526dff38d6f86
1 parent
8acdcd61
Exists in
master
and in
1 other branch
Testando módulo HLLAPI.
Showing
2 changed files
with
30 additions
and
2 deletions
Show diff stats
testprogram/testprogram.cc
| @@ -36,6 +36,7 @@ | @@ -36,6 +36,7 @@ | ||
| 36 | * | 36 | * |
| 37 | */ | 37 | */ |
| 38 | 38 | ||
| 39 | + #include <getopt.h> | ||
| 39 | #include <cstdlib> | 40 | #include <cstdlib> |
| 40 | #include <lib3270++.h> | 41 | #include <lib3270++.h> |
| 41 | 42 | ||
| @@ -43,9 +44,33 @@ | @@ -43,9 +44,33 @@ | ||
| 43 | 44 | ||
| 44 | /*---[ Implement ]----------------------------------------------------------------------------------*/ | 45 | /*---[ Implement ]----------------------------------------------------------------------------------*/ |
| 45 | 46 | ||
| 46 | - int main(int argc, const char *argv[]) { | 47 | + int main(int argc, char **argv) { |
| 47 | 48 | ||
| 48 | - TN3270::Host host{"pw3270:a"}; | 49 | + const char * session = "pw3270:a"; |
| 50 | + | ||
| 51 | + #pragma GCC diagnostic push | ||
| 52 | + #pragma GCC diagnostic ignored "-Wzero-as-null-pointer-constant" | ||
| 53 | + static struct option options[] = { | ||
| 54 | + { "session", required_argument, 0, 's' }, | ||
| 55 | + { 0, 0, 0, 0} | ||
| 56 | + | ||
| 57 | + }; | ||
| 58 | + #pragma GCC diagnostic pop | ||
| 59 | + | ||
| 60 | + int long_index =0; | ||
| 61 | + int opt; | ||
| 62 | + while((opt = getopt_long(argc, argv, "s:", options, &long_index )) != -1) { | ||
| 63 | + | ||
| 64 | + switch(opt) { | ||
| 65 | + case 's': | ||
| 66 | + session = optarg; | ||
| 67 | + break; | ||
| 68 | + | ||
| 69 | + } | ||
| 70 | + | ||
| 71 | + } | ||
| 72 | + | ||
| 73 | + TN3270::Host host{session}; | ||
| 49 | 74 | ||
| 50 | try { | 75 | try { |
| 51 | 76 |
windows/session.cc
| @@ -39,6 +39,7 @@ | @@ -39,6 +39,7 @@ | ||
| 39 | #include "../private.h" | 39 | #include "../private.h" |
| 40 | #include <cstring> | 40 | #include <cstring> |
| 41 | #include <lib3270/trace.h> | 41 | #include <lib3270/trace.h> |
| 42 | + #include <algorithm> | ||
| 42 | 43 | ||
| 43 | using std::string; | 44 | using std::string; |
| 44 | 45 | ||
| @@ -59,6 +60,8 @@ | @@ -59,6 +60,8 @@ | ||
| 59 | pipename += "\\"; | 60 | pipename += "\\"; |
| 60 | pipename += (ptr+1); | 61 | pipename += (ptr+1); |
| 61 | 62 | ||
| 63 | + std::transform(pipename.begin(), pipename.end(), pipename.begin(), ::tolower); | ||
| 64 | + | ||
| 62 | debug("pipename: \"%s\"",pipename.c_str()); | 65 | debug("pipename: \"%s\"",pipename.c_str()); |
| 63 | 66 | ||
| 64 | this->hPipe = CreateFile( | 67 | this->hPipe = CreateFile( |