Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Tidies up after map enumeration... effectively destroys the enumerator.
Returns the bucket from which the next node in the enumeration will come. Once the next node has been enumerated, you can use the bucket and node to remove the node from the map using the GSIMapRemoveNodeFromMap() function.
Enumerating
Create an return an enumerator
for the specified map.
You must call
GSIMapEndEnumerator()
when you have finished with the enumerator.
WARNING You should not alter a
map while an enumeration is in progress. The
results of doing so are reasonably unpredictable.
Remember, DON'T MESS WITH A MAP WHILE YOU'RE
ENUMERATING IT.
Returns the next node in the map, or a nul pointer if at the end.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Description forthcoming.
Returns the NSStringEncoding that matches the specified character set registry and encoding information. For instance, for the iso8859-5 character set, the registry is iso8859 and the encoding is 5, and the returned NSStringEncoding is NSISOCyrillicStringEncoding. If there is no specific encoding, use @"0". Returns GSUndefinedEncoding if there is no match.
Try to deduce the string encoding from the locale string clocale. This function looks in the Locale.encodings file installed as part of GNUstep Base if the encoding cannot be deduced from the clocale string itself. If clocale isn't set or no match can be found, returns GSUndefinedEncoding.
Description forthcoming.
Function to convert from 16-bit unicode to 8-bit data.
The dst argument is a pointer to a pointer to a buffer in which the converted data is to be stored. If it is a null pointer, this function discards converted data, and is used only to determine the length of the converted data. If the zone argument is non-nul, the function is free to allocate a larger buffer if necessary, and store this new buffer in the dst argument. It will *NOT* deallocate the original buffer!
The size argument is a pointer to the initial size of the destination buffer. If the function changes the buffer size, this value will be altered to the new size. This is measured in bytes.
The src argument is a pointer to the 16-bit unicode string which is to be converted to 8-bit data.
The slen argument is the length of the 16-bit unicode string which is to be converted to 8-bit data. This is measured in 16-bit characters, not bytes.
The enc argument specifies the encoding type of the 8-bit byte sequence which is to be produced from the 16-bit unicode.
The zone argument specifies a memory zone in which the function may allocate a buffer to return data in. If this is nul, the function will fail if the originally supplied buffer is not big enough (unless dst is a null pointer... indicating that converted data is to be discarded).
The options argument controls some special behavior.
On return, the function result is a flag indicating
success (YES
) or failure (
NO
), and on success, the value stored
in size is the number of bytes in the
converted data. The converted data itself is
stored in the location given by dst.
NB. If the value stored in dst has
been changed, it is a pointer to allocated memory
which the caller is responsible for freeing, and the
caller is still responsible for freeing the
original buffer.
Function to convert from 8-bit data to 16-bit unicode characters.
The dst argument is a pointer to a pointer to a buffer in which the converted string is to be stored. If it is a null pointer, this function discards converted data, and is used only to determine the length of the converted string. If the zone argument is non-nul, the function is free to allocate a larger buffer if necessary, and store this new buffer in the dst argument. It will *NOT* deallocate the original buffer!
The size argument is a pointer to the initial size of the destination buffer. If the function changes the buffer size, this value will be altered to the new size. This is measured in 16-bit unicode characters, not bytes.
The src argument is a pointer to the byte sequence which is to be converted to 16-bit unicode.
The slen argument is the length of the byte sequence which is to be converted to 16-bit unicode. This is measured in bytes.
The enc argument specifies the encoding type of the 8-bit byte sequence which is to be converted to 16-bit unicode.
The zone argument specifies a memory zone in which the function may allocate a buffer to return data in. If this is nul, the function will fail if the originally supplied buffer is not big enough (unless dst is a null pointer... indicating that converted data is to be discarded).
The options argument controls some special behavior.
On return, the function result is a flag indicating
success (YES
) or failure (
NO
), and on success, the value stored
in size is the number of characters in the
converted string. The converted string itself is
stored in the location given by dst.
NB. If the value stored in dst has
been changed, it is a pointer to allocated memory
which the caller is responsible for freeing, and the
caller is still responsible for freeing the
original buffer.
Returns a nul terminated array of the available string encodings.
Return the default encoding
Description forthcoming.
deprecated See GSToUnicode() and GSFromUnicode()
deprecated See GSToUnicode() and GSFromUnicode()
deprecated See GSToUnicode() and GSFromUnicode()
deprecated See GSToUnicode() and GSFromUnicode()
deprecated See GSToUnicode() and GSFromUnicode()
deprecated See GSToUnicode() and GSFromUnicode()
Description forthcoming.
Description forthcoming.
Description forthcoming.
Uses direct access into a two-level table to map cases.
The two-level table method is less space
efficient (but still not bad) than a single table
and a linear search, but it reduces the number of
conditional statements to just one.
Uses direct access into a two-level table to map cases.
The two-level table method is less space
efficient (but still not bad) than a single table
and a linear search, but it reduces the number of
conditional statements to just one.
deprecated See GSToUnicode() and GSFromUnicode()
Fills a nil
terminated array of Class
objects referenced by buffer with max number of
classes registered with the objc runtime. The
provided buffer must be large enough to hold max + 1
Class objects. If buffer is nil
, the
function returns the number of Class objects that
would be inserted if the buffer is large enough.
Otherwise returns the number of Class objects that
did not fit into the provided buffer. This function keeps
a cache of the class list for future invocations when used
with the GNU runtime. If clearCache is YES
,
this cache will be invalidated and rebuild. The flag has
no effect for the NeXT runtime. This function is provided
as consistent API to both runtimes. In the case of the GNU
runtime it is likely more efficient to use
objc_next_class()
to iterate over the classes.
GSObjCClass()
return the class of an instance. Returns a nul pointer
if the argument is nil
.
Returns the
superclass of this.
GSObjCIsInstance()
tests to see if an id is an instance. Returns
NO
if the argument is nil
.
GSObjCIsClass()
tests to see if an id is a class. Returns
NO
if the argument is nil
.
GSObjCIsKindOf()
tests to see if a class inherits from another class The
argument to this function must NOT be
nil
.
Given a class name, return
the corresponding class or a nul pointer if the class
cannot be found.
If the argument is
nil
, return a nul pointer.
Return
the name of the supplied class, or a nul pointer if no
class was supplied.
Return the name of the
object's class, or a nul pointer if no object was
supplied.
Return the name of the supplied
selector, or a nul pointer if no selector was
supplied.
Return a selector matching the
specified name, or nil
if no name is
supplied. The returned selector could be any one
with the name.
If no selector exists, returns
nil
.
Return the selector for the
specified name and types. Returns a nul pointer if
the name is nul. Uses any available selector if the types
argument is nul.
Creates a new selector if
necessary.
Return the type information from
the specified selector. May return a nul pointer if the
selector was a nul pointer or if it was not typed.
Compare only the type information ignoring
qualifiers, the frame layout and register
markers. Unlike sel_types_match, this function also
handles comparisons of types with and without any
layout information.
Returns a protocol object
with the corresponding name. This function searches the
registered classes for any protocol with the
supplied name. If one is found, it is cached in for
future requests. If efficiency is a factor then use
GSRegisterProtocol()
to insert a protocol explicitly into the cache used by
this function. If no protocol is found this function
returns nil
.
Registers proto in
the cache used by
GSProtocolFromName()
.
Returns the pointer to the method structure for
the selector in the specified class. Depending on
searchInstanceMethods, this function
searches either instance or class methods. Depending
on searchSuperClassesm this function searches either the
specified class only or also its superclasses.
To obtain the implementation pointer IMP use
returnValue->method_imp which should
be safe across all runtimes.
It should be safe to
use this function in
+load
implementations.
This function should
currently (June 2004) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Flushes the
cached method dispatch table for the class. Call this
function after any manipulations in the method
structures.
It should be safe to use this
function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns the
pointer to the instance variable structure for the
instance variable name in the specified class. This
function searches the specified class and its
superclasses.
It should be safe to use
this function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns the
pointer to the instance variable structure for the
instance variable name in the specified class. This
function searches the specified class and its
superclasses.
It is not necessarily safe
to use this function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns a pointer to objc_malloc'ed memory large enough to hold a struct objc_method_list with 'count' number of struct objc_method entries. The memory returned is initialized with 0, including the method count and next method list fields.
This function is intended for use in conjunction with GSAppendMethodToList() to fill the memory and GSAddMethodList() to activate the method list.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Inserts the method described by sel, types and imp into the slot of the list's method_count incremented by 1. This function does not and cannot check whether the list provided has the necessary capacity.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
This function is intended for use in conjunction with GSAllocMethodList() to allocate the list and GSAddMethodList() to activate the method list.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Removes the method identified by sel from the method list moving the following methods up in the list, leaving the last entry blank. After this call, all references of previous GSMethodFromList() calls with this list should be considered invalid. If the values they referenced are needed, they must be copied to external buffers before this function is called.
Returns YES
if the a matching method
was found a removed, NO
otherwise.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns a method list of the class that contains
the selector. Depending on searchInstanceMethods either
instance or class methods are searched. Returns
NULL if none are found. This function does not search
the superclasses method lists. Call this method with
the address of a void *
pointing to NULL
to obtain the first (active) method list containing the
selector. Subsequent calls will return further
method lists which contain the selector. If none are
found, it returns NULL. You may instead pass NULL as
the iterator in which case the first method list
containing the selector will be returned. Do not
call it with an uninitialized iterator. If either
class or selector are NULL the function returns NULL.
If subsequent calls to this function with the same
non-NULL iterator yet different
searchInstanceMethods value are
called, the behavior is undefined.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns the (first) GSMethod contained in the supplied list that corresponds to sel. Returns NULL if none is found.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
Add the method list to the class as the first list to be searched during method invocation for the given class. Depending on toInstanceMethods, this list will be added as an instance or a class method list. If the list is in use by another class, behavior is undefined. Create a new list with GSAllocMethodList() or use GSRemoveMethodList() to remove a list before inserting it in a class.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Removes the method list from the classes instance or class method lists depending on fromInstanceMethods. If the list is not part of the class, behavior is undefined.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns the version number of this.
Return the
zone in which an object belongs, without using the zone
method
Quickly return autoreleased data storage
area.
Allocate a new objc_mutex_t and store it
in the location pointed to by request. A mutex is only
created if the value pointed to by request is NULL.
This function is thread safe in the sense that multiple
threads my call this function with the same value of
request and only one will actually set the mutex. It
is the users responsibility that no one else attempts to
set the mutex pointed to. This function should be used
with objc_mutex_t variables which were statically
initialized to NULL like:
void function (void) { static objc_mutex_t my_lock = NULL; if (my_lock == NULL) GSAllocateMutexAt(&my_lock); objc_mutex_lock(my_lock); do_work (); objc_mutex_unlock(my_lock); }
Prints a message to fptr using the format string provided and any additional arguments. The format string is interpreted as by the NSString formatted initialisers, and understands the '%@' syntax for printing an object.
The data is written to the file pointer in the default CString encoding if possible, as a UTF8 string otherwise.
This function is recommended for printing general log messages. For debug messages use NSDebugLog() and friends. For error logging use NSLog() , and for warnings you might consider NSWarnLog() .
## deprecated ##
## deprecated ##
##
deprecated ##
The number of objects to try
to get from varargs into an array on the stack... if there
are more than this, use the heap. NB. This MUST be a
multiple of 2
Fills a nil
terminated array of Class
objects referenced by buffer with max number of
classes registered with the objc runtime. The
provided buffer must be large enough to hold max + 1
Class objects. If buffer is nil
, the
function returns the number of Class objects that
would be inserted if the buffer is large enough.
Otherwise returns the number of Class objects that
did not fit into the provided buffer. This function keeps
a cache of the class list for future invocations when used
with the GNU runtime. If clearCache is YES
,
this cache will be invalidated and rebuild. The flag has
no effect for the NeXT runtime. This function is provided
as consistent API to both runtimes. In the case of the GNU
runtime it is likely more efficient to use
objc_next_class()
to iterate over the classes.
GSObjCClass()
return the class of an instance. Returns a nul pointer
if the argument is nil
.
Returns the
superclass of this.
GSObjCIsInstance()
tests to see if an id is an instance. Returns
NO
if the argument is nil
.
GSObjCIsClass()
tests to see if an id is a class. Returns
NO
if the argument is nil
.
GSObjCIsKindOf()
tests to see if a class inherits from another class The
argument to this function must NOT be
nil
.
Given a class name, return
the corresponding class or a nul pointer if the class
cannot be found.
If the argument is
nil
, return a nul pointer.
Return
the name of the supplied class, or a nul pointer if no
class was supplied.
Return the name of the
object's class, or a nul pointer if no object was
supplied.
Return the name of the supplied
selector, or a nul pointer if no selector was
supplied.
Return a selector matching the
specified name, or nil
if no name is
supplied. The returned selector could be any one
with the name.
If no selector exists, returns
nil
.
Return the selector for the
specified name and types. Returns a nul pointer if
the name is nul. Uses any available selector if the types
argument is nul.
Creates a new selector if
necessary.
Return the type information from
the specified selector. May return a nul pointer if the
selector was a nul pointer or if it was not typed.
Compare only the type information ignoring
qualifiers, the frame layout and register
markers. Unlike sel_types_match, this function also
handles comparisons of types with and without any
layout information.
Returns a protocol object
with the corresponding name. This function searches the
registered classes for any protocol with the
supplied name. If one is found, it is cached in for
future requests. If efficiency is a factor then use
GSRegisterProtocol()
to insert a protocol explicitly into the cache used by
this function. If no protocol is found this function
returns nil
.
Registers proto in
the cache used by
GSProtocolFromName()
.
Returns the pointer to the method structure for
the selector in the specified class. Depending on
searchInstanceMethods, this function
searches either instance or class methods. Depending
on searchSuperClassesm this function searches either the
specified class only or also its superclasses.
To obtain the implementation pointer IMP use
returnValue->method_imp which should
be safe across all runtimes.
It should be safe to
use this function in
+load
implementations.
This function should
currently (June 2004) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Flushes the
cached method dispatch table for the class. Call this
function after any manipulations in the method
structures.
It should be safe to use this
function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns the
pointer to the instance variable structure for the
instance variable name in the specified class. This
function searches the specified class and its
superclasses.
It should be safe to use
this function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns the
pointer to the instance variable structure for the
instance variable name in the specified class. This
function searches the specified class and its
superclasses.
It is not necessarily safe
to use this function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns a pointer to objc_malloc'ed memory large enough to hold a struct objc_method_list with 'count' number of struct objc_method entries. The memory returned is initialized with 0, including the method count and next method list fields.
This function is intended for use in conjunction with GSAppendMethodToList() to fill the memory and GSAddMethodList() to activate the method list.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Inserts the method described by sel, types and imp into the slot of the list's method_count incremented by 1. This function does not and cannot check whether the list provided has the necessary capacity.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
This function is intended for use in conjunction with GSAllocMethodList() to allocate the list and GSAddMethodList() to activate the method list.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Removes the method identified by sel from the method list moving the following methods up in the list, leaving the last entry blank. After this call, all references of previous GSMethodFromList() calls with this list should be considered invalid. If the values they referenced are needed, they must be copied to external buffers before this function is called.
Returns YES
if the a matching method
was found a removed, NO
otherwise.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns a method list of the class that contains
the selector. Depending on searchInstanceMethods either
instance or class methods are searched. Returns
NULL if none are found. This function does not search
the superclasses method lists. Call this method with
the address of a void *
pointing to NULL
to obtain the first (active) method list containing the
selector. Subsequent calls will return further
method lists which contain the selector. If none are
found, it returns NULL. You may instead pass NULL as
the iterator in which case the first method list
containing the selector will be returned. Do not
call it with an uninitialized iterator. If either
class or selector are NULL the function returns NULL.
If subsequent calls to this function with the same
non-NULL iterator yet different
searchInstanceMethods value are
called, the behavior is undefined.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns the (first) GSMethod contained in the supplied list that corresponds to sel. Returns NULL if none is found.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
Add the method list to the class as the first list to be searched during method invocation for the given class. Depending on toInstanceMethods, this list will be added as an instance or a class method list. If the list is in use by another class, behavior is undefined. Create a new list with GSAllocMethodList() or use GSRemoveMethodList() to remove a list before inserting it in a class.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Removes the method list from the classes instance or class method lists depending on fromInstanceMethods. If the list is not part of the class, behavior is undefined.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns the version number of this.
Return the
zone in which an object belongs, without using the zone
method
Quickly return autoreleased data storage
area.
Allocate a new objc_mutex_t and store it
in the location pointed to by request. A mutex is only
created if the value pointed to by request is NULL.
This function is thread safe in the sense that multiple
threads my call this function with the same value of
request and only one will actually set the mutex. It
is the users responsibility that no one else attempts to
set the mutex pointed to. This function should be used
with objc_mutex_t variables which were statically
initialized to NULL like:
void function (void) { static objc_mutex_t my_lock = NULL; if (my_lock == NULL) GSAllocateMutexAt(&my_lock); objc_mutex_lock(my_lock); do_work (); objc_mutex_unlock(my_lock); }
Prints a message to fptr using the format string provided and any additional arguments. The format string is interpreted as by the NSString formatted initialisers, and understands the '%@' syntax for printing an object.
The data is written to the file pointer in the default CString encoding if possible, as a UTF8 string otherwise.
This function is recommended for printing general log messages. For debug messages use NSDebugLog() and friends. For error logging use NSLog() , and for warnings you might consider NSWarnLog() .
## deprecated ##
## deprecated ##
##
deprecated ##
The number of objects to try
to get from varargs into an array on the stack... if there
are more than this, use the heap. NB. This MUST be a
multiple of 2
This is a macro designed to minimise the use of memory
allocation and deallocation when you need to
work with a vararg list of objects.
The objects
are unpacked from the vararg list into two 'C' arrays
and then a code fragment you specify is able
to make use of them before that 'C' array is destroyed.
The firstObject argument is the name of the formal parameter in your method or function which precedes the ',...' denoting variable args.
The code argument is a piece of objective-c
code to be executed to make use of the
objects stored in the 'C' arrays.
When this
code is called the unsigned integer
'__count' will contain the number of objects
unpacked, the pointer '__objects' will point to
the first object in each pair, and the pointer
'__pairs' will point to an array containing the
second halves of the pairs of objects whose first
halves are in '__objects'.
This lets you pack
a list of the form 'key, value, key, value,...' into an
array of keys and an array of values.
This is a macro designed to minimise the use of memory
allocation and deallocation when you need to
work with a vararg list of objects.
The objects
are unpacked from the vararg list into a 'C' array and
then a code fragment you specify is able to
make use of them before that 'C' array is destroyed.
The firstObject argument is the name of the formal parameter in your method or function which precedes the ',...' denoting variable args.
The code argument is a piece of objective-c
code to be executed to make use of the
objects stored in the 'C' array.
When this
code is called the unsigned integer
'__count' will contain the number of objects
unpacked, and the pointer '__objects' will point
to the unpacked objects, ie. firstObject
followed by the vararg arguments up to (but not
including) the first nil
.
Fills a nil
terminated array of Class
objects referenced by buffer with max number of
classes registered with the objc runtime. The
provided buffer must be large enough to hold max + 1
Class objects. If buffer is nil
, the
function returns the number of Class objects that
would be inserted if the buffer is large enough.
Otherwise returns the number of Class objects that
did not fit into the provided buffer. This function keeps
a cache of the class list for future invocations when used
with the GNU runtime. If clearCache is YES
,
this cache will be invalidated and rebuild. The flag has
no effect for the NeXT runtime. This function is provided
as consistent API to both runtimes. In the case of the GNU
runtime it is likely more efficient to use
objc_next_class()
to iterate over the classes.
GSObjCClass()
return the class of an instance. Returns a nul pointer
if the argument is nil
.
Returns the
superclass of this.
GSObjCIsInstance()
tests to see if an id is an instance. Returns
NO
if the argument is nil
.
GSObjCIsClass()
tests to see if an id is a class. Returns
NO
if the argument is nil
.
GSObjCIsKindOf()
tests to see if a class inherits from another class The
argument to this function must NOT be
nil
.
Given a class name, return
the corresponding class or a nul pointer if the class
cannot be found.
If the argument is
nil
, return a nul pointer.
Return
the name of the supplied class, or a nul pointer if no
class was supplied.
Return the name of the
object's class, or a nul pointer if no object was
supplied.
Return the name of the supplied
selector, or a nul pointer if no selector was
supplied.
Return a selector matching the
specified name, or nil
if no name is
supplied. The returned selector could be any one
with the name.
If no selector exists, returns
nil
.
Return the selector for the
specified name and types. Returns a nul pointer if
the name is nul. Uses any available selector if the types
argument is nul.
Creates a new selector if
necessary.
Return the type information from
the specified selector. May return a nul pointer if the
selector was a nul pointer or if it was not typed.
Compare only the type information ignoring
qualifiers, the frame layout and register
markers. Unlike sel_types_match, this function also
handles comparisons of types with and without any
layout information.
Returns a protocol object
with the corresponding name. This function searches the
registered classes for any protocol with the
supplied name. If one is found, it is cached in for
future requests. If efficiency is a factor then use
GSRegisterProtocol()
to insert a protocol explicitly into the cache used by
this function. If no protocol is found this function
returns nil
.
Registers proto in
the cache used by
GSProtocolFromName()
.
Returns the pointer to the method structure for
the selector in the specified class. Depending on
searchInstanceMethods, this function
searches either instance or class methods. Depending
on searchSuperClassesm this function searches either the
specified class only or also its superclasses.
To obtain the implementation pointer IMP use
returnValue->method_imp which should
be safe across all runtimes.
It should be safe to
use this function in
+load
implementations.
This function should
currently (June 2004) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Flushes the
cached method dispatch table for the class. Call this
function after any manipulations in the method
structures.
It should be safe to use this
function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns the
pointer to the instance variable structure for the
instance variable name in the specified class. This
function searches the specified class and its
superclasses.
It should be safe to use
this function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns the
pointer to the instance variable structure for the
instance variable name in the specified class. This
function searches the specified class and its
superclasses.
It is not necessarily safe
to use this function in
+load
implementations.
This function should
currently (June 2003) be considered WIP. Please
follow potential changes (Name, parameters,...)
closely until it stabilizes.
Returns a pointer to objc_malloc'ed memory large enough to hold a struct objc_method_list with 'count' number of struct objc_method entries. The memory returned is initialized with 0, including the method count and next method list fields.
This function is intended for use in conjunction with GSAppendMethodToList() to fill the memory and GSAddMethodList() to activate the method list.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Inserts the method described by sel, types and imp into the slot of the list's method_count incremented by 1. This function does not and cannot check whether the list provided has the necessary capacity.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
This function is intended for use in conjunction with GSAllocMethodList() to allocate the list and GSAddMethodList() to activate the method list.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Removes the method identified by sel from the method list moving the following methods up in the list, leaving the last entry blank. After this call, all references of previous GSMethodFromList() calls with this list should be considered invalid. If the values they referenced are needed, they must be copied to external buffers before this function is called.
Returns YES
if the a matching method
was found a removed, NO
otherwise.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
WARNING: Manipulating the runtime structures can be hazardous!
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns a method list of the class that contains
the selector. Depending on searchInstanceMethods either
instance or class methods are searched. Returns
NULL if none are found. This function does not search
the superclasses method lists. Call this method with
the address of a void *
pointing to NULL
to obtain the first (active) method list containing the
selector. Subsequent calls will return further
method lists which contain the selector. If none are
found, it returns NULL. You may instead pass NULL as
the iterator in which case the first method list
containing the selector will be returned. Do not
call it with an uninitialized iterator. If either
class or selector are NULL the function returns NULL.
If subsequent calls to this function with the same
non-NULL iterator yet different
searchInstanceMethods value are
called, the behavior is undefined.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns the (first) GSMethod contained in the supplied list that corresponds to sel. Returns NULL if none is found.
The GNU runtime makes a difference between method lists
that are "free standing" and those that "attached" to
classes. For "free standing" method lists (e.g.
created with
GSAllocMethodList()
that have not been added to a class or those which
have been removed via GSRemoveMethodList()) isFree
must be passed YES
. When manipulating
"attached" method lists, specify NO
.
Add the method list to the class as the first list to be searched during method invocation for the given class. Depending on toInstanceMethods, this list will be added as an instance or a class method list. If the list is in use by another class, behavior is undefined. Create a new list with GSAllocMethodList() or use GSRemoveMethodList() to remove a list before inserting it in a class.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Removes the method list from the classes instance or class method lists depending on fromInstanceMethods. If the list is not part of the class, behavior is undefined.
After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.
This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.
Returns the version number of this.
Return the
zone in which an object belongs, without using the zone
method
Quickly return autoreleased data storage
area.
Allocate a new objc_mutex_t and store it
in the location pointed to by request. A mutex is only
created if the value pointed to by request is NULL.
This function is thread safe in the sense that multiple
threads my call this function with the same value of
request and only one will actually set the mutex. It
is the users responsibility that no one else attempts to
set the mutex pointed to. This function should be used
with objc_mutex_t variables which were statically
initialized to NULL like:
void function (void) { static objc_mutex_t my_lock = NULL; if (my_lock == NULL) GSAllocateMutexAt(&my_lock); objc_mutex_lock(my_lock); do_work (); objc_mutex_unlock(my_lock); }
Prints a message to fptr using the format string provided and any additional arguments. The format string is interpreted as by the NSString formatted initialisers, and understands the '%@' syntax for printing an object.
The data is written to the file pointer in the default CString encoding if possible, as a UTF8 string otherwise.
This function is recommended for printing general log messages. For debug messages use NSDebugLog() and friends. For error logging use NSLog() , and for warnings you might consider NSWarnLog() .
## deprecated ##
## deprecated ##
##
deprecated ##
The number of objects to try
to get from varargs into an array on the stack... if there
are more than this, use the heap. NB. This MUST be a
multiple of 2
This is a macro designed to minimise the use of memory
allocation and deallocation when you need to
work with a vararg list of objects.
The objects
are unpacked from the vararg list into two 'C' arrays
and then a code fragment you specify is able
to make use of them before that 'C' array is destroyed.
The firstObject argument is the name of the formal parameter in your method or function which precedes the ',...' denoting variable args.
The code argument is a piece of objective-c
code to be executed to make use of the
objects stored in the 'C' arrays.
When this
code is called the unsigned integer
'__count' will contain the number of objects
unpacked, the pointer '__objects' will point to
the first object in each pair, and the pointer
'__pairs' will point to an array containing the
second halves of the pairs of objects whose first
halves are in '__objects'.
This lets you pack
a list of the form 'key, value, key, value,...' into an
array of keys and an array of values.