summaryrefslogtreecommitdiff
path: root/src/lib/spy/spy_private.h
blob: 3258546c1539a8b7a86a2e456fff5cb13444a5d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#include <Spy.h>

extern int _spy_log_dom_global;

#define ERR(...) EINA_LOG_DOM_ERR(_spy_log_dom_global, __VA_ARGS__)
#define DBG(...) EINA_LOG_DOM_DBG(_spy_log_dom_global, __VA_ARGS__)
#define NFO(...) EINA_LOG_DOM_INFO(_spy_log_dom_global, __VA_ARGS__)
#define WRN(...) EINA_LOG_DOM_WARN(_spy_log_dom_global, __VA_ARGS__)
#define CRI(...) EINA_LOG_DOM_CRIT(_spy_log_dom_global, __VA_ARGS__)

struct _Spy
{
   Eina_Inlist *files;
};


struct _Spy_File
{
   EINA_INLIST;
   const char *name;
   const void *data;
   Spy *spy;

   struct
   {
      Ecore_Timer *timer;
      off_t size;
      Eina_Bool running,
                pause;
   } poll;

   struct
   {
      int fd;
      off_t offset,
            length;
      Eina_Strbuf *buf;
      char *databuf;
      ssize_t nbr;
      Eina_Bool error : 1;
   } read;

   struct
   {
      const char *p,
                 *s;
      size_t l;
   } extract;
};

struct _Spy_Line
{
   Spy_File *sf;
   const char *line;
};

Eina_Bool spy_file_poll(void *data);