Commit f2132466ff6b007ceb841d697b913265099a3006
1 parent
c26f54c3
Exists in
master
and in
5 other branches
Issue #1 - Alterando hllapi_connect, hllapi_wait_for_ready e hllapi_wait para re…
…tornar o valor HLLAPI correspondente ao estado do terminal ao invés do código de retorno da lib3270.
Showing
3 changed files
with
18 additions
and
13 deletions
Show diff stats
install-cross.sh
@@ -64,6 +64,11 @@ do | @@ -64,6 +64,11 @@ do | ||
64 | 64 | ||
65 | case $parameter in | 65 | case $parameter in |
66 | 66 | ||
67 | + ar) | ||
68 | + zypper ar --refresh http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_42.1/ mingw32 | ||
69 | + zypper ar --refresh http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_42.1/ mingw64 | ||
70 | + ;; | ||
71 | + | ||
67 | 32) | 72 | 32) |
68 | install_packages mingw32 | 73 | install_packages mingw32 |
69 | ;; | 74 | ;; |
src/include/pw3270/hllapi.h
@@ -140,7 +140,7 @@ extern "C" { | @@ -140,7 +140,7 @@ extern "C" { | ||
140 | HLLAPI_API_CALL hllapi_erase_eol(void); | 140 | HLLAPI_API_CALL hllapi_erase_eol(void); |
141 | HLLAPI_API_CALL hllapi_erase_input(void); | 141 | HLLAPI_API_CALL hllapi_erase_input(void); |
142 | 142 | ||
143 | - HLLAPI_API_CALL hllapi_action(LPSTR buffer); | 143 | + HLLAPI_API_CALL hllapi_action(LPSTR buffer); |
144 | 144 | ||
145 | HLLAPI_API_CALL hllapi_print(void); | 145 | HLLAPI_API_CALL hllapi_print(void); |
146 | 146 |
src/plugins/hllapi/calls.cc
@@ -97,18 +97,16 @@ | @@ -97,18 +97,16 @@ | ||
97 | 97 | ||
98 | HLLAPI_API_CALL hllapi_connect(LPSTR uri, WORD wait) | 98 | HLLAPI_API_CALL hllapi_connect(LPSTR uri, WORD wait) |
99 | { | 99 | { |
100 | - int rc = HLLAPI_STATUS_SUCCESS; | ||
101 | - | ||
102 | try | 100 | try |
103 | { | 101 | { |
104 | - rc = session::get_default()->connect(uri,hllapi_timeout); | 102 | + session::get_default()->connect(uri,hllapi_timeout); |
105 | } | 103 | } |
106 | catch(std::exception &e) | 104 | catch(std::exception &e) |
107 | { | 105 | { |
108 | return HLLAPI_STATUS_SYSTEM_ERROR; | 106 | return HLLAPI_STATUS_SYSTEM_ERROR; |
109 | } | 107 | } |
110 | 108 | ||
111 | - return rc; | 109 | + return hllapi_get_state(); |
112 | } | 110 | } |
113 | 111 | ||
114 | HLLAPI_API_CALL hllapi_is_connected(void) | 112 | HLLAPI_API_CALL hllapi_is_connected(void) |
@@ -120,11 +118,11 @@ | @@ -120,11 +118,11 @@ | ||
120 | { | 118 | { |
121 | switch(hllapi_get_message_id()) | 119 | switch(hllapi_get_message_id()) |
122 | { | 120 | { |
123 | - case LIB3270_MESSAGE_NONE: /* 0 - No message */ | ||
124 | - return HLLAPI_STATUS_SUCCESS; | 121 | + case LIB3270_MESSAGE_NONE: // 0 - No message |
122 | + return HLLAPI_STATUS_SUCCESS; // keyboard was unlocked and ready for input. | ||
125 | 123 | ||
126 | - case LIB3270_MESSAGE_DISCONNECTED: /* 4 - Disconnected from host */ | ||
127 | - return HLLAPI_STATUS_DISCONNECTED; | 124 | + case LIB3270_MESSAGE_DISCONNECTED: // 4 - Disconnected from host |
125 | + return HLLAPI_STATUS_DISCONNECTED; // Your application program was not connected to a valid session. | ||
128 | 126 | ||
129 | case LIB3270_MESSAGE_MINUS: | 127 | case LIB3270_MESSAGE_MINUS: |
130 | case LIB3270_MESSAGE_PROTECTED: | 128 | case LIB3270_MESSAGE_PROTECTED: |
@@ -132,7 +130,7 @@ | @@ -132,7 +130,7 @@ | ||
132 | case LIB3270_MESSAGE_OVERFLOW: | 130 | case LIB3270_MESSAGE_OVERFLOW: |
133 | case LIB3270_MESSAGE_INHIBIT: | 131 | case LIB3270_MESSAGE_INHIBIT: |
134 | case LIB3270_MESSAGE_KYBDLOCK: | 132 | case LIB3270_MESSAGE_KYBDLOCK: |
135 | - return HLLAPI_STATUS_KEYBOARD_LOCKED; | 133 | + return HLLAPI_STATUS_KEYBOARD_LOCKED; // keyboard is locked. |
136 | 134 | ||
137 | case LIB3270_MESSAGE_SYSWAIT: | 135 | case LIB3270_MESSAGE_SYSWAIT: |
138 | case LIB3270_MESSAGE_TWAIT: | 136 | case LIB3270_MESSAGE_TWAIT: |
@@ -140,7 +138,7 @@ | @@ -140,7 +138,7 @@ | ||
140 | case LIB3270_MESSAGE_X: | 138 | case LIB3270_MESSAGE_X: |
141 | case LIB3270_MESSAGE_RESOLVING: | 139 | case LIB3270_MESSAGE_RESOLVING: |
142 | case LIB3270_MESSAGE_CONNECTING: | 140 | case LIB3270_MESSAGE_CONNECTING: |
143 | - return HLLAPI_STATUS_WAITING; | 141 | + return HLLAPI_STATUS_WAITING; // time-out while still busy (in XCLOCK or XSYSTEM in X) for the 3270 terminal emulation. |
144 | } | 142 | } |
145 | 143 | ||
146 | return HLLAPI_STATUS_SYSTEM_ERROR; | 144 | return HLLAPI_STATUS_SYSTEM_ERROR; |
@@ -154,12 +152,14 @@ | @@ -154,12 +152,14 @@ | ||
154 | 152 | ||
155 | HLLAPI_API_CALL hllapi_wait_for_ready(WORD seconds) | 153 | HLLAPI_API_CALL hllapi_wait_for_ready(WORD seconds) |
156 | { | 154 | { |
157 | - return session::get_default()->wait_for_ready(seconds); | 155 | + session::get_default()->wait_for_ready(seconds); |
156 | + return hllapi_get_state(); | ||
158 | } | 157 | } |
159 | 158 | ||
160 | HLLAPI_API_CALL hllapi_wait(WORD seconds) | 159 | HLLAPI_API_CALL hllapi_wait(WORD seconds) |
161 | { | 160 | { |
162 | - return session::get_default()->wait(seconds); | 161 | + session::get_default()->wait(seconds); |
162 | + return hllapi_get_state(); | ||
163 | } | 163 | } |
164 | 164 | ||
165 | HLLAPI_API_CALL hllapi_get_message_id(void) | 165 | HLLAPI_API_CALL hllapi_get_message_id(void) |