[gupnp-dlna/wip/new-api: 5/48] Remove 'Native' from 'GUPnPDLNANativeRestriction'.



commit 0d51ec38b2038b6baf0c3b0e6f97c71d2f2347ed
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Tue Nov 27 20:04:44 2012 +0100

    Remove 'Native' from 'GUPnPDLNANativeRestriction'.
    
    Also, moved it to $(top_srcdir)/libgupnp-dlna.

 libgupnp-dlna/Makefile.am                          |    5 +-
 libgupnp-dlna/gupnp-dlna-profile.c                 |    3 +-
 libgupnp-dlna/gupnp-dlna-profile.h                 |    1 +
 ...-private.h => gupnp-dlna-restriction-private.h} |   23 +++----
 ...tive-restriction.c => gupnp-dlna-restriction.c} |   50 +++++++--------
 ...tive-restriction.h => gupnp-dlna-restriction.h} |   27 ++++----
 .../gupnp-dlna-native-profile-guesser-impl.c       |    4 +-
 .../native/gupnp-dlna-native-profile-loader.c      |   45 ++++++-------
 .../native/gupnp-dlna-native-sets.h                |    2 +-
 .../native/gupnp-dlna-native-utils.c               |    8 +-
 .../native/sets/gupnp-dlna-native-info-set.c       |    8 +-
 .../native/sets/gupnp-dlna-native-info-set.h       |    7 +-
 .../native/sets/gupnp-dlna-native-sets-private.h   |    5 +-
 libgupnp-dlna/profile-backends/native/sets/sets.am |    2 -
 tests/Makefile.am                                  |    1 +
 tests/sets.c                                       |   70 ++++++++++----------
 16 files changed, 125 insertions(+), 136 deletions(-)
---
diff --git a/libgupnp-dlna/Makefile.am b/libgupnp-dlna/Makefile.am
index 5197932..3e48bbb 100644
--- a/libgupnp-dlna/Makefile.am
+++ b/libgupnp-dlna/Makefile.am
@@ -111,7 +111,8 @@ libgupnp_dlna_2_0_la_SOURCES = \
 	$(metadata_general_sources) \
 	gupnp-dlna-field-value.c \
 	gupnp-dlna-profile-backend.c \
-	gupnp-dlna-profile.c
+	gupnp-dlna-profile.c \
+	gupnp-dlna-restriction.c
 libgupnp_dlna_2_0_la_LIBADD = \
 	$(gupnp_libadd) \
 	libloader.la \
@@ -127,7 +128,7 @@ libgupnp_dlna_incdir = \
 libgupnp_dlna_inc_HEADERS = \
 	gupnp-dlna-profile-guesser.h \
 	gupnp-dlna-profile.h \
-	profile-backends/native/sets/gupnp-dlna-native-restriction.h
+	gupnp-dlna-restriction.h
 
 libgupnp_dlna_metadata_incdir = \
 	$(libgupnp_dlna_incdir)/metadata
diff --git a/libgupnp-dlna/gupnp-dlna-profile.c b/libgupnp-dlna/gupnp-dlna-profile.c
index 5f0bcde..f21fe4d 100644
--- a/libgupnp-dlna/gupnp-dlna-profile.c
+++ b/libgupnp-dlna/gupnp-dlna-profile.c
@@ -22,7 +22,6 @@
  */
 
 #include "gupnp-dlna-profile.h"
