summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorMikael Hallendal <micke@imendio.com>2003-11-27 01:25:50 +0000
committerMikael Hallendal <micke@imendio.com>2003-11-27 01:25:50 +0000
commit9f1a60dbba69844c0a04b3dd86280352736187ce (patch)
treeb50747f9d3b395ba92bd37109504626813f03802 /bus
parent6d9f72b9e651d90fcbd191b43b5e91ba7bd63789 (diff)
downloaddbus-9f1a60dbba69844c0a04b3dd86280352736187ce.tar.gz
2003-11-26 Mikael Hallendal <micke@imendio.com>
* bus/*.[ch]: * dbus/*.[ch]: * glib/*.[ch]: Made ref functions return the pointer
Diffstat (limited to 'bus')
-rw-r--r--bus/activation.c8
-rw-r--r--bus/activation.h2
-rw-r--r--bus/bus.c4
-rw-r--r--bus/bus.h2
-rw-r--r--bus/config-parser.c4
-rw-r--r--bus/config-parser.h2
-rw-r--r--bus/connection.c4
-rw-r--r--bus/connection.h2
-rw-r--r--bus/policy.c12
-rw-r--r--bus/policy.h6
-rw-r--r--bus/services.c8
-rw-r--r--bus/services.h4
-rw-r--r--bus/signals.c8
-rw-r--r--bus/signals.h4
14 files changed, 47 insertions, 23 deletions
diff --git a/bus/activation.c b/bus/activation.c
index 5588ed86..bdb294a8 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -99,11 +99,13 @@ handle_timeout_callback (DBusTimeout *timeout,
_dbus_wait_for_memory ();
}
-static void
+static BusPendingActivation *
bus_pending_activation_ref (BusPendingActivation *pending_activation)
{
_dbus_assert (pending_activation->refcount > 0);
pending_activation->refcount += 1;
+
+ return pending_activation;
}
static void
@@ -445,12 +447,14 @@ bus_activation_new (BusContext *context,
return NULL;
}
-void
+BusActivation *
bus_activation_ref (BusActivation *activation)
{
_dbus_assert (activation->refcount > 0);
activation->refcount += 1;
+
+ return activation;
}
void
diff --git a/bus/activation.h b/bus/activation.h
index a2e174f9..2bf2eb47 100644
--- a/bus/activation.h
+++ b/bus/activation.h
@@ -32,7 +32,7 @@ BusActivation* bus_activation_new (BusContext *context,
const DBusString *address,
DBusList **directories,
DBusError *error);
-void bus_activation_ref (BusActivation *activation);
+BusActivation* bus_activation_ref (BusActivation *activation);
void bus_activation_unref (BusActivation *activation);
dbus_bool_t bus_activation_activate_service (BusActivation *activation,
DBusConnection *connection,
diff --git a/bus/bus.c b/bus/bus.c
index 69359456..73fe9e55 100644
--- a/bus/bus.c
+++ b/bus/bus.c
@@ -670,11 +670,13 @@ bus_context_shutdown (BusContext *context)
}
}
-void
+BusContext *
bus_context_ref (BusContext *context)
{
_dbus_assert (context->refcount > 0);
context->refcount += 1;
+
+ return context;
}
void
diff --git a/bus/bus.h b/bus/bus.h
index a2db07b8..0ebe737c 100644
--- a/bus/bus.h
+++ b/bus/bus.h
@@ -66,7 +66,7 @@ BusContext* bus_context_new (const DBusStri
int print_pid_fd,
DBusError *error);
void bus_context_shutdown (BusContext *context);
-void bus_context_ref (BusContext *context);
+BusContext* bus_context_ref (BusContext *context);
void bus_context_unref (BusContext *context);
const char* bus_context_get_type (BusContext *context);
const char* bus_context_get_address (BusContext *context);
diff --git a/bus/config-parser.c b/bus/config-parser.c
index cc55a492..ab2ed3b1 100644
--- a/bus/config-parser.c
+++ b/bus/config-parser.c
@@ -345,12 +345,14 @@ bus_config_parser_new (const DBusString *basedir,
return parser;
}
-void
+BusConfigParser *
bus_config_parser_ref (BusConfigParser *parser)
{
_dbus_assert (parser->refcount > 0);
parser->refcount += 1;
+
+ return parser;
}
void
diff --git a/bus/config-parser.h b/bus/config-parser.h
index eaeafdc5..f4488a4e 100644
--- a/bus/config-parser.h
+++ b/bus/config-parser.h
@@ -37,7 +37,7 @@ typedef struct BusConfigParser BusConfigParser;
BusConfigParser* bus_config_parser_new (const DBusString *basedir,
dbus_bool_t is_toplevel);
-void bus_config_parser_ref (BusConfigParser *parser);
+BusConfigParser* bus_config_parser_ref (BusConfigParser *parser);
void bus_config_parser_unref (BusConfigParser *parser);
dbus_bool_t bus_config_parser_check_doctype (BusConfigParser *parser,
const char *doctype,
diff --git a/bus/connection.c b/bus/connection.c
index 71102db1..cfd07651 100644
--- a/bus/connection.c
+++ b/bus/connection.c
@@ -471,11 +471,13 @@ bus_connections_new (BusContext *context)
return NULL;
}
-void
+BusConnections *
bus_connections_ref (BusConnections *connections)
{
_dbus_assert (connections->refcount > 0);
connections->refcount += 1;
+
+ return connections;
}
void
diff --git a/bus/connection.h b/bus/connection.h
index 00a7ce49..666de829 100644
--- a/bus/connection.h
+++ b/bus/connection.h
@@ -33,7 +33,7 @@ typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection
BusConnections* bus_connections_new (BusContext *context);
-void bus_connections_ref (BusConnections *connections);
+BusConnections* bus_connections_ref (BusConnections *connections);
void bus_connections_unref (BusConnections *connections);
dbus_bool_t bus_connections_setup_connection (BusConnections *connections,
DBusConnection *connection);
diff --git a/bus/policy.c b/bus/policy.c
index 63131aca..5cd23ca8 100644
--- a/bus/policy.c
+++ b/bus/policy.c
@@ -68,12 +68,14 @@ bus_policy_rule_new (BusPolicyRuleType type,
return rule;
}
-void
+BusPolicyRule *
bus_policy_rule_ref (BusPolicyRule *rule)
{
_dbus_assert (rule->refcount > 0);
rule->refcount += 1;
+
+ return rule;
}
void
@@ -178,12 +180,14 @@ bus_policy_new (void)
return NULL;
}
-void
+BusPolicy *
bus_policy_ref (BusPolicy *policy)
{
_dbus_assert (policy->refcount > 0);
policy->refcount += 1;
+
+ return policy;
}
void
@@ -628,12 +632,14 @@ bus_client_policy_new (void)
return policy;
}
-void
+BusClientPolicy *
bus_client_policy_ref (BusClientPolicy *policy)
{
_dbus_assert (policy->refcount > 0);
policy->refcount += 1;
+
+ return policy;
}
static void
diff --git a/bus/policy.h b/bus/policy.h
index 17dfbf27..f570da55 100644
--- a/bus/policy.h
+++ b/bus/policy.h
@@ -101,11 +101,11 @@ struct BusPolicyRule
BusPolicyRule* bus_policy_rule_new (BusPolicyRuleType type,
dbus_bool_t allow);
-void bus_policy_rule_ref (BusPolicyRule *rule);
+BusPolicyRule* bus_policy_rule_ref (BusPolicyRule *rule);
void bus_policy_rule_unref (BusPolicyRule *rule);
BusPolicy* bus_policy_new (void);
-void bus_policy_ref (BusPolicy *policy);
+BusPolicy* bus_policy_ref (BusPolicy *policy);
void bus_policy_unref (BusPolicy *policy);
BusClientPolicy* bus_policy_create_client_policy (BusPolicy *policy,
DBusConnection *connection,
@@ -127,7 +127,7 @@ dbus_bool_t bus_policy_merge (BusPolicy *policy,
BusPolicy *to_absorb);
BusClientPolicy* bus_client_policy_new (void);
-void bus_client_policy_ref (BusClientPolicy *policy);
+BusClientPolicy* bus_client_policy_ref (BusClientPolicy *policy);
void bus_client_policy_unref (BusClientPolicy *policy);
dbus_bool_t bus_client_policy_check_can_send (BusClientPolicy *policy,
BusRegistry *registry,
diff --git a/bus/services.c b/bus/services.c
index 84cabe21..a8020a17 100644
--- a/bus/services.c
+++ b/bus/services.c
@@ -82,11 +82,13 @@ bus_registry_new (BusContext *context)
return NULL;
}
-void
+BusRegistry *
bus_registry_ref (BusRegistry *registry)
{
_dbus_assert (registry->refcount > 0);
registry->refcount += 1;
+
+ return registry;
}
void
@@ -713,12 +715,14 @@ bus_service_remove_owner (BusService *service,
return TRUE;
}
-void
+BusService *
bus_service_ref (BusService *service)
{
_dbus_assert (service->refcount > 0);
service->refcount += 1;
+
+ return service;
}
void
diff --git a/bus/services.h b/bus/services.h
index bed950c3..40300df9 100644
--- a/bus/services.h
+++ b/bus/services.h
@@ -33,7 +33,7 @@ typedef void (* BusServiceForeachFunction) (BusService *service,
void *data);
BusRegistry* bus_registry_new (BusContext *context);
-void bus_registry_ref (BusRegistry *registry);
+BusRegistry* bus_registry_ref (BusRegistry *registry);
void bus_registry_unref (BusRegistry *registry);
BusService* bus_registry_lookup (BusRegistry *registry,
const DBusString *service_name);
@@ -56,7 +56,7 @@ dbus_bool_t bus_registry_acquire_service (BusRegistry *registry
BusTransaction *transaction,
DBusError *error);
-void bus_service_ref (BusService *service);
+BusService* bus_service_ref (BusService *service);
void bus_service_unref (BusService *service);
dbus_bool_t bus_service_add_owner (BusService *service,
DBusConnection *owner,
diff --git a/bus/signals.c b/bus/signals.c
index 9c0d31e2..d136e613 100644
--- a/bus/signals.c
+++ b/bus/signals.c
@@ -59,12 +59,14 @@ bus_match_rule_new (DBusConnection *matches_go_to)
return rule;
}
-void
+BusMatchRule *
bus_match_rule_ref (BusMatchRule *rule)
{
_dbus_assert (rule->refcount > 0);
rule->refcount += 1;
+
+ return rule;
}
void
@@ -765,12 +767,14 @@ bus_matchmaker_new (void)
return matchmaker;
}
-void
+BusMatchmaker *
bus_matchmaker_ref (BusMatchmaker *matchmaker)
{
_dbus_assert (matchmaker->refcount > 0);
matchmaker->refcount += 1;
+
+ return matchmaker;
}
void
diff --git a/bus/signals.h b/bus/signals.h
index fab018ae..ef578c86 100644
--- a/bus/signals.h
+++ b/bus/signals.h
@@ -40,7 +40,7 @@ typedef enum
} BusMatchFlags;
BusMatchRule* bus_match_rule_new (DBusConnection *matches_go_to);
-void bus_match_rule_ref (BusMatchRule *rule);
+BusMatchRule* bus_match_rule_ref (BusMatchRule *rule);
void bus_match_rule_unref (BusMatchRule *rule);
dbus_bool_t bus_match_rule_set_message_type (BusMatchRule *rule,
@@ -61,7 +61,7 @@ BusMatchRule* bus_match_rule_parse (DBusConnection *matches_go_to,
DBusError *error);
BusMatchmaker* bus_matchmaker_new (void);
-void bus_matchmaker_ref (BusMatchmaker *matchmaker);
+BusMatchmaker* bus_matchmaker_ref (BusMatchmaker *matchmaker);
void bus_matchmaker_unref (BusMatchmaker *matchmaker);
dbus_bool_t bus_matchmaker_add_rule (BusMatchmaker *matchmaker,