summaryrefslogtreecommitdiff
path: root/src/lib/eina/eina_array.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/eina/eina_array.c')
-rw-r--r--src/lib/eina/eina_array.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/lib/eina/eina_array.c b/src/lib/eina/eina_array.c
index dddcf732bb..4e8f6fdb86 100644
--- a/src/lib/eina/eina_array.c
+++ b/src/lib/eina/eina_array.c
@@ -172,6 +172,22 @@ eina_array_accessor_free(Eina_Accessor_Array *it)
172 MAGIC_FREE(it); 172 MAGIC_FREE(it);
173} 173}
174 174
175static EAPI Eina_Accessor *
176eina_array_accessor_clone(const Eina_Array *array)
177{
178 Eina_Accessor_Array *ac;
179
180 EINA_SAFETY_ON_NULL_RETURN_VAL(array, NULL);
181 EINA_MAGIC_CHECK_ARRAY(array);
182
183 ac = calloc(1, sizeof (Eina_Accessor_Array));
184 if (!ac) return NULL;
185
186 memcpy(ac, array, sizeof(Eina_Accessor_Array));
187
188 return &ac->accessor;
189}
190
175/* used from eina_inline_array.x, thus a needed symbol */ 191/* used from eina_inline_array.x, thus a needed symbol */
176EAPI Eina_Bool 192EAPI Eina_Bool
177eina_array_grow(Eina_Array *array) 193eina_array_grow(Eina_Array *array)
@@ -419,6 +435,8 @@ eina_array_accessor_new(const Eina_Array *array)
419 ac->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER( 435 ac->accessor.get_container = FUNC_ACCESSOR_GET_CONTAINER(
420 eina_array_accessor_get_container); 436 eina_array_accessor_get_container);
421 ac->accessor.free = FUNC_ACCESSOR_FREE(eina_array_accessor_free); 437 ac->accessor.free = FUNC_ACCESSOR_FREE(eina_array_accessor_free);
438 ac->accessor.clone = FUNC_ACCESSOR_CLONE(eina_array_accessor_clone);
422 439
423 return &ac->accessor; 440 return &ac->accessor;
424} 441}
442