core: Add stream->variant helper, as well as clear macros for ptrarray/hashtable

This commit is contained in:
Colin Walters committed 2012-03-31 10:32:26 -04:00
1 parent b221b0fdd6
commit 68cce01556
2 files changed
+64

No files matched your search

+19
View File
@@ -33,6 +33,18 @@ G_BEGIN_DECLS
*a_v = NULL; \
} while (0);
#define ot_clear_ptrarray(a_v) do { \
if (*a_v) \
g_ptr_array_unref (*a_v); \
*a_v = NULL; \
} while (0);
#define ot_clear_hashtable(a_v) do { \
if (*a_v) \
g_hash_table_unref (*a_v); \
*a_v = NULL; \
} while (0);
GHashTable *ot_util_variant_asv_to_hash_table (GVariant *variant);
GVariant * ot_util_variant_take_ref (GVariant *variant);
@@ -47,6 +59,13 @@ gboolean ot_util_variant_map (GFile *src,
GVariant **out_variant,
GError **error);
gboolean ot_util_variant_from_stream (GInputStream *src,
const GVariantType *type,
gboolean trusted,
GVariant **out_variant,
GCancellable *cancellable,
GError **error);
G_END_DECLS
#endif