glib/gio/fen/fen-node.h
Alexander Larsson 7dc75d707c Added. Added. Added. Added. Added. Added. Added. Added. Added. Added.
2008-03-14  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * fen/Makefile.am: Added.
        * fen/fen-data.[ch]: Added.
        * fen/fen-dump.[ch]: Added.
        * fen/fen-helper.[ch]: Added.
        * fen/fen-kernel.[ch]: Added.
        * fen/fen-missing.[ch]: Added.
        * fen/fen-node.[ch]: Added.
        * fen/fen-sub.[ch]: Added.
        * fen/gfendirectorymonitor.[ch]: Added.
        * fen/gfenfilemonitor.[ch]: Added.
        * giomodule.c:
	Added Solaris FEN file notification backend.
	Patch from Lin Ma <Lin.Ma@Sun.COM>


svn path=/trunk/; revision=6702
2008-03-14 08:58:24 +00:00

73 lines
2.1 KiB
C

/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:set expandtab ts=4 shiftwidth=4: */
/*
* Copyright (C) 2008 Sun Microsystem.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General
* Public License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307, USA.
*
* Authors: Lin Ma <lin.ma@sun.com>
*/
#ifndef _FEN_NODE_H_
#define _FEN_NODE_H_
typedef struct node node_t;
struct node
{
gchar *filename;
gchar *basename;
gint stat;
/* the parent and children of node */
node_t *parent;
GHashTable *children; /* children in basename */
gpointer user_data;
};
#define IS_TOPNODE(fp) (((node_t *)(fp))->parent == NULL)
#define NODE_NAME(fp) (((node_t *)(fp))->filename)
typedef struct node_op
{
/* find */
void (*hit) (node_t* node, gpointer user_data);
node_t* (*add_missing) (node_t* parent, gpointer user_data);
/* delete */
gboolean (*pre_del) (node_t* node, gpointer user_data);
/* data */
gpointer user_data;
} node_op_t;
node_t* add_node (node_t* parent, const gchar* filename);
void remove_node (node_t* node, node_op_t* op);
void pending_remove_node (node_t* node, node_op_t* op);
void travel_nodes (node_t* node, node_op_t* op);
node_t* find_node_full (const gchar* filename, node_op_t* op);
node_t* find_node (const gchar *filename);
node_t* children_find (node_t *f, const gchar *basename);
guint children_num (node_t *f);
gpointer node_get_data (node_t* node);
gpointer node_set_data (node_t* node, gpointer user_data);
gboolean node_class_init ();
#endif /* _FEN_NODE_H_ */