]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Rename structure DBusSocketSet to DBusPollableSet and adjust the corresponding functi...
authorRalf Habacker <ralf.habacker@freenet.de>
Mon, 7 Jan 2019 12:07:12 +0000 (13:07 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 9 Jan 2019 14:20:19 +0000 (15:20 +0100)
Because the implementation of DBusSocketSet already supports non-socket
pollables like pipes and inotify fd on Unix, DBusPollableSet is a better
name.

cmake/dbus/CMakeLists.txt
dbus/Makefile.am
dbus/dbus-mainloop.c
dbus/dbus-pollable-set-epoll.c [moved from dbus/dbus-socket-set-epoll.c with 81% similarity]
dbus/dbus-pollable-set-poll.c [moved from dbus/dbus-socket-set-poll.c with 79% similarity]
dbus/dbus-pollable-set.c [moved from dbus/dbus-socket-set.c with 78% similarity]
dbus/dbus-pollable-set.h [new file with mode: 0644]
dbus/dbus-socket-set.h [deleted file]

index 960dbdaff44072d10ec9ab35e6a193df6aa5b2ef..77b6c10abd45e73a71ac5c8c4c6074a35d53f8ed 100644 (file)
@@ -162,8 +162,8 @@ set (DBUS_UTIL_SOURCES
        ${DBUS_DIR}/dbus-message-factory.c
        ${DBUS_DIR}/dbus-message-util.c
        ${DBUS_DIR}/dbus-shell.c
-       ${DBUS_DIR}/dbus-socket-set.c
-       ${DBUS_DIR}/dbus-socket-set-poll.c
+       ${DBUS_DIR}/dbus-pollable-set.c
+       ${DBUS_DIR}/dbus-pollable-set-poll.c
        ${DBUS_DIR}/dbus-string-util.c
        ${DBUS_DIR}/dbus-sysdeps-util.c
 )
@@ -182,7 +182,7 @@ set (DBUS_UTIL_HEADERS
        ${DBUS_DIR}/dbus-mainloop.h
        ${DBUS_DIR}/dbus-message-factory.h
        ${DBUS_DIR}/dbus-shell.h
-       ${DBUS_DIR}/dbus-socket-set.h
+       ${DBUS_DIR}/dbus-pollable-set.h
        ${DBUS_DIR}/dbus-spawn.h
        ${DBUS_DIR}/dbus-test.h
        ${DBUS_DIR}/dbus-test-wrappers.h
@@ -237,7 +237,7 @@ endif (WIN32)
 if(DBUS_HAVE_LINUX_EPOLL)
         set(DBUS_UTIL_SOURCES
                 ${DBUS_UTIL_SOURCES}
-                ${DBUS_DIR}/dbus-socket-set-epoll.c
+                ${DBUS_DIR}/dbus-pollable-set-epoll.c
         )
 endif()
 
index 3ca6f050f3a0f70cf52d01b703af6b2930ac2b35..08fb850ec40a151a4235ca867881bc7f0fddabab 100644 (file)
@@ -122,7 +122,7 @@ DBUS_UTIL_arch_sources =                    \
 endif
 
 if DBUS_HAVE_LINUX_EPOLL
-DBUS_UTIL_arch_sources += dbus-socket-set-epoll.c
+DBUS_UTIL_arch_sources += dbus-pollable-set-epoll.c
 endif
 
 dbusinclude_HEADERS=                           \
@@ -260,9 +260,9 @@ DBUS_UTIL_SOURCES=                          \
        dbus-shell.c                            \
        dbus-shell.h                            \
        $(DBUS_UTIL_arch_sources)               \
-       dbus-socket-set.h                       \
-       dbus-socket-set.c                       \
-       dbus-socket-set-poll.c                  \
+       dbus-pollable-set.h                     \
+       dbus-pollable-set.c                     \
+       dbus-pollable-set-poll.c                        \
        dbus-spawn.h                            \
        dbus-string-util.c                      \
        dbus-sysdeps-util.c                     \
index 5a73159735ba4267a6ef5c82b2f78afbdd556e07..c4b7151be70150958cd5fcc238293c5c876fa2b3 100644 (file)
@@ -29,7 +29,7 @@
 
 #include <dbus/dbus-hash.h>
 #include <dbus/dbus-list.h>
-#include <dbus/dbus-socket-set.h>
+#include <dbus/dbus-pollable-set.h>
 #include <dbus/dbus-timeout.h>
 #include <dbus/dbus-watch.h>
 
@@ -40,7 +40,7 @@ struct DBusLoop
   int refcount;
   /** DBusPollable => dbus_malloc'd DBusList ** of references to DBusWatch */
   DBusHashTable *watches;
-  DBusSocketSet *socket_set;
+  DBusPollableSet *pollable_set;
   DBusList *timeouts;
   int callback_list_serial;
   int watch_count;
@@ -116,15 +116,15 @@ _dbus_loop_new (void)
   loop->watches = _dbus_hash_table_new (DBUS_HASH_POLLABLE, NULL,
                                         free_watch_table_entry);
 
-  loop->socket_set = _dbus_socket_set_new (0);
+  loop->pollable_set = _dbus_pollable_set_new (0);
 
-  if (loop->watches == NULL || loop->socket_set == NULL)
+  if (loop->watches == NULL || loop->pollable_set == NULL)
     {
       if (loop->watches != NULL)
         _dbus_hash_table_unref (loop->watches);
 
-      if (loop->socket_set != NULL)
-        _dbus_socket_set_free (loop->socket_set);
+      if (loop->pollable_set != NULL)
+        _dbus_pollable_set_free (loop->pollable_set);
 
       dbus_free (loop);
       return NULL;
@@ -163,7 +163,7 @@ _dbus_loop_unref (DBusLoop *loop)
         }
 
       _dbus_hash_table_unref (loop->watches);
-      _dbus_socket_set_free (loop->socket_set);
+      _dbus_pollable_set_free (loop->pollable_set);
       dbus_free (loop);
     }
 }
