dbus/dbus dbus-message.c, 1.180, 1.181 dbus-pending-call.c, 1.22, 1.23 dbus-server.c, 1.52, 1.53 dbus-signature.c, 1.11, 1.12

Havoc Pennington hp at kemper.freedesktop.org
Sat Oct 21 10:21:47 PDT 2006


Update of /cvs/dbus/dbus/dbus
In directory kemper:/tmp/cvs-serv31657/dbus

Modified Files:
	dbus-message.c dbus-pending-call.c dbus-server.c 
	dbus-signature.c 
Log Message:
2006-10-21  Havoc Pennington  <hp at redhat.com>

        * Move all private API into the private Doxygen group sections of
	the files, so they don't show up in the public API docs



Index: dbus-message.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-message.c,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -d -r1.180 -r1.181
--- dbus-message.c	21 Oct 2006 17:08:08 -0000	1.180
+++ dbus-message.c	21 Oct 2006 17:21:45 -0000	1.181
@@ -579,6 +579,52 @@
     dbus_message_finalize (message);
 }
 
+#ifndef DBUS_DISABLE_CHECKS
+static dbus_bool_t
+_dbus_message_iter_check (DBusMessageRealIter *iter)
+{
+  if (iter == NULL)
+    {
+      _dbus_warn_check_failed ("dbus message iterator is NULL\n");
+      return FALSE;
+    }
+
+  if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_READER)
+    {
+      if (iter->u.reader.byte_order != iter->message->byte_order)
+        {
+          _dbus_warn_check_failed ("dbus message changed byte order since iterator was created\n");
+          return FALSE;
+        }
+      /* because we swap the message into compiler order when you init an iter */
+      _dbus_assert (iter->u.reader.byte_order == DBUS_COMPILER_BYTE_ORDER);
+    }
+  else if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER)
+    {
+      if (iter->u.writer.byte_order != iter->message->byte_order)
+        {
+          _dbus_warn_check_failed ("dbus message changed byte order since append iterator was created\n");
+          return FALSE;
+        }
+      /* because we swap the message into compiler order when you init an iter */
+      _dbus_assert (iter->u.writer.byte_order == DBUS_COMPILER_BYTE_ORDER);
+    }
+  else
+    {
+      _dbus_warn_check_failed ("dbus message iterator looks uninitialized or corrupted\n");
+      return FALSE;
+    }
+
+  if (iter->changed_stamp != iter->message->changed_stamp)
+    {
+      _dbus_warn_check_failed ("dbus message iterator invalid because the message has been modified (or perhaps the iterator is just uninitialized)\n");
+      return FALSE;
+    }
+
+  return TRUE;
+}
+#endif /* DBUS_DISABLE_CHECKS */
+
 /**
  * Implementation of the varargs arg-getting functions.
  * dbus_message_get_args() is the place to go for complete
@@ -1714,52 +1760,6 @@
   return _dbus_type_reader_get_current_type (&real->u.reader) != DBUS_TYPE_INVALID;
 }
 
-#ifndef DBUS_DISABLE_CHECKS
-static dbus_bool_t
-_dbus_message_iter_check (DBusMessageRealIter *iter)
-{
-  if (iter == NULL)
-    {
-      _dbus_warn_check_failed ("dbus message iterator is NULL\n");
-      return FALSE;
-    }
-
-  if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_READER)
-    {
-      if (iter->u.reader.byte_order != iter->message->byte_order)
-        {
-          _dbus_warn_check_failed ("dbus message changed byte order since iterator was created\n");
-          return FALSE;
-        }
-      /* because we swap the message into compiler order when you init an iter */
-      _dbus_assert (iter->u.reader.byte_order == DBUS_COMPILER_BYTE_ORDER);
-    }
-  else if (iter->iter_type == DBUS_MESSAGE_ITER_TYPE_WRITER)
-    {
-      if (iter->u.writer.byte_order != iter->message->byte_order)
-        {
-          _dbus_warn_check_failed ("dbus message changed byte order since append iterator was created\n");
-          return FALSE;
-        }
-      /* because we swap the message into compiler order when you init an iter */
-      _dbus_assert (iter->u.writer.byte_order == DBUS_COMPILER_BYTE_ORDER);
-    }
-  else
-    {
-      _dbus_warn_check_failed ("dbus message iterator looks uninitialized or corrupted\n");
-      return FALSE;
-    }
-
-  if (iter->changed_stamp != iter->message->changed_stamp)
-    {
-      _dbus_warn_check_failed ("dbus message iterator invalid because the message has been modified (or perhaps the iterator is just uninitialized)\n");
-      return FALSE;
-    }
-
-  return TRUE;
-}
-#endif /* DBUS_DISABLE_CHECKS */
-
 /**
  * Checks if an iterator has any more fields.
  *

Index: dbus-pending-call.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-pending-call.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- dbus-pending-call.c	20 Oct 2006 03:42:03 -0000	1.22
+++ dbus-pending-call.c	21 Oct 2006 17:21:45 -0000	1.23
@@ -363,26 +363,6 @@
   return TRUE;
 }
 
-/** @} */
-
-/**
- * @defgroup DBusPendingCall DBusPendingCall
- * @ingroup  DBus
- * @brief Pending reply to a method call message
- *
- * A DBusPendingCall is an object representing an
- * expected reply. A #DBusPendingCall can be created
- * when you send a message that should have a reply.
- *
- * @{
- */
-
-/**
- * @typedef DBusPendingCall
- *
- * Opaque data type representing a message pending.
- */
-
 /**
  * Increments the reference count on a pending call,
  * while the lock on its connection is already held.
@@ -398,32 +378,6 @@
   return pending;
 }
 
-/**
- * Increments the reference count on a pending call.
- *
- * @param pending the pending call object
- * @returns the pending call object
- */
-DBusPendingCall *
-dbus_pending_call_ref (DBusPendingCall *pending)
-{
-  _dbus_return_val_if_fail (pending != NULL, NULL);
-
-  /* The connection lock is better than the global
-   * lock in the atomic increment fallback
-   */
-#ifdef DBUS_HAVE_ATOMIC_INT
-  _dbus_atomic_inc (&pending->refcount);
-#else
-  CONNECTION_LOCK (pending->connection);
-  _dbus_assert (pending->refcount.value > 0);
-
-  pending->refcount.value += 1;
-  CONNECTION_UNLOCK (pending->connection);
-#endif
-  
-  return pending;
-}
 
 static void
 _dbus_pending_call_last_unref (DBusPendingCall *pending)
