• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/iserver/dbus-1.6.8/dbus/

Lines Matching defs:subtree

51 static DBusObjectSubtree* _dbus_object_subtree_ref   (DBusObjectSubtree           *subtree);
52 static void _dbus_object_subtree_unref (DBusObjectSubtree *subtree);
66 * Struct representing a single registered subtree handler, or node
67 * that's a parent of a registered subtree handler. If
158 * subtree nodes
163 find_subtree_recurse (DBusObjectSubtree *subtree,
180 subtree->name);
184 return subtree;
189 subtree->name, path[0]);
193 j = subtree->n_subtrees;
199 v = strcmp (path[0], subtree->subtrees[k]->name);
203 path[0], subtree->subtrees[k]->name,
221 next = find_subtree_recurse (subtree->subtrees[k],
225 subtree->invoke_as_fallback)
229 subtree->name);
233 return subtree;
239 return find_subtree_recurse (subtree->subtrees[k],
255 subtree->name, create_if_not_found);
264 _dbus_verbose (" creating subtree %s\n",
273 new_n_subtrees = subtree->n_subtrees + 1;
274 if (new_n_subtrees > subtree->max_subtrees)
279 new_max_subtrees = subtree->max_subtrees == 0 ? 1 : 2 * subtree->max_subtrees;
280 new_subtrees = dbus_realloc (subtree->subtrees,
287 subtree->subtrees = new_subtrees;
288 subtree->max_subtrees = new_max_subtrees;
295 new_n_subtrees <= subtree->max_subtrees);
298 memmove (&subtree->subtrees[child_pos+1],
299 &subtree->subtrees[child_pos],
301 sizeof subtree->subtrees[0]);
303 subtree->subtrees[child_pos] = child;
307 subtree->n_subtrees = new_n_subtrees;
308 child->parent = subtree;
318 return (return_deepest_match && subtree->invoke_as_fallback) ? subtree : NULL;
327 DBusObjectSubtree *subtree;
330 _dbus_verbose ("Looking for exact registered subtree\n");
333 subtree = find_subtree_recurse (tree->root, path, FALSE, index_in_parent, NULL);
335 if (subtree && subtree->message_function == NULL)
338 return subtree;
346 _dbus_verbose ("Looking for subtree\n");
371 _dbus_verbose ("Ensuring subtree\n");
379 * Registers a new subtree in the global object tree.
383 * @param path NULL-terminated array of path elements giving path to subtree
384 * @param vtable the vtable used to traverse this subtree
398 DBusObjectSubtree *subtree;
404 subtree = ensure_subtree (tree, path);
405 if (subtree == NULL)
411 if (subtree->message_function != NULL)
428 subtree->message_function = vtable->message_function;
429 subtree->unregister_function = vtable->unregister_function;
430 subtree->user_data = user_data;
431 subtree->invoke_as_fallback = fallback != FALSE;
437 * Unregisters an object subtree that was registered with the
441 * @param path path to the subtree (same as the one passed to _dbus_object_tree_register())
448 DBusObjectSubtree *subtree;
458 subtree = find_subtree (tree, path, &i);
461 if (subtree == NULL)
469 _dbus_assert (subtree != NULL);
472 _dbus_assert (subtree->parent == NULL ||
473 (i >= 0 && subtree->parent->subtrees[i] == subtree));
475 subtree->message_function = NULL;
477 unregister_function = subtree->unregister_function;
478 user_data = subtree->user_data;
480 subtree->unregister_function = NULL;
481 subtree->user_data = NULL;
487 if (subtree->parent && subtree->n_subtrees == 0)
490 memmove (&subtree->parent->subtrees[i],
491 &subtree->parent->subtrees[i+1],
492 (subtree->parent->n_subtrees - i - 1) *
493 sizeof (subtree->parent->subtrees[0]));
494 subtree->parent->n_subtrees -= 1;
496 subtree->parent = NULL;
498 _dbus_object_subtree_unref (subtree);
500 subtree = NULL;
526 DBusObjectSubtree *subtree)
531 while (subtree->n_subtrees > 0)
535 child = subtree->subtrees[subtree->n_subtrees - 1];
536 subtree->subtrees[subtree->n_subtrees - 1] = NULL;
537 subtree->n_subtrees -= 1;
544 if (subtree->unregister_function)
545 (* subtree->unregister_function) (connection,
546 subtree->user_data);
548 subtree->message_function = NULL;
549 subtree->unregister_function = NULL;
550 subtree->user_data = NULL;
553 _dbus_object_subtree_unref (subtree);
576 DBusObjectSubtree *subtree;
584 subtree = lookup_subtree (tree, parent_path);
585 if (subtree == NULL)
592 retval = dbus_new0 (char*, subtree->n_subtrees + 1);
596 while (i < subtree->n_subtrees)
598 retval[i] = _dbus_strdup (subtree->subtrees[i]->name);
756 DBusObjectSubtree *subtree;
793 subtree = find_handler (tree, (const char**) path, &exact_match);
796 *found_object = !!subtree;
802 while (subtree != NULL)
804 if (subtree->message_function != NULL && (exact_match || subtree->invoke_as_fallback))
806 _dbus_object_subtree_ref (subtree);
809 if (!_dbus_list_append (&list, subtree))
812 _dbus_object_subtree_unref (subtree);
818 subtree = subtree->parent;
832 subtree = link->data;
837 if (subtree->message_function)
842 message_function = subtree->message_function;
843 user_data = subtree->user_data;
857 /* FIXME you could unregister the subtree in another thread
915 * @param path NULL-terminated array of path elements giving path to subtree
923 DBusObjectSubtree *subtree;
929 subtree = find_handler (tree, (const char**) path, &exact_match);
931 if ((subtree == NULL) || !exact_match)
937 return subtree->user_data;
941 * Allocates a subtree object.
944 * @returns newly-allocated subtree
950 DBusObjectSubtree *subtree;
957 subtree = dbus_malloc0 (MAX (front_padding + (len + 1), sizeof (DBusObjectSubtree)));
959 if (subtree == NULL)
962 memcpy (subtree->name, name, len + 1);
964 return subtree;
972 DBusObjectSubtree *subtree;
974 subtree = allocate_subtree_object (name);
975 if (subtree == NULL)
980 subtree->parent = NULL;
984 subtree->message_function = vtable->message_function;
985 subtree->unregister_function = vtable->unregister_function;
989 subtree->message_function = NULL;
990 subtree->unregister_function = NULL;
993 subtree->user_data = user_data;
994 _dbus_atomic_inc (&subtree->refcount);
995 subtree->subtrees = NULL;
996 subtree->n_subtrees = 0;
997 subtree->max_subtrees = 0;
998 subtree->invoke_as_fallback = FALSE;
1000 return subtree;
1007 _dbus_object_subtree_ref (DBusObjectSubtree *subtree)
1010 _dbus_atomic_inc (&subtree->refcount);
1014 old_value = _dbus_atomic_inc (&subtree->refcount);
1018 return subtree;
1022 _dbus_object_subtree_unref (DBusObjectSubtree *subtree)
1026 old_value = _dbus_atomic_dec (&subtree->refcount);
1031 _dbus_assert (subtree->unregister_function == NULL);
1032 _dbus_assert (subtree->message_function == NULL);
1034 dbus_free (subtree->subtrees);
1035 dbus_free (subtree);
1274 spew_subtree_recurse (DBusObjectSubtree *subtree,
1287 subtree->name, subtree->n_subtrees);
1290 while (i < subtree->n_subtrees)
1292 spew_subtree_recurse (subtree->subtrees[i], indent + 2);