From 4a6490b96d8ac2da6a19b4f251c005ff1b1e7d61 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Bollo?= Date: Fri, 22 Sep 2017 16:09:10 +0200 Subject: [PATCH] Provide the name of the API MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Change-Id: I5b4e4b40385830d1b8921d079f5e7e732ec4247f Signed-off-by: José Bollo --- include/afb/afb-dynapi-itf.h | 3 +++ src/afb-export.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/include/afb/afb-dynapi-itf.h b/include/afb/afb-dynapi-itf.h index 38978a29..682558e0 100644 --- a/include/afb/afb-dynapi-itf.h +++ b/include/afb/afb-dynapi-itf.h @@ -43,6 +43,9 @@ struct afb_dynapi /* current verbosity level */ int verbosity; + + /* the name of the api */ + const char *apiname; }; /* diff --git a/src/afb-export.c b/src/afb-export.c index f8e4be71..ce48dbe0 100644 --- a/src/afb-export.c +++ b/src/afb-export.c @@ -1080,6 +1080,7 @@ static struct afb_export *create(struct afb_apiset *apiset, const char *apiname, else { memset(export, 0, sizeof *export); export->apiname = strdup(apiname); + export->dynapi.apiname = export->apiname; export->version = version; export->state = Api_State_Pre_Init; export->session = afb_session_addref(common_session); @@ -1144,6 +1145,7 @@ void afb_export_rename(struct afb_export *export, const char *apiname) { free(export->apiname); export->apiname = strdup(apiname); + export->dynapi.apiname = export->apiname; afb_export_update_hook(export); } -- 2.16.6