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

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

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

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

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

示例1:

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//	SampleEffectUnit::GetParameterValueStrings////~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~OSStatus			SampleEffectUnit::GetParameterValueStrings(	AudioUnitScope			inScope,                                                                AudioUnitParameterID	inParameterID,                                                                CFArrayRef *			outStrings){    if ( (inScope == kAudioUnitScope_Global) && (inParameterID == kParam_Three_Indexed) ) {        if (outStrings == NULL) return noErr; //called by GetPropInfo				CFStringRef	strings[] = {	kParameterValueStringsOne, kParameterValueStringsTwo, kParameterValueStringsThree };	   		*outStrings = CFArrayCreate( NULL, (const void **)strings, 3, NULL);                return noErr;    }        return kAudioUnitErr_InvalidProperty;}
开发者ID:fruitsamples,项目名称:SampleAUs,代码行数:20,


示例2: CFSTR

OSStatus			SinSynthWithMidi::GetProperty(	AudioUnitPropertyID		inID,											AudioUnitScope			inScope,											AudioUnitElement		inElement,											void *					outData){	if (inScope == kAudioUnitScope_Global) {		if (inID == kAudioUnitProperty_MIDIOutputCallbackInfo) {			CFStringRef strs[1];			strs[0] = CFSTR("MIDI Callback");						CFArrayRef callbackArray = CFArrayCreate(NULL, (const void **)strs, 1, &kCFTypeArrayCallBacks);			*(CFArrayRef *)outData = callbackArray;			return noErr;		}	}	return SinSynth::GetProperty (inID, inScope, inElement, outData);}
开发者ID:fruitsamples,项目名称:SinSynth,代码行数:17,


示例3: iSCSIDiscoveryRecCreateArrayOfTargets

