您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CFShow函数代码示例

51自学网 2021-06-01 19:59:11
  C++
这篇教程C++ CFShow函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CFShow函数的典型用法代码示例。如果您正苦于以下问题:C++ CFShow函数的具体用法?C++ CFShow怎么用?C++ CFShow使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CFShow函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: writePropertyListToFile

void writePropertyListToFile (CFDataRef data) {    CFStringRef errorString;    CFPropertyListRef propertyList = CFPropertyListCreateFromXMLData (NULL, data, kCFPropertyListMutableContainersAndLeaves, &errorString);    if (errorString == NULL) {        CFStringRef urlString = CFStringCreateWithCString (NULL, kFilename, CFStringGetSystemEncoding ());        CFURLRef fileURL = CFURLCreateWithFileSystemPath (NULL, urlString, kCFURLPOSIXPathStyle, FALSE);        CFWriteStreamRef stream = CFWriteStreamCreateWithFile (NULL, fileURL);        Boolean isOpen = CFWriteStreamOpen (stream);        show (CFSTR ("Property list (as written to file):/n%@"), propertyList);          CFIndex bytesWritten = CFPropertyListWriteToStream (propertyList, stream, kCFPropertyListXMLFormat_v1_0, NULL);        CFWriteStreamClose (stream);    }    else {        CFShow (errorString);        CFRelease (errorString);    }    CFRelease (propertyList);}
开发者ID:Ashod,项目名称:WinCairoRequirements,代码行数:27,


示例2: GPDuplexClient_Send

extern CFDataRef GPDuplexClient_Send(GPDuplexClientRef client, SInt32 type, CFDataRef data, Boolean expectsReturn) {	CFMessagePortRef serverPort;	if (client != NULL)		serverPort = client->serverPort;	else {		serverPort = CFMessagePortCreateRemote(NULL, CFSTR("hk.kennytm.GriP.server"));		if (serverPort == NULL) {			CFShow(CFSTR("GPDuplexClient_Send(): Cannot create server port. Is GriP running?"));			return NULL;		}	}		if (expectsReturn) {		CFDataRef retData = NULL;		SInt32 errorCode = CFMessagePortSendRequest(serverPort, type, data, 4, 1, kCFRunLoopDefaultMode, &retData);		if (client == NULL)			CFRelease(serverPort);		if (errorCode != kCFMessagePortSuccess) {			CFLog(4, CFSTR("GPDuplexClient_Send(): Cannot send data %@ of type %d to server. Returning NULL. Error code = %d"), data, type, errorCode);			if (retData != NULL) {				CFRelease(retData);				retData = NULL;			}		}		return retData;	} else {		SInt32 errorCode = CFMessagePortSendRequest(serverPort, type, data, 4, 0, NULL, NULL);		if (client == NULL)			CFRelease(serverPort);		if (errorCode != kCFMessagePortSuccess) {			CFLog(4, CFSTR("GPDuplexClient_Send(): Cannot send data %@ of type %d to server. Error code = %d"), data, type, errorCode);		}		return NULL;	}}
开发者ID:525828027,项目名称:networkpx,代码行数:35,


示例3: wireless_scan_ssid

static CFArrayRefwireless_scan_ssid(wireless_t wref, CFStringRef ssid){    CFArrayRef			bssid_list = NULL;    Apple80211Err		error;    CFDictionaryRef	 	scan_args;    CFArrayRef 			scan_result = NULL;		EAPLOG(LOG_ERR, "######## DEBUG ####### - FAIL - wireless_scan_ssid");	    scan_args = make_scan_args(ssid, 1);    error = Apple80211Scan((Apple80211Ref)wref, &scan_result, scan_args);    CFRelease(scan_args);    if (error != kA11NoErr) {		EAPLOG(LOG_ERR, "Apple80211Scan failed, %d/n", error);		goto failed;    }    bssid_list = copy_bssid_list_from_scan(scan_result, ssid);    if (bssid_list == NULL) {		EAPLOG(LOG_ERR, "No scan results/n");    }    else {		CFShow(bssid_list);    }    fflush(stdout);    fflush(stderr);	failed:    my_CFRelease(&scan_result);    return (bssid_list);	}
开发者ID:gfleury,项目名称:eap8021x-debug,代码行数:32,


