From: chanywa Date: Thu, 24 Nov 2016 08:38:34 +0000 (+0900) Subject: added an api for plugins to get length of maps_item_list_h X-Git-Tag: submit/tizen_3.0/20161124.113335^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c1b95934c6a30f19f0780ca7dc41487a9891126c;p=platform%2Fcore%2Fapi%2Fmaps-service.git added an api for plugins to get length of maps_item_list_h Change-Id: I87d59865248a08cb8ca117fd62a78c9aab6363e2 --- diff --git a/capi-maps-service.changes b/capi-maps-service.changes index a04a5a7..4b6508e 100644 --- a/capi-maps-service.changes +++ b/capi-maps-service.changes @@ -1,3 +1,8 @@ +[Version] capi-maps-service_0.6.9 +[Date] 24 Nov 2016 +[Title] added an api for plugins to get length of maps_item_list_h +[Developer] Seechan Kim + [Version] capi-maps-service_0.6.8 [Date] 11 Nov 2016 [Title] fixed some bugs and improved gestures diff --git a/include/maps_extra_types.h b/include/maps_extra_types.h index f166d28..9c8f9ea 100644 --- a/include/maps_extra_types.h +++ b/include/maps_extra_types.h @@ -348,6 +348,23 @@ typedef bool(*maps_item_list_foreach_noclone_cb) (int index, void *data, void *u */ int maps_item_list_foreach_noclone(maps_item_list_h list, maps_item_list_foreach_noclone_cb callback, void *user_data); +/** + * @brief Gets the number of elements in the specified list. + * @since_tizen 3.0 + * + * @param[in] list The handle of list + * @param[out] length The number of elements in the specified list + * @return 0 on success, otherwise a negative error value + * @retval #MAPS_ERROR_NONE Successful + * @retval #MAPS_ERROR_INVALID_PARAMETER Invalid parameter + * + * @pre @a list is created using maps_item_list_create(). + * + * @see maps_item_list_create() + * @see maps_item_list_append() + */ +int maps_item_list_get_length(maps_item_list_h list, int *length); + /** * @} */ diff --git a/packaging/capi-maps-service.spec b/packaging/capi-maps-service.spec index 39cf550..29f6169 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.8 +Version: 0.6.9 Release: 1 Group: Location/API License: Apache-2.0 diff --git a/src/api/maps_extra_types.cpp b/src/api/maps_extra_types.cpp index d0eb1bf..2d51933 100644 --- a/src/api/maps_extra_types.cpp +++ b/src/api/maps_extra_types.cpp @@ -214,6 +214,20 @@ EXPORT_API int maps_item_list_clone(const maps_item_list_h origin, return error; } +EXPORT_API int maps_item_list_get_length(maps_item_list_h list, int *length) +{ + if (!maps_condition_check_maps_feature()) + return MAPS_ERROR_NOT_SUPPORTED; + if (!list || !length) + return MAPS_ERROR_INVALID_PARAMETER; + maps_item_list_s *l = (maps_item_list_s *)list; + if (!l->l) + *length = 0; + else + *length = g_list_length(l->l); + return MAPS_ERROR_NONE; +} + /*----------------------------------------------------------------------------*/ typedef struct _maps_string_hashtable_s