From: chanywa Date: Fri, 21 Jul 2017 06:47:06 +0000 (+0900) Subject: Return error code when executing an API which is not exist in plugin side. X-Git-Tag: submit/tizen/20170726.061422~3^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e02b6f1dd3bbdb5f77aca3badca589888bd81b41;p=platform%2Fcore%2Fapi%2Fmaps-service.git Return error code when executing an API which is not exist in plugin side. Change-Id: Ic47da57d2c342b3f74c0821cedce7b713609e52a --- diff --git a/capi-maps-service.changes b/capi-maps-service.changes index b5956ce..6f9bbce 100644 --- a/capi-maps-service.changes +++ b/capi-maps-service.changes @@ -1,3 +1,8 @@ +[Version] capi-maps-service_0.6.14 +[Date] 21 Jul 2017 +[Title] Return error code when executing an API which is not exist in plugin side. +[Developer] Seechan Kim + [Version] capi-maps-service_0.6.13 [Date] 13 Jul 2017 [Title] Apply to use std::nothrow when allocating memory with new operator diff --git a/packaging/capi-maps-service.spec b/packaging/capi-maps-service.spec index 052cabf..244aefd 100644 --- a/packaging/capi-maps-service.spec +++ b/packaging/capi-maps-service.spec @@ -1,6 +1,6 @@ Name: capi-maps-service Summary: Tizen Maps Service API -Version: 0.6.13 +Version: 0.6.14 Release: 1 Group: Location/API License: Apache-2.0 diff --git a/src/plugin/empty_module.cpp b/src/plugin/empty_module.cpp index 2f84e3a..c918c0a 100644 --- a/src/plugin/empty_module.cpp +++ b/src/plugin/empty_module.cpp @@ -24,77 +24,77 @@ //LCOV_EXCL_START int maps_plugin_init_empty(maps_plugin_h *plugin) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_init_module_empty(maps_plugin_h *plugin, const char *module) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_shutdown_empty(maps_plugin_h plugin) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_info_empty(maps_plugin_info_h *info) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_request_user_consent_empty(const char *provider, maps_service_request_user_consent_cb callback, void *user_data) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_request_user_consent_with_handle_empty(maps_service_request_user_consent_with_handle_cb callback, void *user_data) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_user_consent_empty(bool *consent) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_set_user_consent_empty(bool consent) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } /* Maps Provider access key, preference and capabilities */ int maps_plugin_set_provider_key_empty(const char *provider_key) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_provider_key_empty(char **provider_key) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_set_preference_empty(maps_preference_h preference) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_preference_empty(maps_preference_h *preference) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_is_service_supported_empty(maps_service_e service, bool *supported) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_is_data_supported_empty(maps_service_data_e data, bool *supported) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } /* Geocode */ @@ -103,7 +103,7 @@ int maps_plugin_geocode_empty(const char *address, const maps_service_geocode_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_geocode_inside_area_empty(const char *address, @@ -112,7 +112,7 @@ int maps_plugin_geocode_inside_area_empty(const char *address, maps_service_geocode_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_geocode_by_structured_address_empty(const maps_address_h address, @@ -121,7 +121,7 @@ int maps_plugin_geocode_by_structured_address_empty(const maps_address_h address void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_reverse_geocode_empty(double latitude, double longitude, @@ -130,7 +130,7 @@ int maps_plugin_reverse_geocode_empty(double latitude, double longitude, callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_multi_reverse_geocode_empty(const maps_coordinates_list_h maps_list, @@ -138,7 +138,7 @@ int maps_plugin_multi_reverse_geocode_empty(const maps_coordinates_list_h maps_l maps_service_multi_reverse_geocode_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } /* Place */ @@ -149,7 +149,7 @@ int maps_plugin_search_place_empty(const maps_coordinates_h position, maps_service_search_place_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_search_place_by_area_empty(const maps_area_h boundary, @@ -159,7 +159,7 @@ int maps_plugin_search_place_by_area_empty(const maps_area_h boundary, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_search_place_by_address_empty(const char *address, @@ -170,7 +170,7 @@ int maps_plugin_search_place_by_address_empty(const char *address, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_search_place_list_empty(const maps_area_h boundary, @@ -179,14 +179,14 @@ int maps_plugin_search_place_list_empty(const maps_area_h boundary, maps_service_search_place_list_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_place_details_empty(const char *url, maps_service_get_place_details_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } /* Route */ @@ -196,7 +196,7 @@ int maps_plugin_search_route_empty(const maps_coordinates_h origin, maps_service_search_route_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_search_route_waypoints_empty(const maps_coordinates_h *waypoint_list, @@ -205,24 +205,24 @@ int maps_plugin_search_route_waypoints_empty(const maps_coordinates_h *waypoint_ maps_service_search_route_cb callback, void *user_data, int *request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } /* Cancel Request */ int maps_plugin_cancel_request_empty(int request_id) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } /* Mapping */ int maps_plugin_create_map_view_empty(maps_view_h view, maps_plugin_map_view_ready_cb callback) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_destroy_map_view_empty(maps_view_h view) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_render_map_empty(maps_view_h view, @@ -230,72 +230,72 @@ int maps_plugin_render_map_empty(maps_view_h view, double zoom_factor, double rotation_angle) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_move_center_empty(maps_view_h view, const int delta_x, const int delta_y) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_set_scalebar_empty(maps_view_h view, bool enable) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_scalebar_empty(maps_view_h view, bool *enabled) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_on_object_empty(maps_view_h view, const maps_view_object_h object, maps_view_object_operation_e operation) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_screen_to_geography_empty(maps_view_h view, const int x, const int y, maps_coordinates_h *coordinates) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_geography_to_screen_empty(maps_view_h view, const maps_coordinates_h coordinates, int* x, int* y) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_min_zoom_level_empty(maps_view_h view, int *min_zoom_level) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_max_zoom_level_empty(maps_view_h view, int *max_zoom_level) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_center_empty(maps_view_h view, maps_coordinates_h *coordinates) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_capture_snapshot_empty(maps_view_h view, void **data, int *width, int *height, maps_view_colorspace_type_e *cs) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_get_view_scale_factor_empty(maps_view_h view, double *scale_factor) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } int maps_plugin_set_view_scale_factor_empty(maps_view_h view, double scale_factor) { - return 0; + return MAPS_ERROR_NOT_SUPPORTED; } diff --git a/src/plugin/module.cpp b/src/plugin/module.cpp index e44ff76..1bdd194 100644 --- a/src/plugin/module.cpp +++ b/src/plugin/module.cpp @@ -116,144 +116,104 @@ maps_plugin_h plugin::binary_extractor::init(const provider_info &info, new_plugin->interface = get_empty_interface(); /* Plugin dedicated functions */ - new_plugin->interface.maps_plugin_init = - (maps_plugin_init_f) gmod_find_sym(plugin, - "maps_plugin_init"); - new_plugin->interface.maps_plugin_init_module = - (maps_plugin_init_module_f) gmod_find_sym(plugin, - "maps_plugin_init_module"); - new_plugin->interface.maps_plugin_shutdown = - (maps_plugin_shutdown_f) gmod_find_sym(plugin, - "maps_plugin_shutdown"); - new_plugin->interface.maps_plugin_get_info = - (maps_plugin_get_info_f) gmod_find_sym(plugin, - "maps_plugin_get_info"); - new_plugin->interface.maps_plugin_request_user_consent = - (maps_plugin_request_user_consent_f) gmod_find_sym(plugin, - "maps_plugin_request_user_consent"); - new_plugin->interface.maps_plugin_request_user_consent_with_handle = - (maps_plugin_request_user_consent_with_handle_f) gmod_find_sym(plugin, - "maps_plugin_request_user_consent_with_handle"); - new_plugin->interface.maps_plugin_get_user_consent = - (maps_plugin_get_user_consent_f) gmod_find_sym(plugin, - "maps_plugin_get_user_consent"); - new_plugin->interface.maps_plugin_set_user_consent = - (maps_plugin_set_user_consent_f) gmod_find_sym(plugin, - "maps_plugin_set_user_consent"); + gpointer func_ptr = NULL; + + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_init"))) + new_plugin->interface.maps_plugin_init = (maps_plugin_init_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_init_module"))) + new_plugin->interface.maps_plugin_init_module = (maps_plugin_init_module_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_shutdown"))) + new_plugin->interface.maps_plugin_shutdown = (maps_plugin_shutdown_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_info"))) + new_plugin->interface.maps_plugin_get_info = (maps_plugin_get_info_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_request_user_consent"))) + new_plugin->interface.maps_plugin_request_user_consent = (maps_plugin_request_user_consent_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_request_user_consent_with_handle"))) + new_plugin->interface.maps_plugin_request_user_consent_with_handle = (maps_plugin_request_user_consent_with_handle_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_user_consent"))) + new_plugin->interface.maps_plugin_get_user_consent = (maps_plugin_get_user_consent_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_set_user_consent"))) + new_plugin->interface.maps_plugin_set_user_consent = (maps_plugin_set_user_consent_f)func_ptr; /* Maps Provider access key, preference and capabilities */ - new_plugin->interface.maps_plugin_set_provider_key = - (maps_plugin_set_provider_key_f) gmod_find_sym(plugin, - "maps_plugin_set_provider_key"); - new_plugin->interface.maps_plugin_get_provider_key = - (maps_plugin_get_provider_key_f) gmod_find_sym(plugin, - "maps_plugin_get_provider_key"); - new_plugin->interface.maps_plugin_set_preference = - (maps_plugin_set_preference_f) gmod_find_sym(plugin, - "maps_plugin_set_preference"); - new_plugin->interface.maps_plugin_get_preference = - (maps_plugin_get_preference_f) gmod_find_sym(plugin, - "maps_plugin_get_preference"); - new_plugin->interface.maps_plugin_is_service_supported = - (maps_plugin_is_service_supported_f) gmod_find_sym(plugin, - "maps_plugin_is_service_supported"); - new_plugin->interface.maps_plugin_is_data_supported = - (maps_plugin_is_data_supported_f) gmod_find_sym(plugin, - "maps_plugin_is_data_supported"); + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_set_provider_key"))) + new_plugin->interface.maps_plugin_set_provider_key = (maps_plugin_set_provider_key_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_provider_key"))) + new_plugin->interface.maps_plugin_get_provider_key = (maps_plugin_get_provider_key_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_set_preference"))) + new_plugin->interface.maps_plugin_set_preference = (maps_plugin_set_preference_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_preference"))) + new_plugin->interface.maps_plugin_get_preference = (maps_plugin_get_preference_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_is_service_supported"))) + new_plugin->interface.maps_plugin_is_service_supported = (maps_plugin_is_service_supported_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_is_data_supported"))) + new_plugin->interface.maps_plugin_is_data_supported = (maps_plugin_is_data_supported_f)func_ptr; /* Geocode */ - new_plugin->interface.maps_plugin_geocode = - (maps_plugin_geocode_f) gmod_find_sym(plugin, - "maps_plugin_geocode"); - new_plugin->interface.maps_plugin_geocode_inside_area = - (maps_plugin_geocode_inside_area_f) gmod_find_sym(plugin, - "maps_plugin_geocode_inside_area"); - new_plugin->interface.maps_plugin_geocode_by_structured_address = - (maps_plugin_geocode_by_structured_address_f) gmod_find_sym(plugin, - "maps_plugin_geocode_by_structured_address"); - new_plugin->interface.maps_plugin_reverse_geocode = - (maps_plugin_reverse_geocode_f) gmod_find_sym(plugin, - "maps_plugin_reverse_geocode"); - new_plugin->interface.maps_plugin_multi_reverse_geocode = - (maps_plugin_multi_reverse_geocode_f) gmod_find_sym(plugin, - "maps_plugin_multi_reverse_geocode"); + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_geocode"))) + new_plugin->interface.maps_plugin_geocode = (maps_plugin_geocode_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_geocode_inside_area"))) + new_plugin->interface.maps_plugin_geocode_inside_area = (maps_plugin_geocode_inside_area_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_geocode_by_structured_address"))) + new_plugin->interface.maps_plugin_geocode_by_structured_address = (maps_plugin_geocode_by_structured_address_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_reverse_geocode"))) + new_plugin->interface.maps_plugin_reverse_geocode = (maps_plugin_reverse_geocode_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_multi_reverse_geocode"))) + new_plugin->interface.maps_plugin_multi_reverse_geocode = (maps_plugin_multi_reverse_geocode_f)func_ptr; /* Place */ - new_plugin->interface.maps_plugin_search_place = - (maps_plugin_search_place_f) gmod_find_sym(plugin, - "maps_plugin_search_place"); - new_plugin->interface.maps_plugin_search_place_by_area = - (maps_plugin_search_place_by_area_f) gmod_find_sym(plugin, - "maps_plugin_search_place_by_area"); - new_plugin->interface.maps_plugin_search_place_by_address = - (maps_plugin_search_place_by_address_f) gmod_find_sym(plugin, - "maps_plugin_search_place_by_address"); - new_plugin->interface.maps_plugin_search_place_list = - (maps_plugin_search_place_list_f) gmod_find_sym(plugin, - "maps_plugin_search_place_list"); - new_plugin->interface.maps_plugin_get_place_details = - (maps_plugin_get_place_details_f) gmod_find_sym(plugin, - "maps_plugin_get_place_details"); + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_search_place"))) + new_plugin->interface.maps_plugin_search_place = (maps_plugin_search_place_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_search_place_by_area"))) + new_plugin->interface.maps_plugin_search_place_by_area = (maps_plugin_search_place_by_area_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_search_place_by_address"))) + new_plugin->interface.maps_plugin_search_place_by_address = (maps_plugin_search_place_by_address_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_search_place_list"))) + new_plugin->interface.maps_plugin_search_place_list = (maps_plugin_search_place_list_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_place_details"))) + new_plugin->interface.maps_plugin_get_place_details = (maps_plugin_get_place_details_f)func_ptr; /* Route */ - new_plugin->interface.maps_plugin_search_route = - (maps_plugin_search_route_f) gmod_find_sym(plugin, - "maps_plugin_search_route"); - new_plugin->interface.maps_plugin_search_route_waypoints = - (maps_plugin_search_route_waypoints_f) gmod_find_sym(plugin, - "maps_plugin_search_route_waypoints"); + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_search_route"))) + new_plugin->interface.maps_plugin_search_route = (maps_plugin_search_route_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_search_route_waypoints"))) + new_plugin->interface.maps_plugin_search_route_waypoints = (maps_plugin_search_route_waypoints_f)func_ptr; /* Cancel Request */ - new_plugin->interface.maps_plugin_cancel_request = - (maps_plugin_cancel_request_f) gmod_find_sym(plugin, - "maps_plugin_cancel_request"); + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_cancel_request"))) + new_plugin->interface.maps_plugin_cancel_request = (maps_plugin_cancel_request_f)func_ptr; /* Mapping */ - new_plugin->interface.maps_plugin_create_map_view = - (maps_plugin_create_map_view_f) gmod_find_sym(plugin, - "maps_plugin_create_map_view"); - new_plugin->interface.maps_plugin_destroy_map_view = - (maps_plugin_destroy_map_view_f) gmod_find_sym(plugin, - "maps_plugin_destroy_map_view"); - new_plugin->interface.maps_plugin_render_map = - (maps_plugin_render_map_f) gmod_find_sym(plugin, - "maps_plugin_render_map"); - new_plugin->interface.maps_plugin_move_center = - (maps_plugin_move_center_f) gmod_find_sym(plugin, - "maps_plugin_move_center"); - new_plugin->interface.maps_plugin_set_scalebar = - (maps_plugin_set_scalebar_f) gmod_find_sym(plugin, - "maps_plugin_set_scalebar"); - new_plugin->interface.maps_plugin_get_scalebar = - (maps_plugin_get_scalebar_f) gmod_find_sym(plugin, - "maps_plugin_get_scalebar"); - new_plugin->interface.maps_plugin_on_object = - (maps_plugin_on_object_f) gmod_find_sym(plugin, - "maps_plugin_on_object"); - new_plugin->interface.maps_plugin_screen_to_geography = - (maps_plugin_screen_to_geography_f) gmod_find_sym(plugin, - "maps_plugin_screen_to_geography"); - new_plugin->interface.maps_plugin_geography_to_screen = - (maps_plugin_geography_to_screen_f) gmod_find_sym(plugin, - "maps_plugin_geography_to_screen"); - new_plugin->interface.maps_plugin_get_min_zoom_level = - (maps_plugin_get_min_zoom_level_f) gmod_find_sym(plugin, - "maps_plugin_get_min_zoom_level"); - new_plugin->interface.maps_plugin_get_max_zoom_level = - (maps_plugin_get_max_zoom_level_f) gmod_find_sym(plugin, - "maps_plugin_get_max_zoom_level"); - new_plugin->interface.maps_plugin_get_center = - (maps_plugin_get_center_f) gmod_find_sym(plugin, - "maps_plugin_get_center"); - new_plugin->interface.maps_plugin_capture_snapshot = - (maps_plugin_capture_snapshot_f) gmod_find_sym(plugin, - "maps_plugin_capture_snapshot"); - new_plugin->interface.maps_plugin_get_view_scale_factor = - (maps_plugin_get_view_scale_factor_f) gmod_find_sym(plugin, - "maps_plugin_get_view_scale_factor"); - new_plugin->interface.maps_plugin_set_view_scale_factor = - (maps_plugin_set_view_scale_factor_f) gmod_find_sym(plugin, - "maps_plugin_set_view_scale_factor"); + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_create_map_view"))) + new_plugin->interface.maps_plugin_create_map_view = (maps_plugin_create_map_view_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_destroy_map_view"))) + new_plugin->interface.maps_plugin_destroy_map_view = (maps_plugin_destroy_map_view_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_render_map"))) + new_plugin->interface.maps_plugin_render_map = (maps_plugin_render_map_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_move_center"))) + new_plugin->interface.maps_plugin_move_center = (maps_plugin_move_center_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_set_scalebar"))) + new_plugin->interface.maps_plugin_set_scalebar = (maps_plugin_set_scalebar_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_scalebar"))) + new_plugin->interface.maps_plugin_get_scalebar = (maps_plugin_get_scalebar_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_on_object"))) + new_plugin->interface.maps_plugin_on_object = (maps_plugin_on_object_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_screen_to_geography"))) + new_plugin->interface.maps_plugin_screen_to_geography = (maps_plugin_screen_to_geography_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_geography_to_screen"))) + new_plugin->interface.maps_plugin_geography_to_screen = (maps_plugin_geography_to_screen_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_min_zoom_level"))) + new_plugin->interface.maps_plugin_get_min_zoom_level = (maps_plugin_get_min_zoom_level_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_max_zoom_level"))) + new_plugin->interface.maps_plugin_get_max_zoom_level = (maps_plugin_get_max_zoom_level_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_center"))) + new_plugin->interface.maps_plugin_get_center = (maps_plugin_get_center_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_capture_snapshot"))) + new_plugin->interface.maps_plugin_capture_snapshot = (maps_plugin_capture_snapshot_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_get_view_scale_factor"))) + new_plugin->interface.maps_plugin_get_view_scale_factor = (maps_plugin_get_view_scale_factor_f)func_ptr; + if ((func_ptr = gmod_find_sym(plugin, "maps_plugin_set_view_scale_factor"))) + new_plugin->interface.maps_plugin_set_view_scale_factor = (maps_plugin_set_view_scale_factor_f)func_ptr; /* 2.3 Check whether the plugin init function is valid */ if (!new_plugin->interface.maps_plugin_init) { @@ -522,50 +482,31 @@ void plugin::binary_extractor::trace_dbg(const plugin_s *plugin) const MAPS_LOGD("maps_plugin_get_info:\t\t\t%p", itf->maps_plugin_get_info); /* Maps Provider access key */ - MAPS_LOGD("maps_plugin_set_provider_key:\t\t%p", - itf->maps_plugin_set_provider_key); - MAPS_LOGD("maps_plugin_get_provider_key:\t\t%p", - itf->maps_plugin_get_provider_key); - MAPS_LOGD("maps_plugin_is_service_supported:\t%p", - itf->maps_plugin_is_service_supported); - MAPS_LOGD("maps_plugin_is_data_supported:\t\t%p", - itf->maps_plugin_is_data_supported); + MAPS_LOGD("maps_plugin_set_provider_key:\t\t%p", itf->maps_plugin_set_provider_key); + MAPS_LOGD("maps_plugin_get_provider_key:\t\t%p", itf->maps_plugin_get_provider_key); + MAPS_LOGD("maps_plugin_is_service_supported:\t%p", itf->maps_plugin_is_service_supported); + MAPS_LOGD("maps_plugin_is_data_supported:\t\t%p", itf->maps_plugin_is_data_supported); MAPS_LOGD("maps_plugin_geocode:\t\t\t%p", itf->maps_plugin_geocode); - MAPS_LOGD("maps_plugin_geocode_inside_area:\t%p", - itf->maps_plugin_geocode_inside_area); - MAPS_LOGD("maps_plugin_geocode_by_structured_address: %p", - itf->maps_plugin_geocode_by_structured_address); - MAPS_LOGD("maps_plugin_reverse_geocode:\t\t%p", - itf->maps_plugin_reverse_geocode); - MAPS_LOGD("maps_plugin_multi_reverse_geocode:\t%p", - itf->maps_plugin_multi_reverse_geocode); - - MAPS_LOGD("maps_plugin_search_place:\t\t%p", - itf->maps_plugin_search_place); - MAPS_LOGD("maps_plugin_search_place_by_area:\t%p", - itf->maps_plugin_search_place_by_area); - MAPS_LOGD("maps_plugin_search_place_by_address:\t%p", - itf->maps_plugin_search_place_by_address); - MAPS_LOGD("maps_plugin_search_place_list:\t\t%p", - itf->maps_plugin_search_place_list); - MAPS_LOGD("maps_plugin_get_place_details:\t%p", - itf->maps_plugin_get_place_details); - - MAPS_LOGD("maps_plugin_search_route:\t\t%p", - itf->maps_plugin_search_route); - MAPS_LOGD("maps_plugin_search_route_waypoints:\t%p", - itf->maps_plugin_search_route_waypoints); - - MAPS_LOGD("maps_plugin_cancel_request:\t\t%p", - itf->maps_plugin_cancel_request); - - MAPS_LOGD("maps_plugin_create_map_view:\t\t%p", - itf->maps_plugin_create_map_view); - MAPS_LOGD("maps_plugin_destroy_map_view:\t\t%p", - itf->maps_plugin_destroy_map_view); - MAPS_LOGD("maps_plugin_capture_snapshot:\t\t%p", - itf->maps_plugin_capture_snapshot); + MAPS_LOGD("maps_plugin_geocode_inside_area:\t%p", itf->maps_plugin_geocode_inside_area); + MAPS_LOGD("maps_plugin_geocode_by_structured_address: %p", itf->maps_plugin_geocode_by_structured_address); + MAPS_LOGD("maps_plugin_reverse_geocode:\t\t%p", itf->maps_plugin_reverse_geocode); + MAPS_LOGD("maps_plugin_multi_reverse_geocode:\t%p", itf->maps_plugin_multi_reverse_geocode); + + MAPS_LOGD("maps_plugin_search_place:\t\t%p", itf->maps_plugin_search_place); + MAPS_LOGD("maps_plugin_search_place_by_area:\t%p", itf->maps_plugin_search_place_by_area); + MAPS_LOGD("maps_plugin_search_place_by_address:\t%p", itf->maps_plugin_search_place_by_address); + MAPS_LOGD("maps_plugin_search_place_list:\t\t%p", itf->maps_plugin_search_place_list); + MAPS_LOGD("maps_plugin_get_place_details:\t%p", itf->maps_plugin_get_place_details); + + MAPS_LOGD("maps_plugin_search_route:\t\t%p", itf->maps_plugin_search_route); + MAPS_LOGD("maps_plugin_search_route_waypoints:\t%p", itf->maps_plugin_search_route_waypoints); + + MAPS_LOGD("maps_plugin_cancel_request:\t\t%p", itf->maps_plugin_cancel_request); + + MAPS_LOGD("maps_plugin_create_map_view:\t\t%p", itf->maps_plugin_create_map_view); + MAPS_LOGD("maps_plugin_destroy_map_view:\t\t%p", itf->maps_plugin_destroy_map_view); + MAPS_LOGD("maps_plugin_capture_snapshot:\t\t%p", itf->maps_plugin_capture_snapshot); MAPS_LOGD("*********************************************"); } diff --git a/test/maps_test_log.c b/test/maps_test_log.c index 401b942..c62c4b5 100755 --- a/test/maps_test_log.c +++ b/test/maps_test_log.c @@ -118,7 +118,7 @@ void log_place_media(char *prefix, maps_place_media_h media) LOG_PRINT("%s%sattribution = %s", prefix, LOG_PREFIX, lv.strval); char _prefix[100]; - sprintf(_prefix, "%s%s", prefix, LOG_PREFIX); + snprintf(_prefix, sizeof(_prefix), "%s%s", prefix, LOG_PREFIX); maps_place_link_object_h supplier = NULL; if (maps_place_media_get_supplier(media, &supplier) == MAPS_ERROR_NONE) { diff --git a/test/maps_test_search_route.c b/test/maps_test_search_route.c index 16dd457..73f82e2 100644 --- a/test/maps_test_search_route.c +++ b/test/maps_test_search_route.c @@ -68,7 +68,7 @@ static bool __maps_route_path_cb(int index, int total, maps_coordinates_h coordi if (!coordinates) return false; char buffer[30] = ""; - sprintf(buffer, "path [%d/%d]", index+1, total); + snprintf(buffer, sizeof(buffer), "path [%d/%d]", index+1, total); log_coordinates("", buffer, coordinates); maps_coordinates_destroy(coordinates); @@ -80,7 +80,7 @@ static bool __maps_route_segment_path_cb(int index, int total, maps_coordinates_ if (!coordinates) return false; char buffer[30] = ""; - sprintf(buffer, "path [%d/%d]", index+1, total); + snprintf(buffer, sizeof(buffer), "path [%d/%d]", index+1, total); log_coordinates(LOG_PREFIX, buffer, coordinates); maps_coordinates_destroy(coordinates);