-#include "gupnp-dlna-native-restriction.h"
 
 /**
  * SECTION:gupnp-dlna-profile
@@ -111,7 +110,7 @@ free_restrictions (GList *list)
         if (list == NULL)
                 return;
         g_list_free_full (list,
-                          (GDestroyNotify) gupnp_dlna_native_restriction_free);
+                          (GDestroyNotify) gupnp_dlna_restriction_free);
 }
 
 static void
diff --git a/libgupnp-dlna/gupnp-dlna-profile.h b/libgupnp-dlna/gupnp-dlna-profile.h
index 5e3fe48..e63bb97 100644
--- a/libgupnp-dlna/gupnp-dlna-profile.h
+++ b/libgupnp-dlna/gupnp-dlna-profile.h
@@ -25,6 +25,7 @@
 #define __GUPNP_DLNA_PROFILE_H__
 
 #include <glib-object.h>
+#include "gupnp-dlna-restriction.h"
 
 G_BEGIN_DECLS
 
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction-private.h b/libgupnp-dlna/gupnp-dlna-restriction-private.h
similarity index 58%
rename from libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction-private.h
rename to libgupnp-dlna/gupnp-dlna-restriction-private.h
index 2768334..a26322f 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction-private.h
+++ b/libgupnp-dlna/gupnp-dlna-restriction-private.h
@@ -19,29 +19,28 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __GUPNP_DLNA_NATIVE_RESTRICTION_PRIVATE_H__
-#define __GUPNP_DLNA_NATIVE_RESTRICTION_PRIVATE_H__
+#ifndef __GUPNP_DLNA_RESTRICTION_PRIVATE_H__
+#define __GUPNP_DLNA_RESTRICTION_PRIVATE_H__
 
 #include <glib.h>
 #include <glib-object.h>
-#include "gupnp-dlna-native-restriction.h"
+#include "gupnp-dlna-restriction.h"
 #include "gupnp-dlna-native-value-list.h"
 
 G_BEGIN_DECLS
 
-GUPnPDLNANativeRestriction *
-gupnp_dlna_native_restriction_new (const gchar *mime);
+GUPnPDLNARestriction *
+gupnp_dlna_restriction_new (const gchar *mime);
 
 gboolean
-gupnp_dlna_native_restriction_add_value_list
-                                       (GUPnPDLNANativeRestriction *restriction,
-                                        const gchar                *name,
-                                        GUPnPDLNANativeValueList   *list);
+gupnp_dlna_restriction_add_value_list (GUPnPDLNARestriction     *restriction,
+                                       const gchar              *name,
+                                       GUPnPDLNANativeValueList *list);
 
 void
-gupnp_dlna_native_restriction_merge (GUPnPDLNANativeRestriction *restriction,
-                                     GUPnPDLNANativeRestriction *merged);
+gupnp_dlna_restriction_merge (GUPnPDLNARestriction *restriction,
+                              GUPnPDLNARestriction *merged);
 
 G_END_DECLS
 
-#endif /* __GUPNP_DLNA_NATIVE_RESTRICTION_PRIVATE_H__ */
+#endif /* __GUPNP_DLNA_RESTRICTION_PRIVATE_H__ */
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction.c b/libgupnp-dlna/gupnp-dlna-restriction.c
similarity index 73%
rename from libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction.c
rename to libgupnp-dlna/gupnp-dlna-restriction.c
index 13ba94b..5b8531c 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction.c
+++ b/libgupnp-dlna/gupnp-dlna-restriction.c
@@ -21,20 +21,19 @@
 
 #include <glib.h>
 
-#include "gupnp-dlna-native-restriction.h"
+#include "gupnp-dlna-restriction-private.h"
 #include "gupnp-dlna-native-value-list.h"
 #include "gupnp-dlna-native-sets-private.h"
 
-struct _GUPnPDLNANativeRestriction {
+struct _GUPnPDLNARestriction {
         gchar *mime;
         GHashTable *entries; /* <gchar *, GUPnPDLNANativeValueList *> */
 };
 
-GUPnPDLNANativeRestriction *
-gupnp_dlna_native_restriction_new (const gchar *mime)
+GUPnPDLNARestriction *
+gupnp_dlna_restriction_new (const gchar *mime)
 {
-        GUPnPDLNANativeRestriction *restriction =
-                                       g_slice_new (GUPnPDLNANativeRestriction);
+        GUPnPDLNARestriction *restriction = g_slice_new (GUPnPDLNARestriction);
 
         restriction->mime = g_strdup (mime);
         restriction->entries = g_hash_table_new_full
@@ -46,20 +45,20 @@ gupnp_dlna_native_restriction_new (const gchar *mime)
         return restriction;
 }
 
-GUPnPDLNANativeRestriction *
-gupnp_dlna_native_restriction_copy (GUPnPDLNANativeRestriction *restriction)
+GUPnPDLNARestriction *
+gupnp_dlna_restriction_copy (GUPnPDLNARestriction *restriction)
 {
-        GUPnPDLNANativeRestriction *dup;
+        GUPnPDLNARestriction *dup;
         GHashTableIter iter;
         gpointer key;
         gpointer value;
 
         g_return_val_if_fail (restriction != NULL, NULL);
 
-        dup = gupnp_dlna_native_restriction_new (restriction->mime);
+        dup = gupnp_dlna_restriction_new (restriction->mime);
         g_hash_table_iter_init (&iter, restriction->entries);
         while (g_hash_table_iter_next (&iter, &key, &value)) {
-                GUPnPDLNANativeValueList * dup_entry;
+                GUPnPDLNANativeValueList *dup_entry;
 
                 if (key == NULL || value == NULL)
                         continue;
@@ -74,20 +73,19 @@ gupnp_dlna_native_restriction_copy (GUPnPDLNANativeRestriction *restriction)
 }
 
 void
-gupnp_dlna_native_restriction_free (GUPnPDLNANativeRestriction *restriction)
+gupnp_dlna_restriction_free (GUPnPDLNARestriction *restriction)
 {
         if (restriction == NULL)
                 return;
         g_free (restriction->mime);
         g_hash_table_unref (restriction->entries);
-        g_slice_free (GUPnPDLNANativeRestriction, restriction);
+        g_slice_free (GUPnPDLNARestriction, restriction);
 }
 
 gboolean
-gupnp_dlna_native_restriction_add_value_list
-                                       (GUPnPDLNANativeRestriction *restriction,
-                                        const gchar                *name,
-                                        GUPnPDLNANativeValueList   *list)
+gupnp_dlna_restriction_add_value_list (GUPnPDLNARestriction     *restriction,
+                                       const gchar              *name,
+                                       GUPnPDLNANativeValueList *list)
 {
         g_return_val_if_fail (restriction != NULL, FALSE);
         g_return_val_if_fail (name != NULL, FALSE);
@@ -104,8 +102,8 @@ gupnp_dlna_native_restriction_add_value_list
 }
 
 void
-gupnp_dlna_native_restriction_merge (GUPnPDLNANativeRestriction *restriction,
-                                     GUPnPDLNANativeRestriction *merged)
+gupnp_dlna_restriction_merge (GUPnPDLNARestriction *restriction,
+                              GUPnPDLNARestriction *merged)
 {
         GHashTableIter iter;
         gpointer name_ptr;
@@ -130,11 +128,11 @@ gupnp_dlna_native_restriction_merge (GUPnPDLNANativeRestriction *restriction,
                                              value_list_ptr);
                 }
         }
-        gupnp_dlna_native_restriction_free (merged);
+        gupnp_dlna_restriction_free (merged);
 }
 
 gboolean
