#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); }