Commit d7398adf6f37fdd8597fd5c9b6f9e1950b870634
1 parent
07637723
Exists in
master
and in
3 other branches
Testando módulo HLLAPI.
Showing
2 changed files
with
30 additions
and
2 deletions
Show diff stats
src/lib3270++/testprogram/testprogram.cc
... | ... | @@ -36,6 +36,7 @@ |
36 | 36 | * |
37 | 37 | */ |
38 | 38 | |
39 | + #include <getopt.h> | |
39 | 40 | #include <cstdlib> |
40 | 41 | #include <lib3270++.h> |
41 | 42 | |
... | ... | @@ -43,9 +44,33 @@ |
43 | 44 | |
44 | 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 | 75 | try { |
51 | 76 | ... | ... |
src/lib3270++/windows/session.cc
... | ... | @@ -39,6 +39,7 @@ |
39 | 39 | #include "../private.h" |
40 | 40 | #include <cstring> |
41 | 41 | #include <lib3270/trace.h> |
42 | + #include <algorithm> | |
42 | 43 | |
43 | 44 | using std::string; |
44 | 45 | |
... | ... | @@ -59,6 +60,8 @@ |
59 | 60 | pipename += "\\"; |
60 | 61 | pipename += (ptr+1); |
61 | 62 | |
63 | + std::transform(pipename.begin(), pipename.end(), pipename.begin(), ::tolower); | |
64 | + | |
62 | 65 | debug("pipename: \"%s\"",pipename.c_str()); |
63 | 66 | |
64 | 67 | this->hPipe = CreateFile( | ... | ... |