Commit 25a7945f7518602be753747c5b0ed49e0d17d506

Authored by Perry Werneck
1 parent 262966b2
Exists in master

Updating api calls.

pw3270-sharp.cbp
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <CodeBlocks_project_file> 2 <CodeBlocks_project_file>
3 <FileVersion major="1" minor="6" /> 3 <FileVersion major="1" minor="6" />
4 <Project> 4 <Project>
5 - <Option title="Mono Bindings for lib3270" /> 5 + <Option title=".NET Bindings for lib3270/pw3270" />
6 <Option makefile_is_custom="1" /> 6 <Option makefile_is_custom="1" />
7 <Option pch_mode="2" /> 7 <Option pch_mode="2" />
8 <Option compiler="gcc" /> 8 <Option compiler="gcc" />
src/native/get.cc
@@ -36,7 +36,7 @@ @@ -36,7 +36,7 @@
36 * @brief Obtém a versão da biblioteca. 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 if(!ses) { 41 if(!ses) {
42 return -1; 42 return -1;
@@ -116,19 +116,19 @@ @@ -116,19 +116,19 @@
116 116
117 int tn3270_get_secure(TN3270::Session *ses) { 117 int tn3270_get_secure(TN3270::Session *ses) {
118 118
119 - /*  
120 if(!ses) { 119 if(!ses) {
121 return -1; 120 return -1;
122 } 121 }
123 122
124 try { 123 try {
125 124
126 - return (int) ses->get_secure(); 125 + return (int) ses->getSSLState();
127 126
128 } catch(const exception &e) { 127 } catch(const exception &e) {
  128 +
129 tn3270_lasterror = e.what(); 129 tn3270_lasterror = e.what();
  130 +
130 } 131 }
131 - */  
132 132
133 return -1; 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,7 +65,7 @@ int tn3270_get_string(TN3270::Session *ses, int addr, char* str, int strlen) {
65 65
66 try { 66 try {
67 memset(str,0,strlen); 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 } catch(const exception &e) { 69 } catch(const exception &e) {
70 tn3270_lasterror = e.what(); 70 tn3270_lasterror = e.what();
71 return -1; 71 return -1;
@@ -74,7 +74,7 @@ int tn3270_get_string(TN3270::Session *ses, int addr, char* str, int strlen) { @@ -74,7 +74,7 @@ int tn3270_get_string(TN3270::Session *ses, int addr, char* str, int strlen) {
74 return 0; 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 if(!ses) { 79 if(!ses) {
80 return -1; 80 return -1;
@@ -82,8 +82,8 @@ int tn3270_get_string_at(TN3270::Session *ses, int row, int col, char* str, int @@ -82,8 +82,8 @@ int tn3270_get_string_at(TN3270::Session *ses, int row, int col, char* str, int
82 82
83 try { 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 } catch(const exception &e) { 88 } catch(const exception &e) {
89 tn3270_lasterror = e.what(); 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,7 +111,6 @@ int tn3270_set_string_at(TN3270::Session *ses, int row, int col, const char* str
111 111
112 int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char *key, int timeout) { 112 int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char *key, int timeout) {
113 113
114 - /*  
115 if(ses) { 114 if(ses) {
116 115
117 try { 116 try {
@@ -125,7 +124,6 @@ int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char @@ -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 return -1; 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,17 +131,15 @@ int tn3270_wait_for_string_at(TN3270::Session *ses, int row, int col, const char
133 131
134 int tn3270_cmp_string_at(TN3270::Session *ses, int row, int col, const char* str) { 132 int tn3270_cmp_string_at(TN3270::Session *ses, int row, int col, const char* str) {
135 133
136 - /*  
137 if(ses) { 134 if(ses) {
138 135
139 try { 136 try {
140 - return ses->cmp_string_at(row,col,str); 137 + return ses->compare(row,col,str,strlen(str));
141 } catch(const exception &e) { 138 } catch(const exception &e) {
142 tn3270_lasterror = e.what(); 139 tn3270_lasterror = e.what();
143 } 140 }
144 141
145 } 142 }
146 - */  
147 143
148 return -1; 144 return -1;
149 } 145 }