lib/deltas: Move variant read helper into the deltas code

What the deltas code is doing is weird/unfortunate.  The name
`ot_variant_read()` conflicts too much with `ot_variant_read_fd()`.
Since nothing else uses it, move it into the deltas code.

Closes: #1254
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-10-05 15:41:00 +00:00
1 parent a903f96673
commit fc33ae018d
3 files changed
+15 -17

No files matched your search

-13
View File
@@ -81,19 +81,6 @@ ot_variant_read_fd (int fd,
return TRUE;
}
/* Get an input stream for a GVariant */
GInputStream *
ot_variant_read (GVariant *variant)
{
GMemoryInputStream *ret = (GMemoryInputStream*)
g_memory_input_stream_new_from_data (g_variant_get_data (variant),
g_variant_get_size (variant),
NULL);
g_object_set_data_full ((GObject*)ret, "ot-variant-data",
g_variant_ref (variant), (GDestroyNotify) g_variant_unref);
return (GInputStream*)ret;
}
/* GVariants are immutable; this function allows generating an open builder
* for a new variant, inherting the data from @variant.
*/
-2
View File
@@ -39,8 +39,6 @@ gboolean ot_variant_read_fd (int fd,
GVariant **out_variant,
GError **error);
GInputStream *ot_variant_read (GVariant *variant);
GVariantBuilder *ot_util_variant_builder_from_variant (GVariant *variant,
const GVariantType *type);