diff --git a/android/jni/main.cpp b/android/jni/main.cpp index b5e745e..fe251ad 100644 --- a/android/jni/main.cpp +++ b/android/jni/main.cpp @@ -365,7 +365,7 @@ JNIEXPORT void JNICALL Java_br_com_bb_pw3270_lib3270_setStartupScript(JNIEnv *en JNIEXPORT jstring JNICALL Java_br_com_bb_pw3270_lib3270_getHost(JNIEnv *env, jobject obj) { - return env->NewStringUTF(lib3270_get_host(lib3270_get_default_session_handle())); + return env->NewStringUTF(lib3270_get_hostname(lib3270_get_default_session_handle())); } JNIEXPORT void JNICALL Java_br_com_bb_pw3270_lib3270_set_1connection_1status(JNIEnv *env, jobject obj, jboolean connected) diff --git a/src/include/lib3270.h b/src/include/lib3270.h index 6b7a1c4..8b0c36f 100644 --- a/src/include/lib3270.h +++ b/src/include/lib3270.h @@ -409,14 +409,14 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *url); /** - * Get host id for the connect/reconnect operations. + * Get hostname for the connect/reconnect operations. * * @param h Session handle. * * @return Pointer to host id set (internal data, do not change it) * */ - LIB3270_EXPORT const char * lib3270_get_host(H3270 *h); + LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h); /** * Network connect operation, keep main loop running diff --git a/src/include/pw3270.h b/src/include/pw3270.h index 0d93cfc..5737040 100644 --- a/src/include/pw3270.h +++ b/src/include/pw3270.h @@ -53,7 +53,7 @@ LIB3270_EXPORT GtkWidget * pw3270_new(const gchar *host, const gchar *systype, unsigned short colors); LIB3270_EXPORT const gchar * pw3270_set_host(GtkWidget *widget, const gchar *uri); - LIB3270_EXPORT const gchar * pw3270_get_host(GtkWidget *widget); + LIB3270_EXPORT const gchar * pw3270_get_hostname(GtkWidget *widget); LIB3270_EXPORT void pw3270_connect_host(GtkWidget *widget, const gchar *uri); LIB3270_EXPORT gboolean pw3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix); diff --git a/src/include/pw3270/v3270.h b/src/include/pw3270/v3270.h index 447253e..e3ed671 100644 --- a/src/include/pw3270/v3270.h +++ b/src/include/pw3270/v3270.h @@ -214,7 +214,7 @@ LIB3270_EXPORT void v3270_set_session_options(GtkWidget *widget, LIB3270_OPTION options); LIB3270_EXPORT int v3270_set_session_color_type(GtkWidget *widget, unsigned short colortype); LIB3270_EXPORT const gchar * v3270_set_host(GtkWidget *widget, const gchar *uri); - LIB3270_EXPORT const gchar * v3270_get_host(GtkWidget *widget); + LIB3270_EXPORT const gchar * v3270_get_hostname(GtkWidget *widget); LIB3270_EXPORT GtkWidget * v3270_get_default_widget(void); // Keyboard & Mouse special actions diff --git a/src/lib3270/api.h b/src/lib3270/api.h index 0578389..c6beed4 100644 --- a/src/lib3270/api.h +++ b/src/lib3270/api.h @@ -319,7 +319,6 @@ /* Get connection info */ #define get_connected_lu(h) lib3270_get_luname(h) -// #define get_current_host(h) lib3270_get_host(h) LOCAL_EXTERN SCRIPT_STATE status_script(SCRIPT_STATE state); diff --git a/src/lib3270/host.c b/src/lib3270/host.c index 3e03990..1bcce31 100644 --- a/src/lib3270/host.c +++ b/src/lib3270/host.c @@ -714,7 +714,7 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n) Replace(h->host.full, lib3270_strdup_printf( "%s%s:%s%s%s", - h->host.opt&LIB3270_CONNECT_OPTION_SSL ? "L:" : "", + h->host.opt&LIB3270_CONNECT_OPTION_SSL ? "tn3270s://" : "", hostname, srvc, *query ? "?" : "", @@ -727,10 +727,10 @@ LIB3270_EXPORT const char * lib3270_set_host(H3270 *h, const char *n) return h->host.current; } -LIB3270_EXPORT const char * lib3270_get_host(H3270 *h) +LIB3270_EXPORT const char * lib3270_get_hostname(H3270 *h) { CHECK_SESSION_HANDLE(h); - return h->host.full; + return h->host.current; } LIB3270_EXPORT int lib3270_reconnect(H3270 *hSession,int wait) diff --git a/src/lib3270/macros.c b/src/lib3270/macros.c index 30112dc..f92929a 100644 --- a/src/lib3270/macros.c +++ b/src/lib3270/macros.c @@ -183,7 +183,7 @@ { const char * luname = (const char *) lib3270_get_luname(hSession); const char * state = get_state(hSession); - const char * host = (const char *) lib3270_get_host(hSession); + const char * host = (const char *) lib3270_get_hostname(hSession); char * rsp; size_t sz; diff --git a/src/pw3270/v3270/security.c b/src/pw3270/v3270/security.c index 9c2fc44..8d371a6 100644 --- a/src/pw3270/v3270/security.c +++ b/src/pw3270/v3270/security.c @@ -310,7 +310,7 @@ g_return_val_if_fail(GTK_IS_V3270(widget),""); if(lib3270_get_secure(GTK_V3270(widget)->host) == LIB3270_SSL_UNSECURE) - return v3270_get_host(widget); + return v3270_get_hostname(widget); #ifdef HAVE_LIBSSL if(lib3270_get_secure(GTK_V3270(widget)->host) != LIB3270_SSL_UNSECURE) @@ -320,7 +320,7 @@ return gettext(info->text); } #endif // HAVE_LIBSSL - return v3270_get_host(widget); + return v3270_get_hostname(widget); } LIB3270_EXPORT const gchar * v3270_get_ssl_status_message(GtkWidget *widget) @@ -362,7 +362,7 @@ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, - "%s",v3270_get_host(widget) + "%s",v3270_get_hostname(widget) ); gtk_message_dialog_format_secondary_markup( diff --git a/src/pw3270/v3270/widget.c b/src/pw3270/v3270/widget.c index 256082e..38709e3 100644 --- a/src/pw3270/v3270/widget.c +++ b/src/pw3270/v3270/widget.c @@ -1495,7 +1495,7 @@ static void v3270_activate(GtkWidget *widget) if(lib3270_connected(terminal->host)) lib3270_enter(terminal->host); - else if(lib3270_get_host(terminal->host)) + else if(lib3270_get_hostname(terminal->host)) v3270_connect(widget,NULL); else g_warning("Terminal widget %p activated without connection or valid hostname",terminal); @@ -1557,10 +1557,10 @@ const gchar * v3270_set_host(GtkWidget *widget, const gchar *uri) return lib3270_set_host(GTK_V3270(widget)->host,uri); } -const gchar * v3270_get_host(GtkWidget *widget) +const gchar * v3270_get_hostname(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_V3270(widget),""); - return lib3270_get_host(GTK_V3270(widget)->host); + return lib3270_get_hostname(GTK_V3270(widget)->host); } const gchar * v3270_get_session_name(GtkWidget *widget) diff --git a/src/pw3270/window.c b/src/pw3270/window.c index 2a31d59..bc7b131 100644 --- a/src/pw3270/window.c +++ b/src/pw3270/window.c @@ -239,10 +239,10 @@ return v3270_set_host(GTK_PW3270(widget)->terminal,uri); } - const gchar * pw3270_get_host(GtkWidget *widget) + const gchar * pw3270_get_hostname(GtkWidget *widget) { g_return_val_if_fail(GTK_IS_PW3270(widget),""); - return v3270_get_host(GTK_PW3270(widget)->terminal); + return v3270_get_hostname(GTK_PW3270(widget)->terminal); } gboolean pw3270_get_toggle(GtkWidget *widget, LIB3270_TOGGLE ix) @@ -271,7 +271,7 @@ if(v3270_is_connected(widget)) { - const gchar *host = v3270_get_host(widget); + const gchar *host = v3270_get_hostname(widget); if(host && *host) title = g_strdup_printf("%s - %s",v3270_get_session_name(widget),host); -- libgit2 0.21.2