aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/eina/eina_inline_value_util.x
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-08-23 17:29:31 -0300
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>2017-08-23 18:32:13 -0300
commitc158d5c17a93ba75013b340dd092441631c785e6 (patch)
tree0cb5ddf9b2be7ab790939fd20085ffce0bf3e6a7 /src/lib/eina/eina_inline_value_util.x
parenteina_value_util: remove "_util" from names. (diff)
downloadefl-c158d5c17a93ba75013b340dd092441631c785e6.tar.gz
eina_value_util: add missing eina_value_*_new() for basic types.
make all basic types available as _new() helpers.
Diffstat (limited to '')
-rw-r--r--src/lib/eina/eina_inline_value_util.x176
1 files changed, 176 insertions, 0 deletions
diff --git a/src/lib/eina/eina_inline_value_util.x b/src/lib/eina/eina_inline_value_util.x
index 2d5c264442..f863fd56cc 100644
--- a/src/lib/eina/eina_inline_value_util.x
+++ b/src/lib/eina/eina_inline_value_util.x
@@ -129,6 +129,118 @@ eina_value_type_offset(const Eina_Value_Type *type, unsigned int base)
/**
* @brief Create a new #Eina_Value containing the passed parameter
+ * @param c The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_uchar_new(unsigned char c)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_UCHAR);
+ if (v) eina_value_set(v, c);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param s The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_ushort_new(unsigned short s)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_USHORT);
+ if (v) eina_value_set(v, s);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param i The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_uint_new(unsigned int i)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_UINT);
+ if (v) eina_value_set(v, i);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param l The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_ulong_new(unsigned long l)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_ULONG);
+ if (v) eina_value_set(v, l);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param i The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_uint64_new(uint64_t i)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_UINT64);
+ if (v) eina_value_set(v, i);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param c The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_char_new(char c)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_CHAR);
+ if (v) eina_value_set(v, c);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param s The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_short_new(short s)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_SHORT);
+ if (v) eina_value_set(v, s);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
* @param i The value to use
* @return The #Eina_Value
* @since 1.21
@@ -145,6 +257,54 @@ eina_value_int_new(int i)
/**
* @brief Create a new #Eina_Value containing the passed parameter
+ * @param l The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_long_new(long l)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_LONG);
+ if (v) eina_value_set(v, l);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param i The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_int64_new(int64_t i)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_INT64);
+ if (v) eina_value_set(v, i);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
+ * @param f The value to use
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_float_new(float f)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_FLOAT);
+ if (v) eina_value_set(v, f);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
* @param d The value to use
* @return The #Eina_Value
* @since 1.21
@@ -225,6 +385,22 @@ eina_value_time_new(time_t t)
/**
* @brief Create a new #Eina_Value containing the passed parameter
+ * @param err The error code
+ * @return The #Eina_Value
+ * @since 1.21
+ */
+static inline Eina_Value *
+eina_value_error_new(Eina_Error err)
+{
+ Eina_Value *v;
+
+ v = eina_value_new(EINA_VALUE_TYPE_ERROR);
+ if (v) eina_value_set(v, err);
+ return v;
+}
+
+/**
+ * @brief Create a new #Eina_Value containing the passed parameter
* @param val The value to use
* @return The #Eina_Value
* @since 1.21