diff --git a/po/pt_BR.po b/po/pt_BR.po index 7c1a33a..6879c92 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2012-09-20 18:39-0300\n" +"POT-Creation-Date: 2012-09-24 23:07-0300\n" "PO-Revision-Date: 2012-09-20 17:33-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Português \n" diff --git a/src/include/pw3270.h b/src/include/pw3270.h index c774d85..a5e4a12 100644 --- a/src/include/pw3270.h +++ b/src/include/pw3270.h @@ -66,6 +66,8 @@ LIB3270_EXPORT const gchar * pw3270_get_session_name(GtkWidget *widget); LIB3270_EXPORT void pw3270_set_session_name(GtkWidget *widget, const gchar *name); + LIB3270_EXPORT gint pw3270_get_integer(GtkWidget *widget, const gchar *group, const gchar *key, gint def); + #ifdef HAVE_GTKMAC #include LIB3270_EXPORT GtkMacBundle * pw3270_get_bundle(void); diff --git a/src/plugins/remotectl/hllapi.c b/src/plugins/remotectl/hllapi.c index ed265ae..23dbd32 100644 --- a/src/plugins/remotectl/hllapi.c +++ b/src/plugins/remotectl/hllapi.c @@ -103,7 +103,9 @@ data->rc = *rc; data->len = length; - memcpy(data->string,arg,length); + if(arg && length > 0) + memcpy(data->string,arg,length); + memset(buffer,0,HLLAPI_MAXLENGTH); if(!TransactNamedPipe(hPipe,(LPVOID) data,cbSize,buffer,HLLAPI_MAXLENGTH,&cbSize,NULL)) @@ -161,16 +163,19 @@ char * inBuffer = NULL; char * outBuffer = NULL; - if(*length <= 0 || *length > HLLAPI_MAXLENGTH) + if(*length < 0 || *length > HLLAPI_MAXLENGTH) { *rc = EINVAL; return 0; } // Copy input argument - inBuffer = malloc(*length+1); - memcpy(inBuffer,buffer,*length); - inBuffer[*length] = 0; + if(*length) + { + inBuffer = malloc(*length+1); + memcpy(inBuffer,buffer,*length); + inBuffer[*length] = 0; + } // Clear output buffer memset(buffer,' ',*length); diff --git a/src/plugins/remotectl/remotectl.c b/src/plugins/remotectl/remotectl.c index fbd5dca..de33562 100644 --- a/src/plugins/remotectl/remotectl.c +++ b/src/plugins/remotectl/remotectl.c @@ -163,6 +163,7 @@ if(!lib3270_connected(hSession)) return ENOTCONN; + trace("%s: pos=%d row=%d col=%d",__FUNCTION__,rc,rc/80,rc%80); lib3270_set_cursor_address(hSession,(int) rc); return 0; } @@ -198,6 +199,9 @@ switch(*(ptr++)) { + case 'P': // Print + break; + case 'E': // Enter lib3270_enter(hSession); break; @@ -275,7 +279,7 @@ static int cmd_wait(H3270 *hSession, unsigned short rc, char *text, unsigned short length) { - return lib3270_wait_for_ready(hSession,60); + return lib3270_wait_for_ready(hSession,pw3270_get_integer(pw3270_get_toplevel(),"hllapi","wait",2)); } static int cmd_copypstostr(H3270 *hSession, unsigned short pos, char *outBuff, unsigned short length) diff --git a/src/pw3270/tools.c b/src/pw3270/tools.c index f8dc685..4e70e19 100644 --- a/src/pw3270/tools.c +++ b/src/pw3270/tools.c @@ -99,3 +99,8 @@ LIB3270_EXPORT void pw3270_restore_window(GtkWidget *widget, const gchar *name) { restore_window_from_config("window", name, widget); } + +LIB3270_EXPORT gint pw3270_get_integer(GtkWidget *widget, const gchar *group, const gchar *key, gint def) +{ + return get_integer_from_config(group, key, def); +} -- libgit2 0.21.2