this helper will validate a struct and fetch its description, also
checking if the user version matches.
return EINA_TRUE;
}
+static inline const Eina_Value_Struct_Desc *
+eina_value_struct_desc_get(const Eina_Value *value)
+{
+ const Eina_Value_Struct *st;
+
+ EINA_VALUE_TYPE_STRUCT_CHECK_RETURN_VAL(value, NULL);
+ st = (const Eina_Value_Struct *)eina_value_memory_get(value);
+ if ((!st) || (!st->desc))
+ return NULL;
+ EINA_SAFETY_ON_FALSE_RETURN_VAL(st->desc->version == EINA_VALUE_STRUCT_DESC_VERSION, NULL);
+ return st->desc;
+}
+
static inline void *
eina_value_struct_member_memory_get(const Eina_Value_Struct *st, const Eina_Value_Struct_Member *member)
{
const Eina_Value_Struct_Desc *desc) EINA_ARG_NONNULL(1, 2);
/**
+ * @brief Checks for a struct and get its description.
+ * @param value Value object
+ * @return structure description, with all members and size.
+ * on failure, #NULL is returned.
+ *
+ * @since 1.21
+ */
+static inline const Eina_Value_Struct_Desc *eina_value_struct_desc_get(const Eina_Value *value) EINA_ARG_NONNULL(1) EINA_WARN_UNUSED_RESULT;
+
+/**
* @brief Sets the generic value in an struct member.
* @param value Source value object
* @param name Name to find the member