diff --git a/api.h b/api.h index 7bd33cf..1fb1403 100644 --- a/api.h +++ b/api.h @@ -119,7 +119,7 @@ /** connection state */ #define cstate LIB3270_CSTATE - #define NOT_CONNECTED LIB3270_NOT_CONNECTED +// #define NOT_CONNECTED LIB3270_NOT_CONNECTED #define RESOLVING LIB3270_RESOLVING #define PENDING LIB3270_PENDING #define CONNECTED_INITIAL LIB3270_CONNECTED_INITIAL diff --git a/host.c b/host.c index 10a5d8b..616691f 100644 --- a/host.c +++ b/host.c @@ -556,7 +556,7 @@ void lib3270_set_disconnected(H3270 *hSession) { CHECK_SESSION_HANDLE(hSession); - hSession->cstate = NOT_CONNECTED; + hSession->cstate = LIB3270_NOT_CONNECTED; hSession->starting = 0; set_status(hSession,OIA_FLAG_UNDERA,False); diff --git a/state.c b/state.c index d47aa44..8522b6c 100644 --- a/state.c +++ b/state.c @@ -55,6 +55,13 @@ LIB3270_EXPORT int lib3270_connected(H3270 *h) return ((int) h->cstate >= (int)CONNECTED_INITIAL); } +LIB3270_EXPORT int lib3270_disconnected(H3270 *h) +{ + CHECK_SESSION_HANDLE(h); + return ((int) h->cstate == (int)LIB3270_NOT_CONNECTED); +} + + LIB3270_EXPORT int lib3270_in_neither(H3270 *h) { CHECK_SESSION_HANDLE(h); diff --git a/telnet.c b/telnet.c index 695b75f..c06f46a 100644 --- a/telnet.c +++ b/telnet.c @@ -2430,7 +2430,7 @@ static void do_lnext(H3270 *hSession, char c) */ static void check_in3270(H3270 *hSession) { - LIB3270_CSTATE new_cstate = NOT_CONNECTED; + LIB3270_CSTATE new_cstate = LIB3270_NOT_CONNECTED; #if defined(X3270_TRACE) /*[*/ static const char *state_name[] = -- libgit2 0.21.2