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>
28 typedef struct node node_t;
36 /* the parent and children of node */
38 GHashTable *children; /* children in basename */
43 #define IS_TOPNODE(fp) (((node_t *)(fp))->parent == NULL)
44 #define NODE_NAME(fp) (((node_t *)(fp))->filename)
46 typedef struct node_op
49 void (*hit) (node_t* node, gpointer user_data);
50 node_t* (*add_missing) (node_t* parent, gpointer user_data);
52 gboolean (*pre_del) (node_t* node, gpointer user_data);
57 node_t* _add_node (node_t* parent, const gchar* filename);
58 void _remove_node (node_t* node, node_op_t* op);
59 void _pending_remove_node (node_t* node, node_op_t* op);
61 void _travel_nodes (node_t* node, node_op_t* op);
62 node_t* _find_node_full (const gchar* filename, node_op_t* op);
63 node_t* _find_node (const gchar *filename);
65 node_t* _children_find (node_t *f, const gchar *basename);
66 guint _children_num (node_t *f);
68 gpointer _node_get_data (node_t* node);
69 gpointer _node_set_data (node_t* node, gpointer user_data);
71 gboolean _node_class_init ();
73 #endif /* _FEN_NODE_H_ */