[gupnp-dlna/wip/new-api: 12/46] Remove 'Native' from 'GUPnPDLNANativeValueList'.
- From: Krzesimir Nowak <krnowak src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gupnp-dlna/wip/new-api: 12/46] Remove 'Native' from 'GUPnPDLNANativeValueList'.
- Date: Mon, 14 Jan 2013 10:05:35 +0000 (UTC)
commit 8492188e3122e094deadf3735d3ef61aff697e2b
Author: Krzesimir Nowak <krnowak openismus com>
Date: Wed Nov 28 12:55:19 2012 +0100
Remove 'Native' from 'GUPnPDLNANativeValueList'.
Also, moved it to $(top_srcdir)/libgupnp-dlna.
libgupnp-dlna/Makefile.am | 9 +-
libgupnp-dlna/gupnp-dlna-restriction-private.h | 8 +-
libgupnp-dlna/gupnp-dlna-restriction.c | 20 ++--
libgupnp-dlna/gupnp-dlna-restriction.h | 2 +-
...t-private.h => gupnp-dlna-value-list-private.h} | 24 ++--
...native-value-list.c => gupnp-dlna-value-list.c} | 44 +++---
...native-value-list.h => gupnp-dlna-value-list.h} | 18 +-
.../native/gupnp-dlna-native-profile-loader.c | 28 ++--
.../native/gupnp-dlna-native-sets.h | 2 +-
.../native/sets/gupnp-dlna-native-info-set.c | 6 +-
.../native/sets/gupnp-dlna-native-sets-private.h | 13 +-
libgupnp-dlna/profile-backends/native/sets/sets.am | 3 -
tests/sets.c | 156 ++++++++++----------
13 files changed, 165 insertions(+), 168 deletions(-)
---
diff --git a/libgupnp-dlna/Makefile.am b/libgupnp-dlna/Makefile.am
index 0e94a7a..2e6d3b8 100644
--- a/libgupnp-dlna/Makefile.am
+++ b/libgupnp-dlna/Makefile.am
@@ -112,7 +112,8 @@ libgupnp_dlna_2_0_la_SOURCES = \
gupnp-dlna-field-value.c \
gupnp-dlna-profile-backend.c \
gupnp-dlna-profile.c \
- gupnp-dlna-restriction.c
+ gupnp-dlna-restriction.c \
+ gupnp-dlna-value-list.c
libgupnp_dlna_2_0_la_LIBADD = \
$(gupnp_libadd) \
libloader.la \
@@ -129,7 +130,7 @@ libgupnp_dlna_inc_HEADERS = \
gupnp-dlna-profile-guesser.h \
gupnp-dlna-profile.h \
gupnp-dlna-restriction.h \
- profile-backends/native/sets/gupnp-dlna-native-value-list.h
+ gupnp-dlna-value-list.h
libgupnp_dlna_metadata_incdir = \
$(libgupnp_dlna_incdir)/metadata
@@ -147,7 +148,9 @@ dist_noinst_HEADERS += \
gupnp-dlna-metadata-backend.h \
gupnp-dlna-profile-backend.h \
gupnp-dlna-profile-loader.h \
- gupnp-dlna-profile-guesser-impl.h
+ gupnp-dlna-profile-guesser-impl.h \
+ gupnp-dlna-restriction-private.h \
+ gupnp-dlna-value-list-private.h
# INTROSPECTION
diff --git a/libgupnp-dlna/gupnp-dlna-restriction-private.h b/libgupnp-dlna/gupnp-dlna-restriction-private.h
index 43fde4a..7eeaef9 100644
--- a/libgupnp-dlna/gupnp-dlna-restriction-private.h
+++ b/libgupnp-dlna/gupnp-dlna-restriction-private.h
@@ -25,7 +25,7 @@
#include <glib.h>
#include <glib-object.h>
#include "gupnp-dlna-restriction.h"
-#include "gupnp-dlna-native-value-list-private.h"
+#include "gupnp-dlna-value-list-private.h"
G_BEGIN_DECLS
@@ -33,9 +33,9 @@ GUPnPDLNARestriction *
gupnp_dlna_restriction_new (const gchar *mime);
gboolean
-gupnp_dlna_restriction_add_value_list (GUPnPDLNARestriction *restriction,
- const gchar *name,
- GUPnPDLNANativeValueList *list);
+gupnp_dlna_restriction_add_value_list (GUPnPDLNARestriction *restriction,
+ const gchar *name,
+ GUPnPDLNAValueList *list);
void
gupnp_dlna_restriction_merge (GUPnPDLNARestriction *restriction,
diff --git a/libgupnp-dlna/gupnp-dlna-restriction.c b/libgupnp-dlna/gupnp-dlna-restriction.c
index d2789e0..22cc841 100644
--- a/libgupnp-dlna/gupnp-dlna-restriction.c
+++ b/libgupnp-dlna/gupnp-dlna-restriction.c
@@ -26,7 +26,7 @@
struct _GUPnPDLNARestriction {
gchar *mime;
- GHashTable *entries; /* <gchar *, GUPnPDLNANativeValueList *> */
+ GHashTable *entries; /* <gchar *, GUPnPDLNAValueList *> */
};
G_DEFINE_BOXED_TYPE (GUPnPDLNARestriction,
@@ -44,7 +44,7 @@ gupnp_dlna_restriction_new (const gchar *mime)
(g_str_hash,
g_str_equal,
g_free,
- (GDestroyNotify) gupnp_dlna_native_value_list_free);
+ (GDestroyNotify) gupnp_dlna_value_list_free);
return restriction;
}
@@ -62,11 +62,11 @@ gupnp_dlna_restriction_copy (GUPnPDLNARestriction *restriction)
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;
+ GUPnPDLNAValueList *dup_entry;
if (key == NULL || value == NULL)
continue;
- dup_entry = gupnp_dlna_native_value_list_copy (value);
+ dup_entry = gupnp_dlna_value_list_copy (value);
if (dup_entry == NULL)
continue;
@@ -87,19 +87,19 @@ gupnp_dlna_restriction_free (GUPnPDLNARestriction *restriction)
}
gboolean
-gupnp_dlna_restriction_add_value_list (GUPnPDLNARestriction *restriction,
- const gchar *name,
- GUPnPDLNANativeValueList *list)
+gupnp_dlna_restriction_add_value_list (GUPnPDLNARestriction *restriction,
+ const gchar *name,
+ GUPnPDLNAValueList *list)
{
g_return_val_if_fail (restriction != NULL, FALSE);
g_return_val_if_fail (name != NULL, FALSE);
g_return_val_if_fail (list != NULL, FALSE);
- if (gupnp_dlna_native_value_list_is_empty (list))
+ if (gupnp_dlna_value_list_is_empty (list))
return FALSE;
if (g_hash_table_contains (restriction->entries, name))
return FALSE;
- gupnp_dlna_native_value_list_sort_items (list);
+ gupnp_dlna_value_list_sort_items (list);
g_hash_table_insert (restriction->entries, g_strdup (name), list);
return TRUE;
@@ -160,7 +160,7 @@ gupnp_dlna_restriction_to_string (GUPnPDLNARestriction *restriction)
str = g_string_new (restriction->mime ? restriction->mime : "(null)");
g_hash_table_iter_init (&iter, restriction->entries);
while (g_hash_table_iter_next (&iter, &key, &value)) {
- gchar *raw = gupnp_dlna_native_value_list_to_string (value);
+ gchar *raw = gupnp_dlna_value_list_to_string (value);
g_string_append_printf (str, ", %s=%s", (gchar *) key, raw);
g_free (raw);
diff --git a/libgupnp-dlna/gupnp-dlna-restriction.h b/libgupnp-dlna/gupnp-dlna-restriction.h
index 4e3e5c7..a5a9221 100644
--- a/libgupnp-dlna/gupnp-dlna-restriction.h
+++ b/libgupnp-dlna/gupnp-dlna-restriction.h
@@ -25,7 +25,7 @@
#include <glib.h>
#include <glib-object.h>
-#include "gupnp-dlna-native-value-list.h"
+#include "gupnp-dlna-value-list.h"
G_BEGIN_DECLS
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list-private.h b/libgupnp-dlna/gupnp-dlna-value-list-private.h
similarity index 58%
rename from libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list-private.h
rename to libgupnp-dlna/gupnp-dlna-value-list-private.h
index 3c13389..7533faf 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list-private.h
+++ b/libgupnp-dlna/gupnp-dlna-value-list-private.h
@@ -19,31 +19,31 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __GUPNP_DLNA_NATIVE_VALUE_LIST_PRIVATE_H__
-#define __GUPNP_DLNA_NATIVE_VALUE_LIST_PRIVATE_H__
+#ifndef __GUPNP_DLNA_VALUE_LIST_PRIVATE_H__
+#define __GUPNP_DLNA_VALUE_LIST_PRIVATE_H__
#include <glib.h>
-#include "gupnp-dlna-native-value-list.h"
+#include "gupnp-dlna-value-list.h"
#include "gupnp-dlna-native-value-type.h"
G_BEGIN_DECLS
-GUPnPDLNANativeValueList *
-gupnp_dlna_native_value_list_new (GUPnPDLNANativeValueType *type);
+GUPnPDLNAValueList *
+gupnp_dlna_value_list_new (GUPnPDLNANativeValueType *type);
void
-gupnp_dlna_native_value_list_free (GUPnPDLNANativeValueList *list);
+gupnp_dlna_value_list_free (GUPnPDLNAValueList *list);
gboolean
-gupnp_dlna_native_value_list_add_range (GUPnPDLNANativeValueList *list,
- const gchar *min,
- const gchar *max);
+gupnp_dlna_value_list_add_range (GUPnPDLNAValueList *list,
+ const gchar *min,
+ const gchar *max);
gboolean
-gupnp_dlna_native_value_list_add_single (GUPnPDLNANativeValueList *list,
- const gchar *single);
+gupnp_dlna_value_list_add_single (GUPnPDLNAValueList *list,
+ const gchar *single);
G_END_DECLS
-#endif /* __GUPNP_DLNA_NATIVE_VALUE_LIST_PRIVATE_H__ */
+#endif /* __GUPNP_DLNA_VALUE_LIST_PRIVATE_H__ */
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list.c b/libgupnp-dlna/gupnp-dlna-value-list.c
similarity index 85%
rename from libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list.c
rename to libgupnp-dlna/gupnp-dlna-value-list.c
index 6bcdbbf..ba5a0fb 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list.c
+++ b/libgupnp-dlna/gupnp-dlna-value-list.c
@@ -19,24 +19,24 @@
* Boston, MA 02110-1301, USA.
*/
-#include "gupnp-dlna-native-value-list-private.h"
+#include "gupnp-dlna-value-list-private.h"
#include "gupnp-dlna-native-value.h"
#include "gupnp-dlna-native-sets-private.h"
-struct _GUPnPDLNANativeValueList {
+struct _GUPnPDLNAValueList {
GUPnPDLNANativeValueType *type;
GList *values; /* <GUPnPDLNANativeValue *> */
gboolean sorted;
};
-GUPnPDLNANativeValueList *
-gupnp_dlna_native_value_list_new (GUPnPDLNANativeValueType *type)
+GUPnPDLNAValueList *
+gupnp_dlna_value_list_new (GUPnPDLNANativeValueType *type)
{
- GUPnPDLNANativeValueList *list;
+ GUPnPDLNAValueList *list;
g_return_val_if_fail (type != NULL, NULL);
- list = g_slice_new (GUPnPDLNANativeValueList);
+ list = g_slice_new (GUPnPDLNAValueList);
list->type = type;
list->values = NULL;
list->sorted = FALSE;
@@ -52,7 +52,7 @@ free_value (GUPnPDLNANativeValue *value,
}
static void
-free_value_list (GUPnPDLNANativeValueList *list)
+free_value_list (GUPnPDLNAValueList *list)
{
if (list->values) {
g_list_foreach (list->values,
@@ -64,13 +64,13 @@ free_value_list (GUPnPDLNANativeValueList *list)
}
void
-gupnp_dlna_native_value_list_free (GUPnPDLNANativeValueList *list)
+gupnp_dlna_value_list_free (GUPnPDLNAValueList *list)
{
if (!list)
return;
free_value_list (list);
- g_slice_free (GUPnPDLNANativeValueList, list);
+ g_slice_free (GUPnPDLNAValueList, list);
}
static gint
@@ -82,7 +82,7 @@ value_compare (GUPnPDLNANativeValue *a,
}
static gboolean
-insert_value (GUPnPDLNANativeValueList *list,
+insert_value (GUPnPDLNAValueList *list,
GUPnPDLNANativeValue *value)
{
if (value) {
@@ -101,7 +101,7 @@ insert_value (GUPnPDLNANativeValueList *list,
}
gboolean
-gupnp_dlna_native_value_list_add_single (GUPnPDLNANativeValueList *list,
+gupnp_dlna_value_list_add_single (GUPnPDLNAValueList *list,
const gchar *single)
{
GUPnPDLNANativeValue *value;
@@ -115,7 +115,7 @@ gupnp_dlna_native_value_list_add_single (GUPnPDLNANativeValueList *list,
}
gboolean
-gupnp_dlna_native_value_list_add_range (GUPnPDLNANativeValueList *list,
+gupnp_dlna_value_list_add_range (GUPnPDLNAValueList *list,
const gchar *min,
const gchar *max)
{
@@ -136,15 +136,15 @@ gupnp_dlna_native_value_list_add_range (GUPnPDLNANativeValueList *list,
}
/* private */
-GUPnPDLNANativeValueList *
-gupnp_dlna_native_value_list_copy (GUPnPDLNANativeValueList *list)
+GUPnPDLNAValueList *
+gupnp_dlna_value_list_copy (GUPnPDLNAValueList *list)
{
- GUPnPDLNANativeValueList *dup;
+ GUPnPDLNAValueList *dup;
if (list) {
GList *iter;
- dup = gupnp_dlna_native_value_list_new (list->type);
+ dup = gupnp_dlna_value_list_new (list->type);
for (iter = list->values; iter != NULL; iter = iter->next) {
GUPnPDLNANativeValue *base =
(GUPnPDLNANativeValue *) iter->data;
@@ -167,7 +167,7 @@ gupnp_dlna_native_value_list_copy (GUPnPDLNANativeValueList *list)
}
gboolean
-gupnp_dlna_native_value_list_is_superset (GUPnPDLNANativeValueList *list,
+gupnp_dlna_value_list_is_superset (GUPnPDLNAValueList *list,
GUPnPDLNANativeInfoValue *value,
gboolean *unsupported)
{
@@ -201,7 +201,7 @@ gupnp_dlna_native_value_list_is_superset (GUPnPDLNANativeValueList *list,
}
gboolean
-gupnp_dlna_native_value_list_is_empty (GUPnPDLNANativeValueList *value_list)
+gupnp_dlna_value_list_is_empty (GUPnPDLNAValueList *value_list)
{
g_return_val_if_fail (value_list != NULL, TRUE);
@@ -209,7 +209,7 @@ gupnp_dlna_native_value_list_is_empty (GUPnPDLNANativeValueList *value_list)
}
GList *
-gupnp_dlna_native_value_list_get_list (GUPnPDLNANativeValueList *value_list)
+gupnp_dlna_value_list_get_list (GUPnPDLNAValueList *value_list)
{
g_return_val_if_fail (value_list != NULL, NULL);
@@ -217,7 +217,7 @@ gupnp_dlna_native_value_list_get_list (GUPnPDLNANativeValueList *value_list)
}
static gchar *
-list_to_string (GUPnPDLNANativeValueList *value_list)
+list_to_string (GUPnPDLNAValueList *value_list)
{
GList *iter;
GPtrArray* strings = g_ptr_array_new_with_free_func (g_free);
@@ -241,7 +241,7 @@ list_to_string (GUPnPDLNANativeValueList *value_list)
}
gchar *
-gupnp_dlna_native_value_list_to_string (GUPnPDLNANativeValueList *value_list)
+gupnp_dlna_value_list_to_string (GUPnPDLNAValueList *value_list)
{
GString *str;
gchar *val_str;
@@ -271,7 +271,7 @@ gupnp_dlna_native_value_list_to_string (GUPnPDLNANativeValueList *value_list)
}
void
-gupnp_dlna_native_value_list_sort_items (GUPnPDLNANativeValueList *value_list)
+gupnp_dlna_value_list_sort_items (GUPnPDLNAValueList *value_list)
{
g_return_if_fail (value_list != NULL);
diff --git a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list.h b/libgupnp-dlna/gupnp-dlna-value-list.h
similarity index 65%
rename from libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list.h
rename to libgupnp-dlna/gupnp-dlna-value-list.h
index f1cc405..a9721d8 100644
--- a/libgupnp-dlna/profile-backends/native/sets/gupnp-dlna-native-value-list.h
+++ b/libgupnp-dlna/gupnp-dlna-value-list.h
@@ -19,28 +19,28 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __GUPNP_DLNA_NATIVE_VALUE_LIST_H__
-#define __GUPNP_DLNA_NATIVE_VALUE_LIST_H__
+#ifndef __GUPNP_DLNA_VALUE_LIST_H__
+#define __GUPNP_DLNA_VALUE_LIST_H__
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS
-typedef struct _GUPnPDLNANativeValueList GUPnPDLNANativeValueList;
+typedef struct _GUPnPDLNAValueList GUPnPDLNAValueList;
-GUPnPDLNANativeValueList *
-gupnp_dlna_native_value_list_copy (GUPnPDLNANativeValueList *list);
+GUPnPDLNAValueList *
+gupnp_dlna_value_list_copy (GUPnPDLNAValueList *list);
void
-gupnp_dlna_native_value_list_free (GUPnPDLNANativeValueList *list);
+gupnp_dlna_value_list_free (GUPnPDLNAValueList *list);
gboolean
-gupnp_dlna_native_value_list_is_empty (GUPnPDLNANativeValueList *list);
+gupnp_dlna_value_list_is_empty (GUPnPDLNAValueList *list);
gchar *
-gupnp_dlna_native_value_list_to_string (GUPnPDLNANativeValueList *list);
+gupnp_dlna_value_list_to_string (GUPnPDLNAValueList *list);
G_END_DECLS
-#endif /* __GUPNP_DLNA_NATIVE_VALUE_LIST_H__ */
+#endif /* __GUPNP_DLNA_VALUE_LIST_H__ */
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 31da177..0150eb1 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
@@ -59,7 +59,7 @@ typedef struct {
typedef struct {
gchar *name;
- GUPnPDLNANativeValueList *list;
+ GUPnPDLNAValueList *list;
} GUPnPDLNANativeNameValueListPair;
typedef struct {
@@ -80,8 +80,8 @@ struct _GUPnPDLNANativeProfileLoaderPrivate {
};
static GUPnPDLNANativeNameValueListPair *
-gupnp_dlna_native_name_value_list_pair_new (const gchar *name,
- GUPnPDLNANativeValueList *list)
+gupnp_dlna_native_name_value_list_pair_new (const gchar *name,
+ GUPnPDLNAValueList *list)
{
GUPnPDLNANativeNameValueListPair *pair =
g_slice_new (GUPnPDLNANativeNameValueListPair);
@@ -99,7 +99,7 @@ gupnp_dlna_native_name_value_list_pair_free
if (pair == NULL)
return;
g_free (pair->name);
- gupnp_dlna_native_value_list_free (pair->list);
+ gupnp_dlna_value_list_free (pair->list);
g_slice_free (GUPnPDLNANativeNameValueListPair, pair);
}
@@ -264,26 +264,24 @@ value_type_from_string (const gchar *type)
}
static void
-append_value_to_list (GUPnPDLNAFieldValue *value,
- GUPnPDLNANativeValueList *list)
+append_value_to_list (GUPnPDLNAFieldValue *value,
+ GUPnPDLNAValueList *list)
{
if (value == NULL)
return;
switch (value->type) {
case GUPNP_DLNA_FIELD_VALUE_TYPE_RANGE:
- if (!gupnp_dlna_native_value_list_add_range
- (list,
- value->value.range.min,
- value->value.range.max))
+ if (!gupnp_dlna_value_list_add_range (list,
+ value->value.range.min,
+ value->value.range.max))
g_warning ("Failed to add range value (%s, %s).",
value->value.range.min,
value->value.range.max);
break;
case GUPNP_DLNA_FIELD_VALUE_TYPE_SINGLE:
- if (!gupnp_dlna_native_value_list_add_single
- (list,
- value->value.single))
+ if (!gupnp_dlna_value_list_add_single (list,
+ value->value.single))
g_warning ("Failed to add single value (%s).",
value->value.single);
@@ -304,7 +302,7 @@ backend_post_field (GUPnPDLNAProfileLoader *loader,
GUPnPDLNANativeProfileLoaderPrivate *priv;
GUPnPDLNANativeRestrictionData *restriction_data;
GUPnPDLNANativeNameValueListPair *pair;
- GUPnPDLNANativeValueList *value_list;
+ GUPnPDLNAValueList *value_list;
GUPnPDLNANativeValueType* value_type;
GList *iter;
@@ -321,7 +319,7 @@ backend_post_field (GUPnPDLNAProfileLoader *loader,
priv = native_loader->priv;
restriction_data =
(GUPnPDLNANativeRestrictionData *) priv->restriction_data_stack->data;
- value_list = gupnp_dlna_native_value_list_new (value_type);
+ value_list = gupnp_dlna_value_list_new (value_type);
for (iter = values; iter != NULL; iter = iter->next) {
GUPnPDLNAFieldValue *field_value =
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 2327132..3028c17 100644
--- a/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-sets.h
+++ b/libgupnp-dlna/profile-backends/native/gupnp-dlna-native-sets.h
@@ -23,7 +23,7 @@
#define __GUPNP_DLNA_NATIVE_SETS_H__
#include "gupnp-dlna-native-value-type.h"
-#include "gupnp-dlna-native-value-list-private.h"
+#include "gupnp-dlna-value-list-private.h"
#include "gupnp-dlna-restriction-private.h"
#include "gupnp-dlna-native-info-set.h"
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 832ea0e..b24eb05 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
@@ -215,7 +215,7 @@ gupnp_dlna_native_info_set_fits_restriction
(restriction));
while (g_hash_table_iter_next (&iter, &key, &value)) {
GUPnPDLNANativeInfoValue *info_value;
- GUPnPDLNANativeValueList *value_list;
+ GUPnPDLNAValueList *value_list;
gboolean unsupported;
if (!g_hash_table_lookup_extended (info_set->entries,
@@ -223,8 +223,8 @@ gupnp_dlna_native_info_set_fits_restriction
NULL,
(gpointer *) &info_value))
return FALSE;
- value_list = (GUPnPDLNANativeValueList *) value;
- if (!gupnp_dlna_native_value_list_is_superset (value_list,
+ value_list = (GUPnPDLNAValueList *) value;
+ if (!gupnp_dlna_value_list_is_superset (value_list,
info_value,
&unsupported))
return FALSE;
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 1c7ee95..b858bb0 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
@@ -24,7 +24,7 @@
#include <glib.h>
#include "gupnp-dlna-native-value-type.h"
-#include "gupnp-dlna-native-value-list-private.h"
+#include "gupnp-dlna-value-list-private.h"
#include "gupnp-dlna-native-info-value.h"
#include "gupnp-dlna-restriction-private.h"
@@ -91,16 +91,15 @@ gupnp_dlna_native_value_type_compare (GUPnPDLNANativeValueType *type,
/* ValueList */
gboolean
-gupnp_dlna_native_value_list_is_superset
- (GUPnPDLNANativeValueList *list,
- GUPnPDLNANativeInfoValue *value,
- gboolean *unsupported);
+gupnp_dlna_value_list_is_superset (GUPnPDLNAValueList *list,
+ GUPnPDLNANativeInfoValue *value,
+ gboolean *unsupported);
GList *
-gupnp_dlna_native_value_list_get_list (GUPnPDLNANativeValueList *value_list);
+gupnp_dlna_value_list_get_list (GUPnPDLNAValueList *value_list);
void
-gupnp_dlna_native_value_list_sort_items (GUPnPDLNANativeValueList *value_list);
+gupnp_dlna_value_list_sort_items (GUPnPDLNAValueList *value_list);
/* InfoValue */
GUPnPDLNANativeValueType *
diff --git a/libgupnp-dlna/profile-backends/native/sets/sets.am b/libgupnp-dlna/profile-backends/native/sets/sets.am
index 0df2b95..da341df 100644
--- a/libgupnp-dlna/profile-backends/native/sets/sets.am
+++ b/libgupnp-dlna/profile-backends/native/sets/sets.am
@@ -6,8 +6,5 @@ sets_sources = \
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 \
- profile-backends/native/sets/gupnp-dlna-native-value-list.c \
- profile-backends/native/sets/gupnp-dlna-native-value-list.h \
- profile-backends/native/sets/gupnp-dlna-native-value-list-private.h \
profile-backends/native/sets/gupnp-dlna-native-value-type.c \
profile-backends/native/sets/gupnp-dlna-native-value-type.h
diff --git a/tests/sets.c b/tests/sets.c
index a8eb4c0..f638255 100644
--- a/tests/sets.c
+++ b/tests/sets.c
@@ -35,145 +35,145 @@ value_type_not_null (void)
static void
value_list_single (void)
{
- GUPnPDLNANativeValueList *list;
+ GUPnPDLNAValueList *list;
gboolean result;
/* bool */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_bool ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_single (list, "true");
+ result = gupnp_dlna_value_list_add_single (list, "true");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "false");
+ result = gupnp_dlna_value_list_add_single (list, "false");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "wrong");
+ result = gupnp_dlna_value_list_add_single (list, "wrong");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
/* fraction */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_fraction ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_single (list, "1/2");
+ result = gupnp_dlna_value_list_add_single (list, "1/2");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "15/3");
+ result = gupnp_dlna_value_list_add_single (list, "15/3");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "wrong");
+ result = gupnp_dlna_value_list_add_single (list, "wrong");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_single (list, "1/0");
+ result = gupnp_dlna_value_list_add_single (list, "1/0");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_single (list, "1/2/3");
+ result = gupnp_dlna_value_list_add_single (list, "1/2/3");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_single (list, "wrong/bad");
+ result = gupnp_dlna_value_list_add_single (list, "wrong/bad");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
/* int */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_int ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_single (list, "1");
+ result = gupnp_dlna_value_list_add_single (list, "1");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "-15");
+ result = gupnp_dlna_value_list_add_single (list, "-15");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "wrong");
+ result = gupnp_dlna_value_list_add_single (list, "wrong");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_single (list, "1.4");
+ result = gupnp_dlna_value_list_add_single (list, "1.4");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
/* string */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_string ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_single (list, "1");
+ result = gupnp_dlna_value_list_add_single (list, "1");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "-15");
+ result = gupnp_dlna_value_list_add_single (list, "-15");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "wrong");
+ result = gupnp_dlna_value_list_add_single (list, "wrong");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_single (list, "1.4");
+ result = gupnp_dlna_value_list_add_single (list, "1.4");
g_assert (result == TRUE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
}
static void
value_list_range (void)
{
- GUPnPDLNANativeValueList *list;
+ GUPnPDLNAValueList *list;
gboolean result;
/* bool ranges have no sense. */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_bool ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_range (list, "true", "true");
+ result = gupnp_dlna_value_list_add_range (list, "true", "true");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "false", "true");
+ result = gupnp_dlna_value_list_add_range (list, "false", "true");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "false", "false");
+ result = gupnp_dlna_value_list_add_range (list, "false", "false");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "false", "true");
+ result = gupnp_dlna_value_list_add_range (list, "false", "true");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "false", "wrong");
+ result = gupnp_dlna_value_list_add_range (list, "false", "wrong");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "wrong", "true");
+ result = gupnp_dlna_value_list_add_range (list, "wrong", "true");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "wrong", "bad");
+ result = gupnp_dlna_value_list_add_range (list, "wrong", "bad");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
/* fraction */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_fraction ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_range (list, "1/2", "3/4");
+ result = gupnp_dlna_value_list_add_range (list, "1/2", "3/4");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_range (list, "-8/3", "15/3");
+ result = gupnp_dlna_value_list_add_range (list, "-8/3", "15/3");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_range (list, "wrong", "bad");
+ result = gupnp_dlna_value_list_add_range (list, "wrong", "bad");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1/0", "-4/3");
+ result = gupnp_dlna_value_list_add_range (list, "1/0", "-4/3");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1/2/3", "3/2");
+ result = gupnp_dlna_value_list_add_range (list, "1/2/3", "3/2");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "a/b", "c/d");
+ result = gupnp_dlna_value_list_add_range (list, "a/b", "c/d");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1/2", "1/4");
+ result = gupnp_dlna_value_list_add_range (list, "1/2", "1/4");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1/2", "-1/2");
+ result = gupnp_dlna_value_list_add_range (list, "1/2", "-1/2");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
/* int */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_int ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_range (list, "1", "3");
+ result = gupnp_dlna_value_list_add_range (list, "1", "3");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_range (list, "-15", "15");
+ result = gupnp_dlna_value_list_add_range (list, "-15", "15");
g_assert (result == TRUE);
- result = gupnp_dlna_native_value_list_add_range (list, "wrong", "bad");
+ result = gupnp_dlna_value_list_add_range (list, "wrong", "bad");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1.4", "3");
+ result = gupnp_dlna_value_list_add_range (list, "1.4", "3");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1", "-3");
+ result = gupnp_dlna_value_list_add_range (list, "1", "-3");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
/* string ranges have no sense */
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_string ());
g_assert (list != NULL);
- result = gupnp_dlna_native_value_list_add_range (list, "1", "3");
+ result = gupnp_dlna_value_list_add_range (list, "1", "3");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "-15", "x");
+ result = gupnp_dlna_value_list_add_range (list, "-15", "x");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "wrong", "bad");
+ result = gupnp_dlna_value_list_add_range (list, "wrong", "bad");
g_assert (result == FALSE);
- result = gupnp_dlna_native_value_list_add_range (list, "1.4", "-1");
+ result = gupnp_dlna_value_list_add_range (list, "1.4", "-1");
g_assert (result == FALSE);
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
}
static void
@@ -199,11 +199,11 @@ restriction_empty (void)
{
GUPnPDLNARestriction *r =
gupnp_dlna_restriction_new (NULL);
- GUPnPDLNANativeValueList *list = gupnp_dlna_native_value_list_new
+ GUPnPDLNAValueList *list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_bool ());
g_assert (gupnp_dlna_restriction_is_empty (r));
- gupnp_dlna_native_value_list_add_single (list, "true");
+ gupnp_dlna_value_list_add_single (list, "true");
g_assert (gupnp_dlna_restriction_add_value_list (r,
"bool",
list));
@@ -219,7 +219,7 @@ restriction_adding_value_lists (void)
{
GUPnPDLNARestriction *r =
gupnp_dlna_restriction_new (NULL);
- GUPnPDLNANativeValueList *list = gupnp_dlna_native_value_list_new
+ GUPnPDLNAValueList *list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_bool ());
g_assert (gupnp_dlna_restriction_is_empty (r));
@@ -228,19 +228,19 @@ restriction_adding_value_lists (void)
"bool",
list));
g_assert (gupnp_dlna_restriction_is_empty (r));
- gupnp_dlna_native_value_list_add_single (list, "true");
+ gupnp_dlna_value_list_add_single (list, "true");
g_assert (gupnp_dlna_restriction_add_value_list (r,
"bool",
list));
g_assert (!gupnp_dlna_restriction_is_empty (r));
- list = gupnp_dlna_native_value_list_new
+ list = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_bool ());
- gupnp_dlna_native_value_list_add_single (list, "false");
+ gupnp_dlna_value_list_add_single (list, "false");
/* adding value list with already existing name should fail */
g_assert (!gupnp_dlna_restriction_add_value_list (r,
"bool",
list));
- gupnp_dlna_native_value_list_free (list);
+ gupnp_dlna_value_list_free (list);
gupnp_dlna_restriction_free (r);
}
@@ -280,32 +280,32 @@ info_set_fit (void)
{
GUPnPDLNARestriction *r =
gupnp_dlna_restriction_new ("mime");
- GUPnPDLNANativeValueList *v = gupnp_dlna_native_value_list_new
+ GUPnPDLNAValueList *v = gupnp_dlna_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_value_list_add_single (v, "true"));
g_assert (gupnp_dlna_restriction_add_value_list (r, "b1", v));
- v = gupnp_dlna_native_value_list_new
+ v = gupnp_dlna_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_value_list_add_single (v, "1/2"));
g_assert (gupnp_dlna_restriction_add_value_list (r, "f1", v));
- v = gupnp_dlna_native_value_list_new
+ v = gupnp_dlna_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_value_list_add_range (v, "1/4", "2/3"));
g_assert (gupnp_dlna_restriction_add_value_list (r, "f2", v));
- v = gupnp_dlna_native_value_list_new
+ v = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_int());
- g_assert (gupnp_dlna_native_value_list_add_single (v, "13"));
+ g_assert (gupnp_dlna_value_list_add_single (v, "13"));
g_assert (gupnp_dlna_restriction_add_value_list (r, "i1", v));
- v = gupnp_dlna_native_value_list_new
+ v = gupnp_dlna_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_value_list_add_range (v, "42", "55"));
g_assert (gupnp_dlna_restriction_add_value_list (r, "i2", v));
- v = gupnp_dlna_native_value_list_new
+ v = gupnp_dlna_value_list_new
(gupnp_dlna_native_value_type_string());
- g_assert (gupnp_dlna_native_value_list_add_single (v, "aaa"));
+ g_assert (gupnp_dlna_value_list_add_single (v, "aaa"));
g_assert (gupnp_dlna_restriction_add_value_list (r, "s1", v));
/* info set with exactly fitting values and same mime*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]