/*! Creates a CFArray object containing CFString objects with names of *  all of the targets in the discovery record. *  @param discoveryRec the discovery record. *  @return an array of strings with names of the targets in the record. */CFArrayRef iSCSIDiscoveryRecCreateArrayOfTargets(iSCSIDiscoveryRecRef discoveryRec){    // Validate input    if(!discoveryRec)        return NULL;        // Get all keys, which correspond to the targets    const CFIndex count = CFDictionaryGetCount(discoveryRec);    const void * keys[count];    CFDictionaryGetKeysAndValues(discoveryRec,keys,NULL);        CFArrayRef targets = CFArrayCreate(kCFAllocatorDefault,                                       keys,                                       count,                                       &kCFTypeArrayCallBacks);    return targets;}
开发者ID:anvena,项目名称:iSCSIInitiator,代码行数:21,


示例4: tests

static void tests(void){    SecTrustResultType trustResult = kSecTrustResultProceed;	SecPolicyRef policy = NULL;	SecTrustRef trust = NULL;	CFArrayRef certs = NULL;		CFDataRef appleid_record_signing_cert_data = NULL;	isnt(appleid_record_signing_cert_data = CFDataCreate(kCFAllocatorDefault, kLeafCert, sizeof(kLeafCert)), 		NULL, "Get the AppleID Record Signing Leaf Certificate Data");			SecCertificateRef appleid_record_signing_cert = NULL;	isnt(appleid_record_signing_cert = SecCertificateCreateWithData(kCFAllocatorDefault, appleid_record_signing_cert_data),		NULL, "Get the AppleID Record Signing Leaf Certificate Data");			CFDataRef appleid_intermediate_cert_data = NULL;	isnt(appleid_intermediate_cert_data = CFDataCreate(kCFAllocatorDefault, kIntermediateCert, sizeof(kIntermediateCert)), 		NULL, "Get the AppleID Intermediate Certificate Data");			SecCertificateRef appleid_intermediate_cert = NULL;	isnt(appleid_intermediate_cert = SecCertificateCreateWithData(kCFAllocatorDefault, appleid_intermediate_cert_data),		NULL, "Get the AppleID Intermediate Certificate");			SecCertificateRef certs_to_use[] = {appleid_record_signing_cert, appleid_intermediate_cert};			certs = CFArrayCreate(NULL, (const void **)certs_to_use, 2, NULL);			isnt(policy = SecPolicyCreateAppleIDValidationRecordSigningPolicy(),		NULL, "Create AppleID Record signing policy SecPolicyRef");					ok_status(SecTrustCreateWithCertificates(certs, policy, &trust),        "Create AppleID record signing leaf");	ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate escrow service trust for club 1");			is_status(trustResult, kSecTrustResultUnspecified,		"Trust is kSecTrustResultUnspecified AppleID record signing leaf");			CFReleaseSafe(trust);	CFReleaseSafe(policy);	CFReleaseSafe(certs);	CFReleaseSafe(appleid_record_signing_cert);    CFReleaseSafe(appleid_intermediate_cert_data);    CFReleaseSafe(appleid_record_signing_cert_data);}
开发者ID:unofficial-opensource-apple,项目名称:Security,代码行数:45,


示例5: main

intmain(int argc, char *argv[]){    /* Define variables and create a CFArray object containing	CFString objects containing paths to watch.	*/    CFStringRef mypath = CFSTR("/");    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&mypath, 1, NULL);    void *callbackInfo = NULL; // could put stream-specific data here.    FSEventStreamRef stream;    CFAbsoluteTime latency = 3.0; /* Latency in seconds */	struct stat Status; 	stat("/", &Status);	dev_t device = Status.st_dev;			CFUUIDRef uuidO;	CFStringRef uuid;	uuidO = FSEventsCopyUUIDForDevice(device); 	uuid = CFUUIDCreateString(NULL, uuidO);		show(CFSTR("%@:256"), uuid);			    /* Create the stream, passing in a callback, */    stream =  FSEventStreamCreateRelativeToDevice(NULL,	&myCallbackFunction,	callbackInfo,	device,	pathsToWatch,	atoi(argv[2]), /* Or a previous event ID */	latency,	kFSEventStreamCreateFlagNone /* Flags explained in reference */	);	  /* Create the stream before calling this. */    FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(),         kCFRunLoopDefaultMode);	FSEventStreamStart(stream);	//CFRunLoopRun();	CFRunLoopRunInMode(kCFRunLoopDefaultMode,atoi(argv[1]),false);	//sleep(10);		  }
开发者ID:chregu,项目名称:tmcli,代码行数:45,


示例6: ShowErrorVa

static void ShowErrorVa(const wchar_t *de, const wchar_t *en, va_list args){	// Get current language	const wchar_t *stringToUse = en;#ifdef _WIN32	if ((GetUserDefaultLangID() & 0xFF) == LANG_GERMAN) stringToUse = de;		#elif defined(__APPLE_CC__)	CFStringRef localisations[2] = { CFSTR("en"), CFSTR("de") };	CFArrayRef allLocalisations = CFArrayCreate(kCFAllocatorDefault, (const void **) localisations, 2, &kCFTypeArrayCallBacks);	CFArrayRef preferredLocalisations = CFBundleCopyPreferredLocalizationsFromArray(allLocalisations);	CFStringRef oldStyleLang = (CFStringRef) CFArrayGetValueAtIndex(preferredLocalisations, 0);	CFStringRef newStyleLang = CFLocaleCreateCanonicalLanguageIdentifierFromString(kCFAllocatorDefault, oldStyleLang);		if (CFStringHasPrefix(newStyleLang, CFSTR("de"))) stringToUse = de;		CFRelease(allLocalisations);	CFRelease(preferredLocalisations);	CFRelease(newStyleLang);#else	// TODO: Implement something here for android.#endif	// Create output string	wchar_t text[1024];	vswprintf(text, 1024, stringToUse, args);		// Show message#ifdef _WIN32	MessageBoxW(NULL, text, L"Mindstorms Simulator", MB_TASKMODAL & MB_ICONWARNING);#elif defined(IPHONE)	// Ignore it#elif defined(__APPLE_CC__)	CFStringRef messageString = CFStringCreateWithBytes(kCFAllocatorDefault, (const UInt8 *) text, sizeof(wchar_t) * wcslen(text), (CFByteOrderGetCurrent() == CFByteOrderBigEndian) ? kCFStringEncodingUTF32BE : kCFStringEncodingUTF32LE, false);	CFUserNotificationDisplayAlert(0.0, kCFUserNotificationStopAlertLevel, NULL, NULL, NULL, messageString, NULL, NULL, NULL, NULL, NULL);	CFRelease(messageString);#else	// TODO: Implement something here for android.	size_t length = wcslen(text)+1;	char *englishMangledASCII = new char[length];	for (unsigned i = 0; i < length; i++)		englishMangledASCII[i] = (char) en[i];		__android_log_print(ANDROID_LOG_FATAL, "librobosim.so", "Error: %s", englishMangledASCII);	delete englishMangledASCII;#endif	}
开发者ID:InfoSphereAC,项目名称:RoboSim,代码行数:45,


示例7: EAPOLClientConfigurationCopyProfiles

/* * Function: EAPOLClientConfigurationCopyProfiles * * Purpose: *   Get the list of defined profiles.   If there are no profiles defined, *   returns NULL. * * Returns: *   NULL if no profiles are defined, non-NULL non-empty array of profiles *   otherwise. */CFArrayRef /* of EAPOLClientProfileRef */EAPOLClientConfigurationCopyProfiles(EAPOLClientConfigurationRef cfg){    CFAllocatorRef		allocator = CFGetAllocator(cfg);    int				count;    CFArrayRef			profiles;    const void * *		values;    count = CFDictionaryGetCount(cfg->profiles);    if (count == 0) {	return (NULL);    }    values = (const void * *)malloc(sizeof(*values) * count);    CFDictionaryGetKeysAndValues(cfg->profiles, NULL, values);    profiles = CFArrayCreate(allocator, values, count, &kCFTypeArrayCallBacks);    free(values);    return (profiles);}
开发者ID:aosm,项目名称:eap8021x,代码行数:29,


示例8: CFStringCreateWithCString

/** * initially this logic was being threaded off using pthreads, but the FSEventStreamCreate call itself has its own threading, and there's no need * for this extra layer of threading, especially as it makes it difficult to consume from Java because of the extra complexity of threading in JNI code */void *event_processing_thread( char * path ) {    char *pathToMonitor =  path ;    CFStringRef mypath = CFStringCreateWithCString(NULL, pathToMonitor, NULL);	    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&mypath, 1, NULL);    CFAbsoluteTime latency = 0.3;    FSEventStreamRef stream = FSEventStreamCreate(NULL, &file_system_changed_callback, NULL ,             pathsToWatch, kFSEventStreamEventIdSinceNow, latency, kFSEventStreamCreateFlagNoDefer);	    FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);    FSEventStreamStart(stream);	    CFRunLoopRun();    return NULL;}
开发者ID:cameronbraid,项目名称:spring-integration-sandbox-fork,代码行数:22,


示例9: IONetworkSetPacketFiltersMask

IOReturnIONetworkSetPacketFiltersMask( io_connect_t    connect,                               const io_name_t filterGroup,                               UInt32          filtersMask,                               IOOptionBits options __unused ){	IOReturn        kr = kIOReturnNoMemory;    CFStringRef     keys[3];    CFArrayRef      keysArray = 0;    CFStringRef     group     = 0;    CFNumberRef     num       = 0;    CFDictionaryRef dict      = 0;    do {        num = CFNumberCreate( kCFAllocatorDefault,                               kCFNumberSInt32Type,                               &filtersMask );        if ( num == 0 ) break;        group = CFStringCreateWithCString( kCFAllocatorDefault, filterGroup,					                       CFStringGetSystemEncoding() );        if ( group == 0 ) break;        keys[0] = CFSTR( kIONetworkInterfaceProperties );        keys[1] = CFSTR( kIORequiredPacketFilters );        keys[2] = group;        keysArray = CFArrayCreate( NULL, (void *)keys, 3, &kCFTypeArrayCallBacks );        if ( keysArray == 0 ) break;        dict = CreateNestedDictionariesUsingKeys( keysArray, num );        if ( dict == 0 ) break;        kr = IOConnectSetCFProperties( connect, dict );    }    while ( 0 );	if ( num )       CFRelease( num );    if ( group )     CFRelease( group );    if ( keysArray ) CFRelease( keysArray );    if ( dict )      CFRelease( dict );    return kr;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:44,


示例10: add_watch

static FSEventStreamRef add_watch (SeafWTMonitorPriv *priv, const char* repo_id){    SeafRepo *repo = NULL;    const char *path = NULL;    repo = seaf_repo_manager_get_repo (seaf->repo_mgr, repo_id);    if (!repo) {        seaf_warning ("[wt mon] cannot find repo %s./n", repo_id);        return 0;    }    path = repo->worktree;    CFStringRef mypath = CFStringCreateWithCString (kCFAllocatorDefault,                                                    path, kCFStringEncodingUTF8);    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&mypath, 1, NULL);    FSEventStreamRef stream;    /* Create the stream, passing in a callback */    struct FSEventStreamContext ctx = {0, priv, NULL, NULL, NULL};    stream = FSEventStreamCreate(kCFAllocatorDefault,                                 stream_callback,                                 &ctx,                                 pathsToWatch,                                 kFSEventStreamEventIdSinceNow,                                 1.0,                                 kFSEventStreamCreateFlagWatchRoot        );    CFRelease (mypath);    CFRelease (pathsToWatch);    if (!stream) {        seaf_warning ("[wt] Failed to create event stream /n");        return stream;    }    FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);    FSEventStreamStart (stream);#ifdef FSEVENT_DEBUG    FSEventStreamShow (stream);    seaf_debug ("[wt mon] Add repo %s watch success :%s./n", repo_id, repo->worktree);#endif    return stream;}
开发者ID:sheyong,项目名称:seafile,代码行数:44,


示例11: SecACLCopyAuthorizations

CFArrayRef SecACLCopyAuthorizations(SecACLRef acl){	CFArrayRef result = NULL;	if (NULL == acl)	{		return result;	}		AclAuthorizationSet auths = ACL::required(acl)->authorizations();	uint32 numAuths = (uint32)auths.size();					    CSSM_ACL_AUTHORIZATION_TAG* tags = new CSSM_ACL_AUTHORIZATION_TAG[numAuths];    int i;    for (i = 0; i < numAuths; ++i)    {        tags[i] = NULL;    }		OSStatus err = SecACLGetAuthorizations(acl, tags, &numAuths);	if (errSecSuccess != err)	{				return result;	}		CFTypeRef* strings = new CFTypeRef[numAuths];    for (i = 0; i < numAuths; ++i)    {        strings[i] = NULL;    }    	for (size_t iCnt = 0; iCnt < numAuths; iCnt++)	{		strings[iCnt] = (CFTypeRef)GetAuthStringFromACLAuthorizationTag(tags[iCnt]);	}	result = CFArrayCreate(kCFAllocatorDefault, (const void **)strings, numAuths, &kCFTypeArrayCallBacks);	delete[] strings;    delete[] tags;	return result;	}
开发者ID:darlinghq,项目名称:darling-security,代码行数:44,


示例12: RegisterConsoleUserChangeCallback

static Boolean RegisterConsoleUserChangeCallback() {	CFStringRef	consoleUserNameChangeKey = NULL;	CFArrayRef	notificationKeys = NULL;	Boolean		success = TRUE;		write_log(LOG_NOTICE, "Creating ConsoleUser key.");		consoleUserNameChangeKey = SCDynamicStoreKeyCreateConsoleUser(NULL);    if(consoleUserNameChangeKey == NULL) {		write_log(LOG_ERR, "Couldn't create ConsoleUser key!");		success = FALSE;        goto EXIT;    }		write_log(LOG_NOTICE, "Creating notification key array.");	    notificationKeys = CFArrayCreate(NULL, (void*)&consoleUserNameChangeKey, 									 (CFIndex)1, &kCFTypeArrayCallBacks);    if(notificationKeys == NULL) {		write_log(LOG_ERR, "Couldn't create notification key array!"); 		success = FALSE;        goto EXIT;    }		write_log(LOG_NOTICE, "Setting up DynamicStore notification.");		if(SCDynamicStoreSetNotificationKeys(dsSession, notificationKeys, NULL) == 	   FALSE) {		write_log(LOG_ERR, "Couldn't set up DynamicStore notification!"); 		success = FALSE;        goto EXIT;	}	EXIT:	if(notificationKeys != NULL) {		CFRelease(notificationKeys);		notificationKeys = NULL;	}	if(consoleUserNameChangeKey != NULL) {		CFRelease(consoleUserNameChangeKey);		consoleUserNameChangeKey = NULL;	}	return success;}
开发者ID:razzfazz,项目名称:iscroll2,代码行数:44,


示例13: tests

static void tests(void){    SecTrustRef trust;    SecCertificateRef leaf, wwdr_intermediate;    SecPolicyRef policy;    isnt(wwdr_intermediate = SecCertificateCreateWithBytes(kCFAllocatorDefault,        wwdr_intermediate_cert, sizeof(wwdr_intermediate_cert)), NULL, "create WWDR intermediate");    isnt(leaf = SecCertificateCreateWithBytes(kCFAllocatorDefault,        codesigning_certificate, sizeof(codesigning_certificate)), NULL, "create leaf");    const void *vcerts[] = { leaf, wwdr_intermediate };    CFArrayRef certs = CFArrayCreate(kCFAllocatorDefault, vcerts, 2, NULL);    isnt(policy = SecPolicyCreateiPhoneProfileApplicationSigning(), NULL,        "create iPhoneProfileApplicationSigning policy instance");    ok_status(SecTrustCreateWithCertificates(certs, policy, &trust), "create trust for leaf");    CFDateRef verifyDate = CFDateCreate(kCFAllocatorDefault, 228244066);    ok_status(SecTrustSetVerifyDate(trust, verifyDate), "set verify date");    CFReleaseNull(verifyDate);    SecTrustResultType trustResult;    CFArrayRef properties = NULL;    properties = SecTrustCopyProperties(trust);    is(properties, NULL, "no properties returned before eval");    CFReleaseNull(properties);    ok_status(SecTrustEvaluate(trust, &trustResult), "evaluate trust");    is_status(trustResult, kSecTrustResultUnspecified, "trust is kSecTrustResultUnspecified");    properties = SecTrustCopyProperties(trust);    if (properties) {        print_plist(properties);        print_cert(leaf, true);        print_cert(wwdr_intermediate, false);    }    CFReleaseNull(properties);    CFReleaseNull(trust);    CFReleaseNull(wwdr_intermediate);    CFReleaseNull(leaf);    CFReleaseNull(certs);    CFReleaseNull(policy);	CFReleaseNull(trust);}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:43,


示例14: gst_mio_video_src_output_available_formats

static CFArrayRefgst_mio_video_src_output_available_formats (gpointer instance,    gboolean ensure_only){  GstMIOVideoSrc *self = GST_MIO_VIDEO_SRC (instance);  CMFormatDescriptionRef format_desc;  GST_DEBUG_OBJECT (self, "%s: ensure_only=%d", G_STRFUNC, ensure_only);  if (ensure_only)    return NULL;  g_assert (self->device != NULL);  format_desc = gst_mio_video_device_get_selected_format (self->device);  g_assert (format_desc != NULL);  return CFArrayCreate (kCFAllocatorDefault, (const void **) &format_desc, 1,      &kCFTypeArrayCallBacks);}
开发者ID:collects,项目名称:gst-plugins-bad,代码行数:19,


示例15: match_fonts

static void match_fonts(ASS_Library *lib, ASS_FontProvider *provider,                        char *name){    const size_t attributes_n = 3;    CTFontDescriptorRef ctdescrs[attributes_n];    CFMutableDictionaryRef cfattrs[attributes_n];    CFStringRef attributes[attributes_n] = {        kCTFontFamilyNameAttribute,        kCTFontDisplayNameAttribute,        kCTFontNameAttribute,    };    CFStringRef cfname =        CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);    for (int i = 0; i < attributes_n; i++) {        cfattrs[i] = CFDictionaryCreateMutable(NULL, 0, 0, 0);        CFDictionaryAddValue(cfattrs[i], attributes[i], cfname);        ctdescrs[i] = CTFontDescriptorCreateWithAttributes(cfattrs[i]);    }    CFArrayRef descriptors =        CFArrayCreate(NULL, (const void **)&ctdescrs, attributes_n, NULL);    CTFontCollectionRef ctcoll =        CTFontCollectionCreateWithFontDescriptors(descriptors, 0);    CFArrayRef fontsd =        CTFontCollectionCreateMatchingFontDescriptors(ctcoll);    process_descriptors(provider, fontsd);    SAFE_CFRelease(fontsd);    SAFE_CFRelease(ctcoll);    for (int i = 0; i < attributes_n; i++) {        SAFE_CFRelease(cfattrs[i]);        SAFE_CFRelease(ctdescrs[i]);    }    SAFE_CFRelease(descriptors);    SAFE_CFRelease(cfname);}
开发者ID:DiamondStudio,项目名称:libass,代码行数:43,


