Up
Authors
- Richard Frith-Macdonald
-
Copyright: (C) 2005 Free Software Foundation, Inc.
ASSIGN(object, value)
Availability: OpenStep
ASSIGN(object,value) assigns the
value to the object with
appropriate retain and release operations.
Use this to avoid retain/release errors.
ASSIGNCOPY(object, value)
Availability: OpenStep
ASSIGNCOPY(object,value) assigns a
copy of the value to the object
with release of the original.
Use this to avoid
retain/release errors.
ASSIGNMUTABLECOPY(object, value)
Availability: OpenStep
ASSIGNMUTABLECOPY(object,value)
assigns a mutable copy of the value to the
object with release of the original.
Use this to avoid retain/release errors.
AUTORELEASE(object)
Availability: OpenStep
Basic autorelease operation... calls
[NSObject -autorelease]
Does nothing when ARC is in use.
CHECK_INDEX_RANGE_ERROR(INDEX, OVER)
Availability: OpenStep
Checks whether INDEX is strictly less than
OVER (within C array space).
INDEX and OVER must be
unsigned integers (NSUInteger).
CREATE_AUTORELEASE_POOL(X)
Availability: OpenStep
DEPRECATED... use ENTER_POOL and LEAVE_POOL and
make sure your code does not break/continue/return out
of the section of code.
DEALLOC
Availability: OpenStep
DEALLOC calls the superclass implementation of
dealloc, unless ARC is in use (in which case it does
nothing).
DESTROY(object)
Availability: OpenStep
DESTROY()
is a release operation which also sets the variable to be
a
nil
pointer for tidiness - we can't
accidentally use a DESTROYED
object
later. It also makes sure to set the variable to
nil
before releasing the
object - to avoid side-effects of the
release trying to reference the
object
being released through the variable.
ENTER_POOL
Availability: OpenStep
ENTER_POOL creates an autorelease pool and places
subsequent code in a block.
The block must
be terminated with a corresponding LEAVE_POOL.
You
should not break, continue, or return from such a
block of code (to do so could leak an autorelease pool
and give objects a longer lifetime than they ought to
have. If you wish to leave the block of code early, you
should ensure that doing so causes the autorelease
pool outside the block to be released promptly (since
that will implicitly release the pool created at the
start of the block too).
GSLocalizedStaticString(key, comment)
Availability: OpenStep
This function (macro) is a GNUstep extensions, and it
is used to localize static strings. Here is an example
of a static string:
NSString *message = @"Hi there";... some code...
NSLog (message);
This string can not be localized using the standard
openstep functions/macros. By using this gnustep
extension, you can localize it as follows:
NSString *message = GSLocalizedStaticString
(@"Hi there", @"Greeting");... some code... NSLog
(NSLocalizedString (message, @""));
When the tools generate the
Localizable.strings
file from the
source code, they will ignore the
NSLocalizedString
call while they will
extract the string (and the comment) to
localize from the
GSLocalizedStaticString
call.
When the code is compiled, instead, the
GSLocalizedStaticString
call is ignored
(discarded, it is a macro which simply expands
to key
), while the
NSLocalizedString
will actually look up
the string for translation in the
Localizable.strings
file.
Please note that there is currently no
macro/function to localize static strings
using different tables. If you need that
functionality, you have either to prepare
the localization tables by hand, or to rewrite your
code in such a way as not to use static strings.
GS_RANGE_CHECK(RANGE, SIZE)
Availability: OpenStep
To be used inside a method for making sure that a range
does not specify anything outside the size of an
array/string. Raises exception if range extends
beyond [0,size]. Size must be an
unsigned integer (NSUInteger).
IF_NO_ARC(X)
Availability: OpenStep
Compile-in X if (and only if) ARC is
not in use. This is provided to handle obscure cases not
covered by the other macros.
IF_NO_GC(X)
Availability: OpenStep
LEAVE_POOL
Availability: OpenStep
LEAVE_POOL terminates a block of code started with
ENTER_POOL.
RECREATE_AUTORELEASE_POOL(X)
Availability: OpenStep
DEPRECATED... use ENTER_POOL and LEAVE_POOL and
make sure your code does not break/continue/return out
of the section of code.
RELEASE(object)
Availability: OpenStep
Basic release operation... calls
[NSObject -release]
Does nothing when ARC is in use.
RETAIN(object)
Availability: OpenStep
Basic retain operation... calls
[NSObject -retain]
Does nothing when ARC is in use.
TEST_AUTORELEASE(object)
Availability: OpenStep
Tested autorelease - only invoke the objective-c
method if the receiver is not nil
.
Does nothing when ARC is in use.
TEST_RELEASE(object)
Availability: OpenStep
Tested release - only invoke the objective-c method if
the receiver is not nil
.
Does nothing
when ARC is in use.
TEST_RETAIN(object)
Availability: OpenStep
Tested retain - only invoke the objective-c method if
the receiver is not nil
.
Does nothing
when ARC is in use.
_(X)
Availability: OpenStep
This function (macro) is a GNUstep extension.
_(@"My string to translate")
is basically equivalent to
NSLocalizedString(@"My string to
translate", @"")
It is useful when you need to translate an application
very quickly, as you just need to enclose all strings
inside
_()
.
But please note that when you use this macro, you are
not taking advantage of comments for the translator, so
consider using NSLocalizedString
instead when you need a comment.
You may define GS_LOCALISATION_BUNDLE_ID to the bundle
identifier of the bundle which is to provide the
localisation information.
This can be
used when compiling a single file by specifying
something like '-D
GS_LOCALISATION_BUNDLE_ID=$(FRAMEWORK_NAME)'
in your make file.
If this is not defined, the
localisation is provided by your application's
main bundle exactly like the NSLocalizedString
function.
Alternatively you may define
GS_LOCALISATION_BUNDLE to be the
bundle to be used to prvide the localisation
information.
__(X)
Availability: OpenStep
This function (macro) is a GNUstep extension.
__(@"My string to translate")
is exactly the same as
GSLocalizedStaticString(@"My
string to translate", @"")
It is useful when you need to translate an application
very quickly. You would use it as follows for static
strings:
NSString *message = __(@"Hello there");... more
code... NSLog (_(messages));
But please note that when you use this macro, you are
not taking advantage of comments for the translator, so
consider using
GSLocalizedStaticString
instead when
you need a comment.
CALL_NON_NULL_BLOCK(block, args,...)
Availability: OpenStep
Calls a block. Works irrespective of whether
the compiler supports blocks.
CALL_NON_NULL_BLOCK_NO_ARGS(block)
Availability: OpenStep
Calls a block without arguments.
GS_API_LATEST
Availability: OpenStep
A constant to represent a feature which is still present in
the latest version. This is the highest possible version
number.
eg.
#if
OS_API_VERSION
(GS_API_MACOSX, GS_API_LATEST)
denotes
code present from the initial MacOS-X version onwards.
GS_API_MACOSX
Availability: OpenStep
The version number of the first MacOS-X implementation.
eg.
#if
OS_API_VERSION
(GS_API_MACOSX, GS_API_LATEST)
denotes
code present from the initial MacOS-X version onwards.
GS_API_NONE
Availability: OpenStep
A constant which is the lowest possible version number (0)
so that when used as the removal version (second argument
of the GS_API_VERSION or OS_API_VERSION macro) represents
a feature which is not present in any version.
eg.
#if
OS_API_VERSION
(GS_API_NONE, GS_API_NONE)
denotes code
not present in OpenStep/OPENSTEP/MacOS-X
GS_API_OPENSTEP
Availability: OpenStep
The version number of the first OPENSTEP implementation.
eg.
#if
OS_API_VERSION
(GS_API_OPENSTEP, GS_API_LATEST)
denotes code present from the initial OPENSTEP
version onwards.
GS_API_OSSPEC
Availability: OpenStep
The version number of the initial OpenStep specification.
eg.
#if
OS_API_VERSION
(GS_API_OSSPEC, GS_API_LATEST)
denotes
code present from the OpenStep specification onwards.
GS_API_VERSION(ADD, REM)
Availability: OpenStep
Macro to check a defined GNUstep version number
(GS_GNUSTEP_V) against the supplied
arguments. Returns true if no GNUstep version is
specified, or if ADD <= version
< REM, where ADD is the
version number at which a feature guarded by the
macro was introduced and REM is the
version number at which it was removed.
The version number arguments are six digit integers
where the first two digits are the major version
number, the second two are the minor version number
and the last two are the subminor number (all left
padded with a zero where necessary). However, for
convenience you can also use the predefined
constants...
GS_API_NONE
,
GS_API_LATEST
,
Also see
OS_API_VERSION
NB. If you are changing the API (eg adding a new
feature) you need to control the visibility io the
new header file code using
#if GS_API_VERSION(ADD,GS_API_LATEST)
where ADD
is the
version number of the next minor release after the
most recent one.
As a general principle you
should not change the API with changing
subminor version numbers... as that tends to
confuse people (though Apple has sometimes done
it).
OS_API_VERSION(ADD, REM)
Availability: OpenStep
Macro to check a defined OpenStep/OPENSTEP/MacOS-X
version against the supplied arguments. Returns
true if no version is specified, or if ADD
<= version < REM, where
ADD is the version number at which a
feature guarded by the macro was introduced and
REM is the version number at which it was
removed.
The version number arguments are six digit integers
where the first two digits are the major version
number, the second two are the minor version number
and the last two are the subminor number (all left
padded with a zero where necessary). However, for
convenience you can also use any of several
predefined constants...
GS_API_NONE
,
GS_API_LATEST
,
GS_API_OSSPEC
,
GS_API_OPENSTEP
,
GS_API_MACOSX
Also see
GS_API_VERSION
For OSX compatibility, this macro also supports the use
of Apple's symbolic constants for version numbering.
Their contants are currently four digit values (two
digits for the major version, one for the minor, and
one for the subminor).
The Apple compatibility version macros are currently:
MAC_OS_X_VERSION_10_0
,
MAC_OS_X_VERSION_10_1
,
MAC_OS_X_VERSION_10_2
,
MAC_OS_X_VERSION_10_3
,
MAC_OS_X_VERSION_10_4
,
MAC_OS_X_VERSION_10_5
,
MAC_OS_X_VERSION_10_6
,
MAC_OS_X_VERSION_10_7
,
MAC_OS_X_VERSION_10_8
MAC_OS_X_VERSION_10_9
GS_MAX_OBJECTS_FROM_STACK
Availability: OpenStep
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
GS_USEIDLIST(firstObject, code,...)
Availability: OpenStep
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
.
GS_USEIDPAIRLIST(firstObject, code,...)
Availability: OpenStep
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.
GS_PART_MAP_ENUMERATOR(state)
Availability: Not in OpenStep/MacOS-X
Used to implement fast enumeration methods in classes
that use GSIMap for their data storage.
GSOnceFLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
Macro to log a message only the first time it is
encountered.
Not entirely thread safe...
but that's not really important, it just means that it's
possible for the message to be logged more than once
if two threads call it simultaneously when it has not
already been called.
Use this from inside a
function. Pass an NSString as a format,
followed by zero or more arguments for the
format string. Example: GSOnceFLog(@"This
function is deprecated, use another");
GSOnceMLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
Macro to log a message only the first time it is
encountered.
Not entirely thread safe...
but that's not really important, it just means that it's
possible for the message to be logged more than once
if two threads call it simultaneously when it has not
already been called.
Use this from inside a
method. Pass an NSString as a format
followed by zero or more arguments for the
format string.
Example:
GSOnceMLog(@"This method is deprecated, use
another");
NSDebugFLLog(key, format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is like
NSDebugLLog()
but includes the name and location of the function in
which the macro is used as part of the log output.
NSDebugFLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is a shorthand for
NSDebugFLLog()
using the default debug key... 'dflt'
NSDebugFRLog(object, msg)
Availability: Not in OpenStep/MacOS-X
This macro saves the name and location of the function
in which the macro is used, along with a
short string msg as the
tag associated with a recorded object.
NSDebugLLog(key, format, args,...)
Availability: Not in OpenStep/MacOS-X
NSDebugLLog()
is the basic debug logging macro used to display log
messages using
NSLog()
, if debug logging was enabled at compile time and the
appropriate logging key was set at
runtime.
Debug logging which can be enabled/disabled by
defining GSDIAGNOSE when compiling and also
setting values in the mutable set which is set up
by NSProcessInfo. GSDIAGNOSE is defined automatically
unless diagnose=no is specified in the make
arguments.
NSProcess initialises a set of strings that are
the names of active debug keys using the
'--GNU-Debug=...' command line argument.
Each command-line argument of that form is removed
from NSProcessInfo
's list of arguments
and the variable part (...) is added to the set. This
means that as far as the program proper is concerned,
it is running with the same arguments as if debugging
had not been enabled.
For instance, to debug the NSBundle class, run your
program with '--GNU-Debug=NSBundle' You can of
course supply multiple '--GNU-Debug=...' arguments
to output debug information on more than one thing.
NSUserDefaults also adds debug keys from the
array given by the GNU-Debug default... but these
values will not take effect until the
+standardUserDefaults
method is called... so they are useless for
debugging NSUserDefaults itself or for debugging
any code executed before the defaults system is used.
To embed debug logging in your code you use the
NSDebugLLog()
or
NSDebugLog()
macro.
NSDebugLog()
is just
NSDebugLLog()
with the debug key set to 'dflt'. So, to
activate debug statements that use
NSDebugLog()
, you supply the '--GNU-Debug=dflt' argument to your
program.
You can also change the active debug keys under your
programs control - NSProcessInfo has a
[-debugSet]
method that returns the mutable set that contains
the active debug keys - your program can modify this
set.
Two debug keys have a special effect - 'dflt' is the
key used for debug logs statements where
no debug key is specified, and 'NoWarn' is
used to *disable* warning messages.
As a convenience, there are four more logging macros you
can use -
NSDebugFLog()
,
NSDebugFLLog()
,
NSDebugMLog()
and
NSDebugMLLog()
. These are the same as the other macros, but are
specifically for use in either functions or
methods and prepend information about the file,
line and either function or class/method in which the
message was generated.
NSDebugLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is a shorthand for
NSDebugLLog()
using the default debug key... 'dflt'
NSDebugMLLog(key, format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is like
NSDebugLLog()
but includes the name and location of the
method
in which the macro is used as part of the log output.
NSDebugMLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is a shorthand for
NSDebugMLLog()
using then default debug key... 'dflt'
NSDebugMRLog(object, msg)
Availability: Not in OpenStep/MacOS-X
This macro saves the name and location of the method in
which the macro is used, along with a
short string msg as the
tag associated with a recorded object.
NSWarnFLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is like
NSWarnLog()
but includes the name and location of the
function in which the macro is used as part of
the log output.
NSWarnLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
NSWarnLog()
is the basic debug logging macro used to display warning
messages using
NSLog()
, if warn logging was not disabled at compile time and
the disabling logging level was not set at runtime.
Warning messages which can be enabled/disabled by
defining GSWARN when compiling.
You can also disable these messages at runtime by
supplying a '--GNU-Debug=NoWarn' argument to the
program, or by adding 'NoWarn' to the user default
array named 'GNU-Debug'.
These logging macros are intended to be used when the
software detects something that it not necessarily
fatal or illegal, but looks like it might be a
programming error. eg. attempting to remove
'nil' from an NSArray, which the Spec/documentation
does not prohibit, but which a well written program
should not be attempting (since an NSArray object
cannot contain a 'nil').
NB. The 'warn=yes' option is understood by the GNUstep
make package to mean that GSWARN should be defined,
and the 'warn=no' means that GSWARN should be
undefined. Default is to define it.
To embed debug logging in your code you use the
NSWarnLog()
macro.
As a convenience, there are two more logging macros you
can use -
NSWarnFLog()
, and
NSWarnMLog()
. These are specifically for use in either functions or
methods and prepend information about the file,
line and either function or class/method in which the
message was generated.
NSWarnMLog(format, args,...)
Availability: Not in OpenStep/MacOS-X
This macro is like
NSWarnLog()
but includes the name and location of the
method
in which the macro is used as part of the log output.
GS_INITIALIZED_LOCK(IDENT, CLASSNAME)
Availability: Not in OpenStep/MacOS-X
Returns
IDENT which will be initialized to
an instance of a
CLASSNAME in a thread safe
manner. If
IDENT has been previously
initialized this macro merely returns
IDENT.
IDENT is considered
uninitialized, if it contains
nil
.
CLASSNAME must be either NSLock,
NSRecursiveLock or one of their subclasses.
See
[NSLock +newLockAt:]
for details. This macro is intended for code that cannot
insure that a lock can be initialized in thread safe
manner otherwise.
NSLock *my_lock = nil;
void function (void)
{
[GS_INITIALIZED_LOCK(my_lock, NSLock) lock];
do_work ();
[my_lock unlock];
}
void* _Block_copy(const void* );
Availability: OpenStep
Description forthcoming.
void _Block_release(const void* );
Availability: OpenStep
Description forthcoming.
void gs_consumed(id o);
Availability: OpenStep
Description forthcoming.
void* GSAutoreleasedBuffer(unsigned int size);
Availability: OpenStep
Quickly return autoreleased data storage area.
GSIVar GSCGetInstanceVariableDefinition(Class cls, const char* name);
Availability: OpenStep
Deprecated.. use
class_getInstanceVariable()
Class GSClassFromName(const char* name);
Availability: OpenStep
unsigned int GSClassList(Class* buffer, unsigned int max, BOOL clearCache);
Availability: OpenStep
Deprecated... use
objc_getClassList()
const char* GSClassNameFromObject(id obj);
Availability: OpenStep
void GSClassSwizzle(id instance, Class newClass);
Availability: OpenStep
Function to change the class of the specified
instance to newClass. This
handles memory debugging issues in GNUstep-base and
also deals with class finalisation issues in a garbage
collecting environment, so you should use this
function rather than attempting to swizzle class
pointers directly.
void GSFlushMethodCacheForClass(Class cls);
Availability: OpenStep
Deprecated.. does nothing.
GSMethod GSGetMethod(Class cls, SEL sel, BOOL searchInstanceMethods, BOOL searchSuperClasses);
Availability: OpenStep
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.
const char* GSLastErrorStr(long int error_id);
Availability: BaseAdditions
Likely to be changed/moved/removed at 1.15.0
Description forthcoming.
const char* GSNameFromClass(Class cls);
Availability: OpenStep
const char* GSNameFromSelector(SEL sel);
Availability: OpenStep
void GSObjCAddClassBehavior(Class receiver, Class behavior);
Availability: OpenStep
A Behavior can be seen as a "Protocol with an
implementation" or a "Class without any
instance variables". A key feature of behaviors is
that they give a degree of multiple inheritance.
Behavior methods, when added to a class, override
the class's superclass methods, but not the class's
methods.
Whan a behavior class is added to a
receiver class, not only are the methods
defined in the behavior class added, but
the methods from the behavior's class hierarchy are
also added (unless already present).
It's not the case that a class adding behaviors from
another class must have "no instance vars". The
receiver class just has to have the same
layout as the behavior class (optionally
with some additional ivars after those of the
behavior class).
This function provides Behaviors without adding any
new syntax to the Objective C language. Simply define a
class with the methods you want to add, then call
this function with that class as the
behavior argument.
This function should be called in the
+initialize
method of the receiver.
If you add several behaviors to a class, be aware that
the order of the additions is significant.
void GSObjCAddClassOverride(Class receiver, Class override);
Availability: OpenStep
An Override can be seen as a "category implemented as a
separate class and manually added to the
receiver class under program control,
rather than automatically added by the
compiler/runtime.
Override methods, when added to a
receiver class, replace the class's
class's methods of the same name (or are added if
the class did not define methods with that name).
It's not the case that a class adding overrides from
another class must have "no instance vars". The
receiver class just has to have the same
layout as the override class (optionally
with some additional ivars after those of the
override class).
This function provides overrides without adding any
new syntax to the Objective C language. Simply define a
class with the methods you want to add, then call
this function with that class as the
override argument.
This function should usually be called in the
+initialize
method of the receiver.
If you add several overrides to a class, be aware that
the order of the additions is significant.
void GSObjCAddClasses(NSArray* classes);
Availability: OpenStep
The
classes argument is an array of NSValue
objects containing pointers to
classes
previously created by the
GSObjCMakeClass()
function.
void GSObjCAddMethods(Class cls, Method* list, BOOL replace);
Availability: OpenStep
Given a NULL terminated list of methods, add
them to the class.
If the method already exists
in a superclass, the new version overrides that one, but
if the method already exists in the class itsself, the new
one is quietly ignored (replace==NO) or replaced with the
new version (if replace==YES).
To add class
methods, cls should be the metaclass of
the class to which the methods are being added.
NSArray* GSObjCAllSubclassesOfClass(Class cls);
Availability: OpenStep
Returns an autoreleased array of subclasses of
Class cls, including
subclasses of subclasses.
BOOL GSObjCBehaviorDebug(int setget);
Availability: OpenStep
Turn on (YES
), off (NO
) or
test (-1) behavior debugging.
Class GSObjCClass(id obj);
Availability: OpenStep
NSArray* GSObjCDirectSubclassesOfClass(Class cls);
Availability: OpenStep
Returns an autoreleased array containing subclasses
directly descendent of Class
cls.
BOOL GSObjCFindVariable(id obj, const char* name, const char** type, unsigned int* size, int* offset);
Availability: OpenStep
This function is used to locate information about the
instance variable of obj called
name. It returns YES
if the
variable was found, NO
otherwise. If it
returns YES
, then the values pointed to
by type, size, and offset
will be set (except where they are null pointers).
GSIVar GSObjCGetInstanceVariableDefinition(Class cls, NSString* name);
Availability: OpenStep
Deprecated.. use
class_getInstanceVariable()
id GSObjCGetVal(NSObject* self, const char* key, SEL sel, const char* type, unsigned int size, int offset);
Availability: OpenStep
This is used internally by the key-value coding methods,
to get a value from an object either via an accessor
method (if sel is supplied), or via direct
access (if type, size, and
offset are supplied).
Automatic
conversion between NSNumber and C scalar types is
performed.
If type is null and
can't be determined from the selector, the
[NSObject -handleQueryWithUnboundKey:]
method is called to try to get a value.
void GSObjCGetVariable(id obj, int offset, unsigned int size, void* data);
Availability: OpenStep
Gets the value from an instance variable in
obj This function performs no
checking... you should use it only where you are
providing information from a call to
GSObjCFindVariable()
and you know that the
data area provided is
the correct
size.
BOOL GSObjCIsClass(Class cls);
Availability: OpenStep
GSObjCIsClass()
is deprecated... use
object_getClass()
in conjunction with
class_isMetaClass()
BOOL GSObjCIsInstance(id obj);
Availability: OpenStep
GSObjCIsInstance()
is deprecated... use
object_getClass()
in conjunction with
class_isMetaClass()
BOOL GSObjCIsKindOf(Class cls, Class other);
Availability: OpenStep
Test to see if class inherits from another class The
argument to this function must NOT be
nil
.
NSValue* GSObjCMakeClass(NSString* name, NSString* superName, NSDictionary* iVars);
Availability: OpenStep
references:
http://www.macdevcenter.com/pub/a/mac/2002/05/31/runtime_parttwo.html?page=1 http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/9objc_runtime_reference/chapter_5_section_1.html http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/9objc_runtime_reference/chapter_5_section_21.html ObjcRuntimeUtilities.m by Nicola Pero
Create a Class structure for use by
the ObjectiveC runtime and return an NSValue object
pointing to it. The class will not be added to the
runtime (you must do that later using the
GSObjCAddClasses()
function).
The iVars dictionary lists the instance
variable names and their types.
NSArray* GSObjCMethodNames(id obj, BOOL recurse);
Availability: OpenStep
This method returns an array listing the names of all
the instance methods available to obj, whether
they belong to the class of obj or one of its
superclasses.
If obj is a
class, this returns the class methods.
Returns
nil
if obj is nil
.
void GSObjCSetVal(NSObject* self, const char* key, id val, SEL sel, const char* type, unsigned int size, int offset);
Availability: OpenStep
This is used internally by the key-value coding methods,
to set a value in an object either via an accessor method
(if sel is supplied), or via direct access (if
type, size, and offset
are supplied).
Automatic conversion between
NSNumber and C scalar types is performed.
If
type is null and can't be determined from
the selector, the
[NSObject -handleTakeValue:forUnboundKey:]
method is called to try to set a value.
void GSObjCSetVariable(id obj, int offset, unsigned int size, const void* data);
Availability: OpenStep
Sets the value in an instance variable in
obj
This function performs no checking... you
should use it only where you are providing information
from a call to
GSObjCFindVariable()
and you know that the
data area provided is
the correct
size.
Class GSObjCSuper(Class cls);
Availability: OpenStep
NSArray* GSObjCVariableNames(id obj, BOOL recurse);
Availability: OpenStep
This method returns an array listing the names of all
the instance variables present in the instance
obj, whether they belong to the class of
obj or one of its superclasses.
Returns nil
if obj is
nil
.
int GSObjCVersion(Class cls);
Availability: OpenStep
BOOL GSPrintf(FILE* fptr, NSString* format,...);
Availability: OpenStep
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()
.
Protocol* GSProtocolFromName(const char* name);
Availability: OpenStep
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
.
struct objc_method_description GSProtocolGetMethodDescriptionRecursive(Protocol* aProtocol, SEL aSel, BOOL isRequired, BOOL isInstance);
Availability: OpenStep
A variant of protocol_getMethodDescription which
recursively searches parent protocols if the
requested selector isn't found in the given
protocol. Returns a {NULL, NULL} structure if the
requested selector couldn't be found.
void GSRegisterProtocol(Protocol* proto);
Availability: OpenStep
SEL GSSelectorFromName(const char* name);
Availability: OpenStep
SEL GSSelectorFromNameAndTypes(const char* name, const char* types);
Availability: OpenStep
Return the selector for the specified name
and types.
Returns a nul pointer if the
name is nul.
Creates a new selector
if necessary.
Code must NOT rely on this providing
a selector with type information.
BOOL GSSelectorTypesMatch(const char* types1, const char* types2);
Availability: OpenStep
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.
const char* GSSkipTypeQualifierAndLayoutInfo(const char* types);
Availability: OpenStep
Takes full type information and skips forward to the
actual type as specified in the _C_... constants.
const char* GSTypesFromSelector(SEL sel);
Availability: OpenStep
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
(or if the runtime does not support typed selectors).
Code must NOT rely on this providing any type
information.
void GSIArrayAddItem(GSIArray array, GSIArrayItem item);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayAddItemNoRetain(GSIArray array, GSIArrayItem item);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
unsigned int GSIArrayCapacity(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayCheckSort(GSIArray array, NSComparisonResult(*) sorter);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayClear(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIArray GSIArrayCopyWithZone(GSIArray array, NSZone* zone);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
unsigned int GSIArrayCount(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayEmpty(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayGrow(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayGrowTo(GSIArray array, unsigned int next);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIArray GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone* zone, size_t capacity);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIArray GSIArrayInitWithZoneAndStaticCapacity(GSIArray array, NSZone* zone, size_t capacity, GSIArrayItem* buffer);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayInsertItemNoRetain(GSIArray array, GSIArrayItem item, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayInsertSorted(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayInsertSortedNoRetain(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
unsigned int GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIArrayItem GSIArrayItemAtIndex(GSIArray array, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIArrayItem* GSIArrayItems(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIArrayItem GSIArrayLastItem(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayRemoveAllItems(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayRemoveItemAtIndex(GSIArray array, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayRemoveItemAtIndexNoRelease(GSIArray array, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayRemoveItemsFromIndex(GSIArray array, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArrayRemoveLastItem(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
unsigned int GSIArraySearch(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIArraySetItemAtIndex(GSIArray array, GSIArrayItem item, unsigned int index);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
NSUInteger GSIArraySize(GSIArray array);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapAddKey(GSIMapTable map, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapAddKeyNoRetain(GSIMapTable map, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapAddNodeToBucket(GSIMapBucket bucket, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapAddNodeToMap(GSIMapTable map, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapAddPair(GSIMapTable map, GSIMapKey key, GSIMapVal value);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapAddPairNoRetain(GSIMapTable map, GSIMapKey key, GSIMapVal value);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapBucket GSIMapBucketForKey(GSIMapTable map, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapCleanMap(GSIMapTable map);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
NSUInteger GSIMapCountByEnumeratingWithStateObjectsCount(GSIMapTable map, NSFastEnumerationState* state, id* stackbuf, NSUInteger len);
Availability: Not in OpenStep/MacOS-X
Used to implement fast enumeration methods in classes
that use GSIMap for their data storage.
void GSIMapEmptyMap(GSIMapTable map);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapEndEnumerator(GSIMapEnumerator enumerator);
Availability: Not in OpenStep/MacOS-X
Tidies up after map enumeration... effectively
destroys the enumerator.
GSIMapBucket GSIMapEnumeratorBucket(GSIMapEnumerator enumerator);
Availability: Not in OpenStep/MacOS-X
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.
GSIMapEnumerator_t GSIMapEnumeratorForMap(GSIMapTable map);
Availability: Not in OpenStep/MacOS-X
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.
GSIMapNode GSIMapEnumeratorNextNode(GSIMapEnumerator enumerator);
Availability: Not in OpenStep/MacOS-X
Returns the next node in the map, or a nul pointer if
at the end.
GSIMapNode GSIMapFirstNode(GSIMapTable map);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapFreeNode(GSIMapTable map, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapInitWithZoneAndCapacity(GSIMapTable map, NSZone* zone, uintptr_t capacity);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapLinkNodeIntoBucket(GSIMapBucket bucket, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapMoreNodes(GSIMapTable map, unsigned int required);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapNodeForKey(GSIMapTable map, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapNodeForKeyInBucket(GSIMapTable map, GSIMapBucket bucket, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapNodeForSimpleKey(GSIMapTable map, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapBucket GSIMapPickBucket(unsigned int hash, GSIMapBucket buckets, uintptr_t bucketCount);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapRemangleBuckets(GSIMapTable map, GSIMapBucket old_buckets, uintptr_t old_bucketCount, GSIMapBucket new_buckets, uintptr_t new_bucketCount);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
GSIMapNode GSIMapRemoveAndFreeNode(GSIMapTable map, uintptr_t bkt, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
BOOL GSIMapRemoveKey(GSIMapTable map, GSIMapKey key);
Availability: Not in OpenStep/MacOS-X
Removes the item for the specified key
from the map. If the key was
present, returns YES
, otherwise returns
NO
.
void GSIMapRemoveNodeFromBucket(GSIMapBucket bucket, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapRemoveNodeFromMap(GSIMapTable map, GSIMapBucket bkt, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapRemoveWeak(GSIMapTable map);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapResize(GSIMapTable map, uintptr_t new_capacity);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapRightSizeMap(GSIMapTable map, uintptr_t capacity);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
NSUInteger GSIMapSize(GSIMapTable map);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
void GSIMapUnlinkNodeFromBucket(GSIMapBucket bucket, GSIMapNode node);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
NSString* GSDefaultLanguageLocale();
Availability: OpenStep
Returns the locale string for LC_MESSAGES
NSDictionary* GSDomainFromDefaultLocale();
Availability: OpenStep
Set the current locale to the system default, and backup
what it was previously (should have been @"C").
Restore the current locale to what we backed up
(again, should be restored to @"C")
NSString* GSLanguageFromLocale(NSString* locale);
Availability: OpenStep
Returns a language name string for a given
locale. e.g. GSLanguageFromLocale(@"en_CA")
returns @"CanadaEnglish"
NSArray* GSLanguagesFromLocale(NSString* locale);
Availability: OpenStep
Convenience function which calls GSLocaleVariants
to expand the given locale to a list of
variants, and then calls GSLanguageFromLocale on
each. e.g. GSLanguagesFromLocale(@"en_CA") returns
(@"CanadaEnglish", @"English")
NSArray* GSLocaleVariants(NSString* locale);
Availability: OpenStep
Return an array of variants of a locale,
formed by stripping off parts of the identifier,
ordered from most similar to least similar. e.g.
GSLocaleVariants(@"en_CA") returns
(@"en_CA", @"en").
NSString* GSSetLocale(int category, NSString* locale);
Availability: OpenStep
Description forthcoming.
const char* GSSetLocaleC(int category, const char* loc);
Availability: OpenStep
Description forthcoming.
NSString* GSFindNamedFile(NSArray* paths, NSString* aName, NSString* anExtension);
Availability: BaseAdditions
Likely to be changed/moved/removed at 1.15.0
Try to locate file/directory (aName).(
anExtension (aName).(anExtension)
in paths. Will return the first found or
nil
if nothing is found.
Deprecated... may be removed in later release.
NSString* GSDebugFunctionMsg(const char* func, const char* file, int line, NSString* fmt);
Availability: Not in OpenStep/MacOS-X
Used to produce a format string for logging a message
with function location details.
NSString* GSDebugMethodMsg(id obj, SEL sel, const char* file, int line, NSString* fmt);
Availability: Not in OpenStep/MacOS-X
Used to produce a format string for logging a message
with method location details.
BOOL GSDebugSet(NSString* level);
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
const char* GSPathHandling(const char* mode);
Availability: OpenStep
See "Portable path handling" in NSString.h.
NSThread* GSCurrentThread();
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
NSMutableDictionary* GSCurrentThreadDictionary();
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
NSStringEncoding GSEncodingForRegistry(NSString* registry, NSString* encoding);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
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
NSISOLatinCyrillicStringEncoding.
If there is no specific encoding, use @"0".
Returns GSUndefinedEncoding if there is no match.
NSStringEncoding GSEncodingFromLocale(const char* clocale);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
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.
BOOL GSFromUnicode(unsigned char** dst, unsigned int* size, const unichar* src, unsigned int slen, NSStringEncoding enc, NSZone* zone, unsigned int options);
Availability: Not in OpenStep/MacOS-X
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).
If the library is built for
garbage collecting, the zone argument is
used only as a marker to say whether the function may
allocate memory (zone is non-null) or
not (zone is null).
The options argument controls some special
behavior.
-
If GSUniStrict is set, the function will fail if a
character is encountered in the source which
can't be converted. Otherwise, some approximation
or marker will be placed in the destination.
-
If GSUniTerminate is set, the function is expected to
nul terminate the output data, and will assume that
it is safe to place the nul just beyond the end of the
stated buffer size. Also, if the
function grows the buffer, it will allow for an
extra termination byte.
-
If GSUniTemporary is set, the function will return the
results in an autoreleased buffer rather than in
a buffer that the caller must release.
-
If GSUniBOM is set, the function will read the first
unicode character as a byte order marker.
-
If GSUniShortOk is set, the function will return a
buffer containing any decoded characters even if
the whole conversion fails.
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.
BOOL GSToUnicode(unichar** dst, unsigned int* size, const unsigned char* src, unsigned int slen, NSStringEncoding enc, NSZone* zone, unsigned int options);
Availability: Not in OpenStep/MacOS-X
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).
If the library is built for
garbage collecting, the zone argument is
used only as a marker to say whether the function may
allocate memory (zone is non-null) or
not (zone is null).
The options argument controls some special
behavior.
-
If GSUniTerminate is set, the function is expected to
null terminate the output string, and will assume
that it is safe to place the nul just beyond the end
of the stated buffer size. Also, if the
function grows the buffer, it will allow for an
extra termination character.
-
If GSUniTemporary is set, the function will return the
results in an autoreleased buffer rather than in
a buffer that the caller must release.
-
If GSUniBOM is set, the function will write the first
unicode character as a byte order marker.
-
If GSUniShortOk is set, the function will return a
buffer containing any decoded characters even if
the whole conversion fails.
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.
unsigned int GSUnicode(const unichar* chars, unsigned int length, BOOL* isASCII, BOOL* isLatin1);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
Function to check a block of data for validity as a
unicode string and say whether it contains solely
ASCII or solely Latin1 data.
Any leading BOM
must already have been removed and the data must already
be in native byte order.
Returns the number of
characters which were found valid.
unsigned char uni_cop(unichar u);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
Description forthcoming.
unichar* uni_is_decomp(unichar u);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
Description forthcoming.
BOOL uni_isnonsp(unichar u);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
Description forthcoming.
unichar uni_tolower(unichar ch);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
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.
unichar uni_toupper(unichar ch);
Availability: Not in OpenStep/MacOS-X, BaseAdditions Likely to be changed/moved/removed at 1.15.0
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.
Up