Lines Matching refs:registry

44   BusRegistry *registry;  member
76 BusRegistry *registry; in bus_registry_new() local
78 registry = dbus_new0 (BusRegistry, 1); in bus_registry_new()
79 if (registry == NULL) in bus_registry_new()
82 registry->refcount = 1; in bus_registry_new()
83 registry->context = context; in bus_registry_new()
85 registry->service_hash = _dbus_hash_table_new (DBUS_HASH_STRING, in bus_registry_new()
87 if (registry->service_hash == NULL) in bus_registry_new()
90 registry->service_pool = _dbus_mem_pool_new (sizeof (BusService), in bus_registry_new()
93 if (registry->service_pool == NULL) in bus_registry_new()
96 registry->owner_pool = _dbus_mem_pool_new (sizeof (BusOwner), in bus_registry_new()
99 if (registry->owner_pool == NULL) in bus_registry_new()
102 registry->service_sid_table = NULL; in bus_registry_new()
104 return registry; in bus_registry_new()
107 bus_registry_unref (registry); in bus_registry_new()
112 bus_registry_ref (BusRegistry *registry) in bus_registry_ref() argument
114 _dbus_assert (registry->refcount > 0); in bus_registry_ref()
115 registry->refcount += 1; in bus_registry_ref()
117 return registry; in bus_registry_ref()
121 bus_registry_unref (BusRegistry *registry) in bus_registry_unref() argument
123 _dbus_assert (registry->refcount > 0); in bus_registry_unref()
124 registry->refcount -= 1; in bus_registry_unref()
126 if (registry->refcount == 0) in bus_registry_unref()
128 if (registry->service_hash) in bus_registry_unref()
129 _dbus_hash_table_unref (registry->service_hash); in bus_registry_unref()
130 if (registry->service_pool) in bus_registry_unref()
131 _dbus_mem_pool_free (registry->service_pool); in bus_registry_unref()
132 if (registry->owner_pool) in bus_registry_unref()
133 _dbus_mem_pool_free (registry->owner_pool); in bus_registry_unref()
134 if (registry->service_sid_table) in bus_registry_unref()
135 _dbus_hash_table_unref (registry->service_sid_table); in bus_registry_unref()
137 dbus_free (registry); in bus_registry_unref()
142 bus_registry_lookup (BusRegistry *registry, in bus_registry_lookup() argument
147 service = _dbus_hash_table_lookup_string (registry->service_hash, in bus_registry_lookup()
193 result = _dbus_mem_pool_alloc (service->registry->owner_pool); in bus_owner_new()
209 _dbus_mem_pool_dealloc (service->registry->owner_pool, result); in bus_owner_new()
236 _dbus_mem_pool_dealloc (owner->service->registry->owner_pool, owner); in bus_owner_unref()
241 bus_registry_ensure (BusRegistry *registry, in bus_registry_ensure() argument
255 service = _dbus_hash_table_lookup_string (registry->service_hash, in bus_registry_ensure()
260 service = _dbus_mem_pool_alloc (registry->service_pool); in bus_registry_ensure()
267 service->registry = registry; in bus_registry_ensure()
274 _dbus_mem_pool_dealloc (registry->service_pool, service); in bus_registry_ensure()
291 if (!bus_activation_service_created (bus_context_get_activation (registry->context), in bus_registry_ensure()
305 if (!_dbus_hash_table_insert_string (registry->service_hash, in bus_registry_ensure()
318 bus_registry_foreach (BusRegistry *registry, in bus_registry_foreach() argument
324 _dbus_hash_iter_init (registry->service_hash, &iter); in bus_registry_foreach()
334 bus_registry_list_services (BusRegistry *registry, in bus_registry_list_services() argument
342 len = _dbus_hash_table_get_n_entries (registry->service_hash); in bus_registry_list_services()
348 _dbus_hash_iter_init (registry->service_hash, &iter); in bus_registry_list_services()
378 bus_registry_acquire_service (BusRegistry *registry, in bus_registry_acquire_service() argument
439 sid = bus_selinux_id_table_lookup (registry->service_sid_table, in bus_registry_acquire_service()
475 bus_context_get_max_services_per_connection (registry->context)) in bus_registry_acquire_service()
486 service = bus_registry_lookup (registry, service_name); in bus_registry_acquire_service()
501 service = bus_registry_ensure (registry, in bus_registry_acquire_service()
588 activation = bus_context_get_activation (registry->context); in bus_registry_acquire_service()
599 bus_registry_release_service (BusRegistry *registry, in bus_registry_release_service() argument
649 service = bus_registry_lookup (registry, service_name); in bus_registry_release_service()
676 bus_registry_set_service_context_table (BusRegistry *registry, in bus_registry_set_service_context_table() argument
698 if (registry->service_sid_table) in bus_registry_set_service_context_table()
699 _dbus_hash_table_unref (registry->service_sid_table); in bus_registry_set_service_context_table()
700 registry->service_sid_table = new_table; in bus_registry_set_service_context_table()
721 _dbus_hash_table_remove_string (service->registry->service_hash, in bus_service_unlink()
734 _dbus_hash_table_insert_string_preallocated (service->registry->service_hash, in bus_service_relink()
963 _dbus_hash_table_free_preallocated_entry (d->service->registry->service_hash, in free_ownership_restore_data()
989 d->hash_entry = _dbus_hash_table_preallocate_entry (service->registry->service_hash); in add_restore_ownership_to_transaction()
1215 _dbus_mem_pool_dealloc (service->registry->service_pool, service); in bus_service_unref()