I wanted to get gpu name, and found the code that does this using IOKit. The only problem is that this code was in Objective-C, while my project is in C, and I don't know how to use C-string instead of NSString.
const void *GPUModel = CFDictionaryGetValue(serviceDictionary, CFSTR("model"));
if (GPUModel != NULL) {
if (CFGetTypeID(GPUModel) == CFDataGetTypeID()) {
//(Original Comment) Create a string from the CFDataRef.
//NSString *modelName = [[NSString alloc] initWithData:
// (NSData *)GPUModel encoding:NSASCIIStringEncoding];
}
}
Solution thanks to Cy-4AH and Rob Napier.