syslog-ng source
poll-file-changes.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2002-2013 Balabit
3  * Copyright (c) 1998-2013 Balázs Scheidler
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 as published
7  * by the Free Software Foundation, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * As an additional exemption you are allowed to compile & link against the
19  * OpenSSL libraries as published by the OpenSSL project. See the file
20  * COPYING for details.
21  *
22  */
23 #ifndef POLL_FILE_CHANGES_H_INCLUDED
24 #define POLL_FILE_CHANGES_H_INCLUDED
25 
26 #include "poll-events.h"
27 #include "file-reader.h"
28 
29 #include <iv.h>
30 
31 typedef struct _PollFileChanges PollFileChanges;
32 
34 {
35  PollEvents super;
36  gint fd;
37  gboolean fd_is_open;
40  struct iv_timer follow_timer;
41  FileReader *file_reader;
42 
43  void (*on_read)(PollFileChanges *);
44  gboolean (*on_eof)(PollFileChanges *);
45  void (*on_file_moved)(PollFileChanges *);
46 };
47 
48 PollEvents *poll_file_changes_new(gint fd, const gchar *follow_filename, gint follow_freq, FileReader *reader);
49 
50 void poll_file_changes_init_instance(PollFileChanges *self, gint fd, const gchar *follow_filename, gint follow_freq,
51  FileReader *reader);
52 void poll_file_changes_update_watches(PollEvents *s, GIOCondition cond);
53 void poll_file_changes_stop_watches(PollEvents *s);
54 void poll_file_changes_free(PollEvents *s);
55 
56 #endif
void poll_file_changes_free(PollEvents *s)
Definition: poll-file-changes.c:227
void poll_file_changes_update_watches(PollEvents *s, GIOCondition cond)
Definition: poll-file-changes.c:201
PollEvents * poll_file_changes_new(gint fd, const gchar *follow_filename, gint follow_freq, FileReader *reader)
Definition: poll-file-changes.c:262
void poll_file_changes_init_instance(PollFileChanges *self, gint fd, const gchar *follow_filename, gint follow_freq, FileReader *reader)
Definition: poll-file-changes.c:236
void poll_file_changes_stop_watches(PollEvents *s)
Definition: poll-file-changes.c:183
Definition: poll-file-changes.h:34
gint fd
Definition: poll-file-changes.h:36
struct iv_timer follow_timer
Definition: poll-file-changes.h:40
PollEvents super
Definition: poll-file-changes.h:35
void(* on_read)(PollFileChanges *)
Definition: poll-file-changes.h:43
FileReader * file_reader
Definition: poll-file-changes.h:41
gboolean fd_is_open
Definition: poll-file-changes.h:37
gboolean(* on_eof)(PollFileChanges *)
Definition: poll-file-changes.h:44
gint follow_freq
Definition: poll-file-changes.h:39
void(* on_file_moved)(PollFileChanges *)
Definition: poll-file-changes.h:45
gchar * follow_filename
Definition: poll-file-changes.h:38
WildcardFileReader * reader
Definition: test_wildcard_file_reader.c:61