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/sectionmap.c

45 lines
776 B

#include "sectionmap.h"
#include "configmodel.h"
SectionMap SectionMapNew()
{
SectionMap result = NewMap(CNTKIT_KEY_STRING,
CNTKIT_CAPACITY, 8,
CNTKIT_VALUESIZE, 4,
TAG_DONE);
return result;
}
VOID SectionMapSet(SectionMap map, CONST_STRPTR canonicalName, SECTIONPTR section)
{
if( canonicalName != NULL )
{
if( section == NULL )
{
RemoveStrKey(map, (STRPTR)canonicalName);
}
else
{
MapStrToValue(map, (STRPTR)canonicalName, (ULONG)section);
}
}
}
SECTIONPTR SectionMapGet(SectionMap map, CONST_STRPTR canonicalName)
{
if( canonicalName != NULL )
{
return (SECTIONPTR)ValueOfStrKey(map, (STRPTR)canonicalName);
}
else
{
return NULL;
}
}
VOID SectionMapFree(SectionMap map)
{
// doesnt seem to delete contents
DeleteMap(map);
}