summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCMakeLists.txt66
-rwxr-xr-xinclude/notification_internal.h40
-rwxr-xr-xpackaging/notification.spec10
-rwxr-xr-xsrc/notification_db_query.h1
-rwxr-xr-xsrc/notification_internal.c10
-rwxr-xr-xsrc/notification_list.c3
-rwxr-xr-xsrc/notification_shared_file.c10
-rwxr-xr-xtest-app/main.c7
8 files changed, 69 insertions, 78 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 938cfb9..c327f09 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,56 +1,15 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(notification C)
-SET(PREFIX ${CMAKE_INSTALL_PREFIX})
-SET(EXEC_PREFIX "\${prefix}")
-SET(LIBDIR ${LIB_INSTALL_DIR})
-SET(INCLUDEDIR "\${prefix}/include/${PROJECT_NAME}")
-
#ADD_SUBDIRECTORY(test-app)
SET(INIT-SRCS
./src/notification_init.c
)
-SET(SRCS
- ./src/notification.c
- ./src/notification_noti.c
- ./src/notification_ongoing.c
- ./src/notification_group.c
- ./src/notification_db.c
- ./src/notification_db_query.h
- ./src/notification_list.c
- ./src/notification_status.c
- ./src/notification_ipc.c
- ./src/notification_setting.c
- ./src/notification_setting_service.c
- ./src/notification_internal.c
- ./src/notification_viewer.c
- ./src/notification_error.c
- ./src/notification_shared_file.c
- )
-SET(HEADERS-DEVEL
- ./include/notification.h
- ./include/notification_internal.h
- ./include/notification_db.h
- ./include/notification_error.h
- ./include/notification_type.h
- ./include/notification_list.h
- ./include/notification_ongoing.h
- ./include/notification_ongoing_flag.h
- ./include/notification_text_domain.h
- ./include/notification_status.h
- ./include/notification_status_internal.h
- ./include/notification_setting.h
- ./include/notification_setting_internal.h
- ./include/notification_ipc.h
- ./include/notification_noti.h
- ./include/notification_setting_service.h
- ./include/notification_viewer.h
- ./include/notification_shared_file.h
- )
-
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
+AUX_SOURCE_DIRECTORY(src SRCS)
+LIST(REMOVE_ITEM SRCS ${INIT-SRCS})
INCLUDE(FindPkgConfig)
pkg_check_modules(pkgs REQUIRED
@@ -81,14 +40,6 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_CFLAGS} -fPIE")
SET(CMAKE_SKIP_BUILD_RPATH TRUE)
-IF (HAVE_X11)
-ADD_DEFINITIONS("-DHAVE_X11")
-ENDIF (HAVE_X11)
-
-IF (HAVE_WAYLAND)
-ADD_DEFINITIONS("-DHAVE_WAYLAND")
-ENDIF (HAVE_WAYLAND)
-
ADD_LIBRARY(${PROJECT_NAME} SHARED ${SRCS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES SOVERSION ${MAJORVER})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${FULLVER})
@@ -97,15 +48,16 @@ TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${pkgs_LDFLAGS})
ADD_EXECUTABLE(notification_init ${INIT-SRCS})
TARGET_LINK_LIBRARIES(notification_init ${pkgs_LDFLAGS} notification "-pie")
-MESSAGE(STATUS "LIB_INSTALL_DIR: " ${LIB_INSTALL_DIR})
-
CONFIGURE_FILE(${PROJECT_NAME}.pc.in ${PROJECT_NAME}.pc @ONLY)
INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${LIB_INSTALL_DIR} COMPONENT RuntimeLibraries)
INSTALL(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig)
-
-FOREACH(hfile ${HEADERS-DEVEL})
- INSTALL(FILES ${CMAKE_SOURCE_DIR}/${hfile} DESTINATION include/${PROJECT_NAME})
-ENDFOREACH(hfile)
+INSTALL(DIRECTORY ${CMAKE_SOURCE_DIR}/include/
+ DESTINATION include/notification
+ FILES_MATCHING
+ PATTERN "*_private.h" EXCLUDE
+ PATTERN "*_group.h" EXCLUDE
+ PATTERN "*_debug.h" EXCLUDE
+ PATTERN "*.h")
INSTALL(FILES ${CMAKE_BINARY_DIR}/11_notification-add.post DESTINATION ${SYSCONF_INSTALL_DIR}/gumd/useradd.d/)
INSTALL(TARGETS notification_init DESTINATION bin)
diff --git a/include/notification_internal.h b/include/notification_internal.h
index 1b23d2a..b56cd6c 100755
--- a/include/notification_internal.h
+++ b/include/notification_internal.h
@@ -1396,7 +1396,47 @@ notification_h notification_load_by_tag_for_uid(const char *tag, uid_t uid);
*/
int notification_get_text_input_max_length(notification_h noti, int *text_input_max_length);
+/**
+ * @brief Sets an extension data.
+ * @since_tizen 4.0
+ * @param[in] noti The notification handle
+ * @param[in] key The key
+ * @param[in] value The bundle data
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ */
+int notification_set_extension_data(notification_h noti, const char *key, bundle *value);
+
+/**
+ * @brief Gets an extension data.
+ * @since_tizen 4.0
+ * @param[in] noti The notification handle
+ * @param[in] key The key
+ * @param[out] value The bundle data
+ * @return #NOTIFICATION_ERROR_NONE on success,
+ * otherwise any other value on failure
+ * @retval #NOTIFICATION_ERROR_NONE Success
+ * @retval #NOTIFICATION_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #NOTIFICATION_ERROR_IO_ERROR IO Error
+ */
+int notification_get_extension_data(notification_h noti, const char *key, bundle **value);
+
+/**
+ * @brief This function will be deprecated.
+ * @see notification_set_extension_data()
+ *
+ */
+NOTIFICATION_DEPRECATED_API
int notification_set_extention_data(notification_h noti, const char *key, bundle *value);
+
+/**
+ * @brief This function will be deprecated.
+ * @see notification_get_extension_data()
+ *
+ */
+NOTIFICATION_DEPRECATED_API
int notification_get_extention_data(notification_h noti, const char *key, bundle **value);
int notification_set_extension_event_handler(notification_h noti,
diff --git a/packaging/notification.spec b/packaging/notification.spec
index 5cb38d9..02ee2f3 100755
--- a/packaging/notification.spec
+++ b/packaging/notification.spec
@@ -1,7 +1,7 @@
%bcond_with wayland
Name: notification
Summary: Notification library
-Version: 0.3.39
+Version: 0.3.40
Release: 1
Group: TBD
License: Apache-2.0
@@ -48,15 +48,9 @@ Development files needed to build software that needs to system a system notific
MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
export LDFLAGS+="-Wl,--rpath=%{_prefix}/lib -Wl,--as-needed"
LDFLAGS="$LDFLAGS"
-%if %{with wayland}
%cmake . \
- -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAVE_WAYLAND=On \
+ -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DMAJORVER=${MAJORVER} -DFULLVER=%{version}
-%else
-%cmake . \
- -DCMAKE_INSTALL_PREFIX=%{_prefix} -DHAVE_X11=On \
- -DMAJORVER=${MAJORVER} -DFULLVER=%{version}
-%endif
make %{?jobs:-j%jobs}
%install
diff --git a/src/notification_db_query.h b/src/notification_db_query.h
index ef11a45..6a22573 100755
--- a/src/notification_db_query.h
+++ b/src/notification_db_query.h
@@ -22,6 +22,7 @@
#define CREATE_NOTIFICATION_TABLE \
"PRAGMA journal_mode = PERSIST;\n" \
"PRAGMA synchronous = FULL;\n" \
+ "PRAGMA integrity_check;\n" \
"CREATE TABLE IF NOT EXISTS noti_list (\n" \
" type INTEGER NOT NULL,\n" \
" layout INTEGER NOT NULL DEFAULT 0,\n" \
diff --git a/src/notification_internal.c b/src/notification_internal.c
index 3a79332..07ebe37 100755
--- a/src/notification_internal.c
+++ b/src/notification_internal.c
@@ -1786,6 +1786,11 @@ static bundle *_create_bundle_from_bundle_raw(bundle_raw *string)
EXPORT_API int notification_set_extention_data(notification_h noti, const char *key, bundle *value)
{
+ return notification_set_extension_data(noti, key, value);
+}
+
+EXPORT_API int notification_set_extension_data(notification_h noti, const char *key, bundle *value)
+{
int ret;
int len = 0;
char *del = NULL;
@@ -1820,6 +1825,11 @@ EXPORT_API int notification_set_extention_data(notification_h noti, const char *
EXPORT_API int notification_get_extention_data(notification_h noti, const char *key, bundle **value)
{
+ return notification_get_extension_data(noti, key, value);
+}
+
+EXPORT_API int notification_get_extension_data(notification_h noti, const char *key, bundle **value)
+{
char *ret_str;
bundle *args;
diff --git a/src/notification_list.c b/src/notification_list.c
index 2dc8269..30724cd 100755
--- a/src/notification_list.c
+++ b/src/notification_list.c
@@ -29,7 +29,6 @@
struct _notification_list {
notification_list_h prev;
notification_list_h next;
-
notification_h noti;
};
@@ -37,7 +36,7 @@ notification_list_h _notification_list_create(void)
{
notification_list_h list = NULL;
- list = (notification_list_h) malloc(sizeof(struct _notification_list));
+ list = (notification_list_h)malloc(sizeof(struct _notification_list));
if (list == NULL) {
/* LCOV_EXCL_START */
NOTIFICATION_ERR("Failed to alloc memory");
diff --git a/src/notification_shared_file.c b/src/notification_shared_file.c
index 6010b68..9bf91e6 100755
--- a/src/notification_shared_file.c
+++ b/src/notification_shared_file.c
@@ -182,8 +182,8 @@ static bool __is_RO_file(const char *smack_label)
}
/* file copy from /res to /data */
-int notification_copy_private_file(const char* src_path,
- const char* dst_path)
+int notification_copy_private_file(const char *src_path,
+ const char *dst_path)
{
int ret = NOTIFICATION_ERROR_NONE;
GFile *src = NULL;
@@ -336,7 +336,7 @@ static gint __comp_dst_path(gconstpointer a, gconstpointer b)
}
/* LCOV_EXCL_STOP */
-static sharing_file_info_s * __dup_file_info(sharing_file_info_s *src)
+static sharing_file_info_s *__dup_file_info(sharing_file_info_s *src)
{
sharing_file_info_s *file_info;
file_info = (sharing_file_info_s *)calloc(1, sizeof(sharing_file_info_s));
@@ -411,7 +411,7 @@ static void __make_file_info(char *src_path, char *dst_path,
}
-static GList* __get_new_file_list(notification_h noti,
+static GList *__get_new_file_list(notification_h noti,
GList *shared_file_list,
bool *is_overlapping)
{
@@ -471,7 +471,7 @@ static GList* __get_new_file_list(notification_h noti,
return new_file_list;
}
-static char* __get_shared_dir(notification_h noti)
+static char *__get_shared_dir(notification_h noti)
{
char *path = NULL;
char *dir;
diff --git a/test-app/main.c b/test-app/main.c
index 47b3505..d562082 100755
--- a/test-app/main.c
+++ b/test-app/main.c
@@ -288,11 +288,6 @@ static int testapp_test_post_notifications()
goto FINISH_OFF;
}
- if (repeat_count > 30) {
- testapp_print("Too many count");
- goto FINISH_OFF;
- }
-
for (i = 0; i < repeat_count; i++) {
if ((err = testapp_add_a_notification()) != NOTIFICATION_ERROR_NONE) {
testapp_print("testapp_add_a_notification failed[%d]", err);
@@ -562,7 +557,7 @@ static int testapp_test_get_list()
bool ongoing_flag;
bool auto_remove;
- noti_err = notification_get_detail_list("./notification-test-app", NOTIFICATION_PRIV_ID_NONE, NOTIFICATION_GROUP_ID_NONE, 10, &noti_list_handle);
+ noti_err = notification_get_list(NOTIFICATION_TYPE_NONE, -1, &noti_list_handle);
if (noti_err != NOTIFICATION_ERROR_NONE) {
testapp_print("notification_get_detail_list failed[%d]\n", noti_err);