示例16: main

int main(int argc, const char * argv[]){    CFStringRef mypath = CFSTR("/Volumes/BACKUP/images");    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&mypath, 1, NULL);    FSEventStreamRef stream;    CFAbsoluteTime latency = 3.0; /* Latency in seconds */    /* Create the stream, passing in a callback */    stream = FSEventStreamCreate(NULL,                                 &fsEventStreamCallback,                                 NULL,                                 pathsToWatch,                                 kFSEventStreamEventIdSinceNow, /* Or a previous event ID */                                 latency,                                 kFSEventStreamCreateFlagFileEvents /* Flags explained in reference */                                 );    FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(),kCFRunLoopDefaultMode);    FSEventStreamStart(stream);    CFRunLoopRun();    return 0;}
开发者ID:812872970,项目名称:cxEngine,代码行数:20,


示例17: _EAPSecIdentityCreateCertificateTrustChain

static OSStatus_EAPSecIdentityCreateCertificateTrustChain(SecIdentityRef identity,					   CFArrayRef * ret_chain){    SecCertificateRef		cert = NULL;    CFArrayRef 			certs;    SecPolicyRef		policy = NULL;    OSStatus			status;    SecTrustRef 		trust = NULL;    SecTrustResultType 		trust_result;    *ret_chain = NULL;    ok(policy = SecPolicyCreateBasicX509(), "SecPolicyCreateBasicX509");    ok_status(status = SecIdentityCopyCertificate(identity, &cert), "SecIdentityCopyCertificate");    certs = CFArrayCreate(NULL, (const void **)&cert,			  1, &kCFTypeArrayCallBacks);    CFReleaseNull(cert);    ok_status(status = SecTrustCreateWithCertificates(certs, policy, &trust),        "SecTrustCreateWithCertificates");    CFReleaseNull(certs);    ok_status(status = SecTrustEvaluate(trust, &trust_result), "SecTrustEvaluate");    {	CFMutableArrayRef	array;	CFIndex			count = SecTrustGetCertificateCount(trust);	CFIndex			i;	isnt(count, 0, "SecTrustGetCertificateCount is nonzero");	array = CFArrayCreateMutable(NULL, count, &kCFTypeArrayCallBacks);	for (i = 0; i < count; i++) {	    SecCertificateRef	s;	    s = SecTrustGetCertificateAtIndex(trust, i);	    CFArrayAppendValue(array, s);	}	*ret_chain = array;    }    CFReleaseNull(trust);    CFReleaseNull(policy);    return (status);}
开发者ID:darlinghq,项目名称:darling-security,代码行数:41,


