summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMyungki Lee <mk5004.lee@samsung.com>2016-08-16 18:07:53 +0900
committerMyungki Lee <mk5004.lee@samsung.com>2016-08-16 18:07:53 +0900
commitbc93aae49338f80981ae5927a1f59e4d2bb4bd65 (patch)
tree51f20920924e6324e9a0caa9b9521ec6a0341bd9 /src
parent243e71c0eeedd0166e224a4c90928ad297c51bdf (diff)
downloadnotification-bc93aae49338f80981ae5927a1f59e4d2bb4bd65.tar.gz
notification-bc93aae49338f80981ae5927a1f59e4d2bb4bd65.tar.bz2
notification-bc93aae49338f80981ae5927a1f59e4d2bb4bd65.zip
Add new api to count the notification list
Change-Id: Id345fe4847957044741dd0d1b39c2cc9893cf1d3 Signed-off-by: Myungki Lee <mk5004.lee@samsung.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/notification_list.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/notification_list.c b/src/notification_list.c
index 3e0be52..5cd7ff1 100755
--- a/src/notification_list.c
+++ b/src/notification_list.c
@@ -139,6 +139,28 @@ EXPORT_API notification_h notification_list_get_data(notification_list_h list)
return cur_list->noti;
}
+EXPORT_API int notification_list_get_count(notification_list_h list)
+{
+ int count = 0;
+ notification_list_h cur_list = NULL;
+
+ if (list == NULL) {
+ NOTIFICATION_ERR("INVALID DATA : list == NULL");
+ set_last_result(NOTIFICATION_ERROR_INVALID_PARAMETER);
+ return 0;
+ }
+
+ cur_list = notification_list_get_head(list);
+
+ while (cur_list != NULL) {
+ count++;
+ cur_list = cur_list->next;
+ }
+
+ set_last_result(NOTIFICATION_ERROR_NONE);
+ return count;
+}
+
EXPORT_API notification_list_h notification_list_append(notification_list_h list,
notification_h noti)
{