Commit 25a7945f7518602be753747c5b0ed49e0d17d506
1 parent
262966b2
Exists in
master
Updating api calls.
Showing
3 changed files
with
10 additions
and
14 deletions
Show diff stats
pw3270-sharp.cbp
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | <CodeBlocks_project_file> |
3 | 3 | <FileVersion major="1" minor="6" /> |
4 | 4 | <Project> |
5 | - <Option title="Mono Bindings for lib3270" /> | |
5 | + <Option title=".NET Bindings for lib3270/pw3270" /> | |
6 | 6 | <Option makefile_is_custom="1" /> |
7 | 7 | <Option pch_mode="2" /> |
8 | 8 | <Option compiler="gcc" /> | ... | ... |
src/native/get.cc
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | * @brief Obtém a versão da biblioteca. |
37 | 37 | * |
38 | 38 | */ |
39 | - int tn3270_get_version(TN3270::Session *ses, char* str, int strlen) { | |
39 | + int tn3270_get_version(TN3270::Session *ses, char * str, int strlen) { | |
40 | 40 | |
41 | 41 | if(!ses) { |
42 | 42 | return -1; |
... | ... | @@ -116,19 +116,19 @@ |
116 | 116 | |
117 | 117 | int tn3270_get_secure(TN3270::Session *ses) { |
118 | 118 | |
119 | - /* | |
120 | 119 | if(!ses) { |
121 | 120 | return -1; |
122 | 121 | } |
123 | 122 | |
124 | 123 | try { |
125 | 124 | |
126 | - return (int) ses->get_secure(); | |
125 | + return (int) ses->getSSLState(); | |
127 | 126 | |
128 | 127 | } catch(const exception &e) { |
128 | + | |
129 | 129 | tn3270_lasterror = e.what(); |
130 | + | |
130 | 131 | } |
131 | - */ | |
132 | 132 | |
133 | 133 | return -1; |
134 | 134 | ... | ... |
src/native/screen.cc
... | ... | @@ -65,7 +65,7 @@ int tn3270_get_string(TN3270::Session *ses, int addr, char* str, int strlen) { |
65 | 65 | |
66 | 66 | try { |
67 | 67 | memset(str,0,strlen); |
68 | - strncpy(str,ses->toString(addr,strlen).c_str(),strlen); | |
68 | + strncpy(str,ses->toString(addr,(size_t) strlen).c_str(),strlen); | |
69 | 69 | } catch(const exception &e) { |
70 | 70 | tn3270_lasterror = e.what(); |
71 | 71 | return -1; |
... | ... | @@ -74,7 +74,7 @@ int tn3270_get_string(TN3270::Session *ses, int addr, char* str, int strlen) { |
74 | 74 | return 0; |
75 | 75 | } |
76 | 76 | |
77 | -int tn3270_get_string_at(TN3270::Session *ses, int row, int col, char* str, int sz) { | |
77 | +int tn3270_get_string_at(TN3270::Session *ses, int row, int col, char* str, int length) { | |
78 | 78 | |
79 | 79 | if(!ses) { |
80 | 80 | return -1; |
... | ... | @@ -82,8 +82,8 @@ int tn3270_get_string_at(TN3270::Session *ses, int row, int col, char* str, int |
82 | 82 | |
83 | 83 | try { |
84 | 84 | |
85 | - memset(str,0,sz+1); | |
86 | - strncpy(str,ses->toString(row,col,(size_t) sz).c_str(),sz); | |
85 | + memset(str,0,length); | |
86 | + strncpy(str,ses->toString(row,col,(size_t) length).c_str(),length); | |
87 | 87 | |
88 | 88 | } catch(const exception &e) { |
89 | 89 | tn3270_lasterror = e.what(); |
... | ... | @@ -111,7 +111,6 @@ int tn3270_set_string_at(TN3270::Session *ses, int row, int col, const char* str |
111 | 111 | |
112 | 112 | int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char *key, int timeout) { |
113 | 113 | |
114 | - /* | |
115 | 114 | if(ses) { |
116 | 115 | |
117 | 116 | try { |
... | ... | @@ -125,7 +124,6 @@ int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char |
125 | 124 | } |
126 | 125 | |
127 | 126 | } |
128 | - */ | |
129 | 127 | |
130 | 128 | return -1; |
131 | 129 | |
... | ... | @@ -133,17 +131,15 @@ int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char |
133 | 131 | |
134 | 132 | int tn3270_cmp_string_at(TN3270::Session *ses, int row, int col, const char* str) { |
135 | 133 | |
136 | - /* | |
137 | 134 | if(ses) { |
138 | 135 | |
139 | 136 | try { |
140 | - return ses->cmp_string_at(row,col,str); | |
137 | + return ses->compare(row,col,str,strlen(str)); | |
141 | 138 | } catch(const exception &e) { |
142 | 139 | tn3270_lasterror = e.what(); |
143 | 140 | } |
144 | 141 | |
145 | 142 | } |
146 | - */ | |
147 | 143 | |
148 | 144 | return -1; |
149 | 145 | } | ... | ... |