summaryrefslogtreecommitdiff
path: root/src/include/eina_inarray.h
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-01-11 02:20:26 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-01-11 02:20:26 +0000
commit811960b066b87a21d333b457dec1f119a167e8eb (patch)
tree47e3abb0d7e44b6e102fb1d6026f71c96be7fe81 /src/include/eina_inarray.h
parentad31f66ea99e78066aec458f71a239b05528d264 (diff)
downloadeina-811960b066b87a21d333b457dec1f119a167e8eb.tar.gz
add eina_value.
eina value is a generic value storage, it's quite efficient to space (16 bytes) and speed (inlines for basic types). It's basically a structure describing how to manage memory (Eina_Value_Type), with default implementation for char, short, int, long, int64_t (and unsigned variants), float, double, stringshare and string. If a type 'value_size' is smaller than 8 bytes, it's stored inline. Otherwise a value is allocated and managed. Most of the methods are inline, with special handling for char, short, int... Then no extra calls are made, allowing the compiler to optimize them. For array of a single type it is recommend to use Eina_Value_Array, as it will efficiently store and access members (just a char if subtype is EINA_VALUE_TYPE_CHAR, etc). It can copy itself, compare itself. Including arrays. It would be nice to have something that converts between EET and this. SVN revision: 67035
Diffstat (limited to 'src/include/eina_inarray.h')
-rw-r--r--src/include/eina_inarray.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/include/eina_inarray.h b/src/include/eina_inarray.h
index 7468dce..08edb4a 100644
--- a/src/include/eina_inarray.h
+++ b/src/include/eina_inarray.h
@@ -272,6 +272,26 @@ EAPI Eina_Bool eina_inarray_insert_at(Eina_Inarray *array,
const void *data) EINA_ARG_NONNULL(1, 3);
/**
+ * @brief Copy the data over the given position.
+ * @param array array object
+ * @param position where to replace the member
+ * @param data data to be copied at position
+ * @return #EINA_TRUE on success, #EINA_FALSE on failure.
+ *
+ * Copies the given pointer contents at the given @a position in the
+ * array. The pointer is not referenced, instead it's contents is
+ * copied to the members array using the previously defined
+ * @c member_size.
+ *
+ * If @a position does not exist, it will fail.
+ *
+ * @since 1.2
+ */
+EAPI Eina_Bool eina_inarray_replace_at(Eina_Inarray *array,
+ unsigned int position,
+ const void *data) EINA_ARG_NONNULL(1, 3);
+
+/**
* @brief Remove member at given position
* @param array array object
* @param position position to be removed