示例4: TestDuplicateAndDeleteSet

static void TestDuplicateAndDeleteSet(void)	// A test of the set duplication and deleting routines.{	OSStatus err;	CFStringRef currentSetID;	CFStringRef newSetID;		currentSetID = NULL;	newSetID = NULL;	err = MoreSCCopyCurrentSet(&currentSetID);	if (err == noErr) {		err = MoreSCDuplicateSet(currentSetID, CFSTR("Frog"), &newSetID);	}	if (err == noErr) {		if (!gRunQuiet) {			fprintf(stderr, "New set ID is ");			CFShow(newSetID);		}				err = MoreSCDeleteSet(newSetID);	}		CFQRelease(currentSetID);	CFQRelease(newSetID);	PrintTestResult(err, NULL);}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:27,


示例5: JSRunEvaluate

/*    JSRunEvaluate*/JSObjectRef JSRunEvaluate(JSRunRef ref){    JSObjectRef result = 0;    JSRun* ptr = (JSRun*)ref;    if (ptr)    {        Completion completion = ptr->Evaluate();        if (completion.isValueCompletion())        {            result = (JSObjectRef)KJSValueToJSObject(completion.value(), ptr->GetInterpreter()->globalExec());        }        if (completion.complType() == Throw)        {            JSFlags flags = ptr->Flags();            if (flags & kJSFlagDebug)            {                CFTypeRef error = JSObjectCopyCFValue(result);                if (error)                {                    CFShow(error);                    CFRelease(error);                }            }        }    }    return result;}
开发者ID:jackiekaon,项目名称:owb-mirror,代码行数:31,


示例6: GTMSMJobCopyDictionary

CFDictionaryRef GTMSMJobCopyDictionary(CFStringRef jobLabel) {  CFDictionaryRef dict = NULL;  CFErrorRef error = NULL;  launch_data_t resp = GTMPerformOnLabel(LAUNCH_KEY_GETJOB,                                         jobLabel,                                         &error);  if (resp) {    launch_data_type_t ldata_Type = launch_data_get_type(resp);    if (ldata_Type == LAUNCH_DATA_DICTIONARY) {      dict = GTMCFTypeCreateFromLaunchData(resp, true, &error);    } else {      error = GTMCFLaunchCreateUnlocalizedError(EINVAL,                                                CFSTR("Unknown launchd type %d"),                                                ldata_Type);    }    launch_data_free(resp);  }  if (error) {#ifdef DEBUG    CFShow(error);#endif //  DEBUG    CFRelease(error);  }  return dict;}
开发者ID:aseehra,项目名称:google-toolbox-for-mac,代码行数:25,


示例7: _ShowCF

static void	_ShowCF (FILE* file, CFStringRef str){	if (CFGetTypeID(str) != CFStringGetTypeID()) {		CFShow(str);		return;	}	UInt32 len = CFStringGetLength(str);	char* chars = (char*)CA_malloc (len * 2); // give us plenty of room for unichar chars	if (CFStringGetCString (str, chars, len * 2, kCFStringEncodingUTF8))		fprintf (file, "%s", chars);	else		CFShow (str);	free (chars);}
开发者ID:AdamDiment,项目名称:CocoaSampleCode,代码行数:16,


示例8: main

intmain (int argc, const char *argv[]){    CFShow(CFSTR("Hello, World!/n"));    return EXIT_SUCCESS;}
开发者ID:senojsitruc,项目名称:Chatter,代码行数:7,


示例9: dumpSetProperties

static voiddumpSetProperties(CFMutableDictionaryRef set){    CFPrintf(CFSTR("/n%@/n"), CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetUUIDKey)));    CFPrintf(CFSTR("/t/"%@/" type = %@ /dev/%@/n"),	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetNameKey)),	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDLevelNameKey)),	     CFDictionaryGetValue(set, CFSTR("BSD Name")));    CFPrintf(CFSTR("/tstatus = %@, sequence = %@/n"),	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDStatusKey)),	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDSequenceNumberKey)));    CFPrintf(CFSTR("/tchunk count = %@, chunk size = %@/n"),	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDChunkCountKey)),	     CFDictionaryGetValue(set, CFSTR(kAppleRAIDChunkSizeKey)));    CFStringRef level = CFDictionaryGetValue(set, CFSTR(kAppleRAIDLevelNameKey));    if (CFStringCompare(level, CFSTR("mirror"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {	CFPrintf(CFSTR("/tcontent hint = %@, auto = %@, quick = %@, timeout = %@/n"),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetContentHintKey)),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetAutoRebuildKey)),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetQuickRebuildKey)),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetTimeoutKey)));    } else if (CFStringCompare(level, CFSTR("LVG"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {	CFPrintf(CFSTR("/tcontent hint = %@, lv count = %@, free space %@/n"),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetContentHintKey)),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDLVGVolumeCountKey)),		 CFDictionaryGetValue(set, CFSTR(kAppleRAIDLVGFreeSpaceKey)));    } else {	CFPrintf(CFSTR("/tcontent hint = %@/n"), CFDictionaryGetValue(set, CFSTR(kAppleRAIDSetContentHintKey)));    }    if (verbose) CFShow(set);}
开发者ID:RomiPierre,项目名称:osx,代码行数:33,


