#include <assert.h>
#include <stdio.h>
#include <config.h>
+#include <glib.h>
#ifndef API
#define API __attribute__((visibility("default")))
} \
} while (0)
+#define ret_unless(val) \
+ do { \
+ if (!(val)) { \
+ _E("Invalid parameter value (`" #val "` check failed)"); \
+ return; \
+ } \
+ } while (0)
+
#define ret_value_if(expr, val) do { \
if (expr) { \
_E("(%s) -> %s():%d return", #expr, __FUNCTION__, __LINE__); \
} \
} while (0)
+#define ret_if_gvariant_type_mismatch(gvariant, type) \
+ do { \
+ if (g_variant_is_of_type(gvariant, G_VARIANT_TYPE(type))) { \
+ _E("Invalid parameter type (expected: %s, got: %s)", \
+ type, g_variant_get_type_string(gvariant)); \
+ return; \
+ } \
+ } while (0)
+
+
#define gslist_for_each_item(item, list) \
for (item = list; item != NULL; item = g_slist_next(item))