[dconf: 2/5] Add gvdb_table_get_raw_value() API for GSettings
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dconf: 2/5] Add gvdb_table_get_raw_value() API for GSettings
- Date: Tue, 14 Dec 2010 05:21:41 +0000 (UTC)
commit e5e491c96946ec6ff6809e4b2b757b1f2d497867
Author: Ryan Lortie <desrt desrt ca>
Date: Sun Oct 3 22:54:03 2010 -0400
Add gvdb_table_get_raw_value() API for GSettings
gvdb-reader.c | 23 +++++++++++++++++++++++
gvdb-reader.h | 3 +++
2 files changed, 26 insertions(+), 0 deletions(-)
---
diff --git a/gvdb-reader.c b/gvdb-reader.c
index 0b1b2ce..fb23393 100644
--- a/gvdb-reader.c
+++ b/gvdb-reader.c
@@ -458,6 +458,29 @@ gvdb_table_get_value (GvdbTable *file,
}
/**
+ * gvdb_table_get_raw_value:
+ * @table: a #GvdbTable
+ * @key: a string
+ * @returns: a #GVariant, or %NULL
+ *
+ * Looks up a value named @key in @file.
+ *
+ * This call is equivalent to gvdb_table_get_value() except that it
+ * never byteswaps the value.
+ **/
+GVariant *
+gvdb_table_get_raw_value (GvdbTable *table,
+ const gchar *key)
+{
+ const struct gvdb_hash_item *item;
+
+ if ((item = gvdb_table_lookup (table, key, 'v')) == NULL)
+ return NULL;
+
+ return gvdb_table_value_from_item (table, item);
+}
+
+/**
* gvdb_table_get_table:
* @file: a #GvdbTable
* @key: a string
diff --git a/gvdb-reader.h b/gvdb-reader.h
index c960646..9f302c0 100644
--- a/gvdb-reader.h
+++ b/gvdb-reader.h
@@ -42,6 +42,9 @@ G_GNUC_INTERNAL
GvdbTable * gvdb_table_get_table (GvdbTable *table,
const gchar *key);
G_GNUC_INTERNAL
+GVariant * gvdb_table_get_raw_value (GvdbTable *table,
+ const gchar *key);
+G_GNUC_INTERNAL
GVariant * gvdb_table_get_value (GvdbTable *table,
const gchar *key);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]