[gupnp-dlna/wip/new-api: 29/48] Move native utils to main directory.



commit 888eda9a5ed60162f053815c6fd77cff0a6d6f3e
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Thu Jan 3 11:54:13 2013 +0100

    Move native utils to main directory.
    
    Functions there are used only in loader and guesser and operate on
    nothing native specific.

 libgupnp-dlna/Makefile.am                          |    6 ++++--
 libgupnp-dlna/gupnp-dlna-profile-guesser-impl.c    |    4 ++--
 libgupnp-dlna/gupnp-dlna-profile-loader.c          |   10 +++++-----
 ...upnp-dlna-native-utils.c => gupnp-dlna-utils.c} |   16 +++++++---------
 ...upnp-dlna-native-utils.h => gupnp-dlna-utils.h} |   12 ++++++------
 libgupnp-dlna/profile-backends/native/native.am    |    2 --
 6 files changed, 24 insertions(+), 26 deletions(-)
---
diff --git a/libgupnp-dlna/Makefile.am b/libgupnp-dlna/Makefile.am
index d2347fe..951bb3f 100644
--- a/libgupnp-dlna/Makefile.am
+++ b/libgupnp-dlna/Makefile.am
@@ -119,7 +119,8 @@ libgupnp_dlna_2_0_la_SOURCES = \
 	gupnp-dlna-profile.c \
 	gupnp-dlna-restriction.c \
 	gupnp-dlna-value-list.c \
-	gupnp-dlna-g-values.c
+	gupnp-dlna-g-values.c \
+	gupnp-dlna-utils.c
 libgupnp_dlna_2_0_la_LIBADD = \
 	$(gupnp_libadd) \
 	libloader.la \
@@ -157,7 +158,8 @@ dist_noinst_HEADERS += \
 	gupnp-dlna-profile-guesser-impl.h \
 	gupnp-dlna-restriction-private.h \
 	gupnp-dlna-value-list-private.h \
-	gupnp-dlna-g-values-private.h
+	gupnp-dlna-g-values-private.h \
+	gupnp-dlna-utils.h
 
 
 # INTROSPECTION
diff --git a/libgupnp-dlna/gupnp-dlna-profile-guesser-impl.c b/libgupnp-dlna/gupnp-dlna-profile-guesser-impl.c
index af93fb5..b0fae80 100644
--- a/libgupnp-dlna/gupnp-dlna-profile-guesser-impl.c
+++ b/libgupnp-dlna/gupnp-dlna-profile-guesser-impl.c
@@ -31,7 +31,7 @@
 #include "gupnp-dlna-image-information.h"
 #include "gupnp-dlna-video-information.h"
 #include "gupnp-dlna-native-sets.h"
-#include "gupnp-dlna-native-utils.h"
+#include "gupnp-dlna-utils.h"
 
 static gboolean
 is_video_profile (GUPnPDLNAProfile *profile)
@@ -65,7 +65,7 @@ match_profile (GUPnPDLNAProfile       *profile,
         }
 
         stream_dump = gupnp_dlna_native_info_set_to_string (stream_info_set);
