2003-11-26 Mikael Hallendal <micke@imendio.com>
authorMikael Hallendal <micke@imendio.com>
Thu, 27 Nov 2003 01:25:50 +0000 (01:25 +0000)
committerMikael Hallendal <micke@imendio.com>
Thu, 27 Nov 2003 01:25:50 +0000 (01:25 +0000)
* bus/*.[ch]:
* dbus/*.[ch]:
* glib/*.[ch]: Made ref functions return the pointer

55 files changed:
ChangeLog
bus/activation.c
bus/activation.h
bus/bus.c
bus/bus.h
bus/config-parser.c
bus/config-parser.h
bus/connection.c
bus/connection.h
bus/policy.c
bus/policy.h
bus/services.c
bus/services.h
bus/signals.c
bus/signals.h
dbus/dbus-auth.c
dbus/dbus-auth.h
dbus/dbus-connection-internal.h
dbus/dbus-connection.c
dbus/dbus-connection.h
dbus/dbus-hash.c
dbus/dbus-hash.h
dbus/dbus-keyring.c
dbus/dbus-keyring.h
dbus/dbus-mainloop.c
dbus/dbus-mainloop.h
dbus/dbus-message-handler.c
dbus/dbus-message-handler.h
dbus/dbus-message-internal.h
dbus/dbus-message.c
dbus/dbus-message.h
dbus/dbus-object-tree.c
dbus/dbus-object-tree.h
dbus/dbus-pending-call.c
dbus/dbus-pending-call.h
dbus/dbus-resources.c
dbus/dbus-resources.h
dbus/dbus-server.c
dbus/dbus-server.h
dbus/dbus-spawn.c
dbus/dbus-spawn.h
dbus/dbus-timeout.c
dbus/dbus-timeout.h
dbus/dbus-transport.c
dbus/dbus-transport.h
dbus/dbus-userdb.c
dbus/dbus-userdb.h
dbus/dbus-watch.c
dbus/dbus-watch.h
glib/dbus-gidl.c
glib/dbus-gidl.h
glib/dbus-gmain.c
glib/dbus-gparser.c
glib/dbus-gparser.h
glib/dbus-gproxy.c

index 4ce9684..e75e88b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2003-11-26  Mikael Hallendal  <micke@imendio.com>
+
+       * bus/*.[ch]:
+       * dbus/*.[ch]:
+       * glib/*.[ch]: Made ref functions return the pointer
+
 2003-11-25  Zack Rusin  <zack@kde.org>
 
        * qt/integrator.h, qt/integrator.cpp: Adding handling of DBusServer,
index 5588ed8..bdb294a 100644 (file)
@@ -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
index a2e174f..2bf2eb4 100644 (file)
@@ -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,
index 6935945..73fe9e5 100644 (file)
--- 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
index a2db07b..0ebe737 100644 (file)
--- 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);
index cc55a49..ab2ed3b 100644 (file)
@@ -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
index eaeafdc..f4488a4 100644 (file)
@@ -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,
index 71102db..cfd0765 100644 (file)
@@ -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
index 00a7ce4..666de82 100644 (file)
@@ -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);
index 63131ac..5cd23ca 100644 (file)
@@ -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
index 17dfbf2..f570da5 100644 (file)
@@ -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,
index 84cabe2..a8020a1 100644 (file)
@@ -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
index bed950c..40300df 100644 (file)
@@ -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,
index 9c0d31e..d136e61 100644 (file)
@@ -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
index fab018a..ef578c8 100644 (file)
@@ -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,
index cdfd3bb..7c7befb 100644 (file)
@@ -1894,13 +1894,16 @@ _dbus_auth_client_new (void)
  * Increments the refcount of an auth object.
  *
  * @param auth the auth conversation
+ * @returns the auth conversation
  */