示例18: GetMetadataForURL

Boolean GetMetadataForURL(void* thisInterface, 			   CFMutableDictionaryRef attributes, 			   CFStringRef contentTypeUTI,			   CFURLRef url){	CGDataProviderRef dataProvider = CGDataProviderCreateWithURL(url);	if (!dataProvider) return FALSE;	CFDataRef data = CGDataProviderCopyData(dataProvider);	CGDataProviderRelease(dataProvider);	if (!data) return FALSE;		const UInt8 *buf = CFDataGetBytePtr(data);	int *height= ((int*) buf) + 3;	int *width = ((int*) buf) + 4;	int *pflags= ((int*) buf) + 20;	CFStringRef format=NULL;	if ((*pflags)&DDPF_FOURCC)		format = CFStringCreateWithBytes(kCFAllocatorDefault, buf + 0x54, 4, kCFStringEncodingASCII, false);	else if ((*pflags)&DDPF_RGB)		format = (*pflags)&DDPF_ALPHAPIXELS ? CFSTR("RGBA") : CFSTR("RGB");	if (format)	{		CFArrayRef codecs = CFArrayCreate(kCFAllocatorDefault, (const void **) &format, 1, &kCFTypeArrayCallBacks);		CFDictionaryAddValue(attributes, kMDItemCodecs, codecs);		CFRelease(format);		CFRelease(codecs);	}		CFNumberRef cfheight = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, height);	CFDictionaryAddValue(attributes, kMDItemPixelHeight, cfheight);	CFRelease(cfheight);		CFNumberRef cfwidth = CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, width);	CFDictionaryAddValue(attributes, kMDItemPixelWidth, cfwidth);	CFRelease(cfwidth);	CFRelease(data);    return TRUE;}
开发者ID:UIKit0,项目名称:QLdds,代码行数:41,


