summaryrefslogtreecommitdiff
path: root/src/bin/spy.c
diff options
context:
space:
mode:
authorGuillaume Friloux <guillaume.friloux@gmail.com>2013-12-13 09:13:12 +0100
committerGuillaume Friloux <guillaume.friloux@gmail.com>2013-12-13 09:13:12 +0100
commit0e4de792483f8539c4a60c9d1d0b6f567b2e8cfb (patch)
tree41031351c968ed7e965e7cc822edd34ccdbd3c03 /src/bin/spy.c
parent371d0cfc0c02dfc6889be3b7e3100d380e65410a (diff)
Less files is better.
Also removed some doxygen doc.
Diffstat (limited to 'src/bin/spy.c')
-rw-r--r--src/bin/spy.c23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/bin/spy.c b/src/bin/spy.c
index 9816449..6d27fde 100644
--- a/src/bin/spy.c
+++ b/src/bin/spy.c
@@ -16,20 +16,11 @@
16 * 16 *
17 */ 17 */
18 18
19/** 19#include "smman.h"
20 * @file spy.c 20#include <wordexp.h>
21 * @brief Contains functions that monitors logfiles 21
22 * @author Guillaume Friloux <kuri@efl.so>
23 * @version 1.0
24 *
25 * @bug : In rules, use wildcards only for filenames, not directories
26 *
27 * Contains functions that monitors logfiles
28 */
29#include "spy.h"
30 22
31/** 23/**
32 * @fn int spy_init(void)
33 * @brief Will ask rules_list() to list all rules and tell spy_addwatcher() 24 * @brief Will ask rules_list() to list all rules and tell spy_addwatcher()
34 * of every found rule so we can process it and monitor matching log files 25 * of every found rule so we can process it and monitor matching log files
35 * 26 *
@@ -42,7 +33,6 @@ int spy_init(void)
42} 33}
43 34
44/** 35/**
45 * @fn int spy_addwatcher(struct rule *foundrule)
46 * @brief Gets a rule in param, and will check for every matching 36 * @brief Gets a rule in param, and will check for every matching
47 * files on the system 37 * files on the system
48 * 38 *
@@ -113,7 +103,6 @@ int spy_addwatcher(struct rule *foundrule)
113} 103}
114 104
115/** 105/**
116 * @fn int spy_event(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
117 * @brief ecore_main_loop() will call this function for every notification he gets from logfiles 106 * @brief ecore_main_loop() will call this function for every notification he gets from logfiles
118 * activity. 107 * activity.
119 * 108 *
@@ -121,7 +110,7 @@ int spy_addwatcher(struct rule *foundrule)
121 * @param em (Ecore_File_Monitor *) Not really used here. 110 * @param em (Ecore_File_Monitor *) Not really used here.
122 * @param event (Ecore_File_Event) Event type 111 * @param event (Ecore_File_Event) Event type
123 * @param path (const char *) Name of the file that raised the event 112 * @param path (const char *) Name of the file that raised the event
124 * 113 *
125 * @return ECORE_CALLBACK_RENEW 114 * @return ECORE_CALLBACK_RENEW
126 */ 115 */
127int spy_event(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path) 116int spy_event(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const char *path)
@@ -229,7 +218,6 @@ int spy_event(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const
229 { 218 {
230 if( !strcmp(new_logfile->name, path) ) 219 if( !strcmp(new_logfile->name, path) )
231 return(ECORE_CALLBACK_RENEW); 220 return(ECORE_CALLBACK_RENEW);
232
233 } 221 }
234 222
235 EINA_LIST_FOREACH(list_rules, l, foundrule) 223 EINA_LIST_FOREACH(list_rules, l, foundrule)
@@ -289,7 +277,6 @@ int spy_event(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const
289 277
290 278
291/** 279/**
292 * @fn int spy_extract_new_lines(char *filename, fpos_t pos_cur, fpos_t *pos_new, char *message)
293 * @brief Gets the new log message that has been inserted. This function kind of sucks and has to 280 * @brief Gets the new log message that has been inserted. This function kind of sucks and has to
294 * be improved to really extract all the messages and send them to a callback that will 281 * be improved to really extract all the messages and send them to a callback that will
295 * process them intead of taking only one (which can cause a problem if we don't get 282 * process them intead of taking only one (which can cause a problem if we don't get
@@ -299,7 +286,7 @@ int spy_event(void *data, Ecore_File_Monitor *em, Ecore_File_Event event, const
299 * @param pos_cur (fpos_t) current cursor position for this file 286 * @param pos_cur (fpos_t) current cursor position for this file
300 * @param pos_new (fpos_t *) New position of the cursor after extracting the new message 287 * @param pos_new (fpos_t *) New position of the cursor after extracting the new message
301 * @param message (char *) message extracted from the logfile 288 * @param message (char *) message extracted from the logfile
302 * 289 *
303 * @return 0 or -1 if there is an error 290 * @return 0 or -1 if there is an error
304 */ 291 */
305int spy_extract_new_lines(char *filename, fpos_t pos_cur, fpos_t *pos_new, char *message) 292int spy_extract_new_lines(char *filename, fpos_t pos_cur, fpos_t *pos_new, char *message)