@@ -491,6 +445,111 @@
 }
 
 /**
+ * Checks whether the pending call has received a reply
+ * yet, or not. Assumes connection lock is held.
+ *
+ * @param pending the pending call
+ * @returns #TRUE if a reply has been received
+ */
+dbus_bool_t
+_dbus_pending_call_get_completed_unlocked (DBusPendingCall    *pending)
+{
+  return pending->completed;
+}
+
+static DBusDataSlotAllocator slot_allocator;
+_DBUS_DEFINE_GLOBAL_LOCK (pending_call_slots);
+
+/**
+ * Stores a pointer on a #DBusPendingCall, along
+ * with an optional function to be used for freeing
+ * the data when the data is set again, or when
+ * the pending call is finalized. The slot number
+ * must have been allocated with dbus_pending_call_allocate_data_slot().
+ *
+ * @param pending the pending_call
+ * @param slot the slot number
+ * @param data the data to store
+ * @param free_data_func finalizer function for the data
+ * @returns #TRUE if there was enough memory to store the data
+ */
+dbus_bool_t
+_dbus_pending_call_set_data_unlocked (DBusPendingCall  *pending,
+                                     dbus_int32_t      slot,
+                                     void             *data,
+                                     DBusFreeFunction  free_data_func)
+{
+  DBusFreeFunction old_free_func;
+  void *old_data;
+  dbus_bool_t retval;
+
+  retval = _dbus_data_slot_list_set (&slot_allocator,
+                                     &pending->slot_list,
+                                     slot, data, free_data_func,
+                                     &old_free_func, &old_data);
+
+  /* Drop locks to call out to app code */
+  CONNECTION_UNLOCK (pending->connection);
+  
+  if (retval)
+    {
+      if (old_free_func)
+        (* old_free_func) (old_data);
+    }
+
+  CONNECTION_LOCK (pending->connection);
+  
+  return retval;
+}
+
+/** @} */
+
+/**
+ * @defgroup DBusPendingCall DBusPendingCall
+ * @ingroup  DBus
+ * @brief Pending reply to a method call message
+ *
+ * A DBusPendingCall is an object representing an
+ * expected reply. A #DBusPendingCall can be created
+ * when you send a message that should have a reply.
+ *
+ * @{
+ */
+
+/**
+ * @typedef DBusPendingCall
+ *
+ * Opaque data type representing a message pending.
+ */
+
+/**
+ * Increments the reference count on a pending call.
+ *
+ * @param pending the pending call object
+ * @returns the pending call object
+ */
+DBusPendingCall *
+dbus_pending_call_ref (DBusPendingCall *pending)
+{
+  _dbus_return_val_if_fail (pending != NULL, NULL);
+
+  /* The connection lock is better than the global
+   * lock in the atomic increment fallback
+   */
+#ifdef DBUS_HAVE_ATOMIC_INT
+  _dbus_atomic_inc (&pending->refcount);
+#else
+  CONNECTION_LOCK (pending->connection);
+  _dbus_assert (pending->refcount.value > 0);
+
+  pending->refcount.value += 1;
+  CONNECTION_UNLOCK (pending->connection);
+#endif
+  
+  return pending;
+}
+
+/**
  * Decrements the reference count on a pending call,
  * freeing it if the count reaches 0.
  *
@@ -572,19 +631,6 @@
 
 /**
  * Checks whether the pending call has received a reply
- * yet, or not. Assumes connection lock is held.
- *
- * @param pending the pending call
- * @returns #TRUE if a reply has been received
- */
-dbus_bool_t
-_dbus_pending_call_get_completed_unlocked (DBusPendingCall    *pending)
-{
-  return pending->completed;
-}
-
-/**
- * Checks whether the pending call has received a reply
  * yet, or not.
  *
  * @param pending the pending call
@@ -655,9 +701,6 @@
   _dbus_connection_block_pending_call (pending);
 }
 
-static DBusDataSlotAllocator slot_allocator;
-_DBUS_DEFINE_GLOBAL_LOCK (pending_call_slots);
-
 /**
  * Allocates an integer ID to be used for storing application-specific
  * data on any DBusPendingCall. The allocated ID may then be used
@@ -716,48 +759,6 @@
  * @returns #TRUE if there was enough memory to store the data
  */
 dbus_bool_t