示例19: EAPOLClientConfigurationCopyMatchingProfiles

/* * Function: EAPOLClientConfigurationCopyMatchingProfiles * * Purpose: *   Find the profile(s) matching the specified profile. *   A profile is matched based on the profileID, the WLAN SSID, and *   the WLAN domain, all of which must be unique in the configuration. * *   Usually invoked after calling  *   EAPOLClientProfileCreateWithPropertyList() to instantiate a profile *   from an external format. * * Returns: *   NULL if no matching profile is part of the configuration, *   non-NULL CFArrayRef of EAPOLClientProfileRef if found. */CFArrayRef /* of EAPOLClientProfileRef */EAPOLClientConfigurationCopyMatchingProfiles(EAPOLClientConfigurationRef cfg,					     EAPOLClientProfileRef profile){    int				count;    EAPOLClientProfileRef	matching_profile;    CFStringRef			profileID = EAPOLClientProfileGetID(profile);    CFDataRef			ssid;    const void *		values[2] = { NULL, NULL };        count = 0;    matching_profile = EAPOLClientConfigurationGetProfileWithID(cfg, profileID);    if (matching_profile != NULL) {	values[count] = matching_profile;	count++;    }    matching_profile = NULL;    ssid = EAPOLClientProfileGetWLANSSIDAndSecurityType(profile, NULL);    if (ssid != NULL) {	matching_profile 	    = EAPOLClientConfigurationGetProfileWithWLANSSID(cfg, ssid);    }    else {	CFStringRef		domain;		domain = EAPOLClientProfileGetWLANDomain(profile);	if (domain != NULL) {	    matching_profile 		= EAPOLClientConfigurationGetProfileWithWLANDomain(cfg, domain);	}    }    if (matching_profile != NULL && values[0] != matching_profile) {	values[count] = matching_profile;	count++;    }    if (count == 0) {	return (NULL);    }    return (CFArrayCreate(CFGetAllocator(cfg), values, count,			  &kCFTypeArrayCallBacks));}
开发者ID:aosm,项目名称:eap8021x,代码行数:57,


