ETCArray documentation

Authors

Generated by builder

Contents -

  1. ETCArray types
  2. ETCArray functions

ETCArray types

ETCArray

typedef struct _ETCArray* ETCArray;

Opaque type representing a thin layer of abstraction around a dynamic C array. An ETCArray can be used to store any pointer type.


ETCArray functions

ETCArrayAdd

int ETCArrayAdd(ETCArray array, void* object);

Adds object at the end of array, allocating more space if needed.


ETCArrayAddAtIndex

int ETCArrayAddAtIndex(ETCArray array, void* object, unsigned int anIndex);

Adds object to array at anIndex, replacing the existing value at that index.


ETCArrayAppendArray

int ETCArrayAppendArray(ETCArray array, ETCArray otherArray);

Appends the contents of otherArray to array.


ETCArrayCount

unsigned int ETCArrayCount(ETCArray array);

Returns the number of objects in the array.


ETCArrayFree

void ETCArrayFree(ETCArray array);

Destroy the array.


ETCArrayIndexOfObjectIdenticalTo

int ETCArrayIndexOfObjectIdenticalTo(ETCArray array, void* object);

Returns the index of the specified value.


ETCArrayNew

ETCArray ETCArrayNew();

Creates a new array with some default initial capacity.


ETCArrayNewWithInitialSize

ETCArray ETCArrayNewWithInitialSize(unsigned int initialSize);

Creates a new array with a specified initial capacity.


ETCArrayObjectAtIndex

void* ETCArrayObjectAtIndex(ETCArray array, unsigned int anIndex);

Returns the value at the specified index.


ETCArrayRemoveAllObjects

int ETCArrayRemoveAllObjects(ETCArray array, int freeObjects);

Removes all objects from the array, giving an empty array.


ETCArrayRemoveLastObject

int ETCArrayRemoveLastObject(ETCArray array);

Removes the last object from an array.


ETCArrayRemoveObjectAtIndex

int ETCArrayRemoveObjectAtIndex(ETCArray array, unsigned int anIndex);

Removes the object at the specified index. All subsequent objects will moved up the array by one element.


ETCArraySwap

int ETCArraySwap(ETCArray array, unsigned int index1, unsigned int index2);

Swap the values at two indexes.