Commit 400cc160a2dfe7eea0b923cf8048ce2a1eeb4c51
1 parent
aa4812b8
Exists in
master
and in
1 other branch
Adding new method to ipc client objects.
Showing
3 changed files
with
8 additions
and
6 deletions
Show diff stats
client/src/include/lib3270/ipc.h
@@ -635,7 +635,6 @@ | @@ -635,7 +635,6 @@ | ||
635 | Host & push(unsigned short row, unsigned short col, const std::string &text); | 635 | Host & push(unsigned short row, unsigned short col, const std::string &text); |
636 | Host & push(const std::string &text); | 636 | Host & push(const std::string &text); |
637 | 637 | ||
638 | - Host & push(const char *text); | ||
639 | Host & push(int baddr, const char *str, int len = -1); | 638 | Host & push(int baddr, const char *str, int len = -1); |
640 | Host & push(unsigned short row, unsigned short col, const char *str, int len = -1); | 639 | Host & push(unsigned short row, unsigned short col, const char *str, int len = -1); |
641 | Host & push(const char *str, int len = -1); | 640 | Host & push(const char *str, int len = -1); |
client/src/session/local/set.cc
@@ -44,14 +44,17 @@ | @@ -44,14 +44,17 @@ | ||
44 | 44 | ||
45 | void Local::Session::set(const std::string &str) { | 45 | void Local::Session::set(const std::string &str) { |
46 | 46 | ||
47 | - std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); | ||
48 | - chkResponse(lib3270_input_string(hSession,(unsigned char *) str.c_str(),str.length())); | 47 | + std::lock_guard<std::mutex> lock(this->sync); |
48 | + | ||
49 | + int rc = lib3270_set_field(hSession,str.c_str(),str.length()); | ||
50 | + if(rc < 0) | ||
51 | + chkResponse(-rc); | ||
49 | 52 | ||
50 | } | 53 | } |
51 | 54 | ||
52 | void Local::Session::set(int baddr, const std::string &str) { | 55 | void Local::Session::set(int baddr, const std::string &str) { |
53 | 56 | ||
54 | - std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); | 57 | + std::lock_guard<std::mutex> lock(this->sync); |
55 | 58 | ||
56 | int rc = lib3270_set_string_at_address(hSession,baddr,(unsigned char *) str.c_str(),str.length()); | 59 | int rc = lib3270_set_string_at_address(hSession,baddr,(unsigned char *) str.c_str(),str.length()); |
57 | if(rc < 0) | 60 | if(rc < 0) |
@@ -61,7 +64,7 @@ | @@ -61,7 +64,7 @@ | ||
61 | 64 | ||
62 | void Local::Session::set(int row, int col, const std::string &str) { | 65 | void Local::Session::set(int row, int col, const std::string &str) { |
63 | 66 | ||
64 | - std::lock_guard<std::mutex> lock(const_cast<Local::Session *>(this)->sync); | 67 | + std::lock_guard<std::mutex> lock(this->sync); |
65 | 68 | ||
66 | int rc = lib3270_set_string_at(hSession,row,col,(unsigned char *) str.c_str(),str.length()); | 69 | int rc = lib3270_set_string_at(hSession,row,col,(unsigned char *) str.c_str(),str.length()); |
67 | if(rc < 0) | 70 | if(rc < 0) |