-void
+DBusAuth *
 _dbus_auth_ref (DBusAuth *auth)
 {
   _dbus_assert (auth != NULL);
   
   auth->refcount += 1;
+  
+  return auth;
 }
 
 /**
index 98e4369..48221ea 100644 (file)
@@ -44,7 +44,7 @@ typedef enum
 
 DBusAuth*     _dbus_auth_server_new          (void);
 DBusAuth*     _dbus_auth_client_new          (void);
-void          _dbus_auth_ref                 (DBusAuth               *auth);
+DBusAuth*     _dbus_auth_ref                 (DBusAuth               *auth);
 void          _dbus_auth_unref               (DBusAuth               *auth);
 dbus_bool_t   _dbus_auth_set_mechanisms      (DBusAuth               *auth,
                                               const char            **mechanisms);
index e53908b..6afd330 100644 (file)
@@ -46,7 +46,7 @@ typedef enum
 
 void              _dbus_connection_lock                        (DBusConnection     *connection);
 void              _dbus_connection_unlock                      (DBusConnection     *connection);
-void              _dbus_connection_ref_unlocked                (DBusConnection     *connection);
+DBusConnection *  _dbus_connection_ref_unlocked                (DBusConnection     *connection);
 void              _dbus_connection_unref_unlocked              (DBusConnection     *connection);
 dbus_bool_t       _dbus_connection_queue_received_message      (DBusConnection     *connection,
                                                                 DBusMessage        *message);
index 7871f92..01ebeb1 100644 (file)
@@ -219,11 +219,13 @@ static void               _dbus_connection_update_dispatch_status_and_unlock (DB
                                                                               DBusDispatchStatus  new_status);
 static void               _dbus_connection_last_unref                        (DBusConnection     *connection);
 
-static void
+static DBusMessageFilter *
 _dbus_message_filter_ref (DBusMessageFilter *filter)
 {
   _dbus_assert (filter->refcount.value > 0);
   _dbus_atomic_inc (&filter->refcount);
+
+  return filter;
 }
 
 static void
@@ -963,8 +965,9 @@ _dbus_connection_new_for_transport (DBusTransport *transport)
  * Requires that the caller already holds the connection lock.
  *
  * @param connection the connection.
+ * @returns the connection.
  */
-void
+DBusConnection *
 _dbus_connection_ref_unlocked (DBusConnection *connection)
 {
 #ifdef DBUS_HAVE_ATOMIC_INT
@@ -973,6 +976,8 @@ _dbus_connection_ref_unlocked (DBusConnection *connection)
   _dbus_assert (connection->refcount.value > 0);
   connection->refcount.value += 1;
 #endif
+
+  return connection;
 }
 
 /**
@@ -1117,11 +1122,12 @@ dbus_connection_open (const char     *address,
  * Increments the reference count of a DBusConnection.
  *
  * @param connection the connection.
+ * @returns the connection.
  */
