summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/include/Spy.h2
-rw-r--r--src/lib/spy/spy_file.c2
-rw-r--r--src/lib/spy/spy_main.c16
-rw-r--r--src/lib/spy/spy_private.h3
4 files changed, 21 insertions, 2 deletions
diff --git a/src/include/Spy.h b/src/include/Spy.h
index b24c42b..4064d62 100644
--- a/src/include/Spy.h
+++ b/src/include/Spy.h
@@ -21,6 +21,8 @@ Spy_File * spy_file_get(Spy *spy, const char *file);
21const char * spy_file_name_get(Spy_File *sf); 21const char * spy_file_name_get(Spy_File *sf);
22void spy_file_data_set(Spy_File *sf, const void *data); 22void spy_file_data_set(Spy_File *sf, const void *data);
23void * spy_file_data_get(Spy_File *sf); 23void * spy_file_data_get(Spy_File *sf);
24void spy_file_pause(Spy_File *sf);
25void spy_file_resume(Spy_File *sf);
24 26
25const char * spy_line_get(Spy_Line *sl); 27const char * spy_line_get(Spy_Line *sl);
26Spy_File * spy_line_spyfile_get(Spy_Line *sl); 28Spy_File * spy_line_spyfile_get(Spy_Line *sl);
diff --git a/src/lib/spy/spy_file.c b/src/lib/spy/spy_file.c
index 307e133..adef42d 100644
--- a/src/lib/spy/spy_file.c
+++ b/src/lib/spy/spy_file.c
@@ -140,7 +140,7 @@ spy_file_poll(void *data)
140 Ecore_Thread *et; 140 Ecore_Thread *et;
141 141
142 sf = data; 142 sf = data;
143 if (sf->poll.running) 143 if ((sf->poll.running) || (sf->poll.pause))
144 return EINA_TRUE; 144 return EINA_TRUE;
145 145
146 /* We should have different actions made depending on error type. */ 146 /* We should have different actions made depending on error type. */
diff --git a/src/lib/spy/spy_main.c b/src/lib/spy/spy_main.c
index b4ca263..3cc7f0c 100644
--- a/src/lib/spy/spy_main.c
+++ b/src/lib/spy/spy_main.c
@@ -34,6 +34,22 @@ spy_free(Spy *spy)
34 free(spy); 34 free(spy);
35} 35}
36 36
37void
38spy_file_pause(Spy_File *sf)
39{
40 EINA_SAFETY_ON_NULL_RETURN(sf);
41
42 sf->poll.pause = EINA_TRUE;
43}
44
45void
46spy_file_resume(Spy_File *sf)
47{
48 EINA_SAFETY_ON_NULL_RETURN(sf);
49
50 sf->poll.pause = EINA_FALSE;
51}
52
37Spy_File * 53Spy_File *
38spy_file_get(Spy *spy, const char *file) 54spy_file_get(Spy *spy, const char *file)
39{ 55{
diff --git a/src/lib/spy/spy_private.h b/src/lib/spy/spy_private.h
index ad32258..26ddfae 100644
--- a/src/lib/spy/spy_private.h
+++ b/src/lib/spy/spy_private.h
@@ -24,7 +24,8 @@ struct _Spy_File
24 { 24 {
25 Ecore_Timer *timer; 25 Ecore_Timer *timer;
26 off_t size; 26 off_t size;
27 Eina_Bool running; 27 Eina_Bool running,
28 pause;
28 } poll; 29 } poll;
29 30
30 struct 31 struct