示例10: write_plist

/* @overload write_plist(hash, path) * * Writes the serialized contents of a property list to the specified path. * * @note This does not yet support all possible types that can exist in a valid property list. * * @note This currently only assumes to be given an Xcode project document. *       This means that it only accepts dictionaries, arrays, and strings in *       the document. * * @param [Hash] hash     The property list to serialize. * @param [String] path   The path to the property list file. * @return [true, false]  Wether or not saving was successful. */static VALUEwrite_plist(VALUE self, VALUE hash, VALUE path) {  VALUE h = rb_check_convert_type(hash, T_HASH, "Hash", "to_hash");  if (NIL_P(h)) {    rb_raise(rb_eTypeError, "%s can't be coerced to Hash", rb_obj_classname(hash));  }  CFMutableDictionaryRef dict = CFDictionaryCreateMutable(NULL,                                                          0,                                                          &kCFTypeDictionaryKeyCallBacks,                                                          &kCFTypeDictionaryValueCallBacks);  rb_hash_foreach(h, dictionary_set, (st_data_t)dict);  CFURLRef fileURL = str_to_url(path);  CFWriteStreamRef stream = CFWriteStreamCreateWithFile(NULL, fileURL);  CFRelease(fileURL);  CFIndex success = 0;  if (CFWriteStreamOpen(stream)) {    CFStringRef errorString;    success = CFPropertyListWriteToStream(dict, stream, kCFPropertyListXMLFormat_v1_0, &errorString);    if (!success) {      CFShow(errorString);    }  } else {    printf("Unable to open stream!/n");  }  CFRelease(dict);  return success ? Qtrue : Qfalse;}
开发者ID:Ashton-W,项目名称:Xcodeproj,代码行数:46,


示例11: DebugModemScriptSearch

	static void DebugModemScriptSearch(void)		// Used for debugging the modem script code.	{		OSStatus 	err;		CFArrayRef	cclArray;		CFIndex		indexOfDefaultCCL;				cclArray = NULL;		err = MoreSCCreateCCLArray(&cclArray, &indexOfDefaultCCL);		if (err == noErr) {			CFIndex i;			CFIndex c;						c = CFArrayGetCount(cclArray);			fprintf(stderr, "CCL Count = %ld/n", c);			for (i = 0; i < c; i++) {				fprintf(stderr, "%3ld %c ", i, i == indexOfDefaultCCL ? '*' : ' ');				CFShow(CFArrayGetValueAtIndex(cclArray, i));			}		}				CFQRelease(cclArray);			    if (err == noErr) {    	    fprintf(stderr, "Success!/n");	    } else {    	    fprintf(stderr, "*** Failed with error %ld!/n", err);	    }	}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:29,


示例12: main

