From ae5f268e5ae7e7736043f9e57930ca4f25b4a5e8 Mon Sep 17 00:00:00 2001 From: Alex Leigh Date: Sat, 15 Dec 2012 16:43:14 -0500 Subject: [PATCH] Initial import --- .gitignore | 2 + smc_util.c | 459 ++++++++++++++++++ smc_util.h | 100 ++++ smc_util.xcodeproj/project.pbxproj | 223 +++++++++ .../contents.xcworkspacedata | 7 + 5 files changed, 791 insertions(+) create mode 100644 .gitignore create mode 100644 smc_util.c create mode 100644 smc_util.h create mode 100644 smc_util.xcodeproj/project.pbxproj create mode 100644 smc_util.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..d1ffaef --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Build +xcuserdata diff --git a/smc_util.c b/smc_util.c new file mode 100644 index 0000000..6c9532a --- /dev/null +++ b/smc_util.c @@ -0,0 +1,459 @@ +/* + * Apple System Management Control (SMC) Tool + * Copyright (C) 2006 devnull + * + * Compile with: + * cc ./smc_util.c -o smc_util -framework IOKit -framework CoreFoundation -Wno-four-char-constants -Wall -g -arch i386 + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include +#include +#include +#include +#include +#include + +#include "smc_util.h" + +io_connect_t conn; + +UInt32 _strtoul(char *str, int size, int base) { + UInt32 total = 0; + int i; + + for (i = 0; i < size; i++) { + if (base == 16) + total += str[i] << (size - 1 - i) * 8; + else + total += (unsigned char) (str[i] << (size - 1 - i) * 8); + } + return total; +} + +void _ultostr(char *str, UInt32 val) { + str[0] = '\0'; + snprintf(str, 5, "%c%c%c%c", + (unsigned int) val >> 24, + (unsigned int) val >> 16, + (unsigned int) val >> 8, + (unsigned int) val); +} + +float _strtof(char *str, int size, int e) { + float total = 0; + int i; + + for (i = 0; i < size; i++) { + if (i == (size - 1)) + total += (str[i] & 0xff) >> e; + else + total += str[i] << (size - 1 - i) * (8 - e); + } + + return total; +} + +void printFPE2(SMCVal_t val) { + /* FIXME: This decode is incomplete, last 2 bits are dropped */ + printf("%.0f ", _strtof(val.bytes, val.dataSize, 2)); +} + +void printUInt(SMCVal_t val) { + printf("%u ", (unsigned int) _strtoul(val.bytes, val.dataSize, 10)); +} + +void printString(SMCVal_t val) { + printf("%s ", val.bytes); +} + +void printBytesHex(SMCVal_t val) { + int i; + + printf("(bytes"); + for (i = 0; i < val.dataSize; i++) { + printf(" %02x", (unsigned char) val.bytes[i]); + } + printf(")\n"); +} + +void printVal(SMCVal_t val) { + printf(" %s [%-4s] ", val.key, val.dataType); + + if (val.dataSize > 0) { + if ((strcmp(val.dataType, DATATYPE_UINT8) == 0) || + (strcmp(val.dataType, DATATYPE_UINT16) == 0) || + (strcmp(val.dataType, DATATYPE_UINT32) == 0) + ) { + printUInt(val); + } + + else if (strcmp(val.dataType, DATATYPE_FPE2) == 0) { + printFPE2(val); + } + + else if (strcmp(val.dataType, DATATYPE_CHARSTAR) == 0) { + printString(val); + } + + printBytesHex(val); + } + + else { + printf("no data\n"); + } +} + +kern_return_t SMCOpen(io_connect_t *conn) { + kern_return_t result; + mach_port_t masterPort; + io_iterator_t iterator; + io_object_t device; + + result = IOMasterPort(MACH_PORT_NULL, &masterPort); + + CFMutableDictionaryRef matchingDictionary = IOServiceMatching("AppleSMC"); + result = IOServiceGetMatchingServices(masterPort, matchingDictionary, &iterator); + if (result != kIOReturnSuccess) { + printf("Error: IOServiceGetMatchingServices() = %08x\n", result); + return 1; + } + + device = IOIteratorNext(iterator); + IOObjectRelease((io_object_t)iterator); + if (device == 0) { + printf("Error: no SMC found\n"); + return 1; + } + + result = IOServiceOpen(device, mach_task_self(), 0, conn); + IOObjectRelease(device); + if (result != kIOReturnSuccess) { + printf("Error: IOServiceOpen() = %08x\n", result); + return 1; + } + + return kIOReturnSuccess; +} + +kern_return_t SMCClose(io_connect_t conn) { + return IOServiceClose(conn); +} + +kern_return_t SMCCall(int index, SMCKeyData_t *inputStructure, SMCKeyData_t *outputStructure) { + IOItemCount inputStructureSize = sizeof(SMCKeyData_t); + IOByteCount outputStructureSize = sizeof(SMCKeyData_t); + + return IOConnectMethodStructureIStructureO( + conn, + index, + inputStructureSize, + &outputStructureSize, + inputStructure, + outputStructure); + + /*return IOConnectCallStructMethod(conn, + index, + inputStructure, + structureInputSize, + outputStructure, + &structureOutputSize); + + return IOConnectCallStructMethod((mach_port_t)conn, + index, + (const void*)&inputStructure, + inputStructureSize, + (void*)&outputStructure, + &outputStructureSize);*/ +} + +kern_return_t SMCReadKey(UInt32Char_t key, SMCVal_t *val) { + kern_return_t result; + SMCKeyData_t inputStructure; + SMCKeyData_t outputStructure; + + memset(&inputStructure, 0, sizeof(SMCKeyData_t)); + memset(&outputStructure, 0, sizeof(SMCKeyData_t)); + memset(val, 0, sizeof(SMCVal_t)); + + inputStructure.key = _strtoul(key, 4, 16); + snprintf(val->key, 5, "%s", key); + inputStructure.data8 = SMC_CMD_READ_KEYINFO; + + result = SMCCall(KERNEL_INDEX_SMC, &inputStructure, &outputStructure); + if (result != kIOReturnSuccess) + return result; + + val->dataSize = outputStructure.keyInfo.dataSize; + _ultostr(val->dataType, outputStructure.keyInfo.dataType); + inputStructure.keyInfo.dataSize = val->dataSize; + inputStructure.data8 = SMC_CMD_READ_BYTES; + + result = SMCCall(KERNEL_INDEX_SMC, &inputStructure, &outputStructure); + if (result != kIOReturnSuccess) + return result; + + memcpy(val->bytes, outputStructure.bytes, sizeof(outputStructure.bytes)); + + return kIOReturnSuccess; +} + +kern_return_t SMCWriteKey(SMCVal_t writeVal) { + kern_return_t result; + SMCKeyData_t inputStructure; + SMCKeyData_t outputStructure; + + SMCVal_t readVal; + + result = SMCReadKey(writeVal.key, &readVal); + if (result != kIOReturnSuccess) + return result; + + if (readVal.dataSize != writeVal.dataSize) { + //return kIOReturnError; + writeVal.dataSize = readVal.dataSize; + } + + memset(&inputStructure, 0, sizeof(SMCKeyData_t)); + memset(&outputStructure, 0, sizeof(SMCKeyData_t)); + + inputStructure.key = _strtoul(writeVal.key, 4, 16); + inputStructure.data8 = SMC_CMD_WRITE_BYTES; + inputStructure.keyInfo.dataSize = writeVal.dataSize; + memcpy(inputStructure.bytes, writeVal.bytes, sizeof(writeVal.bytes)); + + result = SMCCall(KERNEL_INDEX_SMC, &inputStructure, &outputStructure); + if (result != kIOReturnSuccess) + return result; + + return kIOReturnSuccess; +} + +UInt32 SMCReadIndexCount(void) { + SMCVal_t val; + int num = 0; + + SMCReadKey("#KEY", &val); + //num = _strtoul(val.bytes, val.dataSize, 10); + num = ((int)val.bytes[2] << 8) + ((unsigned)val.bytes[3] & 0xff); + printf("Num: b0=%x b1=%x b2=%x b3=%x size=%ld\n", + val.bytes[0], val.bytes[1], val.bytes[2], val.bytes[3], val.dataSize); + //return _strtoul(val.bytes, 4 /*val.dataSize*/, 10); + return num; +} + +kern_return_t SMCPrintAll(void) { + kern_return_t result; + SMCKeyData_t inputStructure; + SMCKeyData_t outputStructure; + + int totalKeys, i; + UInt32Char_t key; + SMCVal_t val; + + totalKeys = SMCReadIndexCount(); + for (i = 0; i < totalKeys; i++) { + memset(&inputStructure, 0, sizeof(SMCKeyData_t)); + memset(&outputStructure, 0, sizeof(SMCKeyData_t)); + memset(&val, 0, sizeof(SMCVal_t)); + + inputStructure.data8 = SMC_CMD_READ_INDEX; + inputStructure.data32 = i; + + result = SMCCall(KERNEL_INDEX_SMC, &inputStructure, &outputStructure); + if (result != kIOReturnSuccess) + continue; + + _ultostr(key, outputStructure.key); + + result = SMCReadKey(key, &val); + printVal(val); + } + + return kIOReturnSuccess; +} + +kern_return_t SMCPrintFans(void) { + kern_return_t result; + SMCVal_t val; + UInt32Char_t key; + int totalFans, i; + + result = SMCReadKey("FNum", &val); + if (result != kIOReturnSuccess) + return kIOReturnError; + + totalFans = _strtoul(val.bytes, val.dataSize, 10); + printf("Total fans in system: %d\n", totalFans); + + for (i = 0; i < totalFans; i++) { + printf("\nFan #%d:\n", i); + snprintf(key, 5, "F%dAc", i); + SMCReadKey(key, &val); + printf(" Actual speed : %.0f Key[%s]\n", _strtof(val.bytes, val.dataSize, 2), key); + snprintf(key, 5, "F%dMn", i); + SMCReadKey(key, &val); + printf(" Minimum speed: %.0f\n", _strtof(val.bytes, val.dataSize, 2)); + snprintf(key, 5, "F%dMx", i); + SMCReadKey(key, &val); + printf(" Maximum speed: %.0f\n", _strtof(val.bytes, val.dataSize, 2)); + snprintf(key, 5, "F%dSf", i); + SMCReadKey(key, &val); + printf(" Safe speed : %.0f\n", _strtof(val.bytes, val.dataSize, 2)); + sprintf(key, "F%dTg", i); + SMCReadKey(key, &val); + printf(" Target speed : %.0f\n", _strtof(val.bytes, val.dataSize, 2)); + SMCReadKey("FS! ", &val); + if ((_strtoul(val.bytes, 2, 16) & (1 << i)) == 0) + printf(" Mode : auto\n"); + else + printf(" Mode : forced\n"); + } + + return kIOReturnSuccess; +} + +void usage(char* prog) { + printf("Apple System Management Control (SMC) tool %s\n", VERSION); + printf("Usage:\n"); + printf("%s [options]\n", prog); + printf(" -f : fan info decoded\n"); + printf(" -h : help\n"); + printf(" -k : key to manipulate\n"); + printf(" -l : list all keys and values\n"); + printf(" -r : read the value of a key\n"); + printf(" -w : write the specified value to a key\n"); + printf(" -v : version\n"); + printf("\n"); +} + +int main(int argc, char *argv[]) { + int c; + extern char *optarg; + + kern_return_t result; + int op = OP_NONE; + UInt32Char_t key = "\0"; + SMCVal_t val; + + while ((c = getopt(argc, argv, "fhk:lrw:v")) != -1) { + switch(c) { + case 'f': + op = OP_READ_FAN; + break; + case 'k': + snprintf(key, 5, "%s", optarg); + break; + case 'l': + op = OP_LIST; + break; + case 'r': + op = OP_READ; + break; + case 'v': + printf("%s\n", VERSION); + return 0; + break; + case 'w': + op = OP_WRITE; + { + int i, j, k1, k2; + char c; + char* p = optarg; j=0; i=0; + while (i < strlen(optarg)) + { + c = *p++; k1=k2=0; i++; + /*if (c=' ') { + c = *p++; i++; + }*/ + if ((c >= '0') && (c<='9')) { + k1=c-'0'; + } else if ((c >='a') && (c<='f')) { + k1=c-'a'+10; + } + c = *p++; i++; + /*if (c=' ') { + c = *p++; i++; + }*/ + if ((c >= '0') && (c<='9')) { + k2=c-'0'; + } else if ((c >= 'a') && (c<='f')) { + k2=c-'a'+10; + } + + //snprintf(c, 2, "%c%c", optarg[i * 2], optarg[(i * 2) + 1]); + val.bytes[j++] = (int)(((k1&0xf)<<4) + (k2&0xf)); + } + val.dataSize = j; + /*if ((val.dataSize * 2) != strlen(optarg)) { + printf("Error: value is not valid\n"); + return 1; + }*/ + } + break; + case 'h': + case '?': + op = OP_NONE; + break; + } + } + + if (op == OP_NONE) { + usage(argv[0]); + return 1; + } + + SMCOpen(&conn); + + switch(op) { + case OP_LIST: + result = SMCPrintAll(); + if (result != kIOReturnSuccess) + printf("Error: SMCPrintAll() = %08x\n", result); + break; + case OP_READ: + if (strlen(key) > 0) { + result = SMCReadKey(key, &val); + if (result != kIOReturnSuccess) + printf("Error: SMCReadKey() = %08x\n", result); + else + printVal(val); + } + else { + printf("Error: specify a key to read\n"); + } + break; + case OP_READ_FAN: + result = SMCPrintFans(); + if (result != kIOReturnSuccess) + printf("Error: SMCPrintFans() = %08x\n", result); + break; + case OP_WRITE: + if (strlen(key) > 0) { + snprintf(val.key, 5, "%s", key); + result = SMCWriteKey(val); + if (result != kIOReturnSuccess) + printf("Error: SMCWriteKey() = %08x\n", result); + } + else { + printf("Error: specify a key to write\n"); + } + break; + } + + SMCClose(conn); + return 0;; +} diff --git a/smc_util.h b/smc_util.h new file mode 100644 index 0000000..fa7249f --- /dev/null +++ b/smc_util.h @@ -0,0 +1,100 @@ +/* + * Apple System Management Control (SMC) Tool + * Copyright (C) 2006 devnull + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __SMC_UTIL_H__ +#define __SMC_UTIL_H__ +#endif + +#define VERSION "1" + +#define OP_NONE 0 +#define OP_LIST 1 +#define OP_READ 2 +#define OP_READ_FAN 3 +#define OP_WRITE 4 + +#define KERNEL_INDEX_SMC 2 + +#define SMC_CMD_READ_BYTES 5 +#define SMC_CMD_WRITE_BYTES 6 +#define SMC_CMD_READ_INDEX 8 +#define SMC_CMD_READ_KEYINFO 9 +#define SMC_CMD_READ_PLIMIT 11 +#define SMC_CMD_READ_VERS 12 + +#define DATATYPE_FPE2 "fpe2" +#define DATATYPE_UINT8 "ui8 " +#define DATATYPE_UINT16 "ui16" +#define DATATYPE_UINT32 "ui32" +#define DATATYPE_CHARSTAR "ch8*" + +typedef struct { + char major; + char minor; + char build; + char reserved[1]; + UInt16 release; +} SMCKeyData_vers_t; + +typedef struct { + UInt16 version; + UInt16 length; + UInt32 cpuPLimit; + UInt32 gpuPLimit; + UInt32 memPLimit; +} SMCKeyData_pLimitData_t; + +typedef struct { + UInt32 dataSize; + UInt32 dataType; + char dataAttributes; +} SMCKeyData_keyInfo_t; + +typedef char SMCBytes_t[32]; + +typedef struct { + UInt32 key; + SMCKeyData_vers_t vers; + SMCKeyData_pLimitData_t pLimitData; + SMCKeyData_keyInfo_t keyInfo; + char result; + char status; + char data8; + UInt32 data32; + SMCBytes_t bytes; +} SMCKeyData_t; + +typedef char UInt32Char_t[5]; + +typedef struct { + UInt32Char_t key; + UInt32 dataSize; + UInt32Char_t dataType; + SMCBytes_t bytes; +} SMCVal_t; + +typedef struct { + uint32_t key; + uint8_t __d0[22]; + uint32_t datasize; + uint8_t __d1[10]; + uint8_t cmd; + uint32_t __d2; + uint8_t data[32]; +} AppleSMCBuffer_t; diff --git a/smc_util.xcodeproj/project.pbxproj b/smc_util.xcodeproj/project.pbxproj new file mode 100644 index 0000000..491e019 --- /dev/null +++ b/smc_util.xcodeproj/project.pbxproj @@ -0,0 +1,223 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 46; + objects = { + +/* Begin PBXBuildFile section */ + D853D8D2167D19A30011FC70 /* smc_util.c in Sources */ = {isa = PBXBuildFile; fileRef = D853D8CF167D19A30011FC70 /* smc_util.c */; }; + D853D8D8167D1A1B0011FC70 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D853D8D7167D1A1B0011FC70 /* CoreFoundation.framework */; }; + D853D8DE167D1A370011FC70 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D853D8DD167D1A370011FC70 /* IOKit.framework */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + D853D8BF167D18DB0011FC70 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = /usr/share/man/man1/; + dstSubfolderSpec = 0; + files = ( + ); + runOnlyForDeploymentPostprocessing = 1; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + D853D8C1167D18DB0011FC70 /* smc_util */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = smc_util; sourceTree = BUILT_PRODUCTS_DIR; }; + D853D8CF167D19A30011FC70 /* smc_util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = smc_util.c; sourceTree = ""; }; + D853D8D0167D19A30011FC70 /* smc_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = smc_util.h; sourceTree = ""; }; + D853D8D7167D1A1B0011FC70 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; + D853D8DD167D1A370011FC70 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + D853D8BE167D18DB0011FC70 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + D853D8DE167D1A370011FC70 /* IOKit.framework in Frameworks */, + D853D8D8167D1A1B0011FC70 /* CoreFoundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + D853D8B6167D18DB0011FC70 = { + isa = PBXGroup; + children = ( + D853D8D0167D19A30011FC70 /* smc_util.h */, + D853D8CF167D19A30011FC70 /* smc_util.c */, + D853D8DF167D1A3B0011FC70 /* Frameworks */, + D853D8C2167D18DB0011FC70 /* Products */, + ); + sourceTree = ""; + }; + D853D8C2167D18DB0011FC70 /* Products */ = { + isa = PBXGroup; + children = ( + D853D8C1167D18DB0011FC70 /* smc_util */, + ); + name = Products; + sourceTree = ""; + }; + D853D8DF167D1A3B0011FC70 /* Frameworks */ = { + isa = PBXGroup; + children = ( + D853D8DD167D1A370011FC70 /* IOKit.framework */, + D853D8D7167D1A1B0011FC70 /* CoreFoundation.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + D853D8C0167D18DB0011FC70 /* smc_util */ = { + isa = PBXNativeTarget; + buildConfigurationList = D853D8CB167D18DB0011FC70 /* Build configuration list for PBXNativeTarget "smc_util" */; + buildPhases = ( + D853D8BD167D18DB0011FC70 /* Sources */, + D853D8BE167D18DB0011FC70 /* Frameworks */, + D853D8BF167D18DB0011FC70 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = smc_util; + productName = smc_util; + productReference = D853D8C1167D18DB0011FC70 /* smc_util */; + productType = "com.apple.product-type.tool"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + D853D8B8167D18DB0011FC70 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0450; + ORGANIZATIONNAME = Atomatica; + }; + buildConfigurationList = D853D8BB167D18DB0011FC70 /* Build configuration list for PBXProject "smc_util" */; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = English; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = D853D8B6167D18DB0011FC70; + productRefGroup = D853D8C2167D18DB0011FC70 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + D853D8C0167D18DB0011FC70 /* smc_util */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + D853D8BD167D18DB0011FC70 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + D853D8D2167D19A30011FC70 /* smc_util.c in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + D853D8C9167D18DB0011FC70 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = NO; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_SYMBOLS_PRIVATE_EXTERN = NO; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = macosx; + }; + name = Debug; + }; + D853D8CA167D18DB0011FC70 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD_32_BIT)"; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + COPY_PHASE_STRIP = YES; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_ENABLE_OBJC_EXCEPTIONS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + MACOSX_DEPLOYMENT_TARGET = 10.8; + SDKROOT = macosx; + }; + name = Release; + }; + D853D8CC167D18DB0011FC70 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D853D8CD167D18DB0011FC70 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + D853D8BB167D18DB0011FC70 /* Build configuration list for PBXProject "smc_util" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D853D8C9167D18DB0011FC70 /* Debug */, + D853D8CA167D18DB0011FC70 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + D853D8CB167D18DB0011FC70 /* Build configuration list for PBXNativeTarget "smc_util" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D853D8CC167D18DB0011FC70 /* Debug */, + D853D8CD167D18DB0011FC70 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; +/* End XCConfigurationList section */ + }; + rootObject = D853D8B8167D18DB0011FC70 /* Project object */; +} diff --git a/smc_util.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/smc_util.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..0fa241a --- /dev/null +++ b/smc_util.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + +