GNUstep CoreBase Library 0.2
Runtime Utilities

Detailed Description

Examples:
Creating a CF opaque type (EXUInt32)
Warning
The CFRuntime functions are not thread-safe.

Data Structures

struct  CFRuntimeClass
struct  CFRuntimeBase
struct  __CFRuntimeBase._flags

Macros

#define INIT_CFRUNTIME_BASE(...)
#define CF_HAS_INIT_STATIC_INSTANCE   1

Enumerations

enum  { _kCFRuntimeNotATypeID = 0 }
enum  { _kCFRuntimeScannedObject = (1UL<<0) , _kCFRuntimeResourcefulObject = (1UL<<2) , _kCFRuntimeCustomRefCount = (1UL<<3) }

Functions

CFTypeID _CFRuntimeRegisterClass (const CFRuntimeClass *const cls)
const CFRuntimeClass * _CFRuntimeGetClassWithTypeID (CFTypeID typeID)
void _CFRuntimeUnregisterClassWithTypeID (CFTypeID typeID)
CFTypeRef _CFRuntimeCreateInstance (CFAllocatorRef allocator, CFTypeID typeID, CFIndex extraBytes, unsigned char *category)
void _CFRuntimeSetInstanceTypeID (CFTypeRef cf, CFTypeID typeID)
void _CFRuntimeInitStaticInstance (void *memory, CFTypeID typeID)

Garbage Collection

Garbage Collection is not supported. All macros and functions relating to GC return false or NULL, but are provided for compatibility.

Boolean kCFUseCollectableAllocator
Boolean(* __CFObjCIsCollectable )(void *)
#define CF_USING_COLLECTABLE_MEMORY   (kCFUseCollectableAllocator)
#define CF_IS_COLLECTABLE_ALLOCATOR(allocator)
#define CF_IS_COLLECTABLE(obj)

Data Structure Documentation

◆ __CFRuntimeClass

struct __CFRuntimeClass

◆ __CFRuntimeBase

struct __CFRuntimeBase

◆ __CFRuntimeBase._flags

struct __CFRuntimeBase._flags

Macro Definition Documentation

◆ CF_IS_COLLECTABLE_ALLOCATOR

#define CF_IS_COLLECTABLE_ALLOCATOR ( allocator)
Value:
0

◆ CF_IS_COLLECTABLE

#define CF_IS_COLLECTABLE ( obj)
Value:
0

◆ INIT_CFRUNTIME_BASE

#define INIT_CFRUNTIME_BASE ( ...)
Value:
{ 0, 0, { 1, 0, 0 } }

Function Documentation

◆ _CFRuntimeRegisterClass()

CFTypeID _CFRuntimeRegisterClass ( const CFRuntimeClass *const cls)

Registers a new CF class with the runtime. This function locks the class table and so is thread-safe.

Parameters
clsA constant CFRuntimeClass.
Returns
The next available CFTypeID or _kCFRuntimeNotATypeID if none are available.
See also
_CFRuntimeUnregisterClassWithTypeID()
Examples
EXUInt32.c.

◆ _CFRuntimeGetClassWithTypeID()

const CFRuntimeClass * _CFRuntimeGetClassWithTypeID ( CFTypeID typeID)

Gets the class structure associated with the typeID.

Parameters
typeIDA CFTypeID to look up.
Returns
The CFRuntimeClass for the typeID

◆ _CFRuntimeUnregisterClassWithTypeID()

void _CFRuntimeUnregisterClassWithTypeID ( CFTypeID typeID)

Unregisters a class.

Parameters
typeIDThe CFTypeID to unregister.
See also
_CFRuntimeRegisterClass()
Warning
This function is not thread-safe.

◆ _CFRuntimeCreateInstance()

CFTypeRef _CFRuntimeCreateInstance ( CFAllocatorRef allocator,
CFTypeID typeID,
CFIndex extraBytes,
unsigned char * category )

Creates a new CF type instance.

Parameters
allocatorThe CFAllocatorRef to use or NULL for the default allocator.
typeIDThe CFTypeID of the class.
extraBytesThe amount of extra bytes over a CFRuntimeBase type needed by this instance.
categoryCurrently unused, use NULL.
Returns
A newly allocated object.
See also
CFRetain()
CFRelease()
Examples
EXUInt32.c.

◆ _CFRuntimeSetInstanceTypeID()

void _CFRuntimeSetInstanceTypeID ( CFTypeRef cf,
CFTypeID typeID )

Set the CFTypeID for an instance.

Parameters
cfThe object instance to set the type ID.
typeIDThe new CFTypeID.

◆ _CFRuntimeInitStaticInstance()

void _CFRuntimeInitStaticInstance ( void * memory,
CFTypeID typeID )

Initializes a static CF object instance.

Parameters
memoryA pointer to a static CF object instance.
typeIDThe CFTypeID of the instance.