-void
+DBusConnection *
 dbus_connection_ref (DBusConnection *connection)
 {
-  _dbus_return_if_fail (connection != NULL);
+  _dbus_return_val_if_fail (connection != NULL, NULL);
 
   /* The connection lock is better than the global
    * lock in the atomic increment fallback
@@ -1136,6 +1142,8 @@ dbus_connection_ref (DBusConnection *connection)
   connection->refcount.value += 1;
   CONNECTION_UNLOCK (connection);
 #endif
+
+  return connection;
 }
 
 static void
index aa92b30..c2251c8 100644 (file)
@@ -95,7 +95,7 @@ typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection     *con
 
 DBusConnection*    dbus_connection_open                         (const char                 *address,
                                                                  DBusError                  *error);
-void               dbus_connection_ref                          (DBusConnection             *connection);
+DBusConnection*    dbus_connection_ref                          (DBusConnection             *connection);
 void               dbus_connection_unref                        (DBusConnection             *connection);
 void               dbus_connection_disconnect                   (DBusConnection             *connection);
 dbus_bool_t        dbus_connection_get_is_connected             (DBusConnection             *connection);
index d35087b..b058151 100644 (file)
@@ -348,11 +348,14 @@ _dbus_hash_table_new (DBusHashType     type,
  * Increments the reference count for a hash table.
  *
  * @param table the hash table to add a reference to.
+ * @returns the hash table.
  */
-void
+DBusHashTable *
 _dbus_hash_table_ref (DBusHashTable *table)
 {
   table->refcount += 1;
+  
+  return table;
 }
 
 /**
index 5e7515f..58fd5bf 100644 (file)
@@ -61,7 +61,7 @@ typedef enum
 DBusHashTable* _dbus_hash_table_new                (DBusHashType      type,
                                                     DBusFreeFunction  key_free_function,
                                                     DBusFreeFunction  value_free_function);
-void           _dbus_hash_table_ref                (DBusHashTable    *table);
+DBusHashTable* _dbus_hash_table_ref                (DBusHashTable    *table);
 void           _dbus_hash_table_unref              (DBusHashTable    *table);
 void           _dbus_hash_iter_init                (DBusHashTable    *table,
                                                     DBusHashIter     *iter);
index e091d80..99de65c 100644 (file)
@@ -657,11 +657,14 @@ _dbus_keyring_reload (DBusKeyring *keyring,
  * Increments reference count of the keyring
  *
  * @param keyring the keyring
+ * @returns the keyring
  */
-void
+DBusKeyring *
 _dbus_keyring_ref (DBusKeyring *keyring)
 {
   keyring->refcount += 1;
+
+  return keyring;
 }
 
 /**
index 2a450ec..d4e2a57 100644 (file)
@@ -34,7 +34,7 @@ typedef struct DBusKeyring DBusKeyring;
 DBusKeyring* _dbus_keyring_new_homedir      (const DBusString  *username,
                                              const DBusString  *context,
                                              DBusError         *error);
-void         _dbus_keyring_ref              (DBusKeyring       *keyring);
+DBusKeyring* _dbus_keyring_ref              (DBusKeyring       *keyring);
 void         _dbus_keyring_unref            (DBusKeyring       *keyring);
 dbus_bool_t  _dbus_keyring_validate_context (const DBusString  *context);
 int          _dbus_keyring_get_best_key     (DBusKeyring       *keyring,
index 6da5318..dd0c015 100644 (file)
@@ -123,12 +123,14 @@ timeout_callback_new (DBusTimeout         *timeout,
   return cb;
 }
 
-static void
+static Callback * 
 callback_ref (Callback *cb)
 {
   _dbus_assert (cb->refcount > 0);
   
   cb->refcount += 1;
+
+  return cb;
 }
 
 static void
@@ -204,13 +206,15 @@ _dbus_loop_new (void)
   return loop;
 }
 
-void
+DBusLoop *
 _dbus_loop_ref (DBusLoop *loop)
 {
   _dbus_assert (loop != NULL);
   _dbus_assert (loop->refcount > 0);
 
   loop->refcount += 1;
+
+  return loop;
 }
 
 void
index 8a3cde1..fadc5ad 100644 (file)
@@ -37,7 +37,7 @@ typedef void        (* DBusTimeoutFunction) (DBusTimeout   *timeout,
                                              void          *data);
 
 DBusLoop*   _dbus_loop_new            (void);
-void        _dbus_loop_ref            (DBusLoop            *loop);
+DBusLoop*   _dbus_loop_ref            (DBusLoop            *loop);
 void        _dbus_loop_unref          (DBusLoop            *loop);
 dbus_bool_t _dbus_loop_add_watch      (DBusLoop            *loop,
                                        DBusWatch           *watch,
index f38e510..89f180a 100644 (file)
@@ -189,13 +189,16 @@ dbus_message_handler_new (DBusHandleMessageFunction function,
  * Increments the reference count on a message handler.
  *
  * @param handler the handler
+ * @returns the handler
  */
-void
+DBusMessageHandler *
 dbus_message_handler_ref (DBusMessageHandler *handler)
 {
   _dbus_return_if_fail (handler != NULL);
 
   _dbus_atomic_inc (&handler->refcount);
+
+  return handler;
 }
 
 /**
index dac015a..ab6f050 100644 (file)
@@ -43,7 +43,7 @@ DBusMessageHandler* dbus_message_handler_new (DBusHandleMessageFunction  functio
                                               DBusFreeFunction           free_user_data);
 
 
-void         dbus_message_handler_ref   (DBusMessageHandler *handler);
+DBusMessageHandler* dbus_message_handler_ref   (DBusMessageHandler *handler);
 void         dbus_message_handler_unref (DBusMessageHandler *handler);
 
 
index 53711f3..26f1676 100644 (file)
@@ -48,7 +48,7 @@ void        _dbus_message_remove_size_counter   (DBusMessage  *message,
                                                  DBusList    **link_return);
 
 DBusMessageLoader* _dbus_message_loader_new                   (void);
-void               _dbus_message_loader_ref                   (DBusMessageLoader  *loader);
+DBusMessageLoader* _dbus_message_loader_ref                   (DBusMessageLoader  *loader);
 void               _dbus_message_loader_unref                 (DBusMessageLoader  *loader);
 
 void               _dbus_message_loader_get_buffer            (DBusMessageLoader  *loader,
index 50f3107..2e4ef0b 100644 (file)
@@ -1504,17 +1504,20 @@ dbus_message_copy (const DBusMessage *message)
  * Increments the reference count of a DBusMessage.
  *
  * @param message The message
+ * @returns the message
  * @see dbus_message_unref
  */
-void
+DBusMessage *
 dbus_message_ref (DBusMessage *message)
 {
   dbus_int32_t old_refcount;
 
-  _dbus_return_if_fail (message != NULL);
+  _dbus_return_val_if_fail (message != NULL, NULL);
   
   old_refcount = _dbus_atomic_inc (&message->refcount);
   _dbus_assert (old_refcount >= 1);
+
+  return message;
 }
 
 static void
@@ -4781,11 +4784,14 @@ _dbus_message_loader_new (void)
  * Increments the reference count of the loader.
  *
  * @param loader the loader.
+ * @returns the loader
  */
-void
+DBusMessageLoader *
 _dbus_message_loader_ref (DBusMessageLoader *loader)
 {
   loader->refcount += 1;
+
+  return loader;
 }
 
 /**
index 9086578..038fdc8 100644 (file)
@@ -73,9 +73,9 @@ DBusMessage* dbus_message_new_error         (DBusMessage *reply_to,
                                              const char  *error_name,
                                              const char  *error_message);
 
-DBusMessage *dbus_message_copy              (const DBusMessage *message);
+DBusMessagedbus_message_copy              (const DBusMessage *message);
 
-void          dbus_message_ref              (DBusMessage   *message);
+DBusMessage*  dbus_message_ref              (DBusMessage   *message);
 void          dbus_message_unref            (DBusMessage   *message);
 int           dbus_message_get_type         (DBusMessage   *message);
 dbus_bool_t   dbus_message_set_path         (DBusMessage   *message,
index 07d3ae5..0904919 100644 (file)
@@ -46,7 +46,7 @@ typedef struct DBusObjectSubtree DBusObjectSubtree;
 static DBusObjectSubtree* _dbus_object_subtree_new   (const char                  *name,
                                                       const DBusObjectPathVTable  *vtable,
                                                       void                        *user_data);
-static void               _dbus_object_subtree_ref   (DBusObjectSubtree           *subtree);
+static DBusObjectSubtree* _dbus_object_subtree_ref   (DBusObjectSubtree           *subtree);
 static void               _dbus_object_subtree_unref (DBusObjectSubtree           *subtree);
 
 /**
@@ -121,13 +121,16 @@ _dbus_object_tree_new (DBusConnection *connection)
 /**
  * Increment the reference count
  * @param tree the object tree
+ * @returns the object tree
  */
-void
+DBusObjectTree *
 _dbus_object_tree_ref (DBusObjectTree *tree)
 {
   _dbus_assert (tree->refcount > 0);
 
   tree->refcount += 1;
+
+  return tree;
 }
 
 /**
@@ -859,11 +862,13 @@ _dbus_object_subtree_new (const char                  *name,
   return NULL;
 }
 
-static void
+static DBusObjectSubtree *
 _dbus_object_subtree_ref (DBusObjectSubtree *subtree)
 {
   _dbus_assert (subtree->refcount.value > 0);
   _dbus_atomic_inc (&subtree->refcount);
+
+  return subtree;
 }
 
 static void
index bf34d97..09e4ee2 100644 (file)
@@ -30,7 +30,7 @@ DBUS_BEGIN_DECLS;
 typedef struct DBusObjectTree DBusObjectTree;
 
 DBusObjectTree* _dbus_object_tree_new   (DBusConnection *connection);
-void            _dbus_object_tree_ref   (DBusObjectTree *tree);
+DBusObjectTree* _dbus_object_tree_ref   (DBusObjectTree *tree);
 void            _dbus_object_tree_unref (DBusObjectTree *tree);
 
 dbus_bool_t       _dbus_object_tree_register              (DBusObjectTree              *tree,
index 590f129..a19ed8b 100644 (file)
@@ -138,13 +138,16 @@ _dbus_pending_call_notify (DBusPendingCall *pending)
  * Increments the reference count on a pending call.
  *
  * @param pending the pending call object
+ * @returns the pending call object
  */
-void
+DBusPendingCall *
 dbus_pending_call_ref (DBusPendingCall *pending)
 {
   _dbus_return_if_fail (pending != NULL);
 
   _dbus_atomic_inc (&pending->refcount);
+
+  return pending;
 }
 
 /**
index 4f1e92c..3ea1486 100644 (file)
@@ -33,7 +33,7 @@
 
 DBUS_BEGIN_DECLS;
 
-void         dbus_pending_call_ref           (DBusPendingCall               *pending);
+DBusPendingCall* dbus_pending_call_ref       (DBusPendingCall               *pending);
 void         dbus_pending_call_unref         (DBusPendingCall               *pending);
 dbus_bool_t  dbus_pending_call_set_notify    (DBusPendingCall               *pending,
                                               DBusPendingCallNotifyFunction  function,
index edc2e78..a5a8e09 100644 (file)
@@ -96,13 +96,16 @@ _dbus_counter_new (void)
  * Increments refcount of the counter
  *
  * @param counter the counter
+ * @returns the counter
  */
-void
+DBusCounter *
 _dbus_counter_ref (DBusCounter *counter)
 {
   _dbus_assert (counter->refcount > 0);
   
   counter->refcount += 1;
+
+  return counter;
 }
 
 /**
index 26a5b98..2975405 100644 (file)
@@ -35,7 +35,7 @@ typedef void (* DBusCounterNotifyFunction) (DBusCounter *counter,
                                             void        *user_data);
 
 DBusCounter* _dbus_counter_new       (void);
-void         _dbus_counter_ref       (DBusCounter *counter);
+DBusCounter* _dbus_counter_ref       (DBusCounter *counter);
 void         _dbus_counter_unref     (DBusCounter *counter);
 void         _dbus_counter_adjust    (DBusCounter *counter,
                                       long         delta);
index 29e20a5..2e33cac 100644 (file)
@@ -450,13 +450,16 @@ dbus_server_listen (const char     *address,
  * Increments the reference count of a DBusServer.
  *
  * @param server the server.
+ * @returns the server
  */
-void
+DBusServer *
 dbus_server_ref (DBusServer *server)
 {
   _dbus_return_if_fail (server != NULL);
   
   server->refcount += 1;
+
+  return server;
 }
 
 /**
index c2a0ca0..237e950 100644 (file)
@@ -41,7 +41,7 @@ typedef void (* DBusNewConnectionFunction) (DBusServer     *server,
 
 DBusServer* dbus_server_listen           (const char     *address,
                                           DBusError      *error);
-void        dbus_server_ref              (DBusServer     *server);
+DBusServer* dbus_server_ref              (DBusServer     *server);
 void        dbus_server_unref            (DBusServer     *server);
 void        dbus_server_disconnect       (DBusServer     *server);
 dbus_bool_t dbus_server_get_is_connected (DBusServer     *server);
index 604b9e7..0e62f95 100644 (file)
@@ -235,14 +235,17 @@ _dbus_babysitter_new (void)
  * Increment the reference count on the babysitter object.
  *
  * @param sitter the babysitter
+ * @returns the babysitter
  */
-void
+DBusBabysitter *
 _dbus_babysitter_ref (DBusBabysitter *sitter)
 {
   _dbus_assert (sitter != NULL);
   _dbus_assert (sitter->refcount > 0);
   
   sitter->refcount += 1;
+
+  return sitter;
 }
 
 /**
index a467bee..9771144 100644 (file)
@@ -40,7 +40,7 @@ dbus_bool_t _dbus_spawn_async_with_babysitter     (DBusBabysitter           **si
                                                    DBusSpawnChildSetupFunc    child_setup,
                                                    void                      *user_data,
                                                    DBusError                 *error);
-void        _dbus_babysitter_ref                  (DBusBabysitter            *sitter);
+DBusBabysitter* _dbus_babysitter_ref              (DBusBabysitter            *sitter);
 void        _dbus_babysitter_unref                (DBusBabysitter            *sitter);
 void        _dbus_babysitter_kill_child           (DBusBabysitter            *sitter);
 dbus_bool_t _dbus_babysitter_get_child_exited     (DBusBabysitter            *sitter);
index b15089d..bd74096 100644 (file)
@@ -86,11 +86,14 @@ _dbus_timeout_new (int                 interval,
  * Increments the reference count of a DBusTimeout object.
  *
  * @param timeout the timeout object.
+ * @returns the timeout object.
  */
-void
+DBusTimeout *
 _dbus_timeout_ref (DBusTimeout *timeout)
 {
   timeout->refcount += 1;
+
+  return timeout;
 }
 
 /**
index c68f29f..3950257 100644 (file)
@@ -38,7 +38,7 @@ DBusTimeout* _dbus_timeout_new          (int                 interval,
                                          DBusTimeoutHandler  handler,
                                          void               *data,
                                          DBusFreeFunction    free_data_function);
-void         _dbus_timeout_ref          (DBusTimeout        *timeout);
+DBusTimeout* _dbus_timeout_ref          (DBusTimeout        *timeout);
 void         _dbus_timeout_unref        (DBusTimeout        *timeout);
 void         _dbus_timeout_set_interval (DBusTimeout        *timeout,
                                          int                 interval);
index b58073f..40fc98d 100644 (file)
@@ -365,13 +365,16 @@ _dbus_transport_open (const char     *address,
  * Increments the reference count for the transport.
  *
  * @param transport the transport.
+ * @returns the transport.
  */
-void
+DBusTransport *
 _dbus_transport_ref (DBusTransport *transport)
 {
   _dbus_assert (transport->refcount > 0);
   
   transport->refcount += 1;
+
+  return transport;
 }
 
 /**
index eadee38..6b1f4b7 100644 (file)
@@ -32,7 +32,7 @@ typedef struct DBusTransport DBusTransport;
 
 DBusTransport*     _dbus_transport_open                   (const char                 *address,
                                                            DBusError                  *error);
-void               _dbus_transport_ref                    (DBusTransport              *transport);
+DBusTransport*     _dbus_transport_ref                    (DBusTransport              *transport);
 void               _dbus_transport_unref                  (DBusTransport              *transport);
 void               _dbus_transport_disconnect             (DBusTransport              *transport);
 dbus_bool_t        _dbus_transport_get_is_connected       (DBusTransport              *transport);
index 95f1398..1350230 100644 (file)
@@ -635,13 +635,16 @@ _dbus_user_database_new (void)
 /**
  * Increments refcount of user database.
  * @param db the database
+ * @returns the database
  */
-void
+DBusUserDatabase *
 _dbus_user_database_ref (DBusUserDatabase  *db)
 {
   _dbus_assert (db->refcount > 0);
 
   db->refcount += 1;
+
+  return db;
 }
 
 /**
index e277979..9080747 100644 (file)
@@ -31,7 +31,7 @@ DBUS_BEGIN_DECLS;
 typedef struct DBusUserDatabase DBusUserDatabase;
 
 DBusUserDatabase* _dbus_user_database_new           (void);
-void              _dbus_user_database_ref           (DBusUserDatabase     *db);
+DBusUserDatabase* _dbus_user_database_ref           (DBusUserDatabase     *db);
 void              _dbus_user_database_unref         (DBusUserDatabase     *db);
 dbus_bool_t       _dbus_user_database_get_groups    (DBusUserDatabase     *db,
                                                      dbus_uid_t            uid,
index f212090..7171dd6 100644 (file)
@@ -97,11 +97,14 @@ _dbus_watch_new (int               fd,
  * Increments the reference count of a DBusWatch object.
  *
  * @param watch the watch object.
+ * @returns the watch object.
  */
-void
+DBusWatch *
 _dbus_watch_ref (DBusWatch *watch)
 {
   watch->refcount += 1;
+
+  return watch;
 }
 
 /**
index 355a9b7..bea4d59 100644 (file)
@@ -42,7 +42,7 @@ DBusWatch* _dbus_watch_new                (int               fd,
                                            DBusWatchHandler  handler,
                                            void             *data,
                                            DBusFreeFunction  free_data_function);
-void       _dbus_watch_ref                (DBusWatch        *watch);
+DBusWatch* _dbus_watch_ref                (DBusWatch        *watch);
 void       _dbus_watch_unref              (DBusWatch        *watch);
 void       _dbus_watch_invalidate         (DBusWatch        *watch);
 void       _dbus_watch_sanitize_condition (DBusWatch        *watch,
index 596b43c..aecdc00 100644 (file)
@@ -67,13 +67,15 @@ struct ArgInfo
   ArgDirection direction;
 };
 
-void
+BaseInfo *
 base_info_ref (BaseInfo *info)
 {
   g_return_if_fail (info != NULL);
   g_return_if_fail (info->refcount > 0);
   
   info->refcount += 1;
+
+  return info;
 }
 
 static void
@@ -222,10 +224,12 @@ node_info_new (const char *name)
   return info;
 }
 
-void
+NodeInfo *
 node_info_ref (NodeInfo *info)
 {
   info->base.refcount += 1;
+
+  return info;
 }
 
 void
@@ -287,10 +291,12 @@ interface_info_new (const char *name)
   return info;
 }
 
-void
+InterfaceInfo *
 interface_info_ref (InterfaceInfo *info)
 {
   info->base.refcount += 1;
+
+  return info;
 }
 
 void
@@ -366,10 +372,12 @@ method_info_new (const char *name)
   return info;
 }
 
-void
+MethodInfo *
 method_info_ref (MethodInfo *info)
 {
   info->base.refcount += 1;
+
+  return info;
 }
 
 void
@@ -416,10 +424,12 @@ signal_info_new (const char *name)
   return info;
 }
 
-void
+SignalInfo *
 signal_info_ref (SignalInfo *info)
 {
   info->base.refcount += 1;
+
+  return info;
 }
 
 void
@@ -472,10 +482,12 @@ arg_info_new (const char  *name,
   return info;
 }
 
-void
+ArgInfo *
 arg_info_ref (ArgInfo *info)
 {
   info->base.refcount += 1;
+
+  return info;
 }
 
 void
index f95abfb..6df2bdf 100644 (file)
@@ -54,7 +54,7 @@ typedef enum
 
 } InfoType;
 
-void           base_info_ref              (BaseInfo      *info);
+BaseInfo*      base_info_ref              (BaseInfo      *info);
 void           base_info_unref            (BaseInfo      *info);
 InfoType       base_info_get_type         (BaseInfo      *info);
 const char*    base_info_get_name         (BaseInfo      *info);
@@ -65,7 +65,7 @@ GType          base_info_get_gtype        (void);
 
 
 NodeInfo*      node_info_new              (const char    *name);
-void           node_info_ref              (NodeInfo      *info);
+NodeInfo*      node_info_ref              (NodeInfo      *info);
 void           node_info_unref            (NodeInfo      *info);
 const char*    node_info_get_name         (NodeInfo      *info);
 GSList*        node_info_get_interfaces   (NodeInfo      *info);
@@ -76,7 +76,7 @@ void           node_info_add_node         (NodeInfo      *info,
                                            NodeInfo      *child);
 
 InterfaceInfo* interface_info_new         (const char    *name);
-void           interface_info_ref         (InterfaceInfo *info);
+InterfaceInfo* interface_info_ref         (InterfaceInfo *info);
 void           interface_info_unref       (InterfaceInfo *info);
 const char*    interface_info_get_name    (InterfaceInfo *info);
 GSList*        interface_info_get_methods (InterfaceInfo *info);
@@ -87,7 +87,7 @@ void           interface_info_add_signal  (InterfaceInfo *info,
                                            SignalInfo    *signal);
 
 MethodInfo*    method_info_new            (const char    *name);
-void           method_info_ref            (MethodInfo    *info);
+MethodInfo*    method_info_ref            (MethodInfo    *info);
 void           method_info_unref          (MethodInfo    *info);
 
 const char*    method_info_get_name       (MethodInfo    *info);
@@ -96,7 +96,7 @@ void           method_info_add_arg        (MethodInfo    *info,
                                            ArgInfo       *arg);
 
 SignalInfo*    signal_info_new            (const char    *name);
-void           signal_info_ref            (SignalInfo    *info);
+SignalInfo*    signal_info_ref            (SignalInfo    *info);
 void           signal_info_unref          (SignalInfo    *info);
 
 const char*    signal_info_get_name       (SignalInfo    *info);
@@ -107,7 +107,7 @@ void           signal_info_add_arg        (SignalInfo    *info,
 ArgInfo*       arg_info_new               (const char    *name,
                                            ArgDirection   direction,
                                            int            type);
-void           arg_info_ref               (ArgInfo       *info);
+ArgInfo*       arg_info_ref               (ArgInfo       *info);
 void           arg_info_unref             (ArgInfo       *info);
 const char*    arg_info_get_name          (ArgInfo       *info);
 int            arg_info_get_type          (ArgInfo       *info);
index 6f0737b..6179dc9 100644 (file)
@@ -88,10 +88,12 @@ watch_fd_new (void)
   return watch_fd;
 }
 
-static void
+static WatchFD * 
 watch_fd_ref (WatchFD *watch_fd)
 {
   watch_fd->refcount += 1;
+
+  return watch_fd;
 }
 
 static void
index 16d17f3..c9b1b35 100644 (file)
@@ -184,10 +184,12 @@ parser_new (void)
   return parser;
 }
 
-void
+Parser *
 parser_ref (Parser *parser)
 {
   parser->refcount += 1;
+
+  return parser;
 }
 
 void
index cc58e5e..9783105 100644 (file)
@@ -32,7 +32,7 @@ G_BEGIN_DECLS
 typedef struct Parser Parser;
 
 Parser*  parser_new           (void);
-void     parser_ref           (Parser      *parser);
+Parser*  parser_ref           (Parser      *parser);
 void     parser_unref         (Parser      *parser);
 gboolean parser_check_doctype (Parser      *parser,
                                const char  *doctype,
index 02c53c5..65e43fc 100644 (file)
@@ -93,7 +93,7 @@ struct DBusGProxyManager
 
 };
 
-static void              dbus_gproxy_manager_ref    (DBusGProxyManager *manager);
+static DBusGProxyManager *dbus_gproxy_manager_ref    (DBusGProxyManager *manager);
 static DBusHandlerResult dbus_gproxy_manager_filter (DBusConnection    *connection,
                                                      DBusMessage       *message,
                                                      void              *user_data);
@@ -152,7 +152,7 @@ dbus_gproxy_manager_get (DBusConnection *connection)
   return manager;
 }
 
-static void
+static DBusGProxyManager * 
 dbus_gproxy_manager_ref (DBusGProxyManager *manager)
 {
   g_assert (manager != NULL);
@@ -163,6 +163,8 @@ dbus_gproxy_manager_ref (DBusGProxyManager *manager)
   manager->refcount += 1;
 
   UNLOCK_MANAGER (manager);
+
+  return manager;
 }
 
 static void