-gupnp_dlna_native_restriction_is_empty (GUPnPDLNANativeRestriction *restriction)
+gupnp_dlna_restriction_is_empty (GUPnPDLNARestriction *restriction)
 {
         g_return_val_if_fail (restriction != NULL, TRUE);
 
@@ -143,8 +141,7 @@ gupnp_dlna_native_restriction_is_empty (GUPnPDLNANativeRestriction *restriction)
 }
 
 gchar *
-gupnp_dlna_native_restriction_to_string
-                                       (GUPnPDLNANativeRestriction *restriction)
+gupnp_dlna_restriction_to_string (GUPnPDLNARestriction *restriction)
 {
         GString *str;
         GHashTableIter iter;
@@ -153,7 +150,7 @@ gupnp_dlna_native_restriction_to_string
 
         g_return_val_if_fail (restriction != NULL, NULL);
 
-        if (gupnp_dlna_native_restriction_is_empty (restriction))
+        if (gupnp_dlna_restriction_is_empty (restriction))
                 return g_strdup ("EMPTY");
 
         str = g_string_new (restriction->mime ? restriction->mime : "(null)");
@@ -169,7 +166,7 @@ gupnp_dlna_native_restriction_to_string
 }
 
 const gchar *
-gupnp_dlna_native_restriction_get_mime (GUPnPDLNANativeRestriction *restriction)
+gupnp_dlna_restriction_get_mime (GUPnPDLNARestriction *restriction)
 {
         g_return_val_if_fail (restriction != NULL, NULL);
 
@@ -177,8 +174,7 @@ gupnp_dlna_native_restriction_get_mime (GUPnPDLNANativeRestriction *restriction)
 }
 
 GHashTable *