-_dbus_pending_call_set_data_unlocked (DBusPendingCall  *pending,
-                                     dbus_int32_t      slot,
-                                     void             *data,
-                                     DBusFreeFunction  free_data_func)
-{
-  DBusFreeFunction old_free_func;
-  void *old_data;
-  dbus_bool_t retval;
-
-  retval = _dbus_data_slot_list_set (&slot_allocator,
-                                     &pending->slot_list,
-                                     slot, data, free_data_func,
-                                     &old_free_func, &old_data);
-
-  /* Drop locks to call out to app code */
-  CONNECTION_UNLOCK (pending->connection);
-  
-  if (retval)
-    {
-      if (old_free_func)
-        (* old_free_func) (old_data);
-    }
-
-  CONNECTION_LOCK (pending->connection);
-  
-  return retval;
-}
-
-/**
- * Stores a pointer on a #DBusPendingCall, along
- * with an optional function to be used for freeing
- * the data when the data is set again, or when
- * the pending call is finalized. The slot number
- * must have been allocated with dbus_pending_call_allocate_data_slot().
- *
- * @param pending the pending_call
- * @param slot the slot number
- * @param data the data to store
- * @param free_data_func finalizer function for the data
- * @returns #TRUE if there was enough memory to store the data
- */
-dbus_bool_t
 dbus_pending_call_set_data (DBusPendingCall  *pending,
                             dbus_int32_t      slot,
                             void             *data,

Index: dbus-server.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-server.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- dbus-server.c	20 Oct 2006 03:04:59 -0000	1.52
+++ dbus-server.c	21 Oct 2006 17:21:45 -0000	1.53
@@ -423,6 +423,67 @@
                             enabled);
 }
 
