diff --git a/bootstrap.sh b/bootstrap.sh index c1ff273..070a6f7 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,7 @@ #!/bin/bash PACKAGE_VERSION=4.2 -PACKAGE_RELEASE=5 +PACKAGE_RELEASE=6 REV_FILE=./revision.m4 REV=`date +%y%m%d%H%M` diff --git a/src/gtk2/action_calls.c b/src/gtk2/action_calls.c index ea06ce3..70d742a 100644 --- a/src/gtk2/action_calls.c +++ b/src/gtk2/action_calls.c @@ -54,10 +54,11 @@ char *ptr; gboolean again = TRUE; char buffer[1024]; - GtkTable *table = GTK_TABLE(gtk_table_new(2,4,FALSE)); + GtkTable *table = GTK_TABLE(gtk_table_new(2,6,FALSE)); GtkEntry *host = GTK_ENTRY(gtk_entry_new()); GtkEntry *port = GTK_ENTRY(gtk_entry_new()); - GtkToggleButton *checkbox = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label( _( "Secure connection" ) )); + GtkToggleButton *secure = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label( _( "Secure connection" ) )); + GtkToggleButton *as400 = GTK_TOGGLE_BUTTON(gtk_check_button_new_with_label( _( "Host is AS400" ) )); GtkWidget *dialog = gtk_dialog_new_with_buttons( _( "Select hostname" ), GTK_WINDOW(topwindow), GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT, @@ -73,12 +74,13 @@ gtk_entry_set_width_chars(port,7); gtk_table_attach(table,gtk_label_new( _( "Hostname:" ) ), 0,1,0,1,0,0,5,0); - gtk_table_attach(table,GTK_WIDGET(host), 1,2,0,1,GTK_EXPAND|GTK_FILL,0,0,0); + gtk_table_attach(table,GTK_WIDGET(host), 1,4,0,1,GTK_EXPAND|GTK_FILL,0,0,0); - gtk_table_attach(table,gtk_label_new( _( "Port:" ) ), 2,3,0,1,0,0,5,0); - gtk_table_attach(table,GTK_WIDGET(port), 3,4,0,1,GTK_FILL,0,0,0); + gtk_table_attach(table,gtk_label_new( _( "Port:" ) ), 4,5,0,1,0,0,5,0); + gtk_table_attach(table,GTK_WIDGET(port), 5,6,0,1,GTK_EXPAND|GTK_FILL,0,0,0); - gtk_table_attach(table,GTK_WIDGET(checkbox), 1,2,1,2,GTK_EXPAND|GTK_FILL,0,0,0); + gtk_table_attach(table,GTK_WIDGET(secure), 1,2,1,2,GTK_FILL,0,0,0); + gtk_table_attach(table,GTK_WIDGET(as400), 2,3,1,2,GTK_EXPAND|GTK_FILL,0,20,0); gtk_container_set_border_width(GTK_CONTAINER(table),5); @@ -89,16 +91,23 @@ #ifdef HAVE_LIBSSL if(!strncmp(hostname,"L:",2)) { - gtk_toggle_button_set_active(checkbox,TRUE); + gtk_toggle_button_set_active(secure,TRUE); hostname += 2; } #else - gtk_toggle_button_set_active(checkbox,FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(checkbox),FALSE); + gtk_toggle_button_set_active(secure,FALSE); + gtk_widget_set_sensitive(GTK_WIDGET(secure),FALSE); if(!strncmp(hostname,"L:",2)) hostname += 2; #endif + ptr = strchr(hostname,','); + if(ptr) + { + *(ptr++) = 0; + gtk_toggle_button_set_active(as400,strcmp(ptr,"as400") == 0); + } + ptr = strchr(hostname,':'); if(ptr) { @@ -123,7 +132,7 @@ gtk_widget_set_sensitive(dialog,FALSE); - if(gtk_toggle_button_get_active(checkbox)) + if(gtk_toggle_button_get_active(secure)) strcpy(buffer,"L:"); else *buffer = 0; @@ -132,6 +141,9 @@ strncat(buffer,":",1023); strncat(buffer,gtk_entry_get_text(port),1023); + if(gtk_toggle_button_get_active(as400)) + strncat(buffer,",as400",1023); + if(!host_connect(buffer,1)) { // Connection OK diff --git a/src/include/lib3270/api.h b/src/include/lib3270/api.h index f99920a..1f2f04b 100644 --- a/src/include/lib3270/api.h +++ b/src/include/lib3270/api.h @@ -197,6 +197,7 @@ int sock; /**< Network socket */ int net_sock; LIB3270_CSTATE cstate; /**< Connection state */ + int as400; /**< Host is AS400 */ #if defined(_WIN32) /*[*/ HANDLE sock_handle; diff --git a/src/lib/host.c b/src/lib/host.c index 8a6a7dd..fa5ca26 100644 --- a/src/lib/host.c +++ b/src/lib/host.c @@ -620,6 +620,9 @@ static int do_connect(H3270 *hSession, const char *n) int lib3270_connect(H3270 *h, const char *n, int wait) { + char * hostname; + char * options; + if(!h) h = &h3270; @@ -631,8 +634,20 @@ int lib3270_connect(H3270 *h, const char *n, int wait) if(PCONNECTED) return EBUSY; - if(do_connect(h,n)) + hostname = strdup(n); + + options = strchr(hostname,','); + if(options) + { + *(options++) = 0; + h->as400 = strcasecmp(options,"as400") == 0 ? 1 : 0; + } + + if(do_connect(h,hostname)) + { + free(hostname); return -1; + } if(wait) { @@ -647,6 +662,7 @@ int lib3270_connect(H3270 *h, const char *n, int wait) } } + free(hostname); return 0; } diff --git a/src/lib/kybd.c b/src/lib/kybd.c index 2d27c9e..faee7b5 100644 --- a/src/lib/kybd.c +++ b/src/lib/kybd.c @@ -546,10 +546,19 @@ LIB3270_FKEY_ACTION( pfkey ) if (kybdlock & KL_OIA_MINUS) return -1; - else if (kybdlock) + + if (kybdlock) + { + if(h3270.as400) + enq_key(pa_xlate,0); enq_key(pf_xlate,key-1); + } else + { + if(h3270.as400) + key_AID(pa_xlate[0]); key_AID(pf_xlate[key-1]); + } return 0; } -- libgit2 0.21.2