CELIX-237: Added interface check to that method must return an int. This to always be able to throw "exceptions". disabled printing dyn_types to stdout.
Project: http://git-wip-us.apache.org/repos/asf/celix/repo Commit: http://git-wip-us.apache.org/repos/asf/celix/commit/75773baf Tree: http://git-wip-us.apache.org/repos/asf/celix/tree/75773baf Diff: http://git-wip-us.apache.org/repos/asf/celix/diff/75773baf Branch: refs/heads/feature/CELIX-230_Refactoring_of_the_shell_command_service Commit: 75773baf300fea80a790efa0d7f53a7acb68ef86 Parents: f60ca0d Author: Pepijn Noltes <pepijnnol...@gmail.com> Authored: Fri Oct 16 13:26:47 2015 +0200 Committer: Pepijn Noltes <pepijnnol...@gmail.com> Committed: Fri Oct 16 13:26:47 2015 +0200 ---------------------------------------------------------------------- .../dynamic_function_interface/dyn_interface.c | 11 +++++++++++ .../dynamic_function_interface_tst/dyn_type_tests.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c ---------------------------------------------------------------------- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c index 9bb7bcc..823957b 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface/dyn_interface.c @@ -95,6 +95,17 @@ static int dynInterface_checkInterface(dyn_interface_type *intf) { status = ERROR; LOG_ERROR("Parse Error. There must be a header section with a type, version and name entry"); } + + struct method_entry *mEntry = NULL; + TAILQ_FOREACH(mEntry, &intf->methods, entries) { + dyn_type *type = dynFunction_returnType(mEntry->dynFunc); + int descriptor = dynType_descriptorType(type); + if (descriptor != 'N') { + status = ERROR; + LOG_ERROR("Parse Error. Only method with a return type 'N' (native int) are supported. Got return type '%c'\n", descriptor); + break; + } + } } return status; http://git-wip-us.apache.org/repos/asf/celix/blob/75773baf/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp ---------------------------------------------------------------------- diff --git a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp index 9cf81c5..4b9bd41 100644 --- a/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp +++ b/remote_services/remote_service_admin_dfi/dynamic_function_interface_tst/dyn_type_tests.cpp @@ -43,7 +43,7 @@ extern "C" { } FILE *stream = fopen("/dev/null", "w"); - dynType_print(type, stdout); + dynType_print(type, stream); fclose(stream); dynType_destroy(type); //printf("--\n\n");