这篇教程C++ CFEqual函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中CFEqual函数的典型用法代码示例。如果您正苦于以下问题:C++ CFEqual函数的具体用法?C++ CFEqual怎么用?C++ CFEqual使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了CFEqual函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: CGImageSourceGetTypebool ImageSource::frameHasAlphaAtIndex(size_t index){ if (!m_decoder) return false; // FIXME: why doesn't this return true? if (!frameIsCompleteAtIndex(index)) return true; CFStringRef imageType = CGImageSourceGetType(m_decoder); // Return false if there is no image type or the image type is JPEG, because // JPEG does not support alpha transparency. if (!imageType || CFEqual(imageType, CFSTR("public.jpeg"))) return false; // FIXME: Could return false for other non-transparent image formats. // FIXME: Could maybe return false for a GIF Frame if we have enough info in the GIF properties dictionary // to determine whether or not a transparent color was defined. return true;}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:20,
示例2: unused// -----------------------------------------------------------------------------// FLACMDImporterPluginFactory// -----------------------------------------------------------------------------// Implementation of the factory function for this type.//void *MetadataImporterPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID){#pragma unused(allocator) MetadataImporterPluginType *result; CFUUIDRef uuid; /* If correct type is being requested, allocate an * instance of TestType and return the IUnknown interface. */ if (CFEqual(typeID,kMDImporterTypeID)) { uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID)); result = AllocMetadataImporterPluginType(uuid); CFRelease(uuid); return result; } /* If the requested type is incorrect, return NULL. */ return NULL;}
开发者ID:sbooth,项目名称:FLACImporter,代码行数:25,
示例3: updateStorestatic voidupdateStore(const void *key, const void *value, void *context){ CFDictionaryRef dict; CFDictionaryRef newDict = (CFDictionaryRef)value; CFDictionaryRef oldIFs = (CFDictionaryRef)context; dict = CFDictionaryGetValue(oldIFs, key); if (!dict || !CFEqual(dict, newDict)) { if (CFDictionaryGetCount(newDict) > 0) { cache_SCDynamicStoreSetValue(store, key, newDict); } else if (dict) { cache_SCDynamicStoreRemoveValue(store, key); } network_changed = TRUE; } return;}
开发者ID:010001111,项目名称:darling,代码行数:20,
示例4: findStartupItemInListLSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef findUrl){ // loop through the list of startup items and try to find the bitcoin app CFArrayRef listSnapshot = LSSharedFileListCopySnapshot(list, NULL); for(int i = 0; i < CFArrayGetCount(listSnapshot); i++) { LSSharedFileListItemRef item = (LSSharedFileListItemRef)CFArrayGetValueAtIndex(listSnapshot, i); UInt32 resolutionFlags = kLSSharedFileListNoUserInteraction | kLSSharedFileListDoNotMountVolumes; CFURLRef currentItemURL = NULL; LSSharedFileListItemResolve(item, resolutionFlags, ¤tItemURL, NULL); if(currentItemURL && CFEqual(currentItemURL, findUrl)) { // found CFRelease(currentItemURL); return item; } if(currentItemURL) { CFRelease(currentItemURL); } } return NULL;}
开发者ID:Lederstrumpf,项目名称:Gridcoin-master,代码行数:20,
示例5: CFUUIDCreateFromUUIDBytesHRESULT IOHIDTransactionClass::queryInterface(REFIID iid, void ** ppv){ CFUUIDRef uuid = CFUUIDCreateFromUUIDBytes(NULL, iid); HRESULT res = S_OK; if (CFEqual(uuid, kIOHIDDeviceTransactionInterfaceID)) { *ppv = getInterfaceMap(); addRef(); } else { res = fOwningDevice->queryInterface(iid, ppv); } if (!*ppv) res = E_NOINTERFACE; CFRelease(uuid); return res;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:20,
示例6: SecKeyEqualstatic Boolean SecKeyEqual(CFTypeRef cf1, CFTypeRef cf2){ SecKeyRef key1 = (SecKeyRef)cf1; SecKeyRef key2 = (SecKeyRef)cf2; if (key1 == key2) return true; if (!key2 || key1->key_class != key2->key_class) return false; if (key1->key_class->extraBytes) return !memcmp(key1->key, key2->key, key1->key_class->extraBytes); /* TODO: Won't work when we get reference keys. */ CFDictionaryRef d1, d2; d1 = SecKeyCopyAttributeDictionary(key1); d2 = SecKeyCopyAttributeDictionary(key2); Boolean result = CFEqual(d1, d2); CFReleaseSafe(d1); CFReleaseSafe(d2); return result;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:20,
示例7: dataCopyPropertystatic CFPropertyListRef dataCopyProperty(struct _CFStream *stream, CFStringRef propertyName, void *info) { _CFWriteDataStreamContext *dataStream = (_CFWriteDataStreamContext *)info; CFIndex size = 0; _CFStreamByteBuffer *buf; CFAllocatorRef alloc; UInt8 *bytes, *currByte; if (!CFEqual(propertyName, kCFStreamPropertyDataWritten)) return NULL; if (dataStream->bufferAllocator == kCFAllocatorNull) return NULL; alloc = dataStream->bufferAllocator; for (buf = dataStream->firstBuf; buf != NULL; buf = buf->next) { size += buf->length; } bytes = (UInt8 *)CFAllocatorAllocate(alloc, size, 0); currByte = bytes; for (buf = dataStream->firstBuf; buf != NULL; buf = buf->next) { memmove(currByte, buf->bytes, buf->length); currByte += buf->length; } return CFDataCreateWithBytesNoCopy(alloc, bytes, size, alloc);}
开发者ID:nagyistge,项目名称:swift-corelibs-foundation,代码行数:20,
示例8: imageWithColorSpacestatic RetainPtr<CGImageRef> imageWithColorSpace(CGImageRef originalImage, ColorSpace colorSpace){ CGColorSpaceRef originalColorSpace = CGImageGetColorSpace(originalImage); // If the image already has a (non-device) color space, we don't want to // override it, so return. if (!originalColorSpace || !CFEqual(originalColorSpace, deviceRGBColorSpaceRef())) return originalImage; switch (colorSpace) { case DeviceColorSpace: return originalImage; case sRGBColorSpace: return RetainPtr<CGImageRef>(AdoptCF, CGImageCreateCopyWithColorSpace(originalImage, sRGBColorSpaceRef())); } ASSERT_NOT_REACHED(); return originalImage;}
开发者ID:flying-dutchmen,项目名称:3DS_w3Browser,代码行数:20,
示例9: writeXMLValuestatic void writeXMLValue(CFTypeRef context, void *xmlDomain, CFStringRef key, CFTypeRef value) { _CFXMLPreferencesDomain *domain = (_CFXMLPreferencesDomain *)xmlDomain; const void *existing = NULL; __CFLock(&domain->_lock); if (domain->_domainDict == NULL) { _loadXMLDomainIfStale((CFURLRef )context, domain); } // check to see if the value is the same // if (1) the key is present AND value is !NULL and equal to existing, do nothing, or // if (2) the key is not present AND value is NULL, do nothing // these things are no-ops, and should not dirty the domain if (CFDictionaryGetValueIfPresent(domain->_domainDict, key, &existing)) { if (NULL != value && (existing == value || CFEqual(existing, value))) { __CFUnlock(&domain->_lock); return; } } else { if (NULL == value) { __CFUnlock(&domain->_lock); return; } } // We must append first so key gets another retain (in case we're // about to remove it from the dictionary, and that's the sole reference) // This should be a set not an array. if (!CFArrayContainsValue(domain->_dirtyKeys, CFRangeMake(0, CFArrayGetCount(domain->_dirtyKeys)), key)) { CFArrayAppendValue(domain->_dirtyKeys, key); } if (value) { // Must copy for two reasons - we don't want mutable objects in the cache, and we don't want objects allocated from a different allocator in the cache. CFTypeRef newValue = CFPropertyListCreateDeepCopy(__CFPreferencesAllocator(), value, kCFPropertyListImmutable); CFDictionarySetValue(domain->_domainDict, key, newValue); CFRelease(newValue); } else { CFDictionaryRemoveValue(domain->_domainDict, key); } __CFUnlock(&domain->_lock);}
开发者ID:JGiola,项目名称:swift-corelibs-foundation,代码行数:41,
示例10: LOGNativeImagePtr ImageDecoder::createFrameImageAtIndex(size_t index, SubsamplingLevel subsamplingLevel, DecodingMode decodingMode) const{ LOG(Images, "ImageDecoder %p createFrameImageAtIndex %lu", this, index); RetainPtr<CFDictionaryRef> options = imageSourceOptions(subsamplingLevel, decodingMode); RetainPtr<CGImageRef> image; if (decodingMode == DecodingMode::OnDemand) image = adoptCF(CGImageSourceCreateImageAtIndex(m_nativeDecoder.get(), index, options.get())); else image = adoptCF(CGImageSourceCreateThumbnailAtIndex(m_nativeDecoder.get(), index, options.get())); #if PLATFORM(IOS) // <rdar://problem/7371198> - CoreGraphics changed the default caching behaviour in iOS 4.0 to kCGImageCachingTransient // which caused a performance regression for us since the images had to be resampled/recreated every time we called // CGContextDrawImage. We now tell CG to cache the drawn images. See also <rdar://problem/14366755> - // CoreGraphics needs to un-deprecate kCGImageCachingTemporary since it's still not the default.#if COMPILER(CLANG)#pragma clang diagnostic push#pragma clang diagnostic ignored "-Wdeprecated-declarations"#endif CGImageSetCachingFlags(image.get(), kCGImageCachingTemporary);#if COMPILER(CLANG)#pragma clang diagnostic pop#endif#endif // PLATFORM(IOS) CFStringRef imageUTI = CGImageSourceGetType(m_nativeDecoder.get()); static const CFStringRef xbmUTI = CFSTR("public.xbitmap-image"); if (!imageUTI) return image; if (!CFEqual(imageUTI, xbmUTI)) return image; // If it is an xbm image, mask out all the white areas to render them transparent. const CGFloat maskingColors[6] = {255, 255, 255, 255, 255, 255}; RetainPtr<CGImageRef> maskedImage = adoptCF(CGImageCreateWithMaskingColors(image.get(), maskingColors)); return maskedImage ? maskedImage : image;}
开发者ID:ollie314,项目名称:webkit,代码行数:41,
示例11: EAPOLClientConfigurationGetSystemProfile/* * Function: EAPOLClientConfigurationGetSystemProfile * * Purpose: * Return the profile configured for System mode on the * specified BSD network interface (e.g. "en0", "en1"). * * Returns: * NULL if no such profile is defined, non-NULL profile * otherwise. */EAPOLClientProfileRefEAPOLClientConfigurationGetSystemProfile(EAPOLClientConfigurationRef cfg, CFStringRef if_name){ CFDictionaryRef dict; SCNetworkInterfaceRef net_if = NULL; EAPOLClientProfileRef profile = NULL; CFStringRef profileID; dict = get_eapol_configuration(get_sc_prefs(cfg), if_name, &net_if); if (dict != NULL && !CFEqual(SCNetworkInterfaceGetInterfaceType(net_if), kSCNetworkInterfaceTypeIEEE80211)) { profileID = CFDictionaryGetValue(dict, kSystemProfileID); if (isA_CFString(profileID) != NULL) { profile = EAPOLClientConfigurationGetProfileWithID(cfg, profileID); } } my_CFRelease(&net_if); return (profile);}
开发者ID:aosm,项目名称:eap8021x,代码行数:32,
示例12: druDeviceContainsErasableMedia/* druDeviceContainsErasableMedia Returns TRUE if the device contains blank media.*/intdruDeviceContainsErasableMedia(DRDeviceRef device){ CFDictionaryRef deviceStatus = DRDeviceCopyStatus(device); CFStringRef mediaState = CFDictionaryGetValue(deviceStatus,kDRDeviceMediaStateKey); int result = 0; /* Check to see if there's media in the device */ if (mediaState != NULL && CFEqual(mediaState,kDRDeviceMediaStateMediaPresent)) { CFDictionaryRef mediaInfo = CFDictionaryGetValue(deviceStatus,kDRDeviceMediaInfoKey); CFBooleanRef erasable = CFDictionaryGetValue(mediaInfo,kDRDeviceMediaIsErasableKey); /* There's media, but is it blank and writable? */ if (erasable != NULL && CFBooleanGetValue(erasable)) result = 1; } CFRelease(deviceStatus); return result;}
开发者ID:fruitsamples,项目名称:audioburntest,代码行数:26,
示例13: druMediaIsReserved/* druMediaIsReserved Returns TRUE if the device contains blank media.*/intdruMediaIsReserved(DRDeviceRef device){ CFDictionaryRef deviceStatus = DRDeviceCopyStatus(device); CFStringRef mediaState = CFDictionaryGetValue(deviceStatus,kDRDeviceMediaStateKey); int result = 0; /* Check to see if there's media in the device */ if (mediaState != NULL && CFEqual(mediaState,kDRDeviceMediaStateMediaPresent)) { CFDictionaryRef mediaInfo = CFDictionaryGetValue(deviceStatus,kDRDeviceMediaInfoKey); CFBooleanRef reserved = CFDictionaryGetValue(mediaInfo,kDRDeviceMediaIsReservedKey); /* There's media, but do we have the reservation? */ if (reserved != NULL && CFBooleanGetValue(reserved)) result = 1; } CFRelease(deviceStatus); return result;}
开发者ID:fruitsamples,项目名称:audioburntest,代码行数:26,
示例14: RemoveEventFromArrayvoid RemoveEventFromArray(CFMutableArrayRef array, CFNumberRef launchdToken){ CFIndex i; CFIndex count = CFArrayGetCount(array); // Loop thru looking for us. for (i = 0; i < count; ) { CFDictionaryRef eventDict = CFArrayGetValueAtIndex(array, i); CFNumberRef token = CFDictionaryGetValue(eventDict, sLaunchdTokenKey); if (CFEqual(token, launchdToken)) // This is the same event? { CFArrayRemoveValueAtIndex(array, i); // Remove the event, break; // The token should only exist once, so it make no sense to continue. } else { ++i; // If it's not us, advance. } } }
开发者ID:benvanik,项目名称:mDNSResponder,代码行数:21,
示例15: CFCopyHomeDirectoryURLForUserCF_EXPORT CFURLRef CFCopyHomeDirectoryURLForUser(CFStringRef uName) {#if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI || DEPLOYMENT_TARGET_LINUX || DEPLOYMENT_TARGET_FREEBSD if (!uName) { uid_t euid; __CFGetUGIDs(&euid, NULL); struct passwd *upwd = getpwuid(euid ? euid : getuid()); return _CFCopyHomeDirURLForUser(upwd, true); } else { struct passwd *upwd = NULL; char buf[128], *user; SInt32 len = CFStringGetLength(uName), size = CFStringGetMaximumSizeForEncoding(len, kCFPlatformInterfaceStringEncoding); CFIndex usedSize; if (size < 127) { user = buf; } else { user = CFAllocatorAllocate(kCFAllocatorSystemDefault, size+1, 0); } if (CFStringGetBytes(uName, CFRangeMake(0, len), kCFPlatformInterfaceStringEncoding, 0, true, (uint8_t *)user, size, &usedSize) == len) { user[usedSize] = '/0'; upwd = getpwnam(user); } if (buf != user) { CFAllocatorDeallocate(kCFAllocatorSystemDefault, user); } return _CFCopyHomeDirURLForUser(upwd, false); }#elif DEPLOYMENT_TARGET_WINDOWS // This code can only get the directory for the current user CFStringRef userName = uName ? CFCopyUserName() : NULL; if (uName && !CFEqual(uName, userName)) { CFLog(kCFLogLevelError, CFSTR("CFCopyHomeDirectoryURLForUser(): Unable to get home directory for other user")); if (userName) CFRelease(userName); return NULL; } if (userName) CFRelease(userName); return CFCopyHomeDirectoryURL();#else#error Dont know how to compute users home directories on this platform#endif}
开发者ID:mlabbe,项目名称:CoreFoundation,代码行数:40,
示例16: AFPUserList_lookupAFPUserRefAFPUserList_lookup(AFPUserListRef users, CFStringRef afp_user){ int i; int n; n = CFArrayGetCount(users->list); for (i = 0; i < n; i++) { CFStringRef name; AFPUserRef user; ODRecordRef record; user = (AFPUserRef)CFArrayGetValueAtIndex(users->list, i); record = (ODRecordRef)CFDictionaryGetValue(user, kAFPUserODRecord); name = ODRecordGetRecordName(record); if (CFEqual(name, afp_user)) { return (user); } } return (NULL);}
开发者ID:aosm,项目名称:bootp,代码行数:22,
示例17: updateStorestatic voidupdateStore(const void *key, const void *value, void *context){ CFDictionaryRef dict; CFDictionaryRef newDict = (CFDictionaryRef)value; CFDictionaryRef oldIFs = (CFDictionaryRef)context; dict = CFDictionaryGetValue(oldIFs, key); if (!dict || !CFEqual(dict, newDict)) { if (CFDictionaryGetCount(newDict) > 0) { SC_log(LOG_DEBUG, "Update interface configuration: %@: %@", key, newDict); cache_SCDynamicStoreSetValue(store, key, newDict); } else if (dict) { SC_log(LOG_DEBUG, "Update interface configuration: %@: <removed>", key); cache_SCDynamicStoreRemoveValue(store, key); } network_changed = TRUE; } return;}
开发者ID:carriercomm,项目名称:osx-2,代码行数:22,
示例18: AddRefHRESULT STDMETHODCALLTYPE IBMDSwitcherDiscovery::QueryInterface(REFIID riid, LPVOID *ppv){ if (!ppv) return E_POINTER; if (riid == IID_IBMDSwitcherDiscovery) { *ppv = static_cast<IBMDSwitcherDiscovery*>(this); AddRef(); return S_OK; } if (CFEqual(CFUUIDCreateFromUUIDBytes(NULL,riid), IUnknownUUID)) { *ppv = static_cast<IUnknown*>(this); AddRef(); return S_OK; } *ppv = NULL; return E_NOINTERFACE;}
开发者ID:terinjokes,项目名称:BMDSwitcherMock,代码行数:22,
示例19: CFUUIDCreateFromString// -----------------------------------------------------------------------------// QuickLookGeneratorPluginFactory// -----------------------------------------------------------------------------void *QuickLookGeneratorPluginFactory(CFAllocatorRef allocator,CFUUIDRef typeID){ QuickLookGeneratorPluginType *result; CFUUIDRef uuid; /* If correct type is being requested, allocate an * instance of kQLGeneratorTypeID and return the IUnknown interface. */ if (CFEqual(typeID,kQLGeneratorTypeID)){ uuid = CFUUIDCreateFromString(kCFAllocatorDefault,CFSTR(PLUGIN_ID)); result = AllocQuickLookGeneratorPluginType(uuid); CFRelease(uuid); return result; } allocator = NULL; /* If the requested type is incorrect, return NULL. */ /* Fixes a warning at compile time */ allocator = NULL; return NULL;}
开发者ID:Avtolic,项目名称:qltorrent,代码行数:25,
示例20: GetPMSettingBool__private_extern__ boolGetPMSettingBool(CFStringRef which){ CFDictionaryRef current_settings; CFNumberRef n; int nint = 0; CFStringRef pwrSrc; if (!energySettings || !which) return false; if (CFEqual(which, CFSTR(kIOPMDarkWakeBackgroundTaskKey))) { /* Overrides for DWBT support */ if (gSilentRunningOverride == kPMSROverrideEnable) return true; if (gSilentRunningOverride == kPMSROverrideDisable) return false; } if (_getPowerSource() == kBatteryPowered) pwrSrc = CFSTR(kIOPMBatteryPowerKey); else pwrSrc = CFSTR(kIOPMACPowerKey); // Don't use 'currentPowerSource' here as that gets updated // little slowly after this function is called to get a setting // on new power source. current_settings = (CFDictionaryRef)isA_CFDictionary( CFDictionaryGetValue(energySettings, pwrSrc)); if (current_settings) { n = CFDictionaryGetValue(current_settings, which); if (n) { CFNumberGetValue(n, kCFNumberIntType, &nint); } return (0 != nint); } return false;}
开发者ID:hashier,项目名称:caffeinate_fix,代码行数:38,
示例21: test_persistent2static void test_persistent2(struct test_persistent_s *p){ CFTypeRef results = NULL; CFTypeRef results2 = NULL; ok_status(!SecItemCopyMatching(p->query, &results), "don't find internet password by attributes"); ok(!results, "no results"); ok_status(!SecItemCopyMatching(p->query2, &results2), "don't find internet password by persistent ref anymore"); ok(!results2, "no results"); SKIP:{ ok_status(SecItemCopyMatching(p->query4, &results2), "find non updated internet password by persistent ref"); skip("non updated internet password by persistent ref NOT FOUND!", 2, results2); ok(results2, "non updated internet password not found"); CFStringRef server = CFDictionaryGetValue(results2, kSecAttrServer); ok(CFEqual(server, CFSTR("zuigt.nl")), "verify second items attribute was not modified by update"); CFReleaseNull(results2); } is_status(SecItemCopyMatching(p->query3, &results2), errSecItemNotFound, "don't find deleted internet password by persistent ref"); CFReleaseNull(results2); ok_status(SecItemCopyMatching(p->query4, &results2), "find non deleted internet password by persistent ref"); CFReleaseNull(results2); ok_status(SecItemDelete(p->query4),"Deleted internet password by persistent ref"); CFRelease(p->query); CFRelease(p->query2); CFRelease(p->query3); CFRelease(p->query4); CFReleaseNull(p->persist[0]); CFReleaseNull(p->persist[1]);}
开发者ID:unofficial-opensource-apple,项目名称:Security,代码行数:38,
示例22: IOPSCopyInternalBatteriesArray/* IOPSCopyInternalBatteriesArray * * Argument: * CFTypeRef power_sources: The return value from IOPSCoyPowerSourcesInfo() * Return value: * CFArrayRef: all the batteries we found * NULL if none are found */CFArrayRefIOPSCopyInternalBatteriesArray(CFTypeRef power_sources){ CFArrayRef array = isA_CFArray(IOPSCopyPowerSourcesList(power_sources)); CFMutableArrayRef ret_arr; CFTypeRef name = NULL; CFDictionaryRef ps; CFStringRef transport_type; int i, count; if(!array) return NULL; count = CFArrayGetCount(array); name = NULL; ret_arr = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks); if(!ret_arr) goto exit; for(i=0; i<count; i++) { name = CFArrayGetValueAtIndex(array, i); ps = isA_CFDictionary(IOPSGetPowerSourceDescription(power_sources, name)); if(ps) { transport_type = isA_CFString(CFDictionaryGetValue(ps, CFSTR(kIOPSTransportTypeKey))); if(transport_type && CFEqual(transport_type, CFSTR(kIOPSInternalType))) { CFArrayAppendValue(ret_arr, name); } } } if(0 == CFArrayGetCount(ret_arr)) { CFRelease(ret_arr); ret_arr = NULL; }exit: CFRelease(array); return ret_arr;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:46,
示例23: PrintDialogPDEPluginFactory/* ============================================================================= Name: PrintDialogPDEPluginFactory() Description: This is the factory function which should be the only entry point of this plugin. This factory function creates the "base class" for the system. The factory functions name (ie "PrintDialogPDEPluginFactory") needs to be listed in the Info.plist to associate the factory function name with the factory function UUID. For example, this is how this function is associated with the UUID in the Info.plist file. CFPlugInFactories = { "DFC01D58-0C4A-11D5-BB77-003065500EB8" = "PrintDialogPDEPluginFactory"; }; Input Parameters: allocator - the allocator function used by CoreFoundation reqTypeID - requested instance type. Output Parameters: None. Return Value: * ========================================================================== */void* PrintDialogPDEPluginFactory( CFAllocatorRef allocator, CFUUIDRef reqTypeID ){ CFUUIDRef myInstID; IUnknownInstance* instance = NULL; // There is not much we can do with errors - just return NULL. myInstID = CFUUIDCreateFromString(kCFAllocatorDefault, kAppPrintDialogTypeIDStr); // If the requested type matches our plugin type (it should!) // have a plugin instance created which will query us for // interfaces: if (myInstID && CFEqual(reqTypeID, myInstID)) { CFUUIDRef myFactoryID = CFUUIDCreateFromString(kCFAllocatorDefault, kPrintDialogPDEIntfFactoryIDStr); if(myFactoryID) { // allocate and clear our instance structure instance = (IUnknownInstance*) calloc(1, sizeof(IUnknownInstance)); if (instance != NULL) { // Assign all members: instance->vtable = &instance->vtableStorage; instance->vtableStorage.QueryInterface = IUnknownQueryInterface; instance->vtableStorage.AddRef = IUnknownAddRef; instance->vtableStorage.Release = IUnknownRelease; instance->factoryID = myFactoryID; instance->refCount = 1; // Register the newly created instance CFPlugInAddInstanceForFactory(myFactoryID); } } } if(myInstID) CFRelease(myInstID); return ((void*) instance);}
开发者ID:fruitsamples,项目名称:App,代码行数:66,
示例24: HandleStateEventsForService/***************************************************************************** * HandleStateEventsForService * - * This method handles the toggling the state of a while exists event to * reflect the network. *****************************************************************************/void HandleStateEventsForService(BonjourUserEventsPlugin* plugin, NetBrowserInfo* browser, CFStringRef serviceName, Boolean didAppear){ CFArrayRef events = (CFArrayRef)CFDictionaryGetValue(plugin->_whileServiceExist, browser); // Get the _whileServiceExist events that are interested in this browser. CFIndex i; CFIndex count; if (!events) // Somehow we have a orphan browser... return; count = CFArrayGetCount(events); // Go thru the events and run filters, notifity if they pass. for (i = 0; i < count; ++i) { CFDictionaryRef eventDict = (CFDictionaryRef)CFArrayGetValueAtIndex(events, i); CFStringRef eventServiceName = (CFStringRef)CFDictionaryGetValue(eventDict, sServiceNameKey); CFNumberRef token = (CFNumberRef) CFDictionaryGetValue(eventDict, sLaunchdTokenKey); // Currently we only filter on service name, that makes this as simple as... if (!eventServiceName || CFEqual(serviceName, eventServiceName)) UserEventAgentSetLaunchEventState(plugin->_pluginContext, token, didAppear); }}
开发者ID:benvanik,项目名称:mDNSResponder,代码行数:29,
示例25: CFDictionarySetValuevoid SFB::Audio::AttachedPicture::SetValue(CFStringRef key, CFTypeRef value){ if(nullptr == key) return; if(nullptr == value) { if(CFDictionaryContainsKey(mMetadata, key)) CFDictionarySetValue(mChangedMetadata, key, kCFNull); else CFDictionaryRemoveValue(mChangedMetadata, key); } else { if(CFDictionaryContainsKey(mChangedMetadata, key)) { CFTypeRef savedValue = CFDictionaryGetValue(mMetadata, key); if(nullptr != savedValue && CFEqual(savedValue, value)) CFDictionaryRemoveValue(mChangedMetadata, key); else CFDictionarySetValue(mChangedMetadata, key, value); } else CFDictionarySetValue(mChangedMetadata, key, value); }}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:23,
示例26: printf // Implementation of the factory function for this type. void *MyFactory(CFAllocatorRef allocator, CFUUIDRef typeID) { // If correct type is being requested, allocate an // instance of TestType and return the IUnknown interface. if (CFEqual(typeID, kAudioHardwarePlugInTypeID)) {#if PRINTDEBUG printf("JAS: MyFactory kAudioHardwarePlugInTypeID/n");#endif#ifdef kAudioHardwarePlugInInterface2ID MyType *result = _allocMyType( kAudioHardwarePlugInInterface2ID );#else MyType *result = _allocMyType( kAudioHardwarePlugInInterfaceID );#endif return result; } else { // If the requested type is incorrect, return NULL. return NULL; } }
开发者ID:briancline,项目名称:jackosx,代码行数:24,
示例27: _SchedulesRemoveRunLoopAndMode/* extern */ Boolean_SchedulesRemoveRunLoopAndMode(CFMutableArrayRef schedules, CFRunLoopRef runLoop, CFStringRef runLoopMode) { /* Get the number of items in schedules and create a range for searching */ CFIndex count = CFArrayGetCount(schedules); CFRange range = CFRangeMake(0, count); /* Go through the list looking for this schedule */ while (range.length) { /* Find the run loop in the list */ CFIndex i = CFArrayGetFirstIndexOfValue(schedules, range, runLoop); /* If the loop wasn't found, then this pair was never added. */ if (i == kCFNotFound) break; /* If the mode is the same, this is already scheduled here so bail */ if (CFEqual(CFArrayGetValueAtIndex(schedules, i + 1), runLoopMode)) { /* Remove the schedule from the list */ range.location = i; range.length = 2; CFArrayReplaceValues(schedules, range, NULL, 0); /* Did remove the schedule from the list */ return TRUE; } /* Continue looking from here */ range.location = i + 2; range.length = count - range.location; } /* Did not remove the schedule from the list */ return FALSE;}
开发者ID:jmgao,项目名称:CFNetwork,代码行数:37,
示例28: __SCDynamicStoreInitializestatic void__SCDynamicStoreInitialize(void){ CFBundleRef bundle; /* register with CoreFoundation */ __kSCDynamicStoreTypeID = _CFRuntimeRegisterClass(&__SCDynamicStoreClass); /* add handler to cleanup after fork() */ (void) pthread_atfork(NULL, NULL, childForkHandler); /* get the application/executable/bundle name */ bundle = CFBundleGetMainBundle(); if (bundle != NULL) { _sc_bundleID = CFBundleGetIdentifier(bundle); if (_sc_bundleID != NULL) { CFRetain(_sc_bundleID); } else { CFURLRef url; url = CFBundleCopyExecutableURL(bundle); if (url != NULL) { _sc_bundleID = CFURLCopyPath(url); CFRelease(url); } } if (_sc_bundleID != NULL) { if (CFEqual(_sc_bundleID, CFSTR("/"))) { CFRelease(_sc_bundleID); _sc_bundleID = CFStringCreateWithFormat(NULL, NULL, CFSTR("(%d)"), getpid()); } } } return;}
开发者ID:010001111,项目名称:darling,代码行数:37,
示例29: BIGetUTI/* * Map a filename and/or a BIFileType to a UTI string. */static CFStringRef BIGetUTI( CFURLRef url, BIFileType fileType){ switch(fileType) { case BI_FT_JPEG: case BI_FT_JPEG_Lossless: return kUTTypeJPEG; case BI_FT_TIFF: return kUTTypeTIFF; case BI_FT_JPEG2000: case BI_FT_JPEG2000_Lossless: return kUTTypeJPEG2000; case BI_FT_Default: /* figure it out from file extension */ break; default: fprintf(stderr, "***BIGetUTI internal error/n"); return NULL; } CFStringRef fileExt = CFURLCopyPathExtension(url); if(fileExt == NULL) { fprintf(stderr, "***BIGetUTI(BI_FT_Default) - no extension available/n"); return NULL; } for(unsigned mapDex=0; mapDex<NUM_UTI_MAPS; mapDex++) { const UTIMap *map = &utiMap[mapDex]; if(CFEqual(fileExt, map->exten)) { return map->uti; } } fprintf(stderr, "***BIGetUTI(BI_FT_Default) - unknown extension/n"); return NULL;}
开发者ID:JeffreyEarly,项目名称:GLNumericalModelingKit,代码行数:40,
注:本文中的CFEqual函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ CFG函数代码示例 C++ CFE_EVS_SendEvent函数代码示例 |