[gupnp-dlna/wip/new-api: 38/46] Move value into main source directory.



commit bd8ef4678ef5f74e41ca4b30f3f424cf24d5418b
Author: Krzesimir Nowak <krnowak openismus com>
Date:   Thu Jan 3 15:07:01 2013 +0100

    Move value into main source directory.

 libgupnp-dlna/Makefile.am                          |    6 +-
 libgupnp-dlna/gupnp-dlna-value-list.c              |   62 +--
 libgupnp-dlna/gupnp-dlna-value.c                   |  444 +++++++++++++++++++
 libgupnp-dlna/gupnp-dlna-value.h                   |   76 ++++
 .../native/sets/gupnp-dlna-native-value.c          |  465 --------------------
 .../native/sets/gupnp-dlna-native-value.h          |   76 ----
 libgupnp-dlna/profile-backends/native/sets/sets.am |    4 +-
 7 files changed, 550 insertions(+), 583 deletions(-)
---
diff --git a/libgupnp-dlna/Makefile.am b/libgupnp-dlna/Makefile.am
index a668f44..54fcd69 100644
--- a/libgupnp-dlna/Makefile.am
+++ b/libgupnp-dlna/Makefile.am
@@ -122,7 +122,8 @@ libgupnp_dlna_2_0_la_SOURCES = \
 	gupnp-dlna-g-values.c \
 	gupnp-dlna-utils.c \
 	gupnp-dlna-value-type.c \
-	gupnp-dlna-info-value.c
+	gupnp-dlna-info-value.c \
+	gupnp-dlna-value.c
 libgupnp_dlna_2_0_la_LIBADD = \
 	$(gupnp_libadd) \
 	libloader.la \
@@ -164,7 +165,8 @@ dist_noinst_HEADERS += \
 	gupnp-dlna-utils.h \
 	gupnp-dlna-value-union.h \
 	gupnp-dlna-value-type.h \
-	gupnp-dlna-info-value.h
+	gupnp-dlna-info-value.h \
+	gupnp-dlna-value.h
 
 
 # INTROSPECTION
diff --git a/libgupnp-dlna/gupnp-dlna-value-list.c b/libgupnp-dlna/gupnp-dlna-value-list.c
index c208eed..70186fc 100644
--- a/libgupnp-dlna/gupnp-dlna-value-list.c
+++ b/libgupnp-dlna/gupnp-dlna-value-list.c
@@ -20,12 +20,12 @@
  */
 
 #include "gupnp-dlna-value-list-private.h"
-#include "gupnp-dlna-native-value.h"
+#include "gupnp-dlna-value.h"
 #include "gupnp-dlna-info-value.h"
 
 struct _GUPnPDLNAValueList {
         GUPnPDLNAValueType *type;
-        GList              *values; /* <GUPnPDLNANativeValue *> */
+        GList              *values; /* <GUPnPDLNAValue *> */
         gboolean            sorted;
 };
 
@@ -50,18 +50,11 @@ gupnp_dlna_value_list_new (GUPnPDLNAValueType *type)
 }
 
 static void
-free_value (GUPnPDLNANativeValue     *value,
-            GUPnPDLNAValueType *type)
-{
-        gupnp_dlna_native_value_free (value, type);
-}
-
-static void
 free_value_list (GUPnPDLNAValueList *list)
 {
         if (list->values) {
                 g_list_foreach (list->values,
-                                (GFunc) free_value,
+                                (GFunc) gupnp_dlna_value_free,
                                 list->type);
                 g_list_free (list->values);
                 list->values = NULL;
@@ -79,16 +72,16 @@ gupnp_dlna_value_list_free (GUPnPDLNAValueList *list)
 }
 
 static gint
-value_compare (GUPnPDLNANativeValue     *a,
-               GUPnPDLNANativeValue     *b,
+value_compare (GUPnPDLNAValue     *a,
+               GUPnPDLNAValue     *b,
                GUPnPDLNAValueType *type)
 {
-        return gupnp_dlna_native_value_compare (a, b, type);
+        return gupnp_dlna_value_compare (a, b, type);
 }
 
 static gboolean
 insert_value (GUPnPDLNAValueList *list,
-              GUPnPDLNANativeValue *value)
+              GUPnPDLNAValue     *value)
 {
         if (value) {
                 if (list->sorted)
@@ -107,40 +100,40 @@ insert_value (GUPnPDLNAValueList *list,
 
 gboolean
 gupnp_dlna_value_list_add_single (GUPnPDLNAValueList *list,
-                                         const gchar *single)
+                                  const gchar        *single)
 {
-        GUPnPDLNANativeValue *value;
+        GUPnPDLNAValue *value;
 
         g_return_val_if_fail (list != NULL, FALSE);
         g_return_val_if_fail (single != NULL, FALSE);
 
-        value = gupnp_dlna_native_value_new_single (list->type, single);
+        value = gupnp_dlna_value_new_single (list->type, single);
 
         return insert_value (list, value);
 }
 
 gboolean
 gupnp_dlna_value_list_add_range (GUPnPDLNAValueList *list,
-                                        const gchar *min,
-                                        const gchar *max)
+                                 const gchar        *min,
+                                 const gchar        *max)
 {
-        GUPnPDLNANativeValue *range;
+        GUPnPDLNAValue *range;
 
         g_return_val_if_fail (list != NULL, FALSE);
         g_return_val_if_fail (min != NULL, FALSE);
         g_return_val_if_fail (max != NULL, FALSE);
 
-        range = gupnp_dlna_native_value_new_ranged (list->type, min, max);
+        range = gupnp_dlna_value_new_ranged (list->type, min, max);
 
         if (range) {
                 list->values = g_list_prepend (list->values, range);
+
                 return TRUE;
         }
 
         return FALSE;
 }
 
-/* private */
 GUPnPDLNAValueList *
 gupnp_dlna_value_list_copy (GUPnPDLNAValueList *list)
 {
@@ -151,14 +144,13 @@ gupnp_dlna_value_list_copy (GUPnPDLNAValueList *list)
 
                 dup = gupnp_dlna_value_list_new (list->type);
                 for (iter = list->values; iter != NULL; iter = iter->next) {
-                        GUPnPDLNANativeValue *base =
-                                        (GUPnPDLNANativeValue *) iter->data;
-                        GUPnPDLNANativeValue *copy;
+                        GUPnPDLNAValue *base = (GUPnPDLNAValue *) iter->data;
+                        GUPnPDLNAValue *copy;
 
                         if (base == NULL)
                                 continue;
 
-                        copy = gupnp_dlna_native_value_copy (base, list->type);
+                        copy = gupnp_dlna_value_copy (base, list->type);
                         if (copy != NULL)
                                 dup->values = g_list_prepend (dup->values,
                                                               copy);
@@ -192,10 +184,9 @@ gupnp_dlna_value_list_is_superset (GUPnPDLNAValueList *list,
         }
 
         for (iter = list->values; iter != NULL; iter = iter->next) {
-                GUPnPDLNANativeValue *base =
-                                            (GUPnPDLNANativeValue *) iter->data;
+                GUPnPDLNAValue *base = (GUPnPDLNAValue *) iter->data;
 
-                if (gupnp_dlna_native_value_is_superset (base, value)) {
+                if (gupnp_dlna_value_is_superset (base, value)) {
                         *unsupported = FALSE;
 
                         return TRUE;
@@ -229,13 +220,11 @@ list_to_string (GUPnPDLNAValueList *value_list)
         gchar *str;
 
         for (iter = value_list->values; iter != NULL; iter = iter->next) {
-                GUPnPDLNANativeValue *value =
-                                            (GUPnPDLNANativeValue *) iter->data;
+                GUPnPDLNAValue *value = (GUPnPDLNAValue *) iter->data;
 
                 g_ptr_array_add (strings,
-                                 gupnp_dlna_native_value_to_string
-                                        (value,
-                                         value_list->type));
+                                 gupnp_dlna_value_to_string (value,
+                                                             value_list->type));
         }
         g_ptr_array_add (strings, NULL);
 
@@ -298,9 +287,8 @@ gupnp_dlna_value_list_get_g_values (GUPnPDLNAValueList *list)
 
         g_values = NULL;
         for (iter = list->values; iter != NULL; iter = iter->next) {
-                GValue *g_value =
-                                gupnp_dlna_native_value_to_g_value (iter->data,
-                                                                    list->type);
+                GValue *g_value = gupnp_dlna_value_to_g_value (iter->data,
+                                                               list->type);
 
                 if (g_value)
                         g_values = g_list_prepend (g_values, g_value);
diff --git a/libgupnp-dlna/gupnp-dlna-value.c b/libgupnp-dlna/gupnp-dlna-value.c
new file mode 100644
index 0000000..5343c96
--- /dev/null
+++ b/libgupnp-dlna/gupnp-dlna-value.c
@@ -0,0 +1,444 @@
+/*
+ * Copyright (C) 2012, 2013 Intel Corporation.
+ *
+ * Authors: Krzesimir Nowak <krnowak openismus com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "gupnp-dlna-value.h"
+#include "gupnp-dlna-value-union.h"
+
+struct _GUPnPDLNAValueVTable {
+        gboolean
+        (* is_superset) (GUPnPDLNAValue     *base,
+                         GUPnPDLNAInfoValue *info);
+
+        GUPnPDLNAValue *
+        (* copy) (GUPnPDLNAValue     *base,
+                  GUPnPDLNAValueType *type);
+
+        void
+        (* free) (GUPnPDLNAValue     *base,
+                  GUPnPDLNAValueType *type);
+
+        gchar *
+        (* to_string) (GUPnPDLNAValue     *base,
+                       GUPnPDLNAValueType *type);
+
+        GUPnPDLNAValueUnion *
+        (* get_sort_value) (GUPnPDLNAValue *base);
+
+        gboolean
+        (* to_g_value) (GUPnPDLNAValue     *base,
+                        GUPnPDLNAValueType *type,
+                        GValue             *g_value);
+};
+
+/* single */
+typedef struct _GUPnPDLNAValueSingle GUPnPDLNAValueSingle;
+
+struct _GUPnPDLNAValueSingle {
+        GUPnPDLNAValue      base;
+        GUPnPDLNAValueUnion value;
+};
+
+static gboolean
+single_is_superset (GUPnPDLNAValue     *base,
+                    GUPnPDLNAInfoValue *info);
+
+static GUPnPDLNAValue *
+single_copy (GUPnPDLNAValue     *base,
+             GUPnPDLNAValueType *type);
+
+static void
+single_free (GUPnPDLNAValue     *base,
+             GUPnPDLNAValueType *type);
+
+static gchar *
+single_to_string (GUPnPDLNAValue     *base,
+                  GUPnPDLNAValueType *type);
+
+static GUPnPDLNAValueUnion *
+single_get_sort_value (GUPnPDLNAValue *base);
+
+static gboolean
+single_to_g_value (GUPnPDLNAValue     *base,
+                   GUPnPDLNAValueType *type,
+                   GValue             *g_value);
+
+static GUPnPDLNAValueVTable single_vtable = {
+        single_is_superset,
+        single_copy,
+        single_free,
+        single_to_string,
+        single_get_sort_value,
+        single_to_g_value
+};
+
+static gboolean
+single_is_superset (GUPnPDLNAValue     *base,
+                    GUPnPDLNAInfoValue *info)
+{
+        GUPnPDLNAValueSingle *value = (GUPnPDLNAValueSingle *) base;
+        GUPnPDLNAValueType *info_type = gupnp_dlna_info_value_get_type (info);
+        GUPnPDLNAValueUnion *info_value =
+                                        gupnp_dlna_info_value_get_value (info);
+
+        return gupnp_dlna_value_type_is_equal (info_type,
+                                               &value->value,
+                                               info_value);
+}
+
+static GUPnPDLNAValue *
+single_copy (GUPnPDLNAValue     *base,
+             GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueSingle *value = (GUPnPDLNAValueSingle *) base;
+        GUPnPDLNAValueSingle *dup = g_slice_new (GUPnPDLNAValueSingle);
+
+        dup->base.vtable = &single_vtable;
+        if (!gupnp_dlna_value_type_copy (type, &value->value, &dup->value)) {
+                g_slice_free (GUPnPDLNAValueSingle, dup);
+                dup = NULL;
+        }
+
+        return (GUPnPDLNAValue *) dup;
+}
+
+static void
+single_free (GUPnPDLNAValue     *base,
+             GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueSingle *value = (GUPnPDLNAValueSingle *) base;
+
+        gupnp_dlna_value_type_clean (type, &value->value);
+        g_slice_free (GUPnPDLNAValueSingle, value);
+}
+
+static gchar *
+single_to_string (GUPnPDLNAValue     *base,
+                  GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueSingle *value = (GUPnPDLNAValueSingle *) base;
+
+        return gupnp_dlna_value_type_to_string (type, &value->value);
+}
+
+static GUPnPDLNAValueUnion *
+single_get_sort_value (GUPnPDLNAValue *base)
+{
+        GUPnPDLNAValueSingle *value = (GUPnPDLNAValueSingle *) base;
+
+        return &value->value;
+}
+
+static gboolean
+single_to_g_value (GUPnPDLNAValue     *base,
+                   GUPnPDLNAValueType *type,
+                   GValue             *g_value)
+{
+        GUPnPDLNAValueSingle *value = (GUPnPDLNAValueSingle *) base;
+
+        gupnp_dlna_value_type_to_g_value (type, &value->value, g_value);
+
+        return TRUE;
+}
+
+/* range */
+typedef struct _GUPnPDLNAValueRange GUPnPDLNAValueRange;
+
+struct _GUPnPDLNAValueRange {
+        GUPnPDLNAValue base;
+        GUPnPDLNAValueUnion min;
+        GUPnPDLNAValueUnion max;
+};
+
+static gboolean
+range_is_superset (GUPnPDLNAValue     *base,
+                   GUPnPDLNAInfoValue *info);
+
+static GUPnPDLNAValue *
+range_copy (GUPnPDLNAValue     *base,
+            GUPnPDLNAValueType *type);
+
+static void
+range_free (GUPnPDLNAValue     *base,
+            GUPnPDLNAValueType *type);
+
+static gchar *
+range_to_string (GUPnPDLNAValue     *base,
+                 GUPnPDLNAValueType *type);
+
+static GUPnPDLNAValueUnion *
+range_get_sort_value (GUPnPDLNAValue *base);
+
+static gboolean
+range_to_g_value (GUPnPDLNAValue     *base,
+                  GUPnPDLNAValueType *type,
+                  GValue             *g_value);
+
+static GUPnPDLNAValueVTable range_vtable = {
+        range_is_superset,
+        range_copy,
+        range_free,
+        range_to_string,
+        range_get_sort_value,
+        range_to_g_value
+};
+
+static gboolean
+range_is_superset (GUPnPDLNAValue     *base,
+                   GUPnPDLNAInfoValue *info)
+{
+        GUPnPDLNAValueRange *range = (GUPnPDLNAValueRange *) base;
+        GUPnPDLNAValueType *info_type = gupnp_dlna_info_value_get_type (info);
+        GUPnPDLNAValueUnion *info_value =
+                                        gupnp_dlna_info_value_get_value (info);
+
+        return gupnp_dlna_value_type_is_in_range (info_type,
+                                                  &range->min,
+                                                  &range->max,
+                                                  info_value);
+}
+
+static GUPnPDLNAValue *
+range_copy (GUPnPDLNAValue     *base,
+            GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueRange *range = (GUPnPDLNAValueRange *) base;
+        GUPnPDLNAValueRange *dup = g_slice_new (GUPnPDLNAValueRange);
+
+        dup->base.vtable = &range_vtable;
+        if (!gupnp_dlna_value_type_copy (type, &range->min, &dup->min)) {
+                g_slice_free (GUPnPDLNAValueRange, dup);
+                dup = NULL;
+        }
+        if (dup && !gupnp_dlna_value_type_copy (type,
+                                                &range->max,
+                                                &dup->max)) {
+                gupnp_dlna_value_type_clean (type, &dup->min);
+                g_slice_free (GUPnPDLNAValueRange, dup);
+                dup = NULL;
+        }
+
+        return (GUPnPDLNAValue *) dup;
+}
+
+static void
+range_free (GUPnPDLNAValue     *base,
+            GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueRange *range = (GUPnPDLNAValueRange *) base;
+
+        gupnp_dlna_value_type_clean (type, &range->min);
+        gupnp_dlna_value_type_clean (type, &range->max);
+        g_slice_free (GUPnPDLNAValueRange, range);
+}
+
+static gchar *
+range_to_string (GUPnPDLNAValue     *base,
+                 GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueRange *range = (GUPnPDLNAValueRange *) base;
+        gchar *str;
+        gchar *min = gupnp_dlna_value_type_to_string (type, &range->min);
+        gchar *max = gupnp_dlna_value_type_to_string (type, &range->max);
+
+        str = g_strdup_printf ("[ %s, %s ]", min, max);
+        g_free (min);
+        g_free (max);
+
+        return str;
+}
+
+static GUPnPDLNAValueUnion *
+range_get_sort_value (GUPnPDLNAValue *base)
+{
+        GUPnPDLNAValueRange *range = (GUPnPDLNAValueRange *) base;
+
+        return &range->min;
+}
+
+static gboolean
+range_to_g_value (GUPnPDLNAValue     *base,
+                  GUPnPDLNAValueType *type,
+                  GValue             *g_value)
+{
+        GValue from = G_VALUE_INIT;
+        GValue to = G_VALUE_INIT;
+        GUPnPDLNAValueRange *range = (GUPnPDLNAValueRange *) base;
+        gboolean result;
+
+        gupnp_dlna_value_type_to_g_value (type, &range->min, &from);
+        gupnp_dlna_value_type_to_g_value (type, &range->max, &to);
+        result = gupnp_dlna_value_type_flatten (type, g_value, &from, &to);
+        g_value_unset (&from);
+        g_value_unset (&to);
+
+        return result;
+}
+
+/* API */
+
+GUPnPDLNAValue *
+gupnp_dlna_value_new_single (GUPnPDLNAValueType *type,
+                             const gchar        *raw)
+{
+        GUPnPDLNAValueSingle *value;
+
+        g_return_val_if_fail (type != NULL, NULL);
+        g_return_val_if_fail (raw != NULL, NULL);
+
+        value = g_slice_new (GUPnPDLNAValueSingle);
+        value->base.vtable = &single_vtable;
+        if (!gupnp_dlna_value_type_init (type, &value->value, raw)) {
+                g_slice_free (GUPnPDLNAValueSingle, value);
+                value = NULL;
+        }
+
+        return (GUPnPDLNAValue *) value;
+}
+
+GUPnPDLNAValue *
+gupnp_dlna_value_new_ranged (GUPnPDLNAValueType *type,
+                             const gchar        *min,
+                             const gchar        *max)
+{
+        GUPnPDLNAValueRange *range;
+
+        g_return_val_if_fail (type != NULL, NULL);
+        g_return_val_if_fail (min != NULL, NULL);
+        g_return_val_if_fail (max != NULL, NULL);
+
+        range = g_slice_new (GUPnPDLNAValueRange);
+        range->base.vtable = &range_vtable;
+        if (!gupnp_dlna_value_type_init (type, &range->min, min)) {
+                g_slice_free (GUPnPDLNAValueRange, range);
+                range = NULL;
+        }
+        if (range && !gupnp_dlna_value_type_init (type, &range->max, max)) {
+                gupnp_dlna_value_type_clean (type, &range->min);
+                g_slice_free (GUPnPDLNAValueRange, range);
+                range = NULL;
+        }
+        if (range && !gupnp_dlna_value_type_verify_range (type,
+                                                          &range->min,
+                                                          &range->max)) {
+                gupnp_dlna_value_type_clean (type, &range->min);
+                gupnp_dlna_value_type_clean (type, &range->max);
+                g_slice_free (GUPnPDLNAValueRange, range);
+                range = NULL;
+        }
+
+        return (GUPnPDLNAValue *) range;
+}
+
+gboolean
+gupnp_dlna_value_is_superset (GUPnPDLNAValue     *base,
+                              GUPnPDLNAInfoValue *single)
+{
+        g_return_val_if_fail (base != NULL, FALSE);
+        g_return_val_if_fail (single != NULL, FALSE);
+        g_return_val_if_fail (base->vtable != NULL, FALSE);
+        g_return_val_if_fail (base->vtable->is_superset != NULL, FALSE);
+
+        return base->vtable->is_superset (base, single);
+}
+
+GUPnPDLNAValue *
+gupnp_dlna_value_copy (GUPnPDLNAValue     *base,
+                       GUPnPDLNAValueType *type)
+{
+        g_return_val_if_fail (base != NULL, NULL);
+        g_return_val_if_fail (type != NULL, NULL);
+        g_return_val_if_fail (base->vtable != NULL, NULL);
+        g_return_val_if_fail (base->vtable->copy != NULL, NULL);
+
+        return base->vtable->copy (base, type);
+}
+
+void
+gupnp_dlna_value_free (GUPnPDLNAValue     *base,
+                       GUPnPDLNAValueType *type)
+{
+        if (base == NULL)
+                return;
+
+        g_return_if_fail (type != NULL);
+        g_return_if_fail (base->vtable != NULL);
+        g_return_if_fail (base->vtable->free != NULL);
+
+        base->vtable->free (base, type);
+}
+
+gchar *
+gupnp_dlna_value_to_string (GUPnPDLNAValue     *base,
+                            GUPnPDLNAValueType *type)
+{
+        g_return_val_if_fail (base != NULL, NULL);
+        g_return_val_if_fail (type != NULL, NULL);
+        g_return_val_if_fail (base->vtable != NULL, NULL);
+        g_return_val_if_fail (base->vtable->to_string != NULL, NULL);
+
+        return base->vtable->to_string (base, type);
+}
+
+static GUPnPDLNAValueUnion *
+gupnp_dlna_value_get_sort_value (GUPnPDLNAValue *base)
+{
+        g_return_val_if_fail (base->vtable != NULL, NULL);
+        g_return_val_if_fail (base->vtable->get_sort_value != NULL, NULL);
+
+        return base->vtable->get_sort_value (base);
+}
+
+gint
+gupnp_dlna_value_compare (GUPnPDLNAValue     *base,
+                          GUPnPDLNAValue     *other,
+                          GUPnPDLNAValueType *type)
+{
+        GUPnPDLNAValueUnion *base_union;
+        GUPnPDLNAValueUnion *other_union;
+
+        g_return_val_if_fail (base != NULL, 0);
+        g_return_val_if_fail (other != NULL, 0);
+        g_return_val_if_fail (type != NULL, 0);
+
+        base_union = gupnp_dlna_value_get_sort_value (base);
+        other_union = gupnp_dlna_value_get_sort_value (other);
+
+        return gupnp_dlna_value_type_compare (type, base_union, other_union);
+}
+
+GValue *
+gupnp_dlna_value_to_g_value (GUPnPDLNAValue     *base,
+                             GUPnPDLNAValueType *type)
+{
+        GValue *g_value;
+
+        g_return_val_if_fail (base->vtable != NULL, NULL);
+        g_return_val_if_fail (base->vtable->to_g_value != NULL, NULL);
+
+        g_value = g_slice_new0 (GValue);
+
+        if (base->vtable->to_g_value (base, type, g_value)) {
+                g_slice_free (GValue, g_value);
+                g_value = NULL;
+        }
+
+        return g_value;
+}
diff --git a/libgupnp-dlna/gupnp-dlna-value.h b/libgupnp-dlna/gupnp-dlna-value.h
new file mode 100644
index 0000000..7711151
--- /dev/null
+++ b/libgupnp-dlna/gupnp-dlna-value.h
@@ -0,0 +1,76 @@
+/*
+ * Copyright (C) 2012, 2013 Intel Corporation.
+ *
+ * Authors: Krzesimir Nowak <krnowak openismus com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GUPNP_DLNA_VALUE_H__
+#define __GUPNP_DLNA_VALUE_H__
+
+#include <glib.h>
+#include <glib-object.h>
+
+#include "gupnp-dlna-info-value.h"
+#include "gupnp-dlna-value-type.h"
+
+G_BEGIN_DECLS
+
+typedef struct _GUPnPDLNAValue GUPnPDLNAValue;
+typedef struct _GUPnPDLNAValueVTable GUPnPDLNAValueVTable;
+
+struct _GUPnPDLNAValue {
+        GUPnPDLNAValueVTable *vtable;
+};
+
+GUPnPDLNAValue *
+gupnp_dlna_value_new_single (GUPnPDLNAValueType *type,
+                             const gchar        *single);
+
+GUPnPDLNAValue *
+gupnp_dlna_value_new_ranged (GUPnPDLNAValueType *type,
+                             const gchar        *min,
+                             const gchar        *max);
+
+gboolean
+gupnp_dlna_value_is_superset (GUPnPDLNAValue     *base,
+                              GUPnPDLNAInfoValue *single);
+
+GUPnPDLNAValue *
+gupnp_dlna_value_copy (GUPnPDLNAValue     *base,
+                       GUPnPDLNAValueType *type);
+
+void
+gupnp_dlna_value_free (GUPnPDLNAValue     *base,
+                       GUPnPDLNAValueType *type);
+
+gchar *
+gupnp_dlna_value_to_string (GUPnPDLNAValue     *base,
+                            GUPnPDLNAValueType *type);
+
+gint
+gupnp_dlna_value_compare (GUPnPDLNAValue     *base,
+                          GUPnPDLNAValue     *other,
+                          GUPnPDLNAValueType *type);
+
+GValue *
+gupnp_dlna_value_to_g_value (GUPnPDLNAValue     *base,
+                             GUPnPDLNAValueType *type);
+
+G_END_DECLS
+
+#endif /* __GUPNP_DLNA_VALUE_H__ */
diff --git a/libgupnp-dlna/profile-backends/native/sets/sets.am b/libgupnp-dlna/profile-backends/native/sets/sets.am
index 8c95d27..c760c05 100644
--- a/libgupnp-dlna/profile-backends/native/sets/sets.am
+++ b/libgupnp-dlna/profile-backends/native/sets/sets.am
@@ -1,5 +1,3 @@
 sets_sources = \
 	profile-backends/native/sets/gupnp-dlna-native-info-set.c \
-	profile-backends/native/sets/gupnp-dlna-native-info-set.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-info-set.h



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