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

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

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

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

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

示例1: interface_update_status

static voidinterface_update_status(const char *if_name, CFBooleanRef active,			boolean_t attach){	CFStringRef		key		= NULL;	CFMutableDictionaryRef	newDict		= NULL;	key = create_interface_key(if_name);	newDict = copy_entity(key);	/* if new status available, update cache */	if (active == NULL) {	    CFDictionaryRemoveValue(newDict, kSCPropNetLinkActive);	} else {	    CFDictionarySetValue(newDict, kSCPropNetLinkActive, active);	}	if (attach == TRUE) {		/* the interface was attached, remove stale state */		CFDictionaryRemoveValue(newDict, kSCPropNetLinkDetaching);	}	/* update status */	if (CFDictionaryGetCount(newDict) > 0) {		cache_SCDynamicStoreSetValue(store, key, newDict);	} else {		cache_SCDynamicStoreRemoveValue(store, key);	}	CFRelease(key);	CFRelease(newDict);	return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:31,


示例2: find_class_path

static VALUEfind_class_path(VALUE klass){    struct fc_result arg;    arg.name = 0;    arg.path = 0;    arg.klass = klass;    arg.track = rb_cObject;    arg.prev = 0;    CFMutableDictionaryRef iv_dict = rb_class_ivar_dict(rb_cObject);    if (iv_dict != NULL) {	ivar_dict_foreach(iv_dict, fc_i, (VALUE)&arg);    }    if (arg.path == 0) {	st_foreach_safe(rb_class_tbl, fc_i, (st_data_t)&arg);    }    if (arg.path) {	iv_dict = rb_class_ivar_dict_or_create(klass);	CFDictionarySetValue(iv_dict, (const void *)id_classpath,		(const void *)arg.path);	CFDictionaryRemoveValue(iv_dict, (const void *)id_tmp_classpath);	return arg.path;    }    if (!RCLASS_RUBY(klass)) {	VALUE name = rb_str_new2(class_getName((Class)klass));	iv_dict = rb_class_ivar_dict_or_create(klass);	CFDictionarySetValue(iv_dict, (const void *)id_classpath,		(const void *)name);	CFDictionaryRemoveValue(iv_dict, (const void *)id_tmp_classpath);	return name;    }    return Qnil;}
开发者ID:kyab,项目名称:MacRuby,代码行数:35,


示例3: _CFBundlePlugInLoaded

__private_extern__ void _CFBundlePlugInLoaded(CFBundleRef bundle) {    CFDictionaryRef infoDict = CFBundleGetInfoDictionary(bundle);    CFStringRef tempStr;    CFPlugInDynamicRegisterFunction func = NULL;    if (!__CFBundleGetPlugInData(bundle)->_isPlugIn || __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration || !infoDict || !CFBundleIsExecutableLoaded(bundle)) return;    tempStr = (CFStringRef)CFDictionaryGetValue(infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));    if (tempStr && CFGetTypeID(tempStr) == CFStringGetTypeID() && CFStringCompare(tempStr, CFSTR("YES"), kCFCompareCaseInsensitive) == kCFCompareEqualTo) {        CFDictionaryRemoveValue((CFMutableDictionaryRef)infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));        tempStr = (CFStringRef)CFDictionaryGetValue(infoDict, kCFPlugInDynamicRegisterFunctionKey);        if (!tempStr || CFGetTypeID(tempStr) != CFStringGetTypeID() || CFStringGetLength(tempStr) <= 0) tempStr = CFSTR("CFPlugInDynamicRegister");        __CFBundleGetPlugInData(bundle)->_loadOnDemand = false;        __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration = true;        /* Find the symbol and call it. */        func = (CFPlugInDynamicRegisterFunction)CFBundleGetFunctionPointerForName(bundle, tempStr);        if (func) {            func(bundle);            // MF:!!! Unload function is never called.  Need to deal with this!        }        __CFBundleGetPlugInData(bundle)->_isDoingDynamicRegistration = false;        if (__CFBundleGetPlugInData(bundle)->_loadOnDemand && __CFBundleGetPlugInData(bundle)->_instanceCount == 0) CFBundleUnloadExecutable(bundle);   // Unload now if we can/should.    } else {        CFDictionaryRemoveValue((CFMutableDictionaryRef)infoDict, CFSTR("CFPlugInNeedsDynamicRegistration"));    }}
开发者ID:Ashod,项目名称:WinCairoRequirements,代码行数:28,


示例4: copyIF

static CFMutableDictionaryRefcopyIF(CFStringRef key, CFMutableDictionaryRef oldIFs, CFMutableDictionaryRef newIFs){	CFDictionaryRef		dict		= NULL;	CFMutableDictionaryRef	newDict		= NULL;	if (CFDictionaryGetValueIfPresent(newIFs, key, (const void **)&dict)) {		newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);	} else {		dict = cache_SCDynamicStoreCopyValue(store, key);		if (dict) {			CFDictionarySetValue(oldIFs, key, dict);			if (isA_CFDictionary(dict)) {				newDict = CFDictionaryCreateMutableCopy(NULL, 0, dict);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6Addresses);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6DestAddresses);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6Flags);				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6PrefixLength);#ifdef	NOTYET				CFDictionaryRemoveValue(newDict, kSCPropNetIPv6ScopeID);#endif	/* NOTYET */			}			CFRelease(dict);		}	}	if (!newDict) {		newDict = CFDictionaryCreateMutable(NULL,						    0,						    &kCFTypeDictionaryKeyCallBacks,						    &kCFTypeDictionaryValueCallBacks);	}	return newDict;}
开发者ID:010001111,项目名称:darling,代码行数:35,


示例5: CFDictionarySetValue

void SFB::Audio::Metadata::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 {		CFTypeRef savedValue = CFDictionaryGetValue(mMetadata, key);		// Revert the change if the new value is the save as the saved value		if(CFDictionaryContainsKey(mChangedMetadata, key)) {			if(savedValue && CFEqual(savedValue, value))				CFDictionaryRemoveValue(mChangedMetadata, key);			else				CFDictionarySetValue(mChangedMetadata, key, value);		}		// If a saved value exists only register the change if the new value is different		else if(savedValue && !CFEqual(savedValue, value))			CFDictionarySetValue(mChangedMetadata, key, value);		// If no saved value exists for the key register the change		else if(nullptr == savedValue)			CFDictionarySetValue(mChangedMetadata, key, value);	}}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:28,


示例6: rb_mod_init_copy

VALUErb_mod_init_copy(VALUE clone, SEL sel, VALUE orig){    rb_obj_init_copy(clone, 0, orig);    VALUE super;    if (!RCLASS_RUBY(orig)) {	super = orig;	rb_warn("cloning class `%s' is not supported, creating a " /		"subclass instead", rb_class2name(orig));    }    else {	super = RCLASS_SUPER(orig);    }    RCLASS_SET_SUPER(clone, super);    // Copy flags.    unsigned long version_flag = RCLASS_IS_RUBY_CLASS;    if ((RCLASS_VERSION(super) & RCLASS_IS_OBJECT_SUBCLASS)	    == RCLASS_IS_OBJECT_SUBCLASS) {	version_flag |= RCLASS_IS_OBJECT_SUBCLASS;    }    if (RCLASS_MODULE(orig)) {	version_flag |= RCLASS_IS_MODULE;    }    RCLASS_SET_VERSION(clone, version_flag);    if (!class_isMetaClass((Class)clone)) {	// Clear type info.	RCLASS_SET_VERSION(*(Class *)clone, RCLASS_VERSION(*(Class *)clone));    }    // Copy methods.    rb_vm_copy_methods((Class)orig, (Class)clone);    if (!class_isMetaClass((Class)orig)) {	rb_vm_copy_methods(*(Class *)orig, *(Class *)clone);    }    // Copy ivars.    CFMutableDictionaryRef orig_dict = rb_class_ivar_dict(orig);    CFMutableDictionaryRef clone_dict;    if (orig_dict != NULL) {	clone_dict = CFDictionaryCreateMutableCopy(NULL, 0, orig_dict);	rb_class_ivar_set_dict(clone, clone_dict);	CFMakeCollectable(clone_dict);    }    else {	clone_dict = rb_class_ivar_dict_or_create(clone);    }    // Remove the classpath & classid (name) so that they are not    // copied over the new module / class.    CFDictionaryRemoveValue(clone_dict, (const void *)id_classpath);    CFDictionaryRemoveValue(clone_dict, (const void *)id_classid);    return clone;}
开发者ID:Watson1978,项目名称:MacRuby,代码行数:55,


示例7: __remove_password

__private_extern__Boolean__remove_password(SCPreferencesRef	prefs,		  CFDictionaryRef	config,		  CFStringRef		passwordKey,		  CFStringRef		encryptionKey,		  CFStringRef		encryptionKeyChainValue,		  CFStringRef		unique_id,		  CFDictionaryRef	*newConfig){	CFStringRef		encryption	= NULL;	Boolean			ok		= FALSE;	// check for keychain password	if (config != NULL) {		encryption = CFDictionaryGetValue(config, encryptionKey);	}	if ((encryption == NULL) ||	    (isA_CFString(encryption) &&	     CFEqual(encryption, encryptionKeyChainValue))) {		    // remove keychain password		    if (prefs != NULL) {			    ok = _SCPreferencesSystemKeychainPasswordItemRemove(prefs, unique_id);		    } else {			    ok = _SCSecKeychainPasswordItemRemove(NULL, unique_id);		    }	    }	// as needed, check if we have an in-line password that we can remove	if (!ok && (encryption == NULL) && (config != NULL)) {		CFDataRef	inline_password;		inline_password = CFDictionaryGetValue(config, passwordKey);		inline_password = __copy_legacy_password(inline_password);		if (inline_password != NULL) {			CFRelease(inline_password);			ok = TRUE;		}	}	if (newConfig != NULL) {		if (ok && (config != NULL)) {			CFMutableDictionaryRef	temp;			temp = CFDictionaryCreateMutableCopy(NULL, 0, config);			CFDictionaryRemoveValue(temp, passwordKey);			CFDictionaryRemoveValue(temp, encryptionKey);			*newConfig = (CFDictionaryRef)temp;		} else {			*newConfig = NULL;		}	}	return ok;}
开发者ID:010001111,项目名称:darling,代码行数:55,


示例8: rb_mod_init_copy

/* :nodoc: */VALUErb_mod_init_copy(VALUE clone, SEL sel, VALUE orig){    static ID classpath = 0;    static ID classid = 0;    rb_obj_init_copy(clone, 0, orig);    {	VALUE super;	unsigned long version_flag;	if (!RCLASS_RUBY(orig)) {	    super = orig;	    rb_warn("cloning class `%s' is not supported, creating a " /		    "subclass instead", rb_class2name(orig));	}	else {	    super = RCLASS_SUPER(orig);	}	RCLASS_SET_SUPER(clone, super);	version_flag = RCLASS_IS_RUBY_CLASS;	if ((RCLASS_VERSION(super) & RCLASS_IS_OBJECT_SUBCLASS) == RCLASS_IS_OBJECT_SUBCLASS) {	    version_flag |= RCLASS_IS_OBJECT_SUBCLASS;	}	RCLASS_SET_VERSION(clone, version_flag);	rb_vm_copy_methods((Class)orig, (Class)clone);	CFMutableDictionaryRef ivar_dict = rb_class_ivar_dict(orig);	if (ivar_dict != NULL) {	    CFMutableDictionaryRef cloned_ivar_dict;	    if (classpath == 0) {		classpath = rb_intern("__classpath__");	    }	    if (classid == 0) {		classid = rb_intern("__classid__");	    }	    cloned_ivar_dict = CFDictionaryCreateMutableCopy(NULL, 0,		(CFDictionaryRef)ivar_dict);	    // Remove the classpath & classid (name) so that they are not	    // copied over the new module / class	    CFDictionaryRemoveValue(cloned_ivar_dict, (const void *)classpath);	    CFDictionaryRemoveValue(cloned_ivar_dict, (const void *)classid);	    CFMakeCollectable(cloned_ivar_dict);	    rb_class_ivar_set_dict(clone, cloned_ivar_dict);	}    }    return clone;}
开发者ID:MSch,项目名称:MacRuby,代码行数:53,


示例9: EAPOLClientProfileSetInformation

/* * Function: EAPOLClientProfileSetInformation * * Purpose: *   Associate additional information with the profile using the given *   application identifier. *    *   If info is NULL, the information for the particular application is cleared. * * Note: *   applicationID must be an application identifier e.g. "com.mycompany.myapp". */BooleanEAPOLClientProfileSetInformation(EAPOLClientProfileRef profile,				 CFStringRef applicationID,				 CFDictionaryRef information){    if (applicationID_is_valid(applicationID) == FALSE) {	return (FALSE);    }    if (information == NULL) {	if (profile->information != NULL) {	    CFDictionaryRemoveValue(profile->information, applicationID);	}    }    else {	if (isA_CFDictionary(information) == NULL) {	    return (FALSE);	}	if (profile->information == NULL) {	    profile->information		= CFDictionaryCreateMutable(NULL, 0,					    &kCFTypeDictionaryKeyCallBacks,					    &kCFTypeDictionaryValueCallBacks);	}	CFDictionarySetValue(profile->information, applicationID, information);    }    return (TRUE);}
开发者ID:gfleury,项目名称:eap8021x-debug,代码行数:39,


示例10: CFDictionaryCreateMutableCopy

CFDictionaryRef SFB::Audio::Metadata::CreateDictionaryRepresentation() const{	CFMutableDictionaryRef dictionaryRepresentation = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 0, mMetadata);	CFIndex count = CFDictionaryGetCount(mChangedMetadata);	CFTypeRef *keys = (CFTypeRef *)malloc(sizeof(CFTypeRef) * (size_t)count);	CFTypeRef *values = (CFTypeRef *)malloc(sizeof(CFTypeRef) * (size_t)count);	CFDictionaryGetKeysAndValues(mChangedMetadata, keys, values);	for(CFIndex i = 0; i < count; ++i) {		if(kCFNull == values[i])			CFDictionaryRemoveValue(dictionaryRepresentation, keys[i]);		else			CFDictionarySetValue(dictionaryRepresentation, keys[i], values[i]);	}	free(keys), keys = nullptr;	free(values), values = nullptr;	CFMutableArray pictureArray = CFArrayCreateMutable(kCFAllocatorDefault, 0, &kCFTypeArrayCallBacks);	for(auto picture : GetAttachedPictures()) {		CFDictionary pictureRepresentation = picture->CreateDictionaryRepresentation();		CFArrayAppendValue(pictureArray, pictureRepresentation);	}	if(0 < CFArrayGetCount(pictureArray)) {		CFDictionarySetValue(dictionaryRepresentation, kAttachedPicturesKey, pictureArray);	}	return dictionaryRepresentation;}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:34,


示例11: CFDictionaryGetCount

void SFB::Audio::Metadata::MergeChangedMetadataIntoMetadata(){	CFIndex count = CFDictionaryGetCount(mChangedMetadata);		CFTypeRef *keys = (CFTypeRef *)malloc(sizeof(CFTypeRef) * (size_t)count);	CFTypeRef *values = (CFTypeRef *)malloc(sizeof(CFTypeRef) * (size_t)count);		CFDictionaryGetKeysAndValues(mChangedMetadata, keys, values);		for(CFIndex i = 0; i < count; ++i) {		if(kCFNull == values[i])			CFDictionaryRemoveValue(mMetadata, keys[i]);		else			CFDictionarySetValue(mMetadata, keys[i], values[i]);	}		free(keys), keys = nullptr;	free(values), values = nullptr;		CFDictionaryRemoveAllValues(mChangedMetadata);	auto iter = std::begin(mPictures);	while(iter != std::end(mPictures)) {		auto picture = *iter;		if(AttachedPicture::ChangeState::Removed == picture->mState)			iter = mPictures.erase(iter);		else {			picture->MergeChangedMetadataIntoMetadata();			picture->mState = AttachedPicture::ChangeState::Saved;			++iter;		}	}}
开发者ID:JanX2,项目名称:SFBAudioEngine,代码行数:33,


示例12: rb_gc_copy_finalizer

voidrb_gc_copy_finalizer(VALUE dest, VALUE obj){    VALUE table;    if (__os_finalizers == NULL)	return;    if (NATIVE(obj)) {	if (!rb_objc_flag_check((void *)obj, FL_FINALIZE))	    return;    }    else {	if (!FL_TEST(obj, FL_FINALIZE))	    return;    }    table = (VALUE)CFDictionaryGetValue((CFDictionaryRef)__os_finalizers,	(const void *)obj);    if (table == 0) {	CFDictionaryRemoveValue(__os_finalizers, (const void *)dest);    }    else {	CFDictionarySetValue(__os_finalizers, (const void *)dest, 	    (const void *)table);	    }}
开发者ID:prototype,项目名称:MacRuby,代码行数:28,


示例13: interface_update_quality_metric

__private_extern__voidinterface_update_quality_metric(const char *if_name,				int quality){	CFStringRef  		key             = NULL;	CFMutableDictionaryRef	newDict         = NULL;	CFNumberRef		linkquality     = NULL;	key = create_linkquality_key(if_name);	newDict = copy_entity(key);	if (quality != IFNET_LQM_THRESH_UNKNOWN) {		linkquality = CFNumberCreate(NULL, kCFNumberIntType, &quality);		CFDictionarySetValue(newDict, kSCPropNetLinkQuality, linkquality);		CFRelease(linkquality);	} else {		CFDictionaryRemoveValue(newDict, kSCPropNetLinkQuality);	}	/* update status */	if (CFDictionaryGetCount(newDict) > 0) {		cache_SCDynamicStoreSetValue(store, key, newDict);	} else {		cache_SCDynamicStoreRemoveValue(store, key);	}	CFRelease(key);	CFRelease(newDict);	return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:31,


示例14: remove_old_linklocal_modifiers

STATIC voidremove_old_linklocal_modifiers(CFMutableDictionaryRef modifiers){    CFIndex		count;    count = CFDictionaryGetCount(modifiers);    if (count > 0) {	int		i;	const void *	keys[count];	CFDateRef	now;	const void *	values[count];	now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());	CFDictionaryGetKeysAndValues(modifiers, keys, values);	for (i = 0; i < count; i++) {	    CFDictionaryRef	dict = (CFDictionaryRef)values[i];	    if (linklocal_modifier_has_expired(dict, now)) {		CFStringRef	key = (CFStringRef)keys[i];		CFDictionaryRemoveValue(modifiers, key);	    }	}	CFRelease(now);    }    return;}
开发者ID:carriercomm,项目名称:osx-2,代码行数:27,


示例15: classname

static VALUEclassname(VALUE klass){    VALUE path = Qnil;    if (klass == 0) {	klass = rb_cObject;    }    CFMutableDictionaryRef iv_dict = rb_class_ivar_dict(klass);    if (iv_dict != NULL) {	if (!CFDictionaryGetValueIfPresent((CFDictionaryRef)iv_dict, 		    (const void *)id_classpath, (const void **)&path)) {	    if (!CFDictionaryGetValueIfPresent((CFDictionaryRef)iv_dict, 			(const void *)id_classid, (const void **)&path)) {		return find_class_path(klass);	    }	    path = rb_str_dup(path);	    OBJ_FREEZE(path);	    CFDictionarySetValue(iv_dict, (const void *)id_classpath,		    (const void *)path);	    CFDictionaryRemoveValue(iv_dict, (const void *)id_classid);	}	if (TYPE(path) != T_STRING) {	    rb_bug("class path is not set properly");	}	return path;    }    return find_class_path(klass);}
开发者ID:kyab,项目名称:MacRuby,代码行数:29,


示例16: CFMessagePortInvalidate

void CFMessagePortInvalidate(CFMessagePortRef ms) {    __CFGenericValidateType(ms, __kCFMessagePortTypeID);    if (!__CFMessagePortIsDeallocing(ms)) {	CFRetain(ms);    }    __CFMessagePortLock(ms);    if (__CFMessagePortIsValid(ms)) {	CFMessagePortInvalidationCallBack callout = ms->_icallout;	CFRunLoopSourceRef source = ms->_source;	CFMachPortRef replyPort = ms->_replyPort;	CFMachPortRef port = ms->_port;	CFStringRef name = ms->_name;	void *info = NULL;	__CFMessagePortUnsetValid(ms);	if (!__CFMessagePortIsRemote(ms)) {	    info = ms->_context.info;	    ms->_context.info = NULL;	}	ms->_source = NULL;	ms->_replyPort = NULL;	__CFMessagePortUnlock(ms);	__CFSpinLock(&__CFAllMessagePortsLock);	if (NULL != (__CFMessagePortIsRemote(ms) ? __CFAllRemoteMessagePorts : __CFAllLocalMessagePorts)) {	    CFDictionaryRemoveValue(__CFMessagePortIsRemote(ms) ? __CFAllRemoteMessagePorts : __CFAllLocalMessagePorts, name);	}	__CFSpinUnlock(&__CFAllMessagePortsLock);	if (NULL != callout) {	    callout(ms, info);	}	// We already know we're going invalid, don't need this callback	// anymore; plus, this solves a reentrancy deadlock; also, this	// must be done before the deallocate of the Mach port, to	// avoid a race between the notification message which could be	// handled in another thread, and this NULL'ing out.	CFMachPortSetInvalidationCallBack(port, NULL);	// For hashing and equality purposes, cannot get rid of _port here	if (!__CFMessagePortIsRemote(ms) && NULL != ms->_context.release) {	    ms->_context.release(info);	}	if (NULL != source) {	    CFRunLoopSourceInvalidate(source);	    CFRelease(source);	}	if (NULL != replyPort) {	    CFMachPortInvalidate(replyPort);	    CFRelease(replyPort);	}	if (__CFMessagePortIsRemote(ms)) {	    // Get rid of our extra ref on the Mach port gotten from bs server	    mach_port_deallocate(mach_task_self(), CFMachPortGetPort(port));	}    } else {	__CFMessagePortUnlock(ms);    }    if (!__CFMessagePortIsDeallocing(ms)) {	CFRelease(ms);    }}
开发者ID:0x4d52,项目名称:JavaScriptCore-X,代码行数:60,


示例17: do_dictRemoveKey

__private_extern__voiddo_dictRemoveKey(int argc, char **argv){	CFStringRef		key;	CFMutableDictionaryRef	val;	if (value == NULL) {		SCPrint(TRUE, stdout, CFSTR("d.remove: dictionary must be initialized./n"));		return;	}	if (!isA_CFDictionary(value)) {		SCPrint(TRUE, stdout, CFSTR("d.remove: data (fetched from configuration server) is not a dictionary./n"));		return;	}	val = CFDictionaryCreateMutableCopy(NULL, 0, value);	CFRelease(value);	value = val;	key = CFStringCreateWithCString(NULL, argv[0], kCFStringEncodingUTF8);	CFDictionaryRemoveValue((CFMutableDictionaryRef)value, key);	CFRelease(key);	return;}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:27,


示例18: CFSocketFinalize

static voidCFSocketFinalize (CFTypeRef cf){  CFSocketRef s = (CFSocketRef)cf;  #if HAVE_LIBDISPATCH  dispatch_queue_t q = dispatch_get_global_queue(              DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);  dispatch_source_cancel(s->_readSource);  dispatch_source_cancel(s->_writeSource);    // Wait for source handlers to complete  // before we proceed to destruction.  dispatch_barrier_sync_f(q, NULL, DummyBarrier);    if (s->_source != NULL)    CFRelease(s->_source);#endif    if (s->_socket != -1)    {      GSMutexLock (&_kCFSocketObjectsLock);      CFDictionaryRemoveValue(_kCFSocketObjects,                              (void*)(uintptr_t) s->_socket);      closesocket (s->_socket);      GSMutexUnlock (&_kCFSocketObjectsLock);    }  if (s->_address)    CFRelease (s->_address);  if (s->_peerAddress)    CFRelease (s->_peerAddress);}
开发者ID:1053948334,项目名称:myos.frameworks,代码行数:32,


示例19: makeCFMutableDictionary

//// Given a bag of attribute values, automagically come up with a SecCode// without any other information.// This is meant to be the "just do what makes sense" generic call, for callers// who don't want to engage in the fascinating dance of manual guest enumeration.//// Note that we expect the logic embedded here to change over time (in backward// compatible fashion, one hopes), and that it's all right to use heuristics here// as long as it's done sensibly.//// Be warned that the present logic is quite a bit ad-hoc, and will likely not// handle arbitrary combinations of proxy hosting, dynamic hosting, and dedicated// hosting all that well.//SecCode *SecCode::autoLocateGuest(CFDictionaryRef attributes, SecCSFlags flags){	// special case: with no attributes at all, return the root of trust	if (CFDictionaryGetCount(attributes) == 0)		return KernelCode::active()->retain();		// main logic: we need a pid, and we'll take a canonical guest id as an option	int pid = 0;	if (!cfscan(attributes, "{%O=%d}", kSecGuestAttributePid, &pid))		CSError::throwMe(errSecCSUnsupportedGuestAttributes, kSecCFErrorGuestAttributes, attributes);	if (SecCode *process =			KernelCode::active()->locateGuest(attributes)) {		SecPointer<SecCode> code;		code.take(process);		// locateGuest gave us a retained object		if (code->staticCode()->flag(kSecCodeSignatureHost)) {			// might be a code host. Let's find out			CFRef<CFMutableDictionaryRef> rest = makeCFMutableDictionary(attributes);			CFDictionaryRemoveValue(rest, kSecGuestAttributePid);			if (SecCode *guest = code->locateGuest(rest))				return guest;		}		if (!CFDictionaryGetValue(attributes, kSecGuestAttributeCanonical)) {			// only "soft" attributes, and no hosting is happening. Return the (non-)host itself			return code.yield();		}	}	MacOSError::throwMe(errSecCSNoSuchCode);}
开发者ID:alfintatorkace,项目名称:osx-10.9-opensource,代码行数:42,


示例20: gst_vtenc_enqueue_buffer

static VTStatusgst_vtenc_enqueue_buffer (void *data, int a2, int a3, int a4,    CMSampleBufferRef sbuf, int a6, int a7){  GstVTEnc *self = data;  gboolean is_keyframe;  GstBuffer *buf;  /* This may happen if we don't have enough bitrate */  if (sbuf == NULL)    goto beach;  is_keyframe = gst_vtenc_buffer_is_keyframe (self, sbuf);  if (self->expect_keyframe) {    if (!is_keyframe)      goto beach;    CFDictionaryRemoveValue (self->options,        *(self->ctx->vt->kVTEncodeFrameOptionKey_ForceKeyFrame));  }  self->expect_keyframe = FALSE;  buf = gst_core_media_buffer_new (self->ctx, sbuf);  gst_buffer_copy_metadata (buf, self->cur_inbuf, GST_BUFFER_COPY_TIMESTAMPS);  if (is_keyframe) {    GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DISCONT);  } else {    GST_BUFFER_FLAG_UNSET (buf, GST_BUFFER_FLAG_DISCONT);    GST_BUFFER_FLAG_SET (buf, GST_BUFFER_FLAG_DELTA_UNIT);  }  g_ptr_array_add (self->cur_outbufs, buf);beach:  return kVTSuccess;}
开发者ID:dylansong77,项目名称:gstreamer,代码行数:35,


示例21: normalizeHTTPResponseHeaderFields

static void normalizeHTTPResponseHeaderFields(CFMutableDictionaryRef fields){    // Normalize headers    if (CFDictionaryContainsKey(fields, CFSTR("Date")))        CFDictionarySetValue(fields, CFSTR("Date"), CFSTR("Sun, 16 Nov 2008 17:00:00 GMT"));    if (CFDictionaryContainsKey(fields, CFSTR("Last-Modified")))        CFDictionarySetValue(fields, CFSTR("Last-Modified"), CFSTR("Sun, 16 Nov 2008 16:55:00 GMT"));    if (CFDictionaryContainsKey(fields, CFSTR("Etag")))        CFDictionarySetValue(fields, CFSTR("Etag"), CFSTR("/"301925-21-45c7d72d3e780/""));    if (CFDictionaryContainsKey(fields, CFSTR("Server")))        CFDictionarySetValue(fields, CFSTR("Server"), CFSTR("Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.7l PHP/5.2.6"));    // Remove headers    CFDictionaryRemoveValue(fields, CFSTR("Connection"));    CFDictionaryRemoveValue(fields, CFSTR("Keep-Alive"));}
开发者ID:SchleunigerAG,项目名称:WinEC7_Qt5.3.1_Fixes,代码行数:16,


示例22: AFPUser_set_random_password

/* * Function: AFPUser_set_random_password * Purpose: *   Set a random password for the user and returns it in passwd. *   Do not change the password again until AFPUSER_PASSWORD_CHANGE_INTERVAL *   has elapsed.  This overcomes the problem where every client *   request packet is duplicated. In that case, the client tries to use *   a password that subsequently gets changed when the duplicate arrives. */BooleanAFPUser_set_random_password(AFPUserRef user,			    char * passwd, size_t passwd_len){    CFDateRef		last_set;    Boolean		ok = TRUE;    CFDateRef		now;    CFStringRef		pw;    ODRecordRef		record;    now = CFDateCreate(NULL, CFAbsoluteTimeGetCurrent());    pw = CFDictionaryGetValue(user, kAFPUserPassword);    last_set = CFDictionaryGetValue(user, kAFPUserDatePasswordLastSet);    if (pw != NULL && last_set != NULL	&& (CFDateGetTimeIntervalSinceDate(now, last_set) 	    < AFPUSER_PASSWORD_CHANGE_INTERVAL)) {	/* return what we have */#ifdef TEST_AFPUSERS	printf("No need to change the password %d < %d/n",	       (int)CFDateGetTimeIntervalSinceDate(now, last_set),	       AFPUSER_PASSWORD_CHANGE_INTERVAL);#endif /* TEST_AFPUSERS */	(void)_SC_cfstring_to_cstring(pw, passwd, passwd_len,				      kCFStringEncodingASCII);	CFDictionarySetValue(user, kAFPUserDatePasswordLastSet, now);    }    else {	generate_random_password(passwd, passwd_len);	record = (ODRecordRef)CFDictionaryGetValue(user, kAFPUserODRecord);	pw = CFStringCreateWithCString(NULL, passwd, kCFStringEncodingASCII);	ok = ODRecordChangePassword(record, NULL, pw, NULL);	if (ok) {	    CFDictionarySetValue(user, kAFPUserPassword, pw);	    CFDictionarySetValue(user, kAFPUserDatePasswordLastSet, now);	}	else {	    my_log(LOG_NOTICE, "AFPUser_set_random_password:"		   " ODRecordChangePassword() failed");	    CFDictionaryRemoveValue(user, kAFPUserPassword);	    CFDictionaryRemoveValue(user, kAFPUserDatePasswordLastSet);	}	CFRelease(pw);    }    CFRelease(now);    return ok;}
开发者ID:aosm,项目名称:bootp,代码行数:56,


示例23: CFNumberCreate

// Remove itemvoidOPL_DSNList::removeItem(UInt32 idx){	CFNumberRef num = CFNumberCreate(NULL, kCFNumberSInt32Type, &idx);	CFDictionaryRemoveValue(m_items, num);	CFRelease(num);}
开发者ID:openlink,项目名称:odbc-bench,代码行数:9,


示例24: IOMIGMachPortCacheRemove

//------------------------------------------------------------------------------// IOMIGMachPortCacheRemove//------------------------------------------------------------------------------void IOMIGMachPortCacheRemove(mach_port_t port){    pthread_mutex_lock(&__ioPortCacheLock);        CFDictionaryRemoveValue(__ioPortCache, (void *)port);        pthread_mutex_unlock(&__ioPortCacheLock);}
开发者ID:StrongZhu,项目名称:IOKitUser,代码行数:11,


示例25: plist_dict_remove_item

/** * Remove an existing position in a #PLIST_DICT node. * Removed position will be freed using #plist_free * * @param node the node of type #PLIST_DICT * @param key The identifier of the item to remove. Assert if identifier is not present. */void plist_dict_remove_item(plist_t node, const char* key){	CFStringRef keyRef = CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, (UInt8 *)key, strlen(key), kCFStringEncodingUTF8, FALSE, kCFAllocatorNull);	if (keyRef) {		CFDictionaryRemoveValue((CFMutableDictionaryRef) node, keyRef);		CFRelease(keyRef);	}}
开发者ID:aburgh,项目名称:usbmuxd,代码行数:15,


示例26: EAPOLClientConfigurationRemoveProfile

/* * Function: EAPOLClientConfigurationRemoveProfile * * Purpose: *   Remove the specified profile from the configuration. * * Returns: *   FALSE if the profile is invalid or not in the configuration, *   TRUE otherwise. */BooleanEAPOLClientConfigurationRemoveProfile(EAPOLClientConfigurationRef cfg,				      EAPOLClientProfileRef profile){    CFStringRef			profileID = EAPOLClientProfileGetID(profile);    CFDataRef			ssid;        if (EAPOLClientConfigurationGetProfileWithID(cfg, profileID) != profile) {	/* trying to remove profile that isn't part of the configuration */	return (FALSE);    }    ssid = EAPOLClientProfileGetWLANSSIDAndSecurityType(profile, NULL);    if (ssid != NULL) {	CFDictionaryRemoveValue(cfg->ssids, ssid);    }    CFDictionaryRemoveValue(cfg->profiles, profileID);    return (TRUE);}
开发者ID:aosm,项目名称:eap8021x,代码行数:28,


示例27: __setPrefsConfiguration

__private_extern__ Boolean__setPrefsConfiguration(SCPreferencesRef	prefs,			CFStringRef		path,			CFDictionaryRef		config,			Boolean			keepInactive){	CFDictionaryRef		curConfig;	CFMutableDictionaryRef	newConfig	= NULL;	Boolean			ok;	if ((config != NULL) && !isA_CFDictionary(config)) {		_SCErrorSet(kSCStatusInvalidArgument);		return FALSE;	}	curConfig = SCPreferencesPathGetValue(prefs, path);	if (config != NULL) {		newConfig = CFDictionaryCreateMutableCopy(NULL, 0, config);	}	if (keepInactive) {		if (config == NULL) {			newConfig = CFDictionaryCreateMutable(NULL,							      0,							      &kCFTypeDictionaryKeyCallBacks,							      &kCFTypeDictionaryValueCallBacks);		}		if (isA_CFDictionary(curConfig) && CFDictionaryContainsKey(curConfig, kSCResvInactive)) {			// if currently disabled			CFDictionarySetValue(newConfig, kSCResvInactive, kCFBooleanTrue);		} else {			// if currently enabled			CFDictionaryRemoveValue(newConfig, kSCResvInactive);		}	}	// set new configuration	if (_SC_CFEqual(curConfig, newConfig)) {		// if no change		if (newConfig != NULL) CFRelease(newConfig);		ok = TRUE;	} else if (newConfig != NULL) {		// if new configuration (or we are preserving a disabled state)		ok = SCPreferencesPathSetValue(prefs, path, newConfig);		CFRelease(newConfig);	} else {		ok = SCPreferencesPathRemoveValue(prefs, path);		if (!ok && (SCError() == kSCStatusNoKey)) {			ok = TRUE;		}	}	return ok;}
开发者ID:010001111,项目名称:darling,代码行数:56,


示例28: CFErrorSetCallBackForDomain

void CFErrorSetCallBackForDomain(CFStringRef domainName, CFErrorUserInfoKeyCallBack callBack) {    if (!_CFErrorCallBackTable) _CFErrorInitializeCallBackTable();    __CFSpinLock(&_CFErrorSpinlock);    if (callBack) {        CFDictionarySetValue(_CFErrorCallBackTable, domainName, callBack);    } else {        CFDictionaryRemoveValue(_CFErrorCallBackTable, domainName);    }    __CFSpinUnlock(&_CFErrorSpinlock);}
开发者ID:cooljeanius,项目名称:opencflite-code,代码行数:10,


示例29: TearOffSignatureAndHashManifest

static int TearOffSignatureAndHashManifest(CFDictionaryRef manifestDict, CFDataRef* signature, CFDataRef* manifest_data){	int result = -1;	CFMutableDictionaryRef new_manifest_dict = NULL;    CFStringRef sig_data_str = NULL;	CFDataRef sig_data = NULL;	CFDataRef prop_list = NULL;    CFDataRef decoded_sig_data = NULL;		if (NULL == manifestDict || NULL == signature || NULL == manifest_data)	{		return result;	}	*signature = NULL;	*manifest_data = NULL;		new_manifest_dict = CFDictionaryCreateMutableCopy(kCFAllocatorDefault, CFDictionaryGetCount(manifestDict), manifestDict);	sig_data_str = (CFStringRef)CFDictionaryGetValue(new_manifest_dict, CFSTR("Signature"));	if (NULL == sig_data_str)	{		CFRelease(new_manifest_dict);		return result; 	}        sig_data = CFStringCreateExternalRepresentation(kCFAllocatorDefault, sig_data_str, kCFStringEncodingUTF8, 0);    if (NULL == sig_data)    {        CFRelease(sig_data_str);        CFRelease(new_manifest_dict);		return result;    }        if (Base64Data(sig_data, 0, &decoded_sig_data))    {        CFRelease(sig_data);        CFRelease(new_manifest_dict);		return result;    }        	*signature = decoded_sig_data;		CFDictionaryRemoveValue(new_manifest_dict, CFSTR("Signature"));	prop_list = CFPropertyListCreateXMLData (kCFAllocatorDefault, new_manifest_dict);	CFRelease(new_manifest_dict);	if (NULL == prop_list)	{		return result; 	}        (void)CreateHashForData(prop_list, 1, manifest_data);	    result = (NULL == *manifest_data) ? -1 : 0;	return result;	}
开发者ID:unofficial-opensource-apple,项目名称:Security,代码行数:54,



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


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