You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
configreader/containers/sectionarray.c

62 lines
1.1 KiB

#include "sectionarray.h"
#include <proto/exec.h>
#include <string.h>
#include "configmodel.h"
#define SIZE_APTR 2
SectionArray SectionArrayNew(VOID)
{
return NewArray(SIZE_APTR);
}
VOID SectionArrayAppend(SectionArray array, SECTIONPTR value)
{
AppendToArray(SECTIONPTR, array, value);
}
VOID SectionArrayFree(SectionArray array, BOOL freeSections)
{
if( array != NULL )
{
if( freeSections == TRUE )
{
SectionArrayForEach(array, SectionFree(aSection););
}
DeleteArray(array);
}
}
SECTIONPTR* SectionArrayValues(SectionArray array)
{
return ArrayValues(SECTIONPTR, array);
}
VariableArray VariableArrayNew(VOID)
{
return NewArray(SIZE_APTR);
}
VOID VariableArrayAppend(VariableArray array, VARIABLEPTR value)
{
AppendToArray(VARIABLEPTR, array, value);
}
VOID VariableArrayFree(VariableArray array, BOOL freeVars)
{
if( array != NULL )
{
if( freeVars == TRUE )
{
VariableArrayForEach(array, VariableFree(aVariable););
}
DeleteArray(array);
}
}
VARIABLEPTR* VariableArrayValues(VariableArray array)
{
return ArrayValues(VARIABLEPTR, array);
}