GTimeVal tv;
};
+#ifdef GIO_COMPILATION
#define FN_W if (fn_debug_enabled) g_warning
static gboolean fn_debug_enabled = FALSE;
+#else
+#include "gam_error.h"
+#define FN_W(...) GAM_DEBUG(DEBUG_INFO, __VA_ARGS__)
+#endif
G_LOCK_EXTERN (fen_lock);
#define PROCESS_DELETING_INTERVAL 900 /* in second */
d = (struct _dnode*)i->data;
/* Time to free, try only once */
if (g_timeval_lt (&d->tv, &tv_now)) {
- if ((node = find_node (d->filename)) != NULL) {
+ if ((node = _find_node (d->filename)) != NULL) {
remove_node_internal (node, d->op);
}
_dnode_free (d);
}
gpointer
-node_get_data (node_t* node)
+_node_get_data (node_t* node)
{
g_assert (node);
return node->user_data;
}
gpointer
-node_set_data (node_t* node, gpointer user_data)
+_node_set_data (node_t* node, gpointer user_data)
{
gpointer data = node->user_data;
g_assert (node);
}
void
-travel_nodes (node_t* node, node_op_t* op)
+_travel_nodes (node_t* node, node_op_t* op)
{
GList* children;
GList* i;
children = g_hash_table_get_values (node->children);
if (children) {
for (i = children; i; i = i->next) {
- travel_nodes (i->data, op);
+ _travel_nodes (i->data, op);
}
g_list_free (children);
}
if ((token = strtok_r (str, G_DIR_SEPARATOR_S, &lasts)) != NULL) {
do {
FN_W ("%s %s + %s\n", __func__, NODE_NAME(parent), token);
- child = children_find (parent, token);
+ child = _children_find (parent, token);
if (child) {
parent = child;
} else {
}
node_t*
-find_node (const gchar *filename)
+_find_node (const gchar *filename)
{
return find_node_internal (_head, filename, NULL);
}
node_t*
-find_node_full (const gchar* filename, node_op_t* op)
+_find_node_full (const gchar* filename, node_op_t* op)
{
return find_node_internal (_head, filename, op);
}
node_t*
-add_node (node_t* parent, const gchar* filename)
+_add_node (node_t* parent, const gchar* filename)
{
gchar* str;
gchar* token;
}
}
-/**
+/*
* delete recursively
*/
static gboolean
remove_children (node_t* node, node_op_t* op)
{
FN_W ("%s 0x%p %s\n", __func__, node, NODE_NAME(node));
- if (children_num (node) > 0) {
+ if (_children_num (node) > 0) {
children_foreach_remove (node, children_remove_cb,
(gpointer)op);
}
- if (children_num (node) == 0) {
+ if (_children_num (node) == 0) {
return TRUE;
}
return FALSE;
parent = node->parent;
children_remove (parent, node);
node_delete (node);
- if (children_num (parent) == 0) {
+ if (_children_num (parent) == 0) {
remove_node_internal (parent, op);
}
return TRUE;
}
void
-pending_remove_node (node_t* node, node_op_t* op)
+_pending_remove_node (node_t* node, node_op_t* op)
{
struct _dnode* d;
GList* l;
}
void
-remove_node (node_t* node, node_op_t* op)
+_remove_node (node_t* node, node_op_t* op)
{
remove_node_internal (node, op);
}
}
guint
-children_num (node_t *f)
+_children_num (node_t *f)
{
return g_hash_table_size (f->children);
}
node_t *
-children_find (node_t *f, const gchar *basename)
+_children_find (node_t *f, const gchar *basename)
{
return (node_t *) g_hash_table_lookup (f->children, (gpointer)basename);
}
-/**
+/*
* depth first delete recursively
*/
static gboolean
}
gboolean
-node_class_init ()
+_node_class_init ()
{
FN_W ("%s\n", __func__);
if (_head == NULL) {