summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyungKyu Song <hk76.song@samsung.com>2013-02-16 00:11:25 +0900
committerHyungKyu Song <hk76.song@samsung.com>2013-02-16 00:11:25 +0900
commit6f3f81214359d6f01de8588c306f179e1599aaec (patch)
tree520ed9a1c20172f67c0a2501239189e369eb6ef8
parent213d4ec9d2c728d50d110e4c6cc7247344319499 (diff)
downloadheynoti-tizen_2.0.tar.gz
heynoti-tizen_2.0.tar.bz2
heynoti-tizen_2.0.zip
-rwxr-xr-x[-rw-r--r--]CMakeLists.txt0
-rwxr-xr-xdebian/changelog326
-rwxr-xr-x[-rw-r--r--]debian/libheynoti-0.install.in0
-rwxr-xr-x[-rw-r--r--]heynoti.c111
-rw-r--r--heynoti.h112
-rw-r--r--heynoti.manifest5
-rwxr-xr-x[-rw-r--r--]include/heynoti-log.h9
-rw-r--r--packaging/heynoti.spec24
-rw-r--r--test/CMakeLists.txt2
-rwxr-xr-xtest/tst_publish.c6
10 files changed, 382 insertions, 213 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index db58bb8..db58bb8 100644..100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
diff --git a/debian/changelog b/debian/changelog
index 120e6cc..61fbebf 100755
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,327 @@
+heynoti (0.0.2-35) unstable; urgency=low
+
+ * Fixed code not to create file on runtime
+ * Git: slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-35
+
+ -- Sewook Park <sewook7.park@samsung.com> Wed, 07 Mar 2012 20:21:04 +0900
+
+heynoti (0.0.2-34) unstable; urgency=low
+
+ * Fixed TC
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-34
+
+ -- Sewook Park <sewook7.park@samsung.com> Fri, 17 Feb 2012 16:08:34 +0900
+
+heynoti (0.0.2-33) unstable; urgency=low
+
+ * Add heynotitool
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-33
+
+ -- Sewook Park <sewook7.park@samsung.com> Fri, 20 Jan 2012 16:38:16 +0900
+
heynoti (0.0.2-32) unstable; urgency=low
- * Initial Release.
- * Git: pkgs/h/heynoti
+ * Updated changelog
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
* Tag: heynoti_0.0.2-32
- -- Sewook Park <sewook7.park@samsung.com> Wed, 07 Dec 2011 12:55:49 +0900
+ -- Sewook Park <sewook7.park@samsung.com> Mon, 05 Dec 2011 15:52:47 +0900
+
+heynoti (0.0.2-31) unstable; urgency=low
+
+ * Changed Boilerplate as per the guideline
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-31
+
+ -- Jaeho Lee <jaeho81.lee@samsung.com> Mon, 07 Nov 2011 18:10:18 +0900
+
+heynoti (0.0.2-30) unstable; urgency=low
+
+ * Modify TC Makefile
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-30
+
+ -- Jaeho Lee <jaeho81.lee@samsung.com> Tue, 16 Aug 2011 14:56:10 +0900
+
+heynoti (0.0.2-29) unstable; urgency=low
+
+ * Apply code cleanup
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-29
+
+ -- Sewook Park <sewook7.park@samsung.com> Tue, 02 Aug 2011 19:16:45 +0900
+
+heynoti (0.0.2-28) unstable; urgency=low
+
+ * Code cleanup
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-28
+
+ -- Jaeho Lee <jaeho81.lee@samsung.com> Wed, 13 Jul 2011 16:23:53 +0900
+
+heynoti (0.0.2-27) unstable; urgency=low
+
+ * Add defence code for callback fn
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-27
+
+ -- Noha Park <noha.park@samsung.com> Mon, 18 Apr 2011 11:05:39 +0900
+
+heynoti (0.0.2-26) unstable; urgency=low
+
+ * bug fix : glist iteration
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-26
+
+ -- Noha Park <noha.park@samsung.com> Mon, 14 Mar 2011 15:27:57 +0900
+
+heynoti (0.0.2-25) unstable; urgency=low
+
+ * Substituted glib for sglib
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-25
+
+ -- Noha Park <noha.park@samsung.com> Mon, 07 Mar 2011 09:17:56 +0900
+
+heynoti (0.0.2-24) unstable; urgency=low
+
+ * Modify permission
+ * Git: slp-source.sec.samsung.net:slp/pkgs/h/heynoti
+ * Tag: heynoti_0.0.2-24
+
+ -- Noha Park <noha.park@samsung.com> Tue, 11 Jan 2011 18:24:42 +0900
+
+heynoti (0.0.2-23) unstable; urgency=low
+
+ * Modify doxygen document
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-23
+
+ -- Noha Park <noha.park@samsung.com> Thu, 18 Nov 2010 08:41:05 +0900
+
+heynoti (0.0.2-22) unstable; urgency=low
+
+ * Modify doxygen document
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-22
+
+ -- Noha Park <noha.park@samsung.com> Wed, 17 Nov 2010 17:13:08 +0900
+
+heynoti (0.0.2-21) unstable; urgency=low
+
+ * Modify doxygen document
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-21
+
+ -- Sangjung Woo <sangjung.woo@samsung.com> Mon, 08 Nov 2010 20:30:49 +0900
+
+heynoti (0.0.2-20) unstable; urgency=low
+
+ * Modify doxygen document
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-20
+
+ -- Sangjung Woo <sangjung.woo@samsung.com> Fri, 29 Oct 2010 17:46:10 +0900
+
+heynoti (0.0.2-19) unstable; urgency=low
+
+ * Modify doxygen document
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-19
+
+ -- Sangjung Woo <sangjung.woo@samsung.com> Fri, 28 Oct 2010 09:43:19 +0900
+
+heynoti (0.0.2-18) unstable; urgency=low
+
+ * Modify doxygen document
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-18
+
+ -- Sangjung Woo <sangjung.woo@samsung.com> Wed, 20 Oct 2010 09:43:19 +0900
+
+heynoti (0.0.2-17) unstable; urgency=low
+
+ * Repackaging
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-17
+
+ -- Noha Park <noha.park@samsung.com> Tue, 12 Oct 2010 19:43:19 +0900
+
+heynoti (0.0.2-16) unstable; urgency=low
+
+ * Modify doxyzon
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-16
+
+ -- Noha Park <noha.park@samsung.com> Fri, 01 Oct 2010 14:26:05 +0900
+
+heynoti (0.0.2-15) unstable; urgency=low
+
+ * Modify doxyzon
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-15
+
+ -- Noha Park <noha.park@samsung.com> Thu, 30 Sep 2010 21:53:36 +0900
+
+heynoti (0.0.2-14) unstable; urgency=low
+
+ * Modify doxyzon
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-14
+
+ -- Noha Park <noha.park@samsung.com> Thu, 30 Sep 2010 10:47:45 +0900
+
+heynoti (0.0.2-13) unstable; urgency=low
+
+ * Modify ecore event handler callback return
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-13
+
+ -- Noha Park <noha.park@samsung.com> Sun, 12 Sep 2010 14:03:22 +0900
+
+heynoti (0.0.2-12) unstable; urgency=low
+
+ * Repackaging
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-12
+
+ -- Noha Park <noha.park@samsung.com> Fri, 10 Sep 2010 21:09:39 +0900
+
+heynoti (0.0.2-11) unstable; urgency=low
+
+ * Repackaging
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-11
+
+ -- Noha Park <noha.park@samsung.com> Wed, 08 Sep 2010 17:20:19 +0900
+
+heynoti (0.0.2-10) unstable; urgency=low
+
+ * Bug fix in open function
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-10
+
+ -- Noha Park <noha.park@samsung.com> Tue, 07 Sep 2010 21:17:43 +0900
+
+heynoti (0.0.2-9) unstable; urgency=low
+
+ * Code clean-up
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-9
+
+ -- Noha Park <noha.park@samsung.com> Tue, 31 Aug 2010 14:34:26 +0900
+
+heynoti (0.0.2-8) unstable; urgency=low
+
+ * Code clean-up
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-8
+
+ -- Noha Park <noha.park@samsung.com> Fri, 27 Aug 2010 11:33:02 +0900
+
+heynoti (0.0.2-7) unstable; urgency=low
+
+ * fix flaw
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-7
+
+ -- Noha Park <noha.park@samsung.com> Tue, 24 Aug 2010 13:47:55 +0900
+
+heynoti (0.0.2-6) unstable; urgency=low
+
+ * Modify doxyzon
+ * Git: 165.213.180.234:/git/slp/pkgs/heynoti
+ * Tag: heynoti_0.0.2-6
+
+ -- Noha Park <noha.park@samsung.com> Thu, 19 Aug 2010 13:35:15 +0900
+
+heynoti (0.0.2-5) unstable; urgency=low
+
+ * Change maintainer
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.2-5
+
+ -- Youmin Ha <youmin.ha@samsung.com> Thu, 08 Jul 2010 20:37:43 +0900
+
+heynoti (0.0.2-4) unstable; urgency=low
+
+ * Add XB-Generate-Docs tag for doxygen & Modify wrong documents.
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.2-4
+
+ -- Sangjung Woo <sangjung.woo@samsung.com> Mon, 02 July 2010 04:03:22 -0700
+
+heynoti (0.0.2-3) unstable; urgency=low
+
+ * remove dlog_module.h
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.2-3
+
+ -- Hojun Lee <rcn95@samsung.com> Tue, 15 Jun 2010 04:03:22 -0700
+
+heynoti (0.0.2-2) unstable; urgency=low
+
+ * bug FIX for heynoti_get_snoti_name
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.2-2
+
+ -- Hojun Lee <rcn95@samsung.com> Wed, 09 Jun 2010 03:25:26 -0700
+
+heynoti (0.0.2-1) unstable; urgency=low
+
+ * change API(heynoti_get_snoti_name, heynoti_get_pnoti_name)
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.2-1
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Mon, 31 May 2010 14:47:22 +0900
+
+heynoti (0.0.1-5) unstable; urgency=low
+
+ * debugging heynoti_close()
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.1-5
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Fri, 28 May 2010 18:50:48 +0900
+
+heynoti (0.0.1-4) unstable; urgency=low
+
+ * update doxygen
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.1-4
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Thu, 20 May 2010 13:52:15 +0900
+
+heynoti (0.0.1-3) unstable; urgency=low
+
+ * move location of header file, and debugging build error
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.1-3
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Fri, 14 May 2010 16:20:53 +0900
+
+heynoti (0.0.1-2) unstable; urgency=low
+
+ * modify doxygen
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.1-2
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Tue, 11 May 2010 15:44:43 +0900
+
+heynoti (0.0.1-1) unstable; urgency=low
+
+ * minor debugging
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.1-1
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Tue, 11 May 2010 09:23:49 +0900
+
+heynoti (0.0.1-0) unstable; urgency=low
+
+ * Initial Release.
+ * Git: 165.213.180.234:/git/slp2.0/slp2.0-pkgs/heynoti
+ * Tag: heynoti_0.0.1-0
+
+ -- Youngjae Shin <yj99.shin@samsung.com> Thu, 06 May 2010 13:12:08 +0900
diff --git a/debian/libheynoti-0.install.in b/debian/libheynoti-0.install.in
index 9c4dbc5..9c4dbc5 100644..100755
--- a/debian/libheynoti-0.install.in
+++ b/debian/libheynoti-0.install.in
diff --git a/heynoti.c b/heynoti.c
index 18beb7a..7f92c9c 100644..100755
--- a/heynoti.c
+++ b/heynoti.c
@@ -42,7 +42,7 @@
#define AU_PREFIX_SYSNOTI "SYS"
#ifndef NOTI_ROOT
-# define NOTI_ROOT "/tmp/noti"
+# define NOTI_ROOT "/opt/share/noti"
#endif
@@ -60,7 +60,6 @@ static int __make_noti_root(const char *p);
static int __make_noti_file(const char *p);
static inline int __make_noti_path(char *path, int size, const char *name);
static int __read_proc(const char *path, char *buf, int size);
-static int __get_kern_ver();
static void __clear_nslot_list(GList *g_ns);
static struct noti_cont *__get_noti_cont(int fd);
static int __handle_callback(struct noti_cont *nc, int wd, uint32_t mask);
@@ -114,13 +113,11 @@ static int __make_noti_root(const char *p)
{
int fd;
- if ((fd = open(p, O_RDONLY)) == -1) {
- if (mkdir(p, 0777) == -1)
- return -1;
- } else {
- fchmod(fd, 0777);
- close(fd);
- }
+ if ((fd = open(p, O_RDONLY)) == -1 )
+ return -1;
+
+ close(fd);
+
return 0;
}
@@ -128,28 +125,11 @@ static int __make_noti_file(const char *p)
{
int fd;
-#ifdef NODAC_PERMISSION
- if ((fd = open(p, O_RDONLY)) == -1) {
- if ((fd = open(p, O_CREAT, 0666)) < 0) {
- return -1;
- }
- fchmod(fd, 0666);
- close(fd);
- } else {
- fchmod(fd, 0666);
- close(fd);
- }
-#else
- if ((fd = open(p, O_RDONLY)) == -1) {
- if ((fd = open(p, O_CREAT, 0644)) < 0) {
- return -1;
- }
- close(fd);
- } else {
- fchmod(fd, 0644);
- close(fd);
- }
-#endif
+ if ((fd = open(p, O_RDONLY)) == -1)
+ return -1;
+
+ close(fd);
+
return 0;
}
@@ -179,10 +159,9 @@ static int __read_proc(const char *path, char *buf, int size)
return ret;
}
-static int kern_ver; /* Kernel version */
#define PROC_VERSION "/proc/version"
-static int __get_kern_ver()
+static int __check_kern_ver()
{
struct utsname nm;
int ret;
@@ -191,8 +170,6 @@ static int __get_kern_ver()
int v2;
int v3;
- util_retv_if(kern_ver != 0, kern_ver);
-
ret = uname(&nm);
if (ret == 0) {
strncpy(buf, nm.release, sizeof(buf));
@@ -205,8 +182,11 @@ static int __get_kern_ver()
}
if (ret == 3) {
- kern_ver = KERNEL_VERSION(v1, v2, v3);
- return kern_ver;
+ if(KERNEL_VERSION(v1, v2, v3) < KERNEL_VERSION(2, 6, 13)) {
+ return -1;
+ } else {
+ return 0;
+ }
}
return -1;
@@ -267,7 +247,7 @@ static int __handle_event(int fd)
{
int r;
struct inotify_event ie;
- char name[FILENAME_MAX];
+ char name[FILENAME_MAX] = {0, };
struct noti_cont *nc;
@@ -280,8 +260,12 @@ static int __handle_event(int fd)
if (nc)
__handle_callback(nc, ie.wd, ie.mask);
- if (ie.len > 0)
- read(fd, name, ie.len);
+ if(ie.len > SSIZE_MAX)
+ return -1;
+
+ if (ie.len > 0u) {
+ read(fd, name, (ie.len > FILENAME_MAX) ? (size_t)FILENAME_MAX : (size_t) ie.len);
+ }
r = read(fd, &ie, sizeof(ie));
}
@@ -364,8 +348,6 @@ static int __add_noti(int fd, const char *notipath, void (*cb) (void *),
return -1;
}
- __make_noti_file(notipath);
-
wd = __get_wd(fd, notipath);
util_retvm_if(wd == -1, -1, "Error: add noti: %s", strerror(errno));
@@ -401,18 +383,6 @@ static int __add_noti(int fd, const char *notipath, void (*cb) (void *),
return 0;
}
-API int heynoti_subscribe_file(int fd, const char *path, void (*cb) (void *),
- void *data, uint32_t mask)
-{
- if (path == NULL || cb == NULL) {
- UTIL_DBG("Error: add noti: Invalid input");
- errno = EINVAL;
- return -1;
- }
-
- return __add_noti(fd, path, cb, data, mask);
-}
-
API int heynoti_subscribe(int fd, const char *noti, void (*cb) (void *),
void *data)
{
@@ -515,21 +485,6 @@ API int heynoti_unsubscribe(int fd, const char *noti, void (*cb) (void *))
return r;
}
-API int heynoti_unsubscribe_file(int fd, const char *path, void (*cb) (void *))
-{
- int r;
-
- if (fd < 0 || path == NULL) {
- errno = EINVAL;
- return -1;
- }
-
- r = del_noti(fd, path, cb);
- util_warn_if(r == -1, "Error: del [%s]: %s", path, strerror(errno));
-
- return r;
-}
-
API int heynoti_publish(const char *noti)
{
int fd;
@@ -551,11 +506,8 @@ API int heynoti_publish(const char *noti)
}
UTIL_DBG("send noti: [%s]", notipath);
-#ifdef NODAC_PERMISSION
- fd = open(notipath, O_CREAT | O_TRUNC | O_RDWR, 0666);
-#else
- fd = open(notipath, O_CREAT | O_TRUNC | O_RDWR, 0644);
-#endif
+ fd = open(notipath, O_TRUNC | O_WRONLY);
+
util_retvm_if(fd == -1, -1, "Error: send noti: %s", strerror(errno));
/*
@@ -565,9 +517,6 @@ API int heynoti_publish(const char *noti)
if(sb.st_mode & 0033)
fchmod(fd, 0644);
*/
-#ifdef NODAC_PERMISSION
- fchmod(fd, 0666);
-#endif
close(fd);
return 0;
@@ -580,7 +529,7 @@ API int heynoti_init()
struct noti_cont *nc;
- if (__get_kern_ver() < KERNEL_VERSION(2, 6, 13)) {
+ if(__check_kern_ver() < 0) {
UTIL_ERR("inotify requires kernel version >= 2.6.13 ");
errno = EPERM;
return -1;
@@ -589,8 +538,10 @@ API int heynoti_init()
fd = inotify_init();
util_retvm_if(fd == -1, -1, "inotify init: %s", strerror(errno));
- fcntl(fd, F_SETFD, FD_CLOEXEC);
- fcntl(fd, F_SETFL, O_NONBLOCK);
+ r = fcntl(fd, F_SETFD, FD_CLOEXEC);
+ util_retvm_if(r < 0, -1, "fcntl error : %s", strerror(errno));
+ r = fcntl(fd, F_SETFL, O_NONBLOCK);
+ util_retvm_if(r < 0, -1, "fcntl error : %s", strerror(errno));
r = __make_noti_root(noti_root);
if (r == -1) {
diff --git a/heynoti.h b/heynoti.h
index 5cc3f38..27579f4 100644
--- a/heynoti.h
+++ b/heynoti.h
@@ -319,118 +319,6 @@ int heynoti_unsubscribe(int fd, const char *noti, void (*cb)(void *));
/**
* \par Description:
- * Register a new notification callback function with filepath
- *
- * \par Purpose:
- * This API is used for registering a notification callback function with filepath.
- *
- * \par Typical use case:
- * If user want to regist a notification callback function with filepath, he(or she) can use this API.
- *
- * \par Important notes:
- * None
- *
- * \param fd [in] notify file descriptor created by heynoti_init()
- * \param path [in] file path
- * \param cb [in] callback function pointer
- * \param data [in] callback function data
- * \param mask [in] inotify event mask(refer to inotify.h or inotify(7) manpage)
- *
- * \return Return Type (int) \n
- * - 0 - success. \n
- * - -1 - fail. \n
- *
- * \par Prospective clients:
- * External Apps.
- *
- * \pre heynoti_init()
- * \post None
- * \see heynoti_unsubscribe_file()
- * \remark None
- * \par Sample code:
- * \code
- * ...
- * #include <heynoti.h>
- * ...
- * int fd;
- *
- * if((fd = heynoti_init()) < 0)
- * {
- * fprintf(stderr, "heynoti_init fail, error_code: %d\n", fd);
- * return; //return if unavailable file descriptor is returned
- * }
- *
- * if(heynoti_subscribe_file(fd, "/home/test/noti_test_file", callback, NULL, IN_CLOSE_WRITE | IN_DELETE_SELF))
- * {
- * fprintf(stderr, "heynoti_subscribe_file FAIL\n");
- * }
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int heynoti_subscribe_file
- (int fd, const char *path, void (*cb)(void *), void *data, uint32_t mask);
-
-/**
- * \par Description:
- * Unregister notification callback function with filepath
- *
- * \par Purpose:
- * This API is used for unregistering a notification callback function with filepath.
- *
- * \par Typical use case:
- * If user want to unregist a notification callback function with filepath, he(or she) can use this API.
- *
- * \par Important notes:
- * None
- * \pre heynoti_init()
- * \post None
- * \see heynoti_unsubscribe_file()
- * \remark None
- *
- * \param fd [in] notify file descriptor created by heynoti_init()
- * \param path [in] file path
- * \param cb [in] callback function pointer
- *
- * \return Return Type (int) \n
- * - 0 - success. \n
- * - -1 - fail. \n
- *
- * \par Prospective clients:
- * External Apps.
- *
- * \par Sample code:
- * \code
- * ...
- * #include <heynoti.h>
- * ...
- * int fd;
- *
- * if((fd = heynoti_init()) < 0)
- * {
- * fprintf(stderr, "heynoti_init fail, error_code: %d\n", fd);
- * return; //return if unavailable file descriptor is returned
- * }
- *
- * if(heynoti_subscribe_file(fd, "/home/test/noti_test_file", callback, NULL, IN_CLOSE_WRITE | IN_DELETE_SELF))
- * {
- * fprintf(stderr, "heynoti_subscribe_file FAIL\n");
- * }
- *
- * if(heynoti_unsubscribe_file(fd, "/home/test/noti_test_file", callback))
- * {
- * fprintf(stderr, "heynoti_unsubscribe_file FAIL\n");
- * }
- *
- * heynoti_close(fd);
- * ...
- * \endcode
- */
-/*================================================================================================*/
-int heynoti_unsubscribe_file(int fd, const char *path, void (*cb)(void *));
-
-/**
- * \par Description:
* Send a notification
*
* \par Purpose:
diff --git a/heynoti.manifest b/heynoti.manifest
new file mode 100644
index 0000000..97e8c31
--- /dev/null
+++ b/heynoti.manifest
@@ -0,0 +1,5 @@
+<manifest>
+ <request>
+ <domain name="_"/>
+ </request>
+</manifest>
diff --git a/include/heynoti-log.h b/include/heynoti-log.h
index d431431..769c147 100644..100755
--- a/include/heynoti-log.h
+++ b/include/heynoti-log.h
@@ -50,9 +50,9 @@
#include <stdio.h>
-/*#define UTILCORE_DEBUG */
/*#define UTIL_SYSLOG_OUT */
#define UTIL_DLOG_OUT
+#define UTILCORE_DEBUG
#ifdef UTIL_SYSLOG_OUT
#include <syslog.h>
@@ -66,12 +66,13 @@
#define UTIL_ERR(fmt, arg...) __UTIL_LOG(LOG_ERR, fmt, ##arg)
#define _UTIL_DBG(fmt, arg...) __UTIL_LOGD(LOG_DEBUG, fmt, ##arg)
#elif defined(UTIL_DLOG_OUT)
+#define LOG_TAG "HEYNOTI"
#include <dlog.h>
#define UTIL_DLOG(prio, fmt, arg...) \
do { } while (0)
-#define UTIL_INFO(fmt, arg...) UTIL_DLOG(DLOG_VERBOSE, fmt, ##arg)
-#define UTIL_ERR(fmt, arg...) UTIL_DLOG(DLOG_EXCEPTION, fmt, ##arg)
-#define _UTIL_DBG(fmt, arg...) UTIL_DLOG(DLOG_VERBOSE, fmt, ##arg)
+#define UTIL_INFO(fmt, arg...) LOGD(fmt,##arg)
+#define UTIL_ERR(fmt, arg...) LOGE(fmt,##arg)
+#define _UTIL_DBG(fmt, arg...) LOGD(fmt,##arg)
#else
#include <syslog.h>
diff --git a/packaging/heynoti.spec b/packaging/heynoti.spec
index c914144..6e208a7 100644
--- a/packaging/heynoti.spec
+++ b/packaging/heynoti.spec
@@ -2,14 +2,16 @@
Name: heynoti
Summary: HEY (ligHt Easy speedy) notification library
Version: 0.0.2
-Release: 5.1
+Release: 39
Group: System/Libraries
-License: GNU LGPL
-Source0: heynoti-%{version}.tar.gz
+License: Apache License, Version 2.0
+Source0: %{name}-%{version}.tar.gz
+
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
+
BuildRequires: cmake
-BuildRequires: pkgconfig(sglib)
+
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(ecore)
@@ -30,7 +32,7 @@ heynoti API (devel)
%prep
-%setup -q -n %{name}
+%setup -q
%build
@@ -44,20 +46,20 @@ rm -rf %{buildroot}
%make_install
-
-
-%post -p /sbin/ldconfig
+%post
+/sbin/ldconfig
+mkdir -p /opt/share/noti
+chmod 1755 /opt/share/noti
%postun -p /sbin/ldconfig
-
-
-
%files
+%manifest heynoti.manifest
%defattr(-,root,root,-)
%{_libdir}/libheynoti.so.0
%{_libdir}/libheynoti.so.0.0.2
+%{_bindir}/heynotitool
%files devel
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0970193..3f7dc58 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -14,7 +14,7 @@ INCLUDE(FindPkgConfig)
pkg_check_modules(pkg_ecore ecore)
IF(${pkg_ecore_FOUND})
- SET(TARGETS tst_subscribe_ecore tst_subscribe_file_mask)
+ SET(TARGETS tst_subscribe_ecore)
FOREACH(TARGET ${TARGETS})
ADD_EXECUTABLE(${TARGET} ${TARGET}.c)
STRING(REPLACE ";" " " TEMP_CFLAGS "${pkg_ecore_CFLAGS}")
diff --git a/test/tst_publish.c b/test/tst_publish.c
index f49667e..63fc162 100755
--- a/test/tst_publish.c
+++ b/test/tst_publish.c
@@ -31,8 +31,10 @@ int main(int argc, char *argv[])
if (argc > 1) {
char p[FILENAME_MAX];
- if (!heynoti_get_snoti_name(argv[1], p, sizeof(p))) ;
- heynoti_publish(p);
+ if (!heynoti_get_snoti_name(argv[1], p, sizeof(p)))
+ heynoti_publish(p);
+ else
+ printf("noti name error\n");
} else {
printf("usage) %s NOTI_NAME\n", argv[0]);
}