summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-10-23 11:05:36 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-10-23 11:05:36 +0000
commit259b702319a5cfe8edd2be88b1d8fa7cbea0848e (patch)
treea7afcffc1bbe922e33d95aad90464e50a86339bf /legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c
parent8055b915b7585e80730b3df539a8eb73a0c5a3e8 (diff)
[ecore-file] fix doc
SVN revision: 53810
Diffstat (limited to 'legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c')
-rw-r--r--legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c70
1 files changed, 54 insertions, 16 deletions
diff --git a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c
index ca240d850c..15028fa4bd 100644
--- a/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c
+++ b/legacy/ecore/src/lib/ecore_file/ecore_file_monitor.c
@@ -67,20 +67,36 @@ ecore_file_monitor_shutdown(void)
67} 67}
68 68
69/** 69/**
70 * Monitor a path using inotify or polling 70 * @addtogroup Ecore_File_Group Ecore_File - Files and direcotries convenience functions
71 * @param path The path to monitor 71 *
72 * @param func The function to call on changes 72 * @{
73 * @param data The data passed to func 73 */
74 * @return An Ecore_File_Monitor pointer or NULL on failure 74
75/**
76 * @brief Monitor the given path using inotify, Windows notification, or polling.
77 *
78 * @param path The path to monitor.
79 * @param func The function to call on changes.
80 * @param data The data passed to func.
81 * @return An Ecore_File_Monitor pointer or NULL on failure.
82 *
83 * This function monitors @p path. If @p path is @c NULL, or is an
84 * empty string, or none of the notify methods (Inotify, Windows
85 * notification or polling) is available, or if @p path is not a file,
86 * the function returns @c NULL. Otherwise, it returns a newly
87 * allocated Ecore_File_Monitor object and the monitoring begins. When
88 * one of the #Ecore_File_Event event is notified, @p func is called
89 * and @p data is passed to @p func. Call ecore_file_monitor_del() to
90 * stop the monitoring.
75 */ 91 */
76EAPI Ecore_File_Monitor * 92EAPI Ecore_File_Monitor *
77ecore_file_monitor_add(const char *path, 93ecore_file_monitor_add(const char *path,
78 void (*func) (void *data, 94 Ecore_File_Monitor_Cb func,
79 Ecore_File_Monitor *em, 95 void *data)
80 Ecore_File_Event event,
81 const char *path),
82 void *data)
83{ 96{
97 if (!path || !*path)
98 return NULL;
99
84 switch (monitor_type) 100 switch (monitor_type)
85 { 101 {
86 case ECORE_FILE_MONITOR_TYPE_NONE: 102 case ECORE_FILE_MONITOR_TYPE_NONE:
@@ -102,12 +118,22 @@ ecore_file_monitor_add(const char *path,
102} 118}
103 119
104/** 120/**
105 * Stop monitoring a path 121 * @brief Stop the monitoring of the given path.
106 * @param em The Ecore_File_Monitor to stop 122 *
123 * @param em The Ecore_File_Monitor to stop.
124 *
125 * This function stops the the monitoring of the path that has been
126 * monitored by ecore_file_monitor_add(). @p em must be the value
127 * returned by ecore_file_monitor_add(). If @p em is @c NULL, or none
128 * of the notify methods (Inotify, Windows notification or polling) is
129 * availablethis function does nothing.
107 */ 130 */
108EAPI void 131EAPI void
109ecore_file_monitor_del(Ecore_File_Monitor *em) 132ecore_file_monitor_del(Ecore_File_Monitor *em)
110{ 133{
134 if (!em)
135 return;
136
111 switch (monitor_type) 137 switch (monitor_type)
112 { 138 {
113 case ECORE_FILE_MONITOR_TYPE_NONE: 139 case ECORE_FILE_MONITOR_TYPE_NONE:
@@ -131,12 +157,24 @@ ecore_file_monitor_del(Ecore_File_Monitor *em)
131} 157}
132 158
133/** 159/**
134 * Get the monitored path 160 * @brief Get the monitored path.
135 * @param em The Ecore_File_Monitor to query 161 *
136 * @return The path that is monitored by @p em 162 * @param em The Ecore_File_Monitor to query.
163 * @return The path that is monitored by @p em.
164 *
165 * This function returns the monitored path that has been
166 * monitored by ecore_file_monitor_add(). @p em must be the value
167 * returned by ecore_file_monitor_add(). If @p em is @c NULL, the
168 * function returns @c NULL.
137 */ 169 */
138EAPI const char * 170EAPI const char *
139ecore_file_monitor_path_get(Ecore_File_Monitor *em) 171ecore_file_monitor_path_get(Ecore_File_Monitor *em)
140{ 172{
173 if (!em)
174 return NULL;
141 return em->path; 175 return em->path;
142} 176}
177
178/**
179 * @}
180 */