示例20: SQLite3StatementCreateArrayForAllColumns

inline CFArrayRef SQLite3StatementCreateArrayForAllColumns(SQLite3StatementRef statement) {  CFArrayRef array = NULL;  if (statement) {    CFIndex count = SQLite3StatementGetColumnCount(statement);    if (count > 0) {      const void **values = CFAllocatorAllocate(statement->allocator, sizeof(const void *) * count, 0);      if (values) {        for (CFIndex i = 0; i < count; i++) {          values[i] = SQLite3StatementCreateCFTypeWithColumn(statement, i);        }        array = CFArrayCreate(statement->allocator, values, count, &kCFTypeArrayCallBacks);        for (CFIndex i = 0; i < count; i++) {          if (values[i])            CFRelease(values[i]);        }        CFAllocatorDeallocate(statement->allocator, values);      }    }  }  return array;}
开发者ID:neostoic,项目名称:CoreSQLite3,代码行数:21,


示例21: EventProcessingThread

static void * EventProcessingThread(void *data) {    CFStringRef path = CFSTR("/");    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&path, 1, NULL);    void *callbackInfo = NULL;    CFAbsoluteTime latency = 0.3;  // Latency in seconds    FSEventStreamRef stream = FSEventStreamCreate(        NULL,        &callback,        callbackInfo,        pathsToWatch,        kFSEventStreamEventIdSinceNow,        latency,        kFSEventStreamCreateFlagNoDefer    );    FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);    FSEventStreamStart(stream);    CFRunLoopRun();    return NULL;}
开发者ID:theelfismike,项目名称:intellij-community,代码行数:22,


