[libdmapsharing] Move dmap_connection_setup to private header and clean up dmap-connection.{c, h}



commit af19bf974cfaf6dbf9b399cd9cb37f314c13a98c
Author: W. Michael Petullo <mike flyn org>
Date:   Sun Mar 25 15:37:42 2018 -0400

    Move dmap_connection_setup to private header and clean up dmap-connection.{c,h}
    
    Signed-off-by: W. Michael Petullo <mike flyn org>

 libdmapsharing/dmap-connection-private.h |    2 ++
 libdmapsharing/dmap-connection.c         |    4 ++--
 libdmapsharing/dmap-connection.h         |   19 ++++++++++++-------
 3 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/libdmapsharing/dmap-connection-private.h b/libdmapsharing/dmap-connection-private.h
index 6862b06..ea30bce 100644
--- a/libdmapsharing/dmap-connection-private.h
+++ b/libdmapsharing/dmap-connection-private.h
@@ -31,4 +31,6 @@ gboolean dmap_connection_get (DmapConnection * self,
                               DmapResponseHandler handler,
                               gpointer user_data);
 
+void dmap_connection_setup (DmapConnection * connection);
+
 #endif
diff --git a/libdmapsharing/dmap-connection.c b/libdmapsharing/dmap-connection.c
index 00b2bf7..9459663 100644
--- a/libdmapsharing/dmap-connection.c
+++ b/libdmapsharing/dmap-connection.c
@@ -1591,7 +1591,7 @@ _connected_cb (DmapConnection * connection, ConnectionResponseData * rdata)
                                              rdata);
 
        /* if connected then we succeeded */
-       result = dmap_connection_is_connected (connection);
+       result = connection->priv->is_connected;
 
        if (rdata->callback) {
                rdata->callback (rdata->connection,
@@ -1717,7 +1717,7 @@ _disconnected_cb (DmapConnection * connection, ConnectionResponseData * rdata)
                                              rdata);
 
        /* if not connected then we succeeded */
-       result = !dmap_connection_is_connected (connection);
+       result = !connection->priv->is_connected;
 
        if (rdata->callback) {
                rdata->callback (rdata->connection,
diff --git a/libdmapsharing/dmap-connection.h b/libdmapsharing/dmap-connection.h
index 1584d3a..bf3ecb9 100644
--- a/libdmapsharing/dmap-connection.h
+++ b/libdmapsharing/dmap-connection.h
@@ -129,12 +129,12 @@ typedef struct {
                                    DmapRecordFactory * factory, GNode * mlcl,
                                    gint * item_id);
 
-       SoupMessage *(*build_message)
-        
-               (DmapConnection * connection,
-          const gchar * path,
-          gboolean need_hash,
-          gdouble version, gint req_id, gboolean send_close);
+       SoupMessage *(*build_message) (DmapConnection * connection,
+                                      const gchar * path,
+                                      gboolean need_hash,
+                                      gdouble version,
+                                      gint req_id,
+                                      gboolean send_close);
        void (*connected) (DmapConnection * connection);
        void (*disconnected) (DmapConnection * connection);
 
@@ -158,8 +158,13 @@ typedef void (*DmapResponseHandler) (DmapConnection * connection,
 
 GType dmap_connection_get_type (void);
 
+/**
+ * dmap_connection_is_connected:
+ * @connection: The connection.
+ *
+ * Returns TRUE if the connection is presently connected.
+ */
 gboolean dmap_connection_is_connected (DmapConnection * connection);
-void dmap_connection_setup (DmapConnection * connection);
 
 /**
  * dmap_connection_start:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]