From 828f2c8cf3239fc3a8421c23699084e61abbe114 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Thu, 26 Sep 2019 10:42:32 -0300 Subject: [PATCH] Updating to the new action methods from lib3270. --- client/src/session/local/actions.cc | 2 +- gitsync.sh | 21 ++++++++++++++------- server/src/core/methods/action.c | 2 +- server/src/core/methods/methods.c | 9 +++++++++ 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/client/src/session/local/actions.cc b/client/src/session/local/actions.cc index f30c616..4c45fa3 100644 --- a/client/src/session/local/actions.cc +++ b/client/src/session/local/actions.cc @@ -45,7 +45,7 @@ void Local::Session::action(const char *action_name) { std::lock_guard lock(sync); - chkResponse(lib3270_action(hSession,action_name)); + chkResponse(lib3270_action_activate_by_name(action_name,hSession)); } void Local::Session::connect(const char *url, int seconds) { diff --git a/gitsync.sh b/gitsync.sh index 670632c..3d89d0a 100755 --- a/gitsync.sh +++ b/gitsync.sh @@ -1,27 +1,34 @@ #!/bin/bash # # https://help.github.com/articles/syncing-a-fork/ +# # https://help.github.com/articles/configuring-a-remote-for-a-fork/ +# # https://www.opentechguides.com/how-to/article/git/177/git-sync-repos.html # # Setup: # -# git remote add --mirror=fetch secondary https://secondary_repo_url/secondary_repo.git -# git fetch origin -# git push secondary --all +# git remote add github https://github.com/PerryWerneck/lib3270.git # # git push git fetch origin -git checkout master -git merge origin/master +git merge -for repo in $(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') +REPOS=$(git remote -v | grep -v origin | grep "(push)" | awk '{print $1}') + +for repo in ${REPOS} +do + echo "Getting updates from ${repo} ..." + git fetch ${repo} + git merge +done + +for repo in ${REPOS} do echo "Updating ${repo} ..." git push ${repo} done - diff --git a/server/src/core/methods/action.c b/server/src/core/methods/action.c index 44f97e4..032a090 100644 --- a/server/src/core/methods/action.c +++ b/server/src/core/methods/action.c @@ -39,7 +39,7 @@ int ipc3270_method_action(GObject *session, GVariant *request, GObject *response GVariant *value = g_variant_get_child_value(request,0); - ipc3270_response_append_int32(response, lib3270_action(ipc3270_get_session(session),g_variant_get_string(value,NULL))); + ipc3270_response_append_int32(response, lib3270_action_activate_by_name(g_variant_get_string(value,NULL), ipc3270_get_session(session))); g_variant_unref(value); diff --git a/server/src/core/methods/methods.c b/server/src/core/methods/methods.c index 891786b..3810c9c 100644 --- a/server/src/core/methods/methods.c +++ b/server/src/core/methods/methods.c @@ -98,6 +98,14 @@ int ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *req } // Check actions table. + const LIB3270_ACTION * action = lib3270_get_action(method_name); + if(action) { + if(lib3270_action_activate(action,hSession)) { + ipc3270_set_error(object,errno,error); + } + return 0; + } + /* const LIB3270_ACTION * actions = lib3270_get_actions(); for(ix = 0; actions[ix].name; ix++) { @@ -114,6 +122,7 @@ int ipc3270_method_call(GObject *object, const gchar *method_name, GVariant *req } } + */ // Check lib3270 internal methods const IPC_METHOD_INT_ARG * int_methods = ipc3270_get_int_arg_methods(); -- libgit2 0.21.2