示例22: CFSTR

AppleReloadManager::AppleReloadManager(){   //Register with file system    CFStringRef mypath = CFSTR("assets");    CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&mypath, 1, NULL);    FSEventStreamContext  *callbackInfo = NULL; // could put stream-specific data here.    auto myCallbackFunction = AppleReloadManager::eventCallback;    CFAbsoluteTime latency = 3.0; /* Latency in seconds */    /* Create the stream, passing in a callback */    stream = FSEventStreamCreate(NULL,        myCallbackFunction,        callbackInfo,        pathsToWatch,        kFSEventStreamEventIdSinceNow, /* Or a previous event ID */        latency,        kFSEventStreamCreateFlagFileEvents /* Flags explained in reference */    );   FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);   FSEventStreamStart(stream);   pthread_mutex_init(&AppleReloadManager::reloadMutex, NULL);}
开发者ID:kyle-piddington,项目名称:GLFWEngine,代码行数:22,


示例23: main

int main(int argc, const char * argv[]){    size_t width = 2000;    size_t height = 2000;    CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();    CGContextRef context = CGBitmapContextCreate(nullptr, width, height, 8, width * 4, colorSpace, kCGImageAlphaNoneSkipLast);    CGColorSpaceRelease(colorSpace);    const std::vector<uint8_t> fontVector = generateFont();    std::ofstream outputFile("/Volumes/Data/home/mmaxfield/tmp/output.otf", std::ios::out | std::ios::binary);    for (uint8_t b : fontVector)        outputFile << b;    outputFile.close();        CFDataRef fontData = CFDataCreate(kCFAllocatorDefault, fontVector.data(), fontVector.size());    CTFontDescriptorRef fontDescriptor = CTFontManagerCreateFontDescriptorFromData(fontData);    CFRelease(fontData);    CFTypeRef featureValues[] = { CFSTR("liga"), CFSTR("clig"), CFSTR("dlig"), CFSTR("hlig"), CFSTR("calt"), CFSTR("subs"), CFSTR("sups"), CFSTR("smcp"), CFSTR("c2sc"), CFSTR("pcap"), CFSTR("c2pc"), CFSTR("unic"), CFSTR("titl"), CFSTR("onum"), CFSTR("pnum"), CFSTR("tnum"), CFSTR("frac"), CFSTR("afrc"), CFSTR("ordn"), CFSTR("zero"), CFSTR("hist"), CFSTR("jp78"), CFSTR("jp83"), CFSTR("jp90"), CFSTR("jp04"), CFSTR("smpl"), CFSTR("trad"), CFSTR("fwid"), CFSTR("pwid"), CFSTR("ruby") };    CFArrayRef features = CFArrayCreate(kCFAllocatorDefault, featureValues, 30, &kCFTypeArrayCallBacks);    for (CFIndex i = 0; i < CFArrayGetCount(features); ++i) {        drawTextWithFeature(context, fontDescriptor, static_cast<CFStringRef>(CFArrayGetValueAtIndex(features, i)), 1, CGPointMake(25, 1950 - 50 * i));        drawTextWithFeature(context, fontDescriptor, static_cast<CFStringRef>(CFArrayGetValueAtIndex(features, i)), 0, CGPointMake(25, 1925 - 50 * i));    }    CFRelease(features);    CFRelease(fontDescriptor);    CGImageRef image = CGBitmapContextCreateImage(context);    CGContextRelease(context);    CFURLRef url = CFURLCreateWithFileSystemPath(kCFAllocatorDefault, CFSTR("/Volumes/Data/home/mmaxfield/tmp/output.png"), kCFURLPOSIXPathStyle, FALSE);    CGImageDestinationRef imageDestination = CGImageDestinationCreateWithURL(url, kUTTypePNG, 1, nullptr);    CFRelease(url);    CGImageDestinationAddImage(imageDestination, image, nullptr);    CGImageRelease(image);    CGImageDestinationFinalize(imageDestination);    CFRelease(imageDestination);    return 0;}
开发者ID:rodrigo-speller,项目名称:webkit,代码行数:38,


示例24: SCNetworkSetEstablishDefaultInterfaceConfiguration

BooleanSCNetworkSetEstablishDefaultInterfaceConfiguration(SCNetworkSetRef set, SCNetworkInterfaceRef interface){	CFArrayRef	interfaces;	Boolean		updated;	if (!isA_SCNetworkSet(set)) {		_SCErrorSet(kSCStatusInvalidArgument);		return FALSE;	}	if (!isA_SCNetworkInterface(interface)) {		_SCErrorSet(kSCStatusInvalidArgument);		return FALSE;	}	interfaces = CFArrayCreate(NULL, (const void **)&interface, 1, &kCFTypeArrayCallBacks);	assert(interfaces != NULL);	updated = __SCNetworkSetEstablishDefaultConfigurationForInterfaces(set, interfaces, FALSE);	CFRelease(interfaces);	return updated;}
开发者ID:carriercomm,项目名称:osx-2,代码行数:23,


示例25: createDataFromURL

CFDataRef createDataFromURL( CFURLRef url ){	SInt32 errorCode = 0;	CFDataRef fileContent;	CFDictionaryRef dict;	CFArrayRef arr = CFArrayCreate(NULL, NULL, 0, NULL);	Boolean success = CFURLCreateDataAndPropertiesFromResource (NULL,																url,																&fileContent,																&dict,																arr,																&errorCode);	CFRelease(arr);	CFRelease(dict);		if (!success) {		return NULL;	}		return fileContent;}
开发者ID:HeEAaD,项目名称:QuickNFO,代码行数:23,


示例26: CFArrayCreate

// ----------------------------------------------------------bool ofxAudioUnitSampler::setSample(const std::string &samplePath)// ----------------------------------------------------------{	CFURLRef sampleURL[1] = {CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault,																	 (const UInt8 *)samplePath.c_str(),																	 samplePath.length(),																	 NULL)};		CFArrayRef sample = CFArrayCreate(NULL, (const void **)&sampleURL, 1, &kCFTypeArrayCallBacks);	OFXAU_PRINT(AudioUnitSetProperty(*_unit,									 kAUSamplerProperty_LoadAudioFiles,									 kAudioUnitScope_Global,									 0,									 &sample,									 sizeof(sample)),				"setting ofxAudioUnitSampler's source sample");		CFRelease(sample);	CFRelease(sampleURL[0]);		return true;}
开发者ID:CLOUDS-Interactive-Documentary,项目名称:ofxAudioUnit,代码行数:24,


示例27: CFLocaleCopyAvailableLocaleIdentifiers

CFArrayRef CFLocaleCopyAvailableLocaleIdentifiers(void) {    int32_t locale, localeCount = uloc_countAvailable();    CFMutableSetRef working = CFSetCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeSetCallBacks);    for (locale = 0; locale < localeCount; ++locale) {        const char *localeID = uloc_getAvailable(locale);        CFStringRef string1 = CFStringCreateWithCString(kCFAllocatorSystemDefault, localeID, kCFStringEncodingASCII);	CFStringRef string2 = CFLocaleCreateCanonicalLocaleIdentifierFromString(kCFAllocatorSystemDefault, string1);	CFSetAddValue(working, string1);	// do not include canonicalized version as IntlFormats cannot cope with that in its popup        CFRelease(string1);        CFRelease(string2);    }    CFIndex cnt = CFSetGetCount(working);#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_LINUX || (DEPLOYMENT_TARGET_WINDOWS && __GNUC__)    STACK_BUFFER_DECL(const void *, buffer, cnt);#else    const void* buffer[BUFFER_SIZE];#endif    CFSetGetValues(working, buffer);    CFArrayRef result = CFArrayCreate(kCFAllocatorSystemDefault, buffer, cnt, &kCFTypeArrayCallBacks);    CFRelease(working);    return result;}
开发者ID:AbhinavBansal,项目名称:opencflite,代码行数:23,


示例28: watch_directory

void watch_directory(VALUE self) {  VALUE rb_registered_directories = rb_iv_get(self, "@registered_directories");  int i, dir_size;  dir_size = RARRAY_LEN(rb_registered_directories);  VALUE *rb_dir_names = RARRAY_PTR(rb_registered_directories);  CFStringRef dir_names[dir_size];  for (i = 0; i < dir_size; i++) {    dir_names[i] = CFStringCreateWithCString(NULL, (char *)RSTRING_PTR(rb_dir_names[i]), kCFStringEncodingUTF8);  }  CFArrayRef pathsToWatch = CFArrayCreate(NULL, (const void **)&dir_names, dir_size, NULL);  VALUE rb_latency = rb_iv_get(self, "@latency");  CFAbsoluteTime latency = NUM2DBL(rb_latency);  FSEventStreamContext context;  context.version = 0;  context.info = (VALUE *)self;  context.retain = NULL;  context.release = NULL;  context.copyDescription = NULL;  stream = FSEventStreamCreate(NULL,    &callback,    &context,    pathsToWatch,    kFSEventStreamEventIdSinceNow,    latency,    kFSEventStreamCreateFlagNone  );  FSEventStreamScheduleWithRunLoop(stream, CFRunLoopGetCurrent(), kCFRunLoopDefaultMode);  FSEventStreamStart(stream);  CFRunLoopRun();}
开发者ID:hotchpotch,项目名称:ruby-fsevent,代码行数:37,



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


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