@@ -263,9 +263,9 @@ refresh_watches_for_fd (DBusLoop      *loop,
     }
 
   if (interested)
-    _dbus_socket_set_enable (loop->socket_set, fd, flags);
+    _dbus_pollable_set_enable (loop->pollable_set, fd, flags);
   else
-    _dbus_socket_set_disable (loop->socket_set, fd);
+    _dbus_pollable_set_disable (loop->pollable_set, fd);
 }
 
 dbus_bool_t
@@ -293,7 +293,7 @@ _dbus_loop_add_watch (DBusLoop  *loop,
 
   if (_dbus_list_length_is_one (watches))
     {
-      if (!_dbus_socket_set_add (loop->socket_set, fd,
+      if (!_dbus_pollable_set_add (loop->pollable_set, fd,
                                  dbus_watch_get_flags (watch),
                                  dbus_watch_get_enabled (watch)))
         {
@@ -354,7 +354,7 @@ _dbus_loop_remove_watch (DBusLoop         *loop,
                * entry, and stop reserving space for it in the socket set */
               if (gc_watch_table_entry (loop, watches, fd))
                 {
-                  _dbus_socket_set_remove (loop->socket_set, fd);
+                  _dbus_pollable_set_remove (loop->pollable_set, fd);
                 }
 
               return;
@@ -570,7 +570,7 @@ _dbus_loop_iterate (DBusLoop     *loop,
 {  
 #define N_STACK_DESCRIPTORS 64
   dbus_bool_t retval;
-  DBusSocketEvent ready_fds[N_STACK_DESCRIPTORS];
+  DBusPollableEvent ready_fds[N_STACK_DESCRIPTORS];
   int i;
   DBusList *link;
   int n_ready;
@@ -660,8 +660,8 @@ _dbus_loop_iterate (DBusLoop     *loop,
   _dbus_verbose ("  polling on %d descriptors timeout %ld\n", _DBUS_N_ELEMENTS (ready_fds), timeout);
 #endif
 
-  n_ready = _dbus_socket_set_poll (loop->socket_set, ready_fds,
-                                   _DBUS_N_ELEMENTS (ready_fds), timeout);
+  n_ready = _dbus_pollable_set_poll (loop->pollable_set, ready_fds,
+                                     _DBUS_N_ELEMENTS (ready_fds), timeout);
 
   /* re-enable any watches we skipped this time */
   if (loop->oom_watch_pending)
similarity index 81%
rename from dbus/dbus-socket-set-epoll.c
rename to dbus/dbus-pollable-set-epoll.c
index 4692cbe45e35430452c1bed8cde4eae9fb817eb0..7bd200b3faefe334fed4590cee6d55cc1990ed7a 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-socket-set-epoll.c - a socket set implemented via Linux epoll(4)
+/* dbus-pollable-set-epoll.c - a pollable set implemented via Linux epoll(4)
  *
  * Copyright © 2011 Nokia Corporation
  *
@@ -23,7 +23,7 @@
  */
 
 #include <config.h>
-#include "dbus-socket-set.h"
+#include "dbus-pollable-set.h"
 
 #include <dbus/dbus-internals.h>
 #include <dbus/dbus-sysdeps.h>
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 typedef struct {
-    DBusSocketSet parent;
+    DBusPollableSet parent;
     int epfd;
-} DBusSocketSetEpoll;
+} DBusPollableSetEpoll;
 
-static inline DBusSocketSetEpoll *
-socket_set_epoll_cast (DBusSocketSet *set)
+static inline DBusPollableSetEpoll *
+socket_set_epoll_cast (DBusPollableSet *set)
 {
-  _dbus_assert (set->cls == &_dbus_socket_set_epoll_class);
-  return (DBusSocketSetEpoll *) set;
+  _dbus_assert (set->cls == &_dbus_pollable_set_epoll_class);
+  return (DBusPollableSetEpoll *) set;
 }
 
 /* this is safe to call on a partially-allocated socket set */
 static void
-socket_set_epoll_free (DBusSocketSet *set)
+socket_set_epoll_free (DBusPollableSet *set)
 {
-  DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
+  DBusPollableSetEpoll *self = socket_set_epoll_cast (set);
 
   if (self == NULL)
     return;
@@ -66,17 +66,17 @@ socket_set_epoll_free (DBusSocketSet *set)
   dbus_free (self);
 }
 
-DBusSocketSet *
-_dbus_socket_set_epoll_new (void)
+DBusPollableSet *
+_dbus_pollable_set_epoll_new (void)
 {
-  DBusSocketSetEpoll *self;
+  DBusPollableSetEpoll *self;
 
-  self = dbus_new0 (DBusSocketSetEpoll, 1);
+  self = dbus_new0 (DBusPollableSetEpoll, 1);
 
   if (self == NULL)
     return NULL;
 
-  self->parent.cls = &_dbus_socket_set_epoll_class;
+  self->parent.cls = &_dbus_pollable_set_epoll_class;
 
   self->epfd = epoll_create1 (EPOLL_CLOEXEC);
 
@@ -97,11 +97,11 @@ _dbus_socket_set_epoll_new (void)
 
   if (self->epfd == -1)
     {
-      socket_set_epoll_free ((DBusSocketSet *) self);
+      socket_set_epoll_free ((DBusPollableSet *) self);
       return NULL;
     }
 
-  return (DBusSocketSet *) self;
+  return (DBusPollableSet *) self;
 }
 
 static uint32_t
@@ -135,12 +135,12 @@ epoll_events_to_watch_flags (uint32_t events)
 }
 
 static dbus_bool_t
-socket_set_epoll_add (DBusSocketSet  *set,
-                      DBusPollable    fd,
-                      unsigned int    flags,
-                      dbus_bool_t     enabled)
+socket_set_epoll_add (DBusPollableSet  *set,
+                      DBusPollable      fd,
+                      unsigned int      flags,
+                      dbus_bool_t       enabled)
 {
-  DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
+  DBusPollableSetEpoll *self = socket_set_epoll_cast (set);
   struct epoll_event event;
   int err;
 
@@ -189,11 +189,11 @@ socket_set_epoll_add (DBusSocketSet  *set,
 }
 
 static void
-socket_set_epoll_enable (DBusSocketSet  *set,
-                         DBusPollable    fd,
-                         unsigned int    flags)
+socket_set_epoll_enable (DBusPollableSet  *set,
+                         DBusPollable      fd,
+                         unsigned int      flags)
 {
-  DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
+  DBusPollableSetEpoll *self = socket_set_epoll_cast (set);
   struct epoll_event event;
   int err;
 
@@ -230,10 +230,10 @@ socket_set_epoll_enable (DBusSocketSet  *set,
 }
 
 static void
-socket_set_epoll_disable (DBusSocketSet  *set,
-                          DBusPollable    fd)
+socket_set_epoll_disable (DBusPollableSet  *set,
+                          DBusPollable      fd)
 {
-  DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
+  DBusPollableSetEpoll *self = socket_set_epoll_cast (set);
   struct epoll_event event;
   int err;
 
@@ -266,10 +266,10 @@ socket_set_epoll_disable (DBusSocketSet  *set,
 }
 
 static void
-socket_set_epoll_remove (DBusSocketSet  *set,
-                         DBusPollable    fd)
+socket_set_epoll_remove (DBusPollableSet  *set,
+                         DBusPollable      fd)
 {
-  DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
+  DBusPollableSetEpoll *self = socket_set_epoll_cast (set);
   int err;
   /* Kernels < 2.6.9 require a non-NULL struct pointer, even though its
    * contents are ignored */
@@ -289,12 +289,12 @@ socket_set_epoll_remove (DBusSocketSet  *set,
 #define N_STACK_DESCRIPTORS 64
 
 static int
-socket_set_epoll_poll (DBusSocketSet   *set,
-                       DBusSocketEvent *revents,
-                       int              max_events,
-                       int              timeout_ms)
+socket_set_epoll_poll (DBusPollableSet   *set,
+                       DBusPollableEvent *revents,
+                       int                max_events,
+                       int                timeout_ms)
 {
-  DBusSocketSetEpoll *self = socket_set_epoll_cast (set);
+  DBusPollableSetEpoll *self = socket_set_epoll_cast (set);
   struct epoll_event events[N_STACK_DESCRIPTORS];
   int n_ready;
   int i;
@@ -317,7 +317,7 @@ socket_set_epoll_poll (DBusSocketSet   *set,
   return n_ready;
 }
 
-DBusSocketSetClass _dbus_socket_set_epoll_class = {
+DBusPollableSetClass _dbus_pollable_set_epoll_class = {
     socket_set_epoll_free,
     socket_set_epoll_add,
     socket_set_epoll_remove,
similarity index 79%
rename from dbus/dbus-socket-set-poll.c
rename to dbus/dbus-pollable-set-poll.c
index 623e28fa34b2fd14f70c292ce1f6affeafb955e5..24c2c96103d3b0014454f12d15bdbffe58f901e1 100644 (file)
@@ -1,5 +1,5 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/* dbus-socket-set-poll.c - a socket set implemented via _dbus_poll
+/* dbus-pollable-set-poll.c - a pollable set implemented via _dbus_poll
  *
  * Copyright © 2011 Nokia Corporation
  *
@@ -23,7 +23,7 @@
  */
 
 #include <config.h>
-#include "dbus-socket-set.h"
+#include "dbus-pollable-set.h"
 
 #include <dbus/dbus-internals.h>
 #include <dbus/dbus-list.h>
 #ifndef DOXYGEN_SHOULD_SKIP_THIS
 
 typedef struct {
-    DBusSocketSet      parent;
-    DBusPollFD        *fds;
-    int                n_fds;
-    int                n_reserved;
-    int                n_allocated;
-} DBusSocketSetPoll;
+    DBusPollableSet      parent;
+    DBusPollFD          *fds;
+    int                  n_fds;
+    int                  n_reserved;
+    int                  n_allocated;
+} DBusPollableSetPoll;
 
 #define REALLOC_INCREMENT 8
 #define MINIMUM_SIZE 8
@@ -50,38 +50,38 @@ typedef struct {
 #define DEFAULT_SIZE_HINT MINIMUM_SIZE
 #endif
 
-static inline DBusSocketSetPoll *
-socket_set_poll_cast (DBusSocketSet *set)
+static inline DBusPollableSetPoll *
+socket_set_poll_cast (DBusPollableSet *set)
 {
-  _dbus_assert (set->cls == &_dbus_socket_set_poll_class);
-  return (DBusSocketSetPoll *) set;
+  _dbus_assert (set->cls == &_dbus_pollable_set_poll_class);
+  return (DBusPollableSetPoll *) set;
 }
 
 /* this is safe to call on a partially-allocated socket set */
 static void
-socket_set_poll_free (DBusSocketSet *set)
+socket_set_poll_free (DBusPollableSet *set)
 {
-  DBusSocketSetPoll *self = socket_set_poll_cast (set);
+  DBusPollableSetPoll *self = socket_set_poll_cast (set);
 
   dbus_free (self->fds);
   dbus_free (self);
   _dbus_verbose ("freed socket set %p\n", self);
 }
 
-DBusSocketSet *
-_dbus_socket_set_poll_new (int size_hint)
+DBusPollableSet *
+_dbus_pollable_set_poll_new (int size_hint)
 {
-  DBusSocketSetPoll *ret;
+  DBusPollableSetPoll *ret;
 
   if (size_hint <= 0)
     size_hint = DEFAULT_SIZE_HINT;
 
-  ret = dbus_new0 (DBusSocketSetPoll, 1);
+  ret = dbus_new0 (DBusPollableSetPoll, 1);
 
   if (ret == NULL)
     return NULL;
 
-  ret->parent.cls = &_dbus_socket_set_poll_class;
+  ret->parent.cls = &_dbus_pollable_set_poll_class;
   ret->n_fds = 0;
   ret->n_allocated = size_hint;
 
@@ -91,12 +91,12 @@ _dbus_socket_set_poll_new (int size_hint)
     {
       /* socket_set_poll_free specifically supports half-constructed
        * socket sets */
-      socket_set_poll_free ((DBusSocketSet *) ret);
+      socket_set_poll_free ((DBusPollableSet *) ret);
       return NULL;
     }
 
   _dbus_verbose ("new socket set at %p\n", ret);
-  return (DBusSocketSet *) ret;
+  return (DBusPollableSet *) ret;
 }
 
 static short
@@ -113,12 +113,12 @@ watch_flags_to_poll_events (unsigned int flags)
 }
 
 static dbus_bool_t
-socket_set_poll_add (DBusSocketSet  *set,
-                     DBusPollable    fd,
-                     unsigned int    flags,
-                     dbus_bool_t     enabled)
+socket_set_poll_add (DBusPollableSet  *set,
+                     DBusPollable      fd,
+                     unsigned int      flags,
+                     dbus_bool_t       enabled)
 {
-  DBusSocketSetPoll *self = socket_set_poll_cast (set);
+  DBusPollableSetPoll *self = socket_set_poll_cast (set);
 #ifndef DBUS_DISABLE_ASSERT
   int i;
 
@@ -160,11 +160,11 @@ socket_set_poll_add (DBusSocketSet  *set,
 }
 
 static void
-socket_set_poll_enable (DBusSocketSet *set,
-                        DBusPollable   fd,
-                        unsigned int   flags)
+socket_set_poll_enable (DBusPollableSet *set,
+                        DBusPollable     fd,
+                        unsigned int     flags)
 {
-  DBusSocketSetPoll *self = socket_set_poll_cast (set);
+  DBusPollableSetPoll *self = socket_set_poll_cast (set);
   int i;
 
   for (i = 0; i < self->n_fds; i++)
@@ -186,10 +186,10 @@ socket_set_poll_enable (DBusSocketSet *set,
 }
 
 static void
-socket_set_poll_disable (DBusSocketSet *set,
+socket_set_poll_disable (DBusPollableSet *set,
                          DBusPollable   fd)
 {
-  DBusSocketSetPoll *self = socket_set_poll_cast (set);
+  DBusPollableSetPoll *self = socket_set_poll_cast (set);
   int i;
 
   for (i = 0; i < self->n_fds; i++)
@@ -209,10 +209,10 @@ socket_set_poll_disable (DBusSocketSet *set,
 }
 
 static void
-socket_set_poll_remove (DBusSocketSet *set,
-                        DBusPollable   fd)
+socket_set_poll_remove (DBusPollableSet *set,
+                        DBusPollable     fd)
 {
-  DBusSocketSetPoll *self = socket_set_poll_cast (set);
+  DBusPollableSetPoll *self = socket_set_poll_cast (set);
 
   socket_set_poll_disable (set, fd);
   self->n_reserved--;
@@ -266,12 +266,12 @@ watch_flags_from_poll_revents (short revents)
 /** This is basically Linux's epoll_wait(2) implemented in terms of poll(2);
  * it returns results into a caller-supplied buffer so we can be reentrant. */
 static int
-socket_set_poll_poll (DBusSocketSet   *set,
-                      DBusSocketEvent *revents,
-                      int              max_events,
-                      int              timeout_ms)
+socket_set_poll_poll (DBusPollableSet   *set,
+                      DBusPollableEvent *revents,
+                      int                max_events,
+                      int                timeout_ms)
 {
-  DBusSocketSetPoll *self = socket_set_poll_cast (set);
+  DBusPollableSetPoll *self = socket_set_poll_cast (set);
   int i;
   int n_events;
   int n_ready;
@@ -308,7 +308,7 @@ socket_set_poll_poll (DBusSocketSet   *set,
   return n_events;
 }
 
-DBusSocketSetClass _dbus_socket_set_poll_class = {
+DBusPollableSetClass _dbus_pollable_set_poll_class = {
     socket_set_poll_free,
     socket_set_poll_add,
     socket_set_poll_remove,
similarity index 78%
rename from dbus/dbus-socket-set.c
rename to dbus/dbus-pollable-set.c
index 210d600e3e3a7588e4788a81b19f5267e211f21e..e3aaedc59468e3e49684a743448d91858b5ba289 100644 (file)
@@ -1,6 +1,6 @@
 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
 /*
- * dbus-socket-set.c - used to bolt file descriptors onto a bus
+ * dbus-pollable-set.c - a set of pollable objects (file descriptors, sockets or handles)
  *
  * Copyright © 2011 Nokia Corporation
  *
  */
 
 #include <config.h>
-#include <dbus/dbus-socket-set.h>
+#include <dbus/dbus-pollable-set.h>
 
-DBusSocketSet *
-_dbus_socket_set_new (int size_hint)
+DBusPollableSet *
+_dbus_pollable_set_new (int size_hint)
 {
-  DBusSocketSet *ret;
+  DBusPollableSet *ret;
 
 #ifdef DBUS_HAVE_LINUX_EPOLL
-  ret = _dbus_socket_set_epoll_new ();
+  ret = _dbus_pollable_set_epoll_new ();
 
   if (ret != NULL)
     return ret;
 #endif
 
-  ret = _dbus_socket_set_poll_new (size_hint);
+  ret = _dbus_pollable_set_poll_new (size_hint);
 
   if (ret != NULL)
     return ret;
diff --git a/dbus/dbus-pollable-set.h b/dbus/dbus-pollable-set.h
new file mode 100644 (file)
index 0000000..b92d776
--- /dev/null
@@ -0,0 +1,123 @@
+/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
+/*
+ * dbus-pollable-set.h - a set of pollable objects (file descriptors, sockets or handles)
+ *
+ * Copyright © 2011 Nokia Corporation
+ *
+ * Licensed under the Academic Free License version 2.1
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301  USA
+ *
+ */
+
+#ifndef DBUS_POLLABLE_SET_H
+#define DBUS_POLLABLE_SET_H
+
+#ifndef DOXYGEN_SHOULD_SKIP_THIS
+
+#include <dbus/dbus.h>
+#include <dbus/dbus-sysdeps.h>
+
+typedef struct {
+    DBusPollable fd;
+    unsigned int flags;
+} DBusPollableEvent;
+
+typedef struct DBusPollableSet DBusPollableSet;
+
+typedef struct DBusPollableSetClass DBusPollableSetClass;
+struct DBusPollableSetClass {
+    void            (*free)     (DBusPollableSet   *self);
+    dbus_bool_t     (*add)      (DBusPollableSet   *self,
+                                 DBusPollable       fd,
+                                 unsigned int       flags,
+                                 dbus_bool_t        enabled);
+    void            (*remove)   (DBusPollableSet   *self,
+                                 DBusPollable       fd);
+    void            (*enable)   (DBusPollableSet   *self,
+                                 DBusPollable       fd,
+                                 unsigned int       flags);
+    void            (*disable)  (DBusPollableSet   *self,
+                                 DBusPollable       fd);
+    int             (*poll)     (DBusPollableSet   *self,
+                                 DBusPollableEvent *revents,
+                                 int                max_events,
+                                 int                timeout_ms);
+};
+
+struct DBusPollableSet {
+    DBusPollableSetClass *cls;
+};
+
+DBusPollableSet *_dbus_pollable_set_new (int size_hint);
+
+static inline void
+_dbus_pollable_set_free (DBusPollableSet *self)
+{
+  (self->cls->free) (self);
+}
+
+static inline dbus_bool_t
+_dbus_pollable_set_add (DBusPollableSet *self,
+                        DBusPollable     fd,
+                        unsigned int     flags,
+                        dbus_bool_t      enabled)
+{
+  return (self->cls->add) (self, fd, flags, enabled);
+}
+
+static inline void
+_dbus_pollable_set_remove (DBusPollableSet *self,
+                           DBusPollable     fd)
+{
+  (self->cls->remove) (self, fd);
+}
+
+static inline void
+_dbus_pollable_set_enable (DBusPollableSet *self,
+                           DBusPollable     fd,
+                           unsigned int     flags)
+{
+  (self->cls->enable) (self, fd, flags);
+}
+
+static inline void
+_dbus_pollable_set_disable (DBusPollableSet *self,
+                            DBusPollable     fd)
+{
+  (self->cls->disable) (self, fd);
+}
+
+
+static inline int
+_dbus_pollable_set_poll (DBusPollableSet    *self,
+                         DBusPollableEvent  *revents,
+                         int                 max_events,
+                         int                 timeout_ms)
+{
+  return (self->cls->poll) (self, revents, max_events, timeout_ms);
+}
+
+/* concrete implementations, not necessarily built on all platforms */
+
+extern DBusPollableSetClass _dbus_pollable_set_poll_class;
+extern DBusPollableSetClass _dbus_pollable_set_epoll_class;
+
+DBusPollableSet *_dbus_pollable_set_poll_new  (int  size_hint);
+DBusPollableSet *_dbus_pollable_set_epoll_new (void);
+
+#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
+#endif /* multiple-inclusion guard */
diff --git a/dbus/dbus-socket-set.h b/dbus/dbus-socket-set.h
deleted file mode 100644 (file)
index bcc263a..0000000
+++ /dev/null
@@ -1,123 +0,0 @@
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
-/*
- * dbus-socket-set.h - used to bolt file descriptors onto a bus
- *
- * Copyright © 2011 Nokia Corporation
- *
- * Licensed under the Academic Free License version 2.1
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301  USA
- *
- */
-
-#ifndef DBUS_SOCKET_SET_H
-#define DBUS_SOCKET_SET_H
-
-#ifndef DOXYGEN_SHOULD_SKIP_THIS
-
-#include <dbus/dbus.h>
-#include <dbus/dbus-sysdeps.h>
-
-typedef struct {
-    DBusPollable fd;
-    unsigned int flags;
-} DBusSocketEvent;
-
-typedef struct DBusSocketSet DBusSocketSet;
-
-typedef struct DBusSocketSetClass DBusSocketSetClass;
-struct DBusSocketSetClass {
-    void            (*free)     (DBusSocketSet   *self);
-    dbus_bool_t     (*add)      (DBusSocketSet   *self,
-                                 DBusPollable     fd,
-                                 unsigned int     flags,
-                                 dbus_bool_t      enabled);
-    void            (*remove)   (DBusSocketSet   *self,
-                                 DBusPollable     fd);
-    void            (*enable)   (DBusSocketSet   *self,
-                                 DBusPollable     fd,
-                                 unsigned int     flags);
-    void            (*disable)  (DBusSocketSet   *self,
-                                 DBusPollable     fd);
-    int             (*poll)     (DBusSocketSet   *self,
-                                 DBusSocketEvent *revents,
-                                 int              max_events,
-                                 int              timeout_ms);
-};
-
-struct DBusSocketSet {
-    DBusSocketSetClass *cls;
-};
-
-DBusSocketSet *_dbus_socket_set_new           (int               size_hint);
-
-static inline void
-_dbus_socket_set_free (DBusSocketSet *self)
-{
-  (self->cls->free) (self);
-}
-
-static inline dbus_bool_t
-_dbus_socket_set_add (DBusSocketSet *self,
-                      DBusPollable   fd,
-                      unsigned int   flags,
-                      dbus_bool_t    enabled)
-{
-  return (self->cls->add) (self, fd, flags, enabled);
-}
-
-static inline void
-_dbus_socket_set_remove (DBusSocketSet *self,
-                         DBusPollable   fd)
-{
-  (self->cls->remove) (self, fd);
-}
-
-static inline void
-_dbus_socket_set_enable (DBusSocketSet *self,
-                         DBusPollable   fd,
-                         unsigned int   flags)
-{
-  (self->cls->enable) (self, fd, flags);
-}
-
-static inline void
-_dbus_socket_set_disable (DBusSocketSet *self,
-                          DBusPollable   fd)
-{
-  (self->cls->disable) (self, fd);
-}
-
-
-static inline int
-_dbus_socket_set_poll (DBusSocketSet    *self,
-                       DBusSocketEvent  *revents,
-                       int               max_events,
-                       int               timeout_ms)
-{
-  return (self->cls->poll) (self, revents, max_events, timeout_ms);
-}
-
-/* concrete implementations, not necessarily built on all platforms */
-
-extern DBusSocketSetClass _dbus_socket_set_poll_class;
-extern DBusSocketSetClass _dbus_socket_set_epoll_class;
-
-DBusSocketSet *_dbus_socket_set_poll_new  (int  size_hint);
-DBusSocketSet *_dbus_socket_set_epoll_new (void);
-
-#endif /* !DOXYGEN_SHOULD_SKIP_THIS */
-#endif /* multiple-inclusion guard */