1 /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:set expandtab ts=4 shiftwidth=4: */
4 * Copyright (C) 2008 Sun Microsystems, Inc. All rights reserved.
5 * Use is subject to license terms.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General
18 * Public License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20 * Boston, MA 02111-1307, USA.
22 * Authors: Lin Ma <lin.ma@sun.com>
26 #include <sys/types.h>
29 #include "fen-kernel.h"
34 #define FN_EVENT_CREATED 0
35 #define FN_NAME(fp) (((fdata*)(fp))->fobj.fo_name)
36 #define FN_NODE(fp) (((fdata*)(fp))->node)
37 #define FN_IS_DIR(fp) (((fdata*)(fp))->is_dir)
38 #define FN_IS_PASSIVE(fp) (((fdata*)(fp))->subs == NULL)
39 #define FN_IS_MONDIR(fp) (((fdata*)(fp))->mon_dir_num > 0)
40 #define FN_IS_LIVING(fp) (!((fdata*)(fp))->is_cancelled)
46 gboolean is_cancelled;
49 /* to identify if the path is dir */
53 /* List of subscriptions monitoring this fdata/path */
56 /* prcessed changed events num */
57 guint changed_event_num;
59 /* process events source id */
62 guint change_update_id;
66 fdata* _fdata_new (node_t* node, gboolean is_mondir);
67 void _fdata_reset (fdata* data);
68 void _fdata_emit_events_once (fdata *f, int event, gpointer sub);
69 void _fdata_emit_events (fdata *f, int event);
70 void _fdata_add_event (fdata *f, fnode_event_t *ev);
71 void _fdata_adjust_deleted (fdata *f);
72 fdata* _get_parent_data (fdata* data);
73 node_t* _get_parent_node (fdata* data);
74 gboolean _is_monitoring (fdata* data);
77 void _fdata_sub_add (fdata *f, gpointer sub);
78 void _fdata_sub_remove (fdata *f, gpointer sub);
81 node_t* _add_missing_cb (node_t* parent, gpointer user_data);
82 gboolean _pre_del_cb (node_t* node, gpointer user_data);
85 gboolean _fdata_class_init (void (*user_emit_cb) (fdata*, int),
86 void (*user_emit_once_cb) (fdata*, int, gpointer),
87 int (*user_event_converter) (int event));
89 #endif /* _FEN_DATA_H_ */