+
+/**
+ * Like dbus_server_ref() but does not acquire the lock (must already be held)
+ *
+ * @param server the server.
+ */
+void
+_dbus_server_ref_unlocked (DBusServer *server)
+{
+  _dbus_assert (server != NULL);
+  _dbus_assert (server->refcount.value > 0);
+  
+  HAVE_LOCK_CHECK (server);
+
+#ifdef DBUS_HAVE_ATOMIC_INT
+  _dbus_atomic_inc (&server->refcount);
+#else
+  _dbus_assert (server->refcount.value > 0);
+
+  server->refcount.value += 1;
+#endif
+}
+
+/**
+ * Like dbus_server_unref() but does not acquire the lock (must already be held)
+ *
+ * @param server the server.
+ */
+void
+_dbus_server_unref_unlocked (DBusServer *server)
+{
+  dbus_bool_t last_unref;
+
+  /* Keep this in sync with dbus_server_unref */
+  
+  _dbus_assert (server != NULL);
+  _dbus_assert (server->refcount.value > 0);
+
+  HAVE_LOCK_CHECK (server);
+  
+#ifdef DBUS_HAVE_ATOMIC_INT
+  last_unref = (_dbus_atomic_dec (&server->refcount) == 1);
+#else
+  _dbus_assert (server->refcount.value > 0);
+
+  server->refcount.value -= 1;
+  last_unref = (server->refcount.value == 0);
+#endif
+  
+  if (last_unref)
+    {
+      _dbus_assert (server->disconnected);
+      
+      SERVER_UNLOCK (server);
+      
+      _dbus_assert (server->vtable->finalize != NULL);
+      
+      (* server->vtable->finalize) (server);
+    }
+}
+
 /** @} */
 
 /**
@@ -634,6 +695,8 @@
 dbus_server_unref (DBusServer *server)
 {
   dbus_bool_t last_unref;
+
+  /* keep this in sync with unref_unlocked */
   
   _dbus_return_if_fail (server != NULL);
   _dbus_return_if_fail (server->refcount.value > 0);
@@ -663,64 +726,6 @@
 }
 
 /**
- * Like dbus_server_ref() but does not acquire the lock (must already be held)
- *
- * @param server the server.
- */
-void
-_dbus_server_ref_unlocked (DBusServer *server)
-{
-  _dbus_assert (server != NULL);
-  _dbus_assert (server->refcount.value > 0);
-  
-  HAVE_LOCK_CHECK (server);
-
-#ifdef DBUS_HAVE_ATOMIC_INT
-  _dbus_atomic_inc (&server->refcount);
-#else
-  _dbus_assert (server->refcount.value > 0);
-
-  server->refcount.value += 1;
-#endif
-}
-
-/**
- * Like dbus_server_unref() but does not acquire the lock (must already be held)
- *
- * @param server the server.
- */
-void
-_dbus_server_unref_unlocked (DBusServer *server)
-{
-  dbus_bool_t last_unref;
-  
-  _dbus_assert (server != NULL);
-  _dbus_assert (server->refcount.value > 0);
-
-  HAVE_LOCK_CHECK (server);
-  
-#ifdef DBUS_HAVE_ATOMIC_INT
-  last_unref = (_dbus_atomic_dec (&server->refcount) == 1);
-#else
-  _dbus_assert (server->refcount.value > 0);
-
-  server->refcount.value -= 1;
-  last_unref = (server->refcount.value == 0);
-#endif
-  
-  if (last_unref)
-    {
-      _dbus_assert (server->disconnected);
-      
-      SERVER_UNLOCK (server);
-      
-      _dbus_assert (server->vtable->finalize != NULL);
-      
-      (* server->vtable->finalize) (server);
-    }
-}
-
-/**
  * Releases the server's address and stops listening for
  * new clients. If called more than once, only the first
  * call has an effect. Does not modify the server's

Index: dbus-signature.c
===================================================================
RCS file: /cvs/dbus/dbus/dbus/dbus-signature.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- dbus-signature.c	20 Oct 2006 03:42:03 -0000	1.11
+++ dbus-signature.c	21 Oct 2006 17:21:45 -0000	1.12
@@ -329,6 +329,8 @@
     }
 }
 
+/** @} */ /* end of DBusSignature group */
+
 #ifdef DBUS_BUILD_TESTS
 
 /**
@@ -506,5 +508,3 @@
 
 #endif
 
-/** @} */ /* end of DBusSignature group */
-



More information about the dbus-commit mailing list