Commit 434a1974 authored by Chris Müller's avatar Chris Müller

lib: add some documentation for array.h

lib: wrong target- and destination mapping for memmove.
parent 88adfd06
......@@ -128,7 +128,7 @@ cry_array_insert(struct CryArray* array, size_t index, pointer data, size_t size
if(array->alloc < array->length + size)
cry_array_increase_alloc(array, array->length + size);
memmove(array->data + index, array->data + index + size, size);
memmove(array->data + index + size, array->data + index, size);
memcpy(array->data + index, data, size);
array->length += size;
......
......@@ -19,11 +19,22 @@
#ifndef CRYSTAL_STRUCTURES_ARRAY_H
#define CRYSTAL_STRUCTURES_ARRAY_H
/**
* @file structures/array.h
* A dynmical, resized array implementation that hides all memory allocation for a user
*/
#include "structures.h"
struct CryArray;
/**
* Creates an CryArray instance with a given initialization- and extension size
* \param initialsize Sets the initial memory allocation for the internal buffer. Its size is always a multiple factor of the extensionsize
* and fits the given initialsize for the first initialization.
* \param extend Sets the size of memory blocks the array is dynamically extend.
* \return the reference pointer to the constructed array, used by other array calls.
*/
struct CryArray* cry_array_new(size_t initialsize, size_t extend);
void cry_array_free(struct CryArray* array);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment