Debian Codegraph @

src/ck-file-monitor.h

raw symbols SCIP
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
2 *
3 * Copyright (C) 2007 William Jon McCann <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 *
19 */
20
21 #ifndef __CK_FILE_MONITOR_H
22 #define __CK_FILE_MONITOR_H
23
24 #include <glib-object.h>
25
26 G_BEGIN_DECLS
27
28 #define CK_TYPE_FILE_MONITOR (ck_file_monitor_get_type ())
29 #define CK_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CK_TYPE_FILE_MONITOR, CkFileMonitor))
30 #define CK_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), CK_TYPE_FILE_MONITOR, CkFileMonitorClass))
31 #define CK_IS_FILE_MONITOR(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CK_TYPE_FILE_MONITOR))
32 #define CK_IS_FILE_MONITOR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CK_TYPE_FILE_MONITOR))
33 #define CK_FILE_MONITOR_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CK_TYPE_FILE_MONITOR, CkFileMonitorClass))
34
35 typedef struct CkFileMonitorPrivate CkFileMonitorPrivate;
36
37 typedef struct
38 {
39 GObject parent;
40 CkFileMonitorPrivate *priv;
41 } CkFileMonitor;
42
43 typedef struct
44 {
45 GObjectClass parent_class;
46 } CkFileMonitorClass;
47
48 typedef enum
49 {
50 CK_FILE_MONITOR_EVENT_NONE = 1 << 0,
51 CK_FILE_MONITOR_EVENT_ACCESS = 1 << 1,
52 CK_FILE_MONITOR_EVENT_CREATE = 1 << 2,
53 CK_FILE_MONITOR_EVENT_DELETE = 1 << 3,
54 CK_FILE_MONITOR_EVENT_CHANGE = 1 << 4,
55 } CkFileMonitorEvent;
56
57 typedef enum
58 {
59 CK_FILE_MONITOR_ERROR_GENERAL
60 } CkFileMonitorError;
61
62 #define CK_FILE_MONITOR_ERROR ck_file_monitor_error_quark ()
63
64 typedef void (*CkFileMonitorNotifyFunc) (CkFileMonitor *monitor,
65 CkFileMonitorEvent event,
66 const char *path,
67 gpointer user_data);
68
69 GQuark ck_file_monitor_error_quark (void);
70 GType ck_file_monitor_get_type (void);
71
72 CkFileMonitor * ck_file_monitor_new (void);
73
74 guint ck_file_monitor_add_notify (CkFileMonitor *monitor,
75 const char *path,
76 int mask,
77 CkFileMonitorNotifyFunc notify_func,
78 gpointer data);
79 void ck_file_monitor_remove_notify (CkFileMonitor *monitor,
80 guint id);
81
82 G_END_DECLS
83
84 #endif /* __CK_FILE_MONITOR_H */