+#elif defined __APPLE__
+#define BOOL_FROM_CFSTRING(_pl,_key) \
+ strcmp("0", CFStringGetCStringPtr(CFDictionaryGetValue(_pl, CFSTR(_key)), 0) ? : "")
+
+ CFPropertyListRef propertyList;
+ CFStringRef errorString;
+ CFDataRef resourceData;
+ Boolean status;
+ SInt32 errorCode;
+
+ fileURL = CFURLCreateWithFileSystemPath(kCFAllocatorDefault,
+ CFSTR("subsurface.pref"),// file path name
+ kCFURLPOSIXPathStyle, // interpret as POSIX path
+ false ); // is it a directory?
+
+ status = CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault,
+ fileURL, &resourceData,
+ NULL, NULL, &errorCode);
+ propertyList = CFPropertyListCreateFromXMLData(kCFAllocatorDefault,
+ resourceData, kCFPropertyListImmutable,
+ &errorString);
+ CFRelease(resourceData);
+ output_units.length = BOOL_FROM_CFSTRING(propertyList, "feet") ? FEET : METERS;
+ output_units.pressure = BOOL_FROM_CFSTRING(propertyList, "psi") ? PSI : BAR;
+ output_units.volume = BOOL_FROM_CFSTRING(propertyList, "cuft") ? CUFT : LITER;
+ output_units.temperature = BOOL_FROM_CFSTRING(propertyList, "fahrenheit") ? FAHRENHEIT : CELSIUS;
+ visible_cols.temperature = BOOL_FROM_CFSTRING(propertyList, "TEMPERATURE");
+ visible_cols.cylinder = BOOL_FROM_CFSTRING(propertyList, "CYLINDER");
+ visible_cols.nitrox = BOOL_FROM_CFSTRING(propertyList, "NITROX");
+ visible_cols.sac = BOOL_FROM_CFSTRING(propertyList, "SAC");
+ visible_cols.otu = BOOL_FROM_CFSTRING(propertyList, "OTU");
+ CFRelease(propertyList);