From 07a80fd06cbb1b0728441886944b583d4e5011de Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Tue, 19 Feb 2019 15:59:51 -0300 Subject: [PATCH] Adding lib3270 actions as commands on trace window. --- src/trace/exec.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/trace/exec.c b/src/trace/exec.c index 8a26566..c4631f1 100644 --- a/src/trace/exec.c +++ b/src/trace/exec.c @@ -40,6 +40,7 @@ #include #include #include + #include #include #include #include @@ -108,6 +109,8 @@ int v3270_exec_command(GtkWidget *widget, const gchar *text) { + size_t ix; + g_return_val_if_fail(GTK_IS_V3270(widget),EINVAL); H3270 *hSession = v3270_get_session(widget); @@ -147,7 +150,23 @@ if(sep) { *(sep++) = 0; - set_property(hSession,g_strstrip(cmdline),g_strstrip(sep)); + return set_property(hSession,g_strstrip(cmdline),g_strstrip(sep)); + } + else + { + // Check for lib3270 actions. + const LIB3270_ACTION_ENTRY *actions = lib3270_get_action_table(); + + for(ix=0; actions[ix].name; ix++) + { + if(!g_ascii_strcasecmp(actions[ix].name,cmdline)) + { + lib3270_trace_event(hSession,"Action: %s\n",actions[ix].name); + return actions[ix].call(hSession); + } + + } + } return errno = ENOENT; -- libgit2 0.21.2