-gupnp_dlna_native_restriction_get_entries
-                                       (GUPnPDLNANativeRestriction *restriction)
+gupnp_dlna_restriction_get_entries (GUPnPDLNARestriction *restriction)
 {
         g_return_val_if_fail (restriction != NULL, NULL);
 
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction.h b/libgupnp-dlna/gupnp-dlna-restriction.h
similarity index 52%
rename from libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction.h
rename to libgupnp-dlna/gupnp-dlna-restriction.h
index 85b4ed2..3660f46 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-restriction.h
+++ b/libgupnp-dlna/gupnp-dlna-restriction.h
@@ -19,36 +19,33 @@
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef __GUPNP_DLNA_NATIVE_RESTRICTION_H__
-#define __GUPNP_DLNA_NATIVE_RESTRICTION_H__
+#ifndef __GUPNP_DLNA_RESTRICTION_H__
+#define __GUPNP_DLNA_RESTRICTION_H__
 
 #include <glib.h>
 
 G_BEGIN_DECLS
 
-typedef struct _GUPnPDLNANativeRestriction GUPnPDLNANativeRestriction;
+typedef struct _GUPnPDLNARestriction GUPnPDLNARestriction;
 
-#define GUPNP_DLNA_NATIVE_RESTRICTION(x) \
-        ((GUPnPDLNANativeRestriction *) x)
+#define GUPNP_DLNA_RESTRICTION(x) \
+        ((GUPnPDLNARestriction *) x)
 
-GUPnPDLNANativeRestriction *
-gupnp_dlna_native_restriction_copy (GUPnPDLNANativeRestriction *restriction);
+GUPnPDLNARestriction *
+gupnp_dlna_restriction_copy (GUPnPDLNARestriction *restriction);
 
 void
-gupnp_dlna_native_restriction_free (GUPnPDLNANativeRestriction *restriction);
+gupnp_dlna_restriction_free (GUPnPDLNARestriction *restriction);
 
 gboolean
-gupnp_dlna_native_restriction_is_empty
-                                      (GUPnPDLNANativeRestriction *restriction);
+gupnp_dlna_restriction_is_empty (GUPnPDLNARestriction *restriction);
 
 gchar *
-gupnp_dlna_native_restriction_to_string
-                                      (GUPnPDLNANativeRestriction *restriction);
+gupnp_dlna_restriction_to_string (GUPnPDLNARestriction *restriction);
 
 const gchar *
-gupnp_dlna_native_restriction_get_mime
-                                      (GUPnPDLNANativeRestriction *restriction);
+gupnp_dlna_restriction_get_mime (GUPnPDLNARestriction *restriction);
 
 G_END_DECLS
 
-#endif /* __GUPNP_DLNA_NATIVE_RESTRICTION_H__ */
+#endif /* __GUPNP_DLNA_RESTRICTION_H__ */
diff --git a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-guesser-impl.c b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-guesser-impl.c
index 45938e4..8e79a31 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-guesser-impl.c
+++ b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-guesser-impl.c
@@ -83,8 +83,8 @@ match_profile (GUPnPDLNAProfile       *profile,
         g_free (restrictions_dump);
 
         for (iter = profile_restrictions; iter != NULL; iter = iter->next) {
-                GUPnPDLNANativeRestriction *restriction =
-                                     GUPNP_DLNA_NATIVE_RESTRICTION (iter->data);
+                GUPnPDLNARestriction *restriction =
+                                        GUPNP_DLNA_RESTRICTION (iter->data);
 
                 if (restriction != NULL &&
                     gupnp_dlna_native_info_set_fits_restriction
diff --git a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-loader.c b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-loader.c
index 79ec47d..31da177 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-loader.c
+++ b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-profile-loader.c
@@ -68,7 +68,7 @@ typedef struct {
 } GUPnPDLNANativeRestrictionData;
 
 typedef struct {
-        GUPnPDLNANativeRestriction     *restriction;
+        GUPnPDLNARestriction           *restriction;
         GUPnPDLNANativeRestrictionType  type;
 } GUPnPDLNANativeDescription;
 
@@ -104,7 +104,7 @@ gupnp_dlna_native_name_value_list_pair_free
 }
 
 static GUPnPDLNANativeDescription *
-gupnp_dlna_native_description_new (GUPnPDLNANativeRestriction     *restriction,
+gupnp_dlna_native_description_new (GUPnPDLNARestriction           *restriction,
                                    GUPnPDLNANativeRestrictionType  type)
 {
         GUPnPDLNANativeDescription *description =
@@ -122,7 +122,7 @@ gupnp_dlna_native_description_free (GUPnPDLNANativeDescription *description)
         if (description == NULL)
                 return;
 
-        gupnp_dlna_native_restriction_free (description->restriction);
+        gupnp_dlna_restriction_free (description->restriction);
         g_slice_free (GUPnPDLNANativeDescription, description);
 }
 
@@ -176,9 +176,8 @@ gupnp_dlna_native_restriction_data_free (GUPnPDLNANativeRestrictionData *data)
                  (data->name_list_pairs,
                   (GDestroyNotify) gupnp_dlna_native_name_value_list_pair_free);
         if (data->parents != NULL)
-                g_list_free_full
-                          (data->parents,
-                           (GDestroyNotify) gupnp_dlna_native_restriction_free);
+                g_list_free_full (data->parents,
+                                  (GDestroyNotify) gupnp_dlna_restriction_free);
         g_slice_free (GUPnPDLNANativeRestrictionData, data);
 }
 
@@ -345,7 +344,7 @@ backend_merge_restrictions (GUPnPDLNANativeProfileLoader *native_loader,
         GUPnPDLNANativeProfileData* data =
              (GUPnPDLNANativeProfileData *) priv->dlna_profile_data_stack->data;
         GList **target_list;
-        GUPnPDLNANativeRestriction *copy;
+        GUPnPDLNARestriction *copy;
 
         if (description == NULL || description->restriction == NULL)
                 return;
@@ -371,7 +370,7 @@ backend_merge_restrictions (GUPnPDLNANativeProfileLoader *native_loader,
                 g_assert_not_reached ();
         }
 
-        copy = gupnp_dlna_native_restriction_copy (description->restriction);
+        copy = gupnp_dlna_restriction_copy (description->restriction);
         *target_list = g_list_prepend (*target_list, copy);
 }
 
@@ -397,8 +396,8 @@ backend_collect_parents (GUPnPDLNANativeProfileLoader *native_loader,
         if (description != NULL && description->restriction != NULL) {
                 /* Collect parents in a list - we'll
                  * coalesce them later */
-                GUPnPDLNANativeRestriction *copy =
-                  gupnp_dlna_native_restriction_copy (description->restriction);
+                GUPnPDLNARestriction *copy =
+                  gupnp_dlna_restriction_copy (description->restriction);
 
                 data->parents = g_list_prepend (data->parents, copy);
         }
@@ -488,7 +487,7 @@ backend_post_restriction (GUPnPDLNAProfileLoader *loader,
         GUPnPDLNANativeProfileLoaderPrivate *priv = native_loader->priv;
         GUPnPDLNANativeRestrictionData *data =
           (GUPnPDLNANativeRestrictionData *) priv->restriction_data_stack->data;
-        GUPnPDLNANativeRestriction *restriction;
+        GUPnPDLNARestriction *restriction;
         GUPnPDLNANativeDescription *description;
         GUPnPDLNANativeRestrictionType type;
         GList *iter;
@@ -502,13 +501,13 @@ backend_post_restriction (GUPnPDLNAProfileLoader *loader,
         if (restriction_type == NULL)
                 goto out;
 
-        restriction = gupnp_dlna_native_restriction_new (name);
+        restriction = gupnp_dlna_restriction_new (name);
 
         for (iter = data->name_list_pairs; iter != NULL; iter = iter->next) {
                 GUPnPDLNANativeNameValueListPair *pair =
                                 (GUPnPDLNANativeNameValueListPair *) iter->data;
 
-                if (gupnp_dlna_native_restriction_add_value_list (restriction,
+                if (gupnp_dlna_restriction_add_value_list (restriction,
                                                                   pair->name,
                                                                   pair->list))
                         pair->list = NULL;
@@ -526,10 +525,10 @@ backend_post_restriction (GUPnPDLNAProfileLoader *loader,
         for (iter = data->parents; iter != NULL; iter = iter->next) {
                 /* Merge all the parent caps. The child overrides parent
                  * attributes */
-                GUPnPDLNANativeRestriction *parent =
-                                      (GUPnPDLNANativeRestriction *) iter->data;
+                GUPnPDLNARestriction *parent =
+                                        GUPNP_DLNA_RESTRICTION (iter->data);
 
-                gupnp_dlna_native_restriction_merge (restriction,
+                gupnp_dlna_restriction_merge (restriction,
                                                      parent);
                 iter->data = NULL;
         }
@@ -591,10 +590,10 @@ copy_restrictions_list (GList *list)
         GList *iter;
 
         for (iter = list; iter != NULL; iter = iter->next) {
-                GUPnPDLNANativeRestriction *restriction =
-                                     GUPNP_DLNA_NATIVE_RESTRICTION (iter->data);
-                GUPnPDLNANativeRestriction *copy =
-                               gupnp_dlna_native_restriction_copy (restriction);
+                GUPnPDLNARestriction *restriction =
+                                        GUPNP_DLNA_RESTRICTION (iter->data);
+                GUPnPDLNARestriction *copy =
+                                      gupnp_dlna_restriction_copy (restriction);
 
                 if (copy)
                         dup = g_list_prepend (dup, copy);
@@ -644,11 +643,11 @@ restrictions_list_is_empty (GList *list)
         GList *iter;
 
         for (iter = list; iter != NULL; iter = iter->next) {
-                GUPnPDLNANativeRestriction *restriction =
-                                     GUPNP_DLNA_NATIVE_RESTRICTION (iter->data);
+                GUPnPDLNARestriction *restriction =
+                                     GUPNP_DLNA_RESTRICTION (iter->data);
 
                 if (restriction != NULL &&
-                    !gupnp_dlna_native_restriction_is_empty (restriction))
+                    !gupnp_dlna_restriction_is_empty (restriction))
                         return FALSE;
         }
 
diff --git a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-sets.h b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-sets.h
index d35b8d0..79da341 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-sets.h
+++ b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-sets.h
@@ -24,7 +24,7 @@
 
 #include "gupnp-dlna-native-value-type.h"
 #include "gupnp-dlna-native-value-list.h"
-#include "gupnp-dlna-native-restriction-private.h"
+#include "gupnp-dlna-restriction-private.h"
 #include "gupnp-dlna-native-info-set.h"
 
 #endif /* __GUPNP_DLNA_NATIVE_SETS_H__ */
diff --git a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c
index f43ef03..424a70f 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c
+++ b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-utils.c
@@ -28,7 +28,7 @@ gupnp_dlna_native_utils_free_restrictions (GList *list)
         if (list == NULL)
                 return;
         g_list_free_full (list,
-                          (GDestroyNotify) gupnp_dlna_native_restriction_free);
+                          (GDestroyNotify) gupnp_dlna_restriction_free);
 }
 
 gchar *
@@ -39,12 +39,12 @@ gupnp_dlna_native_utils_restrictions_list_to_string (GList *list)
         gchar *final_string;
 
         for (iter = list; iter != NULL; iter = iter->next) {
-                GUPnPDLNANativeRestriction *restriction =
-                                     GUPNP_DLNA_NATIVE_RESTRICTION (iter->data);
+                GUPnPDLNARestriction *restriction =
+                                        GUPNP_DLNA_RESTRICTION (iter->data);
 
                 if (restriction)
                         g_ptr_array_add (strings,
-                                         gupnp_dlna_native_restriction_to_string
+                                         gupnp_dlna_restriction_to_string
                                                             (restriction));
         }
 
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.c b/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.c
index c7b2bfd..832ea0e 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.c
+++ b/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.c
@@ -194,8 +194,8 @@ gupnp_dlna_native_info_set_add_unsupported_string
 
 gboolean
 gupnp_dlna_native_info_set_fits_restriction
-                                       (GUPnPDLNANativeInfoSet     *info_set,
-                                        GUPnPDLNANativeRestriction *restriction)
+                                       (GUPnPDLNANativeInfoSet *info_set,
+                                        GUPnPDLNARestriction   *restriction)
 {
         GHashTableIter iter;
         gpointer key;
@@ -206,12 +206,12 @@ gupnp_dlna_native_info_set_fits_restriction
         g_return_val_if_fail (restriction != NULL, FALSE);
 
         if (g_strcmp0 (info_set->mime,
-                       gupnp_dlna_native_restriction_get_mime (restriction)))
+                       gupnp_dlna_restriction_get_mime (restriction)))
                 return FALSE;
 
         unsupported_match = FALSE;
         g_hash_table_iter_init (&iter,
-                                gupnp_dlna_native_restriction_get_entries
+                                gupnp_dlna_restriction_get_entries
                                         (restriction));
         while (g_hash_table_iter_next (&iter, &key, &value)) {
                 GUPnPDLNANativeInfoValue *info_value;
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.h b/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.h
index 5b87ce6..df4c4b0 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.h
+++ b/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-info-set.h
@@ -23,8 +23,7 @@
 #define __GUPNP_DLNA_NATIVE_INFO_SET_H__
 
 #include <glib.h>
-
-#include "gupnp-dlna-native-restriction.h"
+#include "gupnp-dlna-restriction.h"
 
 G_BEGIN_DECLS
 
@@ -79,8 +78,8 @@ gupnp_dlna_native_info_set_add_unsupported_string
 
 gboolean
 gupnp_dlna_native_info_set_fits_restriction
-                                      (GUPnPDLNANativeInfoSet     *info_set,
-                                       GUPnPDLNANativeRestriction *restriction);
+                                      (GUPnPDLNANativeInfoSet *info_set,
+                                       GUPnPDLNARestriction   *restriction);
 
 gchar *
 gupnp_dlna_native_info_set_to_string (GUPnPDLNANativeInfoSet *info_set);
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-sets-private.h b/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-sets-private.h
index 053b20c..4ef2838 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-sets-private.h
+++ b/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-sets-private.h
@@ -26,7 +26,7 @@
 #include "gupnp-dlna-native-value-type.h"
 #include "gupnp-dlna-native-value-list.h"
 #include "gupnp-dlna-native-info-value.h"
-#include "gupnp-dlna-native-restriction-private.h"
+#include "gupnp-dlna-restriction-private.h"
 
 G_BEGIN_DECLS
 
@@ -120,8 +120,7 @@ gupnp_dlna_native_info_value_get_value (GUPnPDLNANativeInfoValue *info);
 
 /* Restriction */
 GHashTable *
-gupnp_dlna_native_restriction_get_entries
-                                      (GUPnPDLNANativeRestriction *restriction);
+gupnp_dlna_restriction_get_entries (GUPnPDLNARestriction *restriction);
 
 G_END_DECLS
 
diff --git a/libgupnp-dlna/profile-backends/native/sets/sets.am b/libgupnp-dlna/profile-backends/native/sets/sets.am
index 816be70..50dcdcc 100644
--- a/libgupnp-dlna/profile-backends/native/sets/sets.am
+++ b/libgupnp-dlna/profile-backends/native/sets/sets.am
@@ -3,8 +3,6 @@ sets_sources = \
 	profile-backends/native/sets/gupnp-dlna-native-info-set.h \
 	profile-backends/native/sets/gupnp-dlna-native-info-value.c \
 	profile-backends/native/sets/gupnp-dlna-native-info-value.h \
-	profile-backends/native/sets/gupnp-dlna-native-restriction.c \
-	profile-backends/native/sets/gupnp-dlna-native-restriction.h \
 	profile-backends/native/sets/gupnp-dlna-native-sets-private.h \
 	profile-backends/native/sets/gupnp-dlna-native-value.c \
 	profile-backends/native/sets/gupnp-dlna-native-value.h \
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 81668f3..da77f98 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -13,5 +13,6 @@ sets_CFLAGS = \
 	$(GOBJECT_CFLAGS) \
 	$(LIBXML_CFLAGS) \
 	$(GMODULE_CFLAGS) \
+	-I$(top_srcdir)/libgupnp-dlna \
 	-I$(top_srcdir)/libgupnp-dlna/profile-backends/native \
 	-I$(top_srcdir)/libgupnp-dlna/profile-backends/native/sets
diff --git a/tests/sets.c b/tests/sets.c
index 8d60fcf..a8eb4c0 100644
--- a/tests/sets.c
+++ b/tests/sets.c
@@ -179,69 +179,69 @@ value_list_range (void)
 static void
 restriction_construction (void)
 {
-        GUPnPDLNANativeRestriction *r = gupnp_dlna_native_restriction_new
+        GUPnPDLNARestriction *r = gupnp_dlna_restriction_new
                                         (NULL);
-        GHashTable *e = gupnp_dlna_native_restriction_get_entries (r);
+        GHashTable *e = gupnp_dlna_restriction_get_entries (r);
 
-        g_assert_cmpstr (gupnp_dlna_native_restriction_get_mime (r), ==, NULL);
+        g_assert_cmpstr (gupnp_dlna_restriction_get_mime (r), ==, NULL);
         g_assert_cmpuint (g_hash_table_size (e), ==, 0);
-        gupnp_dlna_native_restriction_free (r);
+        gupnp_dlna_restriction_free (r);
 
-        r = gupnp_dlna_native_restriction_new ("mime");
-        e = gupnp_dlna_native_restriction_get_entries (r);
-        g_assert_cmpstr (gupnp_dlna_native_restriction_get_mime (r), ==, "mime");
+        r = gupnp_dlna_restriction_new ("mime");
+        e = gupnp_dlna_restriction_get_entries (r);
+        g_assert_cmpstr (gupnp_dlna_restriction_get_mime (r), ==, "mime");
         g_assert_cmpuint (g_hash_table_size (e), ==, 0);
-        gupnp_dlna_native_restriction_free (r);
+        gupnp_dlna_restriction_free (r);
 }
 
 static void
 restriction_empty (void)
 {
-        GUPnPDLNANativeRestriction *r =
-                                       gupnp_dlna_native_restriction_new (NULL);
+        GUPnPDLNARestriction *r =
+                                       gupnp_dlna_restriction_new (NULL);
         GUPnPDLNANativeValueList *list = gupnp_dlna_native_value_list_new
                                          (gupnp_dlna_native_value_type_bool ());
 
-        g_assert (gupnp_dlna_native_restriction_is_empty (r));
+        g_assert (gupnp_dlna_restriction_is_empty (r));
         gupnp_dlna_native_value_list_add_single (list, "true");
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r,
+        g_assert (gupnp_dlna_restriction_add_value_list (r,
                                                                 "bool",
                                                                 list));
-        g_assert (!gupnp_dlna_native_restriction_is_empty (r));
-        gupnp_dlna_native_restriction_free (r);
-        r = gupnp_dlna_native_restriction_new ("mime");
-        g_assert (!gupnp_dlna_native_restriction_is_empty (r));
-        gupnp_dlna_native_restriction_free (r);
+        g_assert (!gupnp_dlna_restriction_is_empty (r));
+        gupnp_dlna_restriction_free (r);
+        r = gupnp_dlna_restriction_new ("mime");
+        g_assert (!gupnp_dlna_restriction_is_empty (r));
+        gupnp_dlna_restriction_free (r);
 }
 
 static void
 restriction_adding_value_lists (void)
 {
-        GUPnPDLNANativeRestriction *r =
-                                       gupnp_dlna_native_restriction_new (NULL);
+        GUPnPDLNARestriction *r =
+                                       gupnp_dlna_restriction_new (NULL);
         GUPnPDLNANativeValueList *list = gupnp_dlna_native_value_list_new
                                          (gupnp_dlna_native_value_type_bool ());
 
-        g_assert (gupnp_dlna_native_restriction_is_empty (r));
+        g_assert (gupnp_dlna_restriction_is_empty (r));
         /* adding empty value list should fail */
-        g_assert (!gupnp_dlna_native_restriction_add_value_list (r,
+        g_assert (!gupnp_dlna_restriction_add_value_list (r,
                                                                  "bool",
                                                                  list));
-        g_assert (gupnp_dlna_native_restriction_is_empty (r));
+        g_assert (gupnp_dlna_restriction_is_empty (r));
         gupnp_dlna_native_value_list_add_single (list, "true");
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r,
+        g_assert (gupnp_dlna_restriction_add_value_list (r,
                                                                 "bool",
                                                                 list));
-        g_assert (!gupnp_dlna_native_restriction_is_empty (r));
+        g_assert (!gupnp_dlna_restriction_is_empty (r));
         list = gupnp_dlna_native_value_list_new
                                          (gupnp_dlna_native_value_type_bool ());
         gupnp_dlna_native_value_list_add_single (list, "false");
         /* adding value list with already existing name should fail */
-        g_assert (!gupnp_dlna_native_restriction_add_value_list (r,
+        g_assert (!gupnp_dlna_restriction_add_value_list (r,
                                                                  "bool",
                                                                  list));
         gupnp_dlna_native_value_list_free (list);
-        gupnp_dlna_native_restriction_free (r);
+        gupnp_dlna_restriction_free (r);
 }
 
 static void
@@ -278,35 +278,35 @@ info_set_adding_values (void)
 static void
 info_set_fit (void)
 {
-        GUPnPDLNANativeRestriction *r =
-                                     gupnp_dlna_native_restriction_new ("mime");
+        GUPnPDLNARestriction *r =
+                                     gupnp_dlna_restriction_new ("mime");
         GUPnPDLNANativeValueList *v = gupnp_dlna_native_value_list_new
                                           (gupnp_dlna_native_value_type_bool());
         GUPnPDLNANativeInfoSet *s;
 
         /* restriction */
         g_assert (gupnp_dlna_native_value_list_add_single (v, "true"));
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r, "b1", v));
+        g_assert (gupnp_dlna_restriction_add_value_list (r, "b1", v));
         v = gupnp_dlna_native_value_list_new
                                       (gupnp_dlna_native_value_type_fraction());
         g_assert (gupnp_dlna_native_value_list_add_single (v, "1/2"));
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r, "f1", v));
+        g_assert (gupnp_dlna_restriction_add_value_list (r, "f1", v));
         v = gupnp_dlna_native_value_list_new
                                       (gupnp_dlna_native_value_type_fraction());
         g_assert (gupnp_dlna_native_value_list_add_range (v, "1/4", "2/3"));
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r, "f2", v));
+        g_assert (gupnp_dlna_restriction_add_value_list (r, "f2", v));
         v = gupnp_dlna_native_value_list_new
                                            (gupnp_dlna_native_value_type_int());
         g_assert (gupnp_dlna_native_value_list_add_single (v, "13"));
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r, "i1", v));
+        g_assert (gupnp_dlna_restriction_add_value_list (r, "i1", v));
         v = gupnp_dlna_native_value_list_new
                                            (gupnp_dlna_native_value_type_int());
         g_assert (gupnp_dlna_native_value_list_add_range (v, "42", "55"));
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r, "i2", v));
+        g_assert (gupnp_dlna_restriction_add_value_list (r, "i2", v));
         v = gupnp_dlna_native_value_list_new
                                         (gupnp_dlna_native_value_type_string());
         g_assert (gupnp_dlna_native_value_list_add_single (v, "aaa"));
-        g_assert (gupnp_dlna_native_restriction_add_value_list (r, "s1", v));
+        g_assert (gupnp_dlna_restriction_add_value_list (r, "s1", v));
 
         /* info set with exactly fitting values and same mime*/
         s = gupnp_dlna_native_info_set_new ("mime");
@@ -395,7 +395,7 @@ info_set_fit (void)
         g_assert (gupnp_dlna_native_info_set_fits_restriction (s, r));
 
         gupnp_dlna_native_info_set_free (s);
-        gupnp_dlna_native_restriction_free (r);
+        gupnp_dlna_restriction_free (r);
 }
 
 int



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