]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus_connections_foreach, bus_connections_foreach_active: Remove
authorSimon McVittie <smcv@collabora.com>
Fri, 17 Aug 2018 15:30:23 +0000 (16:30 +0100)
committerSimon McVittie <smcv@collabora.com>
Thu, 30 Aug 2018 16:39:31 +0000 (17:39 +0100)
These do not appear in code coverage statistics, and `git grep`
reveals that they are unused.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=107739

bus/connection.c
bus/connection.h
bus/test.h

index 35f8e36ef93bb331f45c3b90a8e974c94b6acda6..25826b1bb4d7c216cde0ea39cbbddd94a8d39b1a 100644 (file)
@@ -1148,86 +1148,6 @@ bus_connection_get_policy (DBusConnection *connection)
   return d->policy;
 }
 
-static dbus_bool_t
-foreach_active (BusConnections               *connections,
-                BusConnectionForeachFunction  function,
-                void                         *data)
-{
-  DBusList *link;
-  
-  link = _dbus_list_get_first_link (&connections->completed);
-  while (link != NULL)
-    {
-      DBusConnection *connection = link->data;
-      DBusList *next = _dbus_list_get_next_link (&connections->completed, link);
-
-      if (!(* function) (connection, data))
-        return FALSE;
-      
-      link = next;
-    }
-
-  return TRUE;
-}
-
-static dbus_bool_t
-foreach_inactive (BusConnections               *connections,
-                  BusConnectionForeachFunction  function,
-                  void                         *data)
-{
-  DBusList *link;
-  
-  link = _dbus_list_get_first_link (&connections->incomplete);
-  while (link != NULL)
-    {
-      DBusConnection *connection = link->data;
-      DBusList *next = _dbus_list_get_next_link (&connections->incomplete, link);
-
-      if (!(* function) (connection, data))
-        return FALSE;
-      
-      link = next;
-    }
-
-  return TRUE;
-}
-
-/**
- * Calls function on each active connection; if the function returns
- * #FALSE, stops iterating. Active connections are authenticated
- * and have sent a Hello message.
- *
- * @param connections the connections object
- * @param function the function
- * @param data data to pass to it as a second arg
- */
-void
-bus_connections_foreach_active (BusConnections               *connections,
-                                BusConnectionForeachFunction  function,
-                                void                         *data)
-{
-  foreach_active (connections, function, data);
-}
-
-/**
- * Calls function on each connection; if the function returns
- * #FALSE, stops iterating.
- *
- * @param connections the connections object
- * @param function the function
- * @param data data to pass to it as a second arg
- */
-void
-bus_connections_foreach (BusConnections               *connections,
-                         BusConnectionForeachFunction  function,
-                         void                         *data)
-{
-  if (!foreach_active (connections, function, data))
-    return;
-
-  foreach_inactive (connections, function, data);
-}
-
 BusContext*
 bus_connections_get_context (BusConnections *connections)
 {
index 736a3b28ddb6b8c9eb7d937768e5642e4fb1ce29..ad3fa8a3c542f07439f43f05e7f51e8c5238dd4f 100644 (file)
@@ -34,21 +34,11 @@ typedef enum
   BUS_EXTRA_HEADERS_NONE = 0
 } BusExtraHeaders;
 
-typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection, 
-                                                      void           *data);
-
-
 BusConnections* bus_connections_new               (BusContext                   *context);
 BusConnections* bus_connections_ref               (BusConnections               *connections);
 void            bus_connections_unref             (BusConnections               *connections);
 dbus_bool_t     bus_connections_setup_connection  (BusConnections               *connections,
                                                    DBusConnection               *connection);
-void            bus_connections_foreach           (BusConnections               *connections,
-                                                   BusConnectionForeachFunction  function,
-                                                   void                         *data);
-void            bus_connections_foreach_active    (BusConnections               *connections,
-                                                   BusConnectionForeachFunction  function,
-                                                   void                         *data);
 BusContext*     bus_connections_get_context       (BusConnections               *connections);
 void            bus_connections_increment_stamp   (BusConnections               *connections);
 dbus_bool_t     bus_connections_reload_policy     (BusConnections               *connections,
index 38b74e89cfaf49219a16c5e88b6709d1f1722608..5b0fe0857fcae4cf403966a006c8ba78c144b242 100644 (file)
@@ -30,6 +30,9 @@
 #include <dbus/dbus-string.h>
 #include "connection.h"
 
+typedef dbus_bool_t (* BusConnectionForeachFunction) (DBusConnection *connection,
+                                                      void           *data);
+
 dbus_bool_t bus_dispatch_test         (const DBusString             *test_data_dir);
 dbus_bool_t bus_dispatch_sha1_test    (const DBusString             *test_data_dir);
 dbus_bool_t bus_config_parser_test    (const DBusString             *test_data_dir);