int main(int argc, const char * argv[]){    // insert code here...    CFShow(CFSTR("Hello, World!/n"));    return 0;}
开发者ID:ERICx86,项目名称:Exercise,代码行数:7,


示例13: xml_load

// ---------------------------------// Load the element strings from the given resource (XML) file into a CFPropertyListRefstatic CFPropertyListRef xml_load(const CFStringRef pResourceName,const CFStringRef pResourceExtension){	CFPropertyListRef tCFPropertyListRef = NULL;	CFURLRef resFileCFURLRef = CFBundleCopyResourceURL(CFBundleGetMainBundle(), pResourceName, pResourceExtension, NULL);	if (NULL != resFileCFURLRef)	{		CFDataRef resCFDataRef;		if (CFURLCreateDataAndPropertiesFromResource(kCFAllocatorDefault, resFileCFURLRef, &resCFDataRef, nil, nil, nil))		{			if (NULL != resCFDataRef)			{				CFStringRef errorString;				tCFPropertyListRef = CFPropertyListCreateFromXMLData(kCFAllocatorDefault, resCFDataRef, kCFPropertyListImmutable, &errorString);				if (NULL == tCFPropertyListRef)					CFShow(errorString);				CFRelease(resCFDataRef);			}		}		CFRelease(resFileCFURLRef);	}	return tCFPropertyListRef;}
开发者ID:AlanFreeman,项目名称:Psychtoolbox-3,代码行数:27,


示例14: GTMSMCopyAllJobDictionaries

CFDictionaryRef GTMSMCopyAllJobDictionaries(void) {  CFDictionaryRef dict = NULL;  launch_data_t msg = launch_data_new_string(LAUNCH_KEY_GETJOBS);  launch_data_t resp = launch_msg(msg);  launch_data_free(msg);  CFErrorRef error = NULL;  if (resp) {    launch_data_type_t ldata_Type = launch_data_get_type(resp);    if (ldata_Type == LAUNCH_DATA_DICTIONARY) {      dict = GTMCFTypeCreateFromLaunchData(resp, true, &error);    } else {      error = GTMCFLaunchCreateUnlocalizedError(EINVAL,                                                CFSTR("Unknown launchd type %d"),                                                ldata_Type);    }    launch_data_free(resp);  } else {    error      = GTMCFLaunchCreateUnlocalizedError(errno, CFSTR(""));  }  if (error) {#ifdef DEBUG    CFShow(error);#endif //  DEBUG    CFRelease(error);  }  return dict;}
开发者ID:aseehra,项目名称:google-toolbox-for-mac,代码行数:29,


示例15: CFDictionaryGetValue

/* Get the value for the given key. We don't allow NULL ad a value, so * returning NULL means failure (not present). */CFPropertyListRef Preferences::get_value(CFStringRef key) const{    CFPropertyListRef prefval = NULL;    if (!this->is_loaded()) {	return NULL;    }    if (this->m_plist) {	prefval = CFDictionaryGetValue((CFDictionaryRef)this->m_plist, key);    } else if (this->m_scpref) {	prefval = SCPreferencesGetValue(this->m_scpref, key);    }    /* Dump the raw keys for debugging. Useful for figuring out whether our     * type conversion has gone awry.     */    if (Options::Debug) {	DEBUGMSG("%s value for key %s:/n",		this->m_pspec.c_str(), cfstring_convert(key).c_str());	CFShow(prefval);    }    return prefval;}
开发者ID:aosm,项目名称:samba,代码行数:28,


示例16: GetACLAuthorizationTagFromString

sint32 GetACLAuthorizationTagFromString(CFStringRef aclStr){	if (NULL == aclStr)	{#ifndef NDEBUG		CFShow(CFSTR("GetACLAuthorizationTagFromString aclStr is NULL"));#endif		return 0;	}	static CFDictionaryRef gACLMapping = NULL;	if (NULL == gACLMapping)	{		gACLMapping = CreateStringToNumDictionary();	}	sint32 result = 0;	CFNumberRef valueResult = (CFNumberRef)CFDictionaryGetValue(gACLMapping, aclStr);	if (NULL != valueResult)	{		if (!CFNumberGetValue(valueResult, kCFNumberSInt32Type, &result))		{			return 0;		}	}	else	{		return 0;	}	return result;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:35,


示例17: AcroPluginCFragInitFunction

OSErr AcroPluginCFragInitFunction( const CFragInitBlock *	initBlock ){	OSErr err = __initialize(initBlock);		if (err == noErr)	{	#if TARGET_API_MAC_CARBON		if (initBlock->fragLocator.where == kDataForkCFragLocator)		{			// Mac OS X 10.1 and earlier has a bug where packaged CFM libs are still passed 			// kDataForkCFragLocator instead of kCFBundleCFragLocator. Apple claims this will			// fixed in Jaguar.			FSSpec spec = *initBlock->fragLocator.u.onDisk.fileSpec;						// See if parent folder is named "MacOS"			FSMakeFSSpec(spec.vRefNum, spec.parID, "/p", &spec);			if (IdenticalString(spec.name, "/pMacOS", NULL) == 0)			{				// See if parent folder is named "Contents"				FSMakeFSSpec(spec.vRefNum, spec.parID, "/p", &spec);				if (IdenticalString(spec.name, "/pContents", NULL) == 0)				{					// Get Bundle Ref					FSRef fsRef;					FSMakeFSSpec(spec.vRefNum, spec.parID, "/p", &spec);					if (noErr == FSpMakeFSRef(&spec, &fsRef))					{						CFURLRef cfURL = CFURLCreateFromFSRef(NULL, &fsRef);						if (cfURL)						{							gPluginBundle = CFBundleCreate(NULL, cfURL);#if DEBUG							CFShow(cfURL);							CFShow(gPluginBundle);#endif														if (gPluginBundle)								gResFile = CFBundleOpenBundleResourceMap(gPluginBundle);														CFRelease(cfURL);						}					}				}			}		}
开发者ID:Ulysses1962,项目名称:light-imposition,代码行数:45,


示例18: testValidPemKey

void testValidPemKey(void){	CFStringRef pemKey = CFStringCreateWithCString(kCFAllocatorDefault, pemEncodedKey, kCFStringEncodingUTF8);	APSetKey(pemKey);	CFRelease(pemKey);		CFDataRef exampleLicenseFileData = CFDataCreate(NULL,													(const UInt8 *)exampleLicenseFileContents,													(CFIndex)strlen(exampleLicenseFileContents));	Boolean licenseIsValid = APVerifyLicenseData(exampleLicenseFileData);	CFRelease(exampleLicenseFileData);		if (licenseIsValid) {		CFShow(CFSTR("Test OK: Valid file recognised using PEM encoded key"));	} else {		CFShow(CFSTR("Test FAILED: Valid file not recognised using PEM encoded key"));	}}
开发者ID:AhiyaHiya,项目名称:AquaticPrime,代码行数:18,


示例19: __security_debug

void __security_debug(const char *scope, const char *function,    const char *file, int line, const char *format, ...){#if !defined(NDEBUG)	pthread_once(&__security_debug_once, __security_debug_init);	CFStringRef scopeName = NULL;	/* Scope NULL is always enabled. */	if (scope) {		/* Check if the scope is enabled. */		if (scopeSet) {			scopeName = copyScopeName(scope, strlen(scope));			if (negate == CFSetContainsValue(scopeSet, scopeName)) {				CFRelease(scopeName);				return;			}		} else if (!negate) {			return;		}	}	CFStringRef formatStr = CFStringCreateWithCString(kCFAllocatorDefault,		format, kCFStringEncodingUTF8);	va_list args;	va_start(args, format);	CFStringRef message = CFStringCreateWithFormatAndArguments(		kCFAllocatorDefault, NULL, formatStr, args);	va_end(args);	time_t now = time(NULL);	char *date = ctime(&now);	date[19] = '/0';	CFStringRef logStr = CFStringCreateWithFormat(kCFAllocatorDefault, NULL,		CFSTR("%s %-*s %s %@/n"), date + 4, MAX_SCOPE_LENGTH - 1,        scope ? scope : "", function, message);	CFShow(logStr);    char logMsg[4096];    if (CFStringGetCString(logStr, logMsg, sizeof(logMsg), kCFStringEncodingUTF8)) {#if 0        asl_log(NULL, NULL, ASL_LEVEL_INFO, logMsg);#else        aslmsg msg = asl_new(ASL_TYPE_MSG);        if (scope) {            asl_set(msg, ASL_KEY_FACILITY, scope);        }        asl_set(msg, ASL_KEY_LEVEL, ASL_STRING_INFO);        asl_set(msg, ASL_KEY_MSG, logMsg);        asl_send(NULL, msg);        asl_free(msg);#endif    }	CFRelease(logStr);	CFRelease(message);	CFRelease(formatStr);	if (scopeName)		CFRelease(scopeName);#endif}
开发者ID:Apple-FOSS-Mirror,项目名称:Security,代码行数:57,


示例20: TestServiceEnumerate

static void TestServiceEnumerate(void)	// A test of the service enumeration routines.{	OSStatus  err;	ItemCount serviceCount;	ItemCount serviceIndex;	CFArrayRef localServiceIDs;	CFArrayRef resolvedServiceIDs;	localServiceIDs = NULL;	resolvedServiceIDs = NULL;		err = MoreSCCopyServiceIDs(NULL, &localServiceIDs, &resolvedServiceIDs);	if (err == noErr) {		serviceCount = CFArrayGetCount(localServiceIDs);		for (serviceIndex = 0; serviceIndex < serviceCount; serviceIndex++) {			CFStringRef userVisible;			Boolean     active;						userVisible = NULL;			err = MoreSCCopyUserVisibleNameOfService(NULL, (CFStringRef) CFArrayGetValueAtIndex(localServiceIDs, serviceIndex), &userVisible);			if (err == noErr) {				err = MoreSCIsServiceActive(NULL, (CFStringRef) CFArrayGetValueAtIndex(localServiceIDs, serviceIndex), &active);			}			if (err == noErr && !gRunQuiet) {				fprintf(stderr, "#%ld %c ", serviceIndex, (active) ? ' ' : 'X');				CFShow(userVisible);				CFShow(CFArrayGetValueAtIndex(localServiceIDs, serviceIndex));				CFShow(CFArrayGetValueAtIndex(resolvedServiceIDs, serviceIndex));			}						CFQRelease(userVisible);						if (err != noErr) {				break;			}		}	}	CFQRelease(localServiceIDs);	CFQRelease(resolvedServiceIDs);	PrintTestResult(err, NULL);}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:44,


示例21: GetMACAddress

// Given an iterator across a set of Ethernet interfaces, return the MAC address of the last one.// If no interfaces are found the MAC address is set to an empty string.// In this sample the iterator should contain just the primary interface.static kern_return_t GetMACAddress(io_iterator_t intfIterator, UInt8 *MACAddress, UInt8 bufferSize){    io_object_t    intfService;    io_object_t    controllerService;    kern_return_t  kernResult = KERN_FAILURE;    // Make sure the caller provided enough buffer space. Protect against buffer overflow problems.  if (bufferSize < kIOEthernetAddressSize) {    return kernResult;  }  // Initialize the returned address    bzero(MACAddress, bufferSize);    // IOIteratorNext retains the returned object, so release it when we're done with it.    while (intfService = IOIteratorNext(intfIterator))    {        CFTypeRef  MACAddressAsCFData;        // IONetworkControllers can't be found directly by the IOServiceGetMatchingServices call,        // since they are hardware nubs and do not participate in driver matching. In other words,        // registerService() is never called on them. So we've found the IONetworkInterface and will        // get its parent controller by asking for it specifically.        // IORegistryEntryGetParentEntry retains the returned object, so release it when we're done with it.        kernResult = IORegistryEntryGetParentEntry(intfService,                           kIOServicePlane,                           &controllerService);        if (KERN_SUCCESS != kernResult) {            printf("IORegistryEntryGetParentEntry returned 0x%08x/n", kernResult);        }        else {            // Retrieve the MAC address property from the I/O Registry in the form of a CFData            MACAddressAsCFData = IORegistryEntryCreateCFProperty(controllerService,                                 CFSTR(kIOMACAddress),                                 kCFAllocatorDefault,                                 0);            if (MACAddressAsCFData) {                CFShow(MACAddressAsCFData); // for display purposes only; output goes to stderr                // Get the raw bytes of the MAC address from the CFData                CFDataGetBytes((CFDataRef)MACAddressAsCFData, CFRangeMake(0, kIOEthernetAddressSize), MACAddress);                CFRelease(MACAddressAsCFData);            }            // Done with the parent Ethernet controller object so we release it.            (void) IOObjectRelease(controllerService);        }        // Done with the Ethernet interface object so we release it.        (void) IOObjectRelease(intfService);    }    return kernResult;}
开发者ID:DX94,项目名称:BumpTop,代码行数:59,


示例22: Zirk2Port

Zirk2PortClient::Zirk2PortClient() : Zirk2Port(), mRemoteMessagePort(NULL), mData(NULL){	CFMessagePortSetName(mMessagePort, CFSTR("Zirk2PortClient"));	mRemoteMessagePort = CFMessagePortCreateRemote(NULL, CFSTR("Zirk2PortServer"));	if (!mRemoteMessagePort) {		CFShow(CFSTR("Could not create remote message port"));		mRemoteMessagePort = NULL;	}	mData = CFDataCreateMutable(NULL, 0);}
开发者ID:paulz,项目名称:zirkonium,代码行数:10,


示例23: main

int main(int argc, const char** argv) {#if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4  CFErrorRef error = NULL;  CFDictionaryRef dict = GTMSMJobCheckIn(&error);  if (!dict) {    CFShow(error);  }#endif //  if MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_4  return 0;}
开发者ID:StyxUT,项目名称:GoFish,代码行数:10,


示例24: check_date_constructors

bool check_date_constructors (){   CFAbsoluteTime      absTime;   CFDateRef           aCFDate;      CFShow(CFSTR("Checking date constructors:"));   absTime = CFAbsoluteTimeGetCurrent();   aCFDate = CFDateCreate(kCFAllocatorDefault, absTime);      CFShow(CFSTR("Absolute Time is"));   printf("The current absolute time is %f/n", absTime);   CFShow(CFSTR("Equivalent CFDate object is"));   CFShow(aCFDate);      printf("/n");      return true;}
开发者ID:AbhinavBansal,项目名称:opencflite,代码行数:19,


示例25: TestEnumerateEntities

static void TestEnumerateEntities(void)	// A test of the MoreSCCopyEntities routine.{	OSStatus 	err;	CFArrayRef  localServiceIDs;	ItemCount	entityCount;	ItemCount	entityIndex;	CFArrayRef  protocols;	CFArrayRef  values;		// Use NULL for the set ID to indicate that we're operating on	// the current set.	//	// Can't use NULL for a service ID, so we have to come up with 	// a valid service ID first.  We do this by choosing the first 	// service ID.		localServiceIDs = NULL;	protocols = NULL;	values = NULL;		err = MoreSCCopyServiceIDs(NULL, &localServiceIDs, NULL);	if (err == noErr) {		assert(CFArrayGetCount(localServiceIDs) > 0);		err = MoreSCCopyEntities(NULL, (CFStringRef) CFArrayGetValueAtIndex(localServiceIDs, 0), &protocols, &values);	}	if (err == noErr && !gRunQuiet) {		entityCount = CFArrayGetCount(protocols);		for (entityIndex = 0; entityIndex < entityCount; entityIndex++) {			fprintf(stderr, "#%ld ", entityIndex);			CFShow(CFArrayGetValueAtIndex(protocols, entityIndex));			CFShow(CFArrayGetValueAtIndex(values,    entityIndex));		}	}	CFQRelease(localServiceIDs);	CFQRelease(protocols);	CFQRelease(values);		PrintTestResult(err, NULL);}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:42,


示例26: cli_print_info_dict

static void cli_print_info_dict (const void *key,                                 const void *value,                                 void *context){  CFStringRef entry = CFStringCreateWithFormat(NULL, NULL,    CFSTR("%@:/n  %@"), key, value);  if (entry) {    CFShow(entry);    CFRelease(entry);  }}
开发者ID:Zabrane,项目名称:fsevent_watch,代码行数:11,


示例27: cutils_test_appsupport_path_Create

/* -------------------------------------------------------------------------- */void cutils_test_appsupport_path_Create(){    LOG0("---- cutils_test_appsupport_path_Create --------------------------");        CFStringRef appSuppLocal = appsupport_path_Create(kLocalDomain);    CFShow(appSuppLocal);    //LOG_CF("app support folder (local)", appSuppLocal);    assert(CFStringCompare(appSuppLocal,                            CFSTR("/Library/Application Support"), 0) == 0);    }
开发者ID:ettore,项目名称:CLutils,代码行数:12,


示例28: TestPortScanner

static void TestPortScanner(void)	// A simple test of the port scanner code.  This doesn't do a 	// lot of automated testing, but you can look at the results 	// and visually check them.{	OSStatus   	err;	CFArrayRef 	portArray;	CFIndex 	portCount;	CFIndex 	portIndex;	long		order;	CFNumberRef	supportsHold;		portArray = NULL;		err = MoreSCCreatePortArray(&portArray);	if (err == noErr) {		portCount = CFArrayGetCount(portArray);		for (portIndex = 0; portIndex < portCount; portIndex++) {			CFDictionaryRef thisPort;						thisPort = (CFDictionaryRef) CFArrayGetValueAtIndex(portArray, portIndex);			if (!gRunQuiet) {				fprintf(stderr, "Port %ld/n", portIndex);				fprintf(stderr, "  device   = ");				CFShow(CFDictionaryGetValue(thisPort, kSCPropNetInterfaceDeviceName));				fprintf(stderr, "  name     = ");				CFShow(CFDictionaryGetValue(thisPort, kSCPropUserDefinedName));				fprintf(stderr, "  hardware = ");				CFShow(CFDictionaryGetValue(thisPort, kSCPropNetInterfaceHardware));				fprintf(stderr, "  variant  = ");				CFShow(CFDictionaryGetValue(thisPort, kMoreSCPropNetInterfaceHardwareVariant));				fprintf(stderr, "  type     = ");				CFShow(CFDictionaryGetValue(thisPort, kSCPropNetInterfaceType));				fprintf(stderr, "  subtype  = ");				CFShow(CFDictionaryGetValue(thisPort, kSCPropNetInterfaceSubType));				fprintf(stderr, "  MAC      = ");				CFShow(CFDictionaryGetValue(thisPort, kSCPropMACAddress));				(void) CFNumberGetValue((CFNumberRef) CFDictionaryGetValue(thisPort, CFSTR("SortOrder")), kCFNumberLongType, &order);								supportsHold = (CFNumberRef) CFDictionaryGetValue(thisPort, kSCPropNetInterfaceSupportsModemOnHold);				if (supportsHold != NULL) {					long hold;										CFNumberGetValue(supportsHold, kCFNumberLongType, &hold);					fprintf(stderr, "  hold     = %ld/n", hold);				}				fprintf(stderr, "  sort     = %ld/n", order);			}		}	}		CFQRelease(portArray);	PrintTestResult(err, NULL);}
开发者ID:fruitsamples,项目名称:MoreIsBetter,代码行数:56,


示例29: mount_developer_image

void mount_developer_image(AMDeviceRef device) {    CFStringRef ds_path = copy_device_support_path(device);    CFStringRef image_path = copy_developer_disk_image_path(device);    CFStringRef sig_path = CFStringCreateWithFormat(NULL, NULL, CFSTR("%@.signature"), image_path);    CFRelease(ds_path);    if (verbose) {        printf("Device support path: ");        fflush(stdout);        CFShow(ds_path);        printf("Developer disk image: ");        fflush(stdout);        CFShow(image_path);    }    FILE* sig = fopen(CFStringGetCStringPtr(sig_path, kCFStringEncodingMacRoman), "rb");    void *sig_buf = malloc(128);    assert(fread(sig_buf, 1, 128, sig) == 128);    fclose(sig);    CFDataRef sig_data = CFDataCreateWithBytesNoCopy(NULL, sig_buf, 128, NULL);    CFRelease(sig_path);    CFTypeRef keys[] = { CFSTR("ImageSignature"), CFSTR("ImageType") };    CFTypeRef values[] = { sig_data, CFSTR("Developer") };    CFDictionaryRef options = CFDictionaryCreate(NULL, (const void **)&keys, (const void **)&values, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks);    CFRelease(sig_data);    int result = AMDeviceMountImage(device, image_path, options, &mount_callback, 0);    if (result == 0) {        printf("[ 95%%] Developer disk image mounted successfully/n");    } else if (result == 0xe8000076 /* already mounted */) {        printf("[ 95%%] Developer disk image already mounted/n");    } else {        printf("[ !! ] Unable to mount developer disk image. (%x)/n", result);        exit(1);    }    CFRelease(image_path);    CFRelease(options);}
开发者ID:ccastleb,项目名称:fruitstrap,代码行数:40,



注:本文中的CFShow函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CFStringAppend函数代码示例
C++ CFSetGetValues函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。