|
|
|
#include <exec/types.h>
|
|
|
|
#include <proto/exec.h>
|
|
|
|
#include <proto/containerkit.h>
|
|
|
|
#include "linearray.h"
|
|
|
|
#include "configmodel.h"
|
|
|
|
|
|
|
|
// -----------------------------
|
|
|
|
#define InsertToArray(ElemType, array, pos, value) do { *((ElemType *)InsertArrayElements(array, pos, 1)) = value;} while(0);
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------
|
|
|
|
|
|
|
|
|
|
|
|
LineArray LineArrayNew(VOID)
|
|
|
|
{
|
|
|
|
#define SIZE_APTR 2
|
|
|
|
return NewArray(SIZE_APTR);
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID LineArrayAppend(LineArray array, LINEPTR value)
|
|
|
|
{
|
|
|
|
AppendToArray(LINEPTR, array, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID LineArrayInsert(LineArray array, LINEPTR value, ULONG pos)
|
|
|
|
{
|
|
|
|
AppendToArray(LINEPTR, array, value);
|
|
|
|
// InsertToArray(LINEPTR, array, pos, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
VOID LineArrayFree(LineArray array, BOOL freeLines)
|
|
|
|
{
|
|
|
|
if( array != NULL )
|
|
|
|
{
|
|
|
|
if( freeLines )
|
|
|
|
{
|
|
|
|
ArrayForEach(LINEPTR, aLine, array, LineFree(aLine););
|
|
|
|
}
|
|
|
|
DeleteArray(array);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
LINEPTR* LineArrayValues(LineArray array)
|
|
|
|
{
|
|
|
|
return ArrayValues(LINEPTR, array);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------
|
|
|
|
// -----------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|