Пример #1
0
CFSetRef
CFSetCreateCopy (CFAllocatorRef allocator, CFSetRef set)
{
  CF_OBJC_FUNCDISPATCH0(_kCFSetTypeID, CFSetRef, set,
    "copy");
  
  return (CFSetRef)GSHashTableCreateCopy (allocator, (GSHashTableRef)set);
}
Пример #2
0
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);
}
Пример #3
0
CFBagRef
CFBagCreateCopy (CFAllocatorRef allocator, CFBagRef bag)
{
  return (CFBagRef)GSHashTableCreateCopy (allocator, (GSHashTableRef)bag);
}