CFSetRef CFSetCreateCopy (CFAllocatorRef allocator, CFSetRef set) { CF_OBJC_FUNCDISPATCH0(_kCFSetTypeID, CFSetRef, set, "copy"); return (CFSetRef)GSHashTableCreateCopy (allocator, (GSHashTableRef)set); }
CFSetRef CFSetCreateCopy (CFAllocatorRef allocator, CFSetRef set) { if (CF_IS_OBJC (_kCFSetTypeID, set)) { CFSetRef result; const CFIndex count = CFSetGetCount (set); void **values = (void **) CFAllocatorAllocate (allocator, sizeof (void *) * count, 0); CFSetGetValues (set, (const void **) values); result = CFSetCreate (allocator, (const void **) values, count, &kCFTypeSetCallBacks); CFAllocatorDeallocate (allocator, (void *) values); return result; } return (CFSetRef) GSHashTableCreateCopy (allocator, (GSHashTableRef) set); }
CFBagRef CFBagCreateCopy (CFAllocatorRef allocator, CFBagRef bag) { return (CFBagRef)GSHashTableCreateCopy (allocator, (GSHashTableRef)bag); }