-        restrictions_dump = gupnp_dlna_native_utils_restrictions_list_to_string
+        restrictions_dump = gupnp_dlna_utils_restrictions_list_to_string
                                         (profile_restrictions);
         g_debug ("Stream: %s\nRestrictions: %s",
                  stream_dump,
diff --git a/libgupnp-dlna/gupnp-dlna-profile-loader.c b/libgupnp-dlna/gupnp-dlna-profile-loader.c
index 9093e22..74eb456 100644
--- a/libgupnp-dlna/gupnp-dlna-profile-loader.c
+++ b/libgupnp-dlna/gupnp-dlna-profile-loader.c
@@ -30,7 +30,7 @@
 #include "gupnp-dlna-profile-loader.h"
 #include "gupnp-dlna-profile-private.h"
 #include "gupnp-dlna-native-sets.h"
-#include "gupnp-dlna-native-utils.h"
+#include "gupnp-dlna-utils.h"
 
 G_DEFINE_TYPE (GUPnPDLNAProfileLoader, gupnp_dlna_profile_loader, G_TYPE_OBJECT)
 
@@ -725,13 +725,13 @@ cleanup (GUPnPDLNAProfileLoader *loader G_GNUC_UNUSED,
 
         for (iter = profiles; iter != NULL; iter = iter->next) {
                 GUPnPDLNAProfile *profile = GUPNP_DLNA_PROFILE (iter->data);
-                gchar *acaps = gupnp_dlna_native_utils_restrictions_list_to_string
+                gchar *acaps = gupnp_dlna_utils_restrictions_list_to_string
                           (gupnp_dlna_profile_get_audio_restrictions (profile));
-                gchar *ccaps = gupnp_dlna_native_utils_restrictions_list_to_string
+                gchar *ccaps = gupnp_dlna_utils_restrictions_list_to_string
                       (gupnp_dlna_profile_get_container_restrictions (profile));
-                gchar *icaps = gupnp_dlna_native_utils_restrictions_list_to_string
+                gchar *icaps = gupnp_dlna_utils_restrictions_list_to_string
                           (gupnp_dlna_profile_get_image_restrictions (profile));
-                gchar *vcaps = gupnp_dlna_native_utils_restrictions_list_to_string
+                gchar *vcaps = gupnp_dlna_utils_restrictions_list_to_string
                           (gupnp_dlna_profile_get_video_restrictions (profile));
 
                 g_debug ("Loaded profile: %s\nMIME: %s\naudio caps: %s\n"
diff --git a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c b/libgupnp-dlna/gupnp-dlna-utils.c
similarity index 78%
rename from libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c
rename to libgupnp-dlna/gupnp-dlna-utils.c
index 424a70f..26f7c0f 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c
+++ b/libgupnp-dlna/gupnp-dlna-utils.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Intel Corporation.
+ * Copyright (C) 2012, 2013 Intel Corporation.
  *
  * Authors: Krzesimir Nowak <krnowak openismus com>
  *
@@ -19,20 +19,19 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#include "gupnp-dlna-native-utils.h"
-#include "gupnp-dlna-native-sets.h"
+#include "gupnp-dlna-utils.h"
+#include "gupnp-dlna-restriction.h"
 
 void
-gupnp_dlna_native_utils_free_restrictions (GList *list)
+gupnp_dlna_utils_free_restrictions (GList *list)
 {
         if (list == NULL)
                 return;
-        g_list_free_full (list,
-                          (GDestroyNotify) gupnp_dlna_restriction_free);
+        g_list_free_full (list, (GDestroyNotify) gupnp_dlna_restriction_free);
 }
 
 gchar *
-gupnp_dlna_native_utils_restrictions_list_to_string (GList *list)
+gupnp_dlna_utils_restrictions_list_to_string (GList *list)
 {
         GList *iter;
         GPtrArray *strings = g_ptr_array_new_with_free_func (g_free);
@@ -50,8 +49,7 @@ gupnp_dlna_native_utils_restrictions_list_to_string (GList *list)
 
         if (strings->len) {
                 g_ptr_array_add (strings, NULL);
-                final_string = g_strjoinv ("; ",
-                                           (gchar **) strings->pdata);
+                final_string = g_strjoinv ("; ", (gchar **) strings->pdata);
         }
         else
                 final_string = g_strdup ("EMPTY");
diff --git a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.h b/libgupnp-dlna/gupnp-dlna-utils.h
similarity index 75%
rename from libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.h
rename to libgupnp-dlna/gupnp-dlna-utils.h
index c8b079b..899ced1 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.h
+++ b/libgupnp-dlna/gupnp-dlna-utils.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012 Intel Corporation.
+ * Copyright (C) 2012, 2013 Intel Corporation.
  *
  * Authors: Krzesimir Nowak <krnowak openismus com>
  *
@@ -19,19 +19,19 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __GUPNP_DLNA_NATIVE_UTILS_H__
-#define __GUPNP_DLNA_NATIVE_UTILS_H__
+#ifndef __GUPNP_DLNA_UTILS_H__
+#define __GUPNP_DLNA_UTILS_H__
 
 #include <glib.h>
 
 G_BEGIN_DECLS
 
 void
-gupnp_dlna_native_utils_free_restrictions (GList *list);
+gupnp_dlna_utils_free_restrictions (GList *list);
 
 gchar *
-gupnp_dlna_native_utils_restrictions_list_to_string (GList *list);
+gupnp_dlna_utils_restrictions_list_to_string (GList *list);
 
 G_END_DECLS
 
-#endif /* __GUPNP_DLNA_NATIVE_UTILS_H__ */
+#endif /* __GUPNP_DLNA_UTILS_H__ */
diff --git a/libgupnp-dlna/profile-backends/native/native.am b/libgupnp-dlna/profile-backends/native/native.am
index 41a14d9..ec8dbc2 100644
--- a/libgupnp-dlna/profile-backends/native/native.am
+++ b/libgupnp-dlna/profile-backends/native/native.am
@@ -17,8 +17,6 @@ include $(top_srcdir)/libgupnp-dlna/profile-backends/native/sets/sets.am
 
 profile_backends_native_libnativeprofilebackend_la_SOURCES = \
 	profile-backends/native/gupnp-dlna-native-sets.h \
-	profile-backends/native/gupnp-dlna-native-utils.c \
-	profile-backends/native/gupnp-dlna-native-utils.h \
 	$(sets_sources)
 profile_backends_native_libnativeprofilebackend_la_LIBADD = \
 	$(common_libadd)



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