mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-08 00:49:17 -04:00
Add _from_bytes and _from_data for types
This commit is contained in:
@@ -401,6 +401,18 @@ static inline {TypeNameRef}
|
||||
return ({TypeNameRef}) {{ g_variant_get_data (v), g_variant_get_size (v) }};
|
||||
}}
|
||||
|
||||
static inline {TypeNameRef}
|
||||
{type_name_ref_}from_bytes (GBytes *b)
|
||||
{{
|
||||
return ({TypeNameRef}) {{ g_bytes_get_data (b, NULL), g_bytes_get_size (b) }};
|
||||
}}
|
||||
|
||||
static inline {TypeNameRef}
|
||||
{type_name_ref_}from_data (gpointer data, gsize size)
|
||||
{{
|
||||
return ({TypeNameRef}) {{ data, size }};
|
||||
}}
|
||||
|
||||
static inline GVariant *
|
||||
{type_name_ref_}dup_to_variant ({TypeNameRef} v)
|
||||
{{
|
||||
|
||||
Reference in New Issue
Block a user