![]() System : Linux absol.cf 5.4.0-198-generic #218-Ubuntu SMP Fri Sep 27 20:18:53 UTC 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /usr/share/doc/gnustep-base-doc/Base/Reference/ |
Upload File : |
<?xml version="1.0"?> <!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 1.0.3//EN" "http://www.gnustep.org/gsdoc-1_0_3.dtd"> <!-- Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. --> <gsdoc base="Functions" up="Base"> <head> <title>Functions</title> <author name="Richard Frith-Macdonald"></author> <copy>2005 Free Software Foundation, Inc.</copy> </head> <body> <front> <contents /> <chapter> <heading>Function index</heading> <index type="function" scope="file" /> </chapter> <chapter> <heading>Macro index</heading> <index type="macro" scope="file" /> </chapter> </front> <!--StartMacros--> <!--StartNSBundleMacros--> <chapter> <heading>NSBundle macros</heading> <p></p> <macro name="NSLocalizedString" ovadd="1.0.0"> <arg>key</arg> <arg>comment</arg> <desc> <p> This function (macro) is used to get the localized translation of the string <code><var>key</var></code>. <code><var>key</var></code> is looked up in the <code>Localizable.strings</code> file for the current language. The current language is determined by the available languages in which the application is translated, and by using the <code>NSLanguages</code> user defaults (which should contain an array of the languages preferred by the user, in order of preference). </p> <p> Technically, the function works by calling <code>localizedStringForKey:value:table:</code> on the main bundle, using <code>@""</code> as value, and <code>nil</code> as the table. The <code><var>comment</var></code> is ignored when the macro is expanded; but when we have tools which can generate the <code>Localizable.strings</code> files automatically from source code, the <code><var>comment</var></code> will be used by the tools and added as a <var>comment</var> before the string to translate. Upon finding something like </p> <p> <code> NSLocalizedString (@"My useful string", @"My useful <var>comment</var> about the string"); </code> </p> <p> in the source code, the tools will generate a <var>comment</var> and the line </p> <p> <code> " My useful string" = "My useful string"; </code> </p> <p> in the <code>Localizable.strings</code> file (the translator then can use this as a skeleton for the <code>Localizable.strings</code> for his/her own language, where she/he can replace the right hand side with the translation in her/his own language). The <var>comment</var> can help the translator to decide how to translate when it is not clear how to translate (because the original string is now out of context, and out of context might not be so clear what the string means). The <var>comment</var> is totally ignored by the library code. </p> <p> If you don't have a <var>comment</var> (because the string is so self-explanatory that it doesn't need it), you can leave it blank, by using <code>@""</code> as a <var>comment</var>. If the string might be unclear out of context, it is recommended that you add a <var>comment</var> (even if it is unused for now). </p> </desc> </macro> <macro name="NSLocalizedStringFromTable" ovadd="1.0.0"> <arg>key</arg> <arg>tbl</arg> <arg>comment</arg> <desc> This function (macro) does the same as <code>NSLocalizedString</code>, but uses the table <code>table</code> rather than the default table. This means that the string to translate will be looked up in a different file than <code>Localizable.strings</code>. For example, if you pass <code>DatabaseErrors</code> as the <code>table</code>, the string will be looked up for translation in the file <code>DatabaseErrors.strings</code>. This allows you to have the same string translated in different ways, by having a different translation in different tables, and choosing between the different translation by choosing a different table. </desc> </macro> <macro name="NSLocalizedStringFromTableInBundle" ovadd="1.0.0"> <arg>key</arg> <arg>tbl</arg> <arg>bundle</arg> <arg>comment</arg> <desc> This function is the full-blown localization function (it is actually a macro). It looks up the string <code><var>key</var></code> for translation in the table <code>table</code> of the <var>bundle</var> <code><var>bundle</var></code> (please refer to the NSBundle documentation for more information on how this lookup is done). <code><var>comment</var></code> is a <var>comment</var>, which is ignored by the library (it is discarded when the macro is expanded) but which can be used by tools which parse the source code and generate strings table to provide a <var>comment</var> which the translator can use when translating the string. </desc> </macro> </chapter> <!--EndNSBundleMacros--> <!--StartNSDecimalMacros--> <chapter> <heading>NSDecimal macros</heading> <p></p> <macro name="NSDecimalMaxSize" ovadd="10.0.0"> <desc> Give a precision of at least 38 decimal digits requires 128 bits. </desc> </macro> </chapter> <!--EndNSDecimalMacros--> <!--StartNSExceptionMacros--> <chapter> <heading>NSException macros</heading> <p></p> <macro name="NSAssert" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>args</arg> <vararg /> <desc> Used in an ObjC method body. <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>args</var>. </desc> </macro> <macro name="NSAssert1" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <desc> Used in an ObjC method body (obsolete... use NSAssert). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var> </desc> </macro> <macro name="NSAssert2" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <desc> Used in an ObjC method body (obsolete... use NSAssert). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var> </desc> </macro> <macro name="NSAssert3" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <arg>arg3</arg> <desc> Used in an ObjC method body (obsolete... use NSAssert). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var>, <var>arg3</var> </desc> </macro> <macro name="NSAssert4" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <arg>arg3</arg> <arg>arg4</arg> <desc> Used in an ObjC method body (obsolete... use NSAssert). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var>, <var>arg3</var>, <var>arg4</var> </desc> </macro> <macro name="NSAssert5" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <arg>arg3</arg> <arg>arg4</arg> <arg>arg5</arg> <desc> Used in an ObjC method body (obsolete... use NSAssert). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var>, <var>arg3</var>, <var>arg4</var>, <var>arg5</var> </desc> </macro> <macro name="NSCAssert" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>args</arg> <vararg /> <desc> Used in plain C code (not in an ObjC method body). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> </desc> </macro> <macro name="NSCAssert1" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <desc> Obsolete... use <ref type="function" id="NSCAssert"> NSCAssert() </ref> . <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var> </desc> </macro> <macro name="NSCAssert2" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <desc> Obsolete... use <ref type="function" id="NSCAssert"> NSCAssert() </ref> . <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var> </desc> </macro> <macro name="NSCAssert3" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <arg>arg3</arg> <desc> Obsolete... use <ref type="function" id="NSCAssert"> NSCAssert() </ref> . <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var>, <var>arg3</var> </desc> </macro> <macro name="NSCAssert4" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <arg>arg3</arg> <arg>arg4</arg> <desc> Obsolete... use <ref type="function" id="NSCAssert"> NSCAssert() </ref> . <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var>, <var>arg3</var>, <var>arg4</var> </desc> </macro> <macro name="NSCAssert5" ovadd="1.0.0"> <arg>condition</arg> <arg>desc</arg> <arg>arg1</arg> <arg>arg2</arg> <arg>arg3</arg> <arg>arg4</arg> <arg>arg5</arg> <desc> Obsolete... use <ref type="function" id="NSCAssert"> NSCAssert() </ref> . <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception using <var>desc</var> and <var>arg1</var>, <var>arg2</var>, <var>arg3</var>, <var>arg4</var>, <var>arg5</var> </desc> </macro> <macro name="NSCParameterAssert" ovadd="1.0.0"> <arg>condition</arg> <desc> Used in plain C code (not in an ObjC method body). <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception saying that an invalid parameter was supplied to the method. </desc> </macro> <macro name="NSParameterAssert" ovadd="1.0.0"> <arg>condition</arg> <desc> Used in an ObjC method body. <br /> See <ref type="class" id="NSAssertionHandler">NSAssertionHandler</ref> for details. <br /> When <var>condition</var> is false, raise an exception saying that an invalid parameter was supplied to the method. </desc> </macro> </chapter> <!--EndNSExceptionMacros--> <!--StartNSInvocationMacros--> <chapter> <heading>NSInvocation macros</heading> <p></p> <macro name="NS_INVOCATION" ovadd="1.0.0"> <arg>aClass</arg> <arg>message</arg> <vararg /> <desc> Creates and returns an autoreleased invocation containing a <var>message</var> to an instance of the class. The 'message' consists of selector and arguments like a standard ObjectiveC method call. <br /> Before using the returned invocation, you need to set its target. </desc> </macro> <macro name="NS_MESSAGE" ovadd="1.0.0"> <arg>target</arg> <arg>message</arg> <vararg /> <desc> Creates and returns an autoreleased invocation containing a <var>message</var> to the <var>target</var> object. The 'message' consists of selector and arguments like a standard ObjectiveC method call. </desc> </macro> </chapter> <!--EndNSInvocationMacros--> <!--StartNSObjCRuntimeMacros--> <chapter> <heading>NSObjCRuntime macros</heading> <p></p> <macro name="FOUNDATION_EXPORT" ovadd="1.0.0"> <desc> Declare the foundation export macro as an alias to GS_EXPORT </desc> </macro> <macro name="NS_CLASS_AVAILABLE" ovadd="1.0.0"> <vararg /> <desc> Declare Apple availability macros for compatibility purposes as no-ops. </desc> </macro> </chapter> <!--EndNSObjCRuntimeMacros--> <!--EndMacros--> <!--StartFunctions--> <!--StartNSDebugFunctions--> <chapter> <heading>NSDebug functions</heading> <p></p> <function type="BOOL" name="GSDebugAllocationActive" ovadd="1.0.0"> <arg type="BOOL">active</arg> <desc> This function activates or deactivates object allocation debugging. <br /> Returns the previous state. <br /> You should call this function to activate allocation debugging before using any of the other allocation debugging functions such as <ref type="function" id="GSDebugAllocationList"> GSDebugAllocationList() </ref> or <ref type="function" id="GSDebugAllocationTotal"> GSDebugAllocationTotal() </ref> . <br /> Object allocation debugging should not affect performance too much, and is very useful as it allows you to monitor how many objects of each class your application has allocated. </desc> </function> <function type="void" name="GSDebugAllocationActiveRecordingObjects" ovadd="1.0.0"> <arg type="Class">c</arg> <desc> DEPRECATED... use GSDebugAllocationRecordObjects instead. </desc> </function> <function type="void" name="GSDebugAllocationAdd" ovadd="1.0.0"> <arg type="Class">c</arg> <arg type="id">o</arg> <desc> Used internally by <ref type="function" id="NSAllocateObject"> NSAllocateObject() </ref> ... you probably don't need this. </desc> </function> <function type="Class*" name="GSDebugAllocationClassList" ovadd="1.0.0"> <desc> This function returns a NULL terminated array listing all the classes for which statistical information has been collected. Usually, you call this function, and then loop on all the classes returned, and for each one you get current, peak and total count by using <ref type="function" id="GSDebugAllocationCount"> GSDebugAllocationCount() </ref> , <ref type="function" id="GSDebugAllocationPeak"> GSDebugAllocationPeak() </ref> and <ref type="function" id="GSDebugAllocationTotal"> GSDebugAllocationTotal() </ref> . </desc> </function> <function type="int" name="GSDebugAllocationCount" ovadd="1.0.0"> <arg type="Class">c</arg> <desc> <p> Returns the number of instances of the specified class which are currently allocated. This number is very important to detect memory leaks. If you notice that this number is constantly increasing without apparent reason, it is very likely a memory leak - you need to check that you are correctly releasing objects of this class, otherwise when your application runs for a <strong>long</strong> time, it will eventually allocate so many objects as to eat up all your system's memory... </p> <p> This function, like the ones below, returns the number of objects allocated/released from the time when <ref type="function" id="GSDebugAllocationActive"> GSDebugAllocationActive() </ref> was first called. A negative number means that in total, there are less objects of this class allocated now than there were when you called <ref type="function" id="GSDebugAllocationActive"> GSDebugAllocationActive() </ref> ; a positive one means there are more. </p> </desc> </function> <function type="const char*" name="GSDebugAllocationList" ovadd="1.0.0"> <arg type="BOOL">changeFlag</arg> <desc> This function returns a newline separated list of the classes which have instances allocated, and the instance counts. If the 'changeFlag' argument is <code>YES</code> then the list gives the number of instances allocated/deallocated since the function was last called with that setting. This function only returns the current count of instances (not the peak or total count), but its output is ready to be displayed or logged. </desc> </function> <function type="const char*" name="GSDebugAllocationListAll" ovadd="1.0.0"> <desc> This function returns a newline separated list of the classes which have had instances allocated at any point, and the total count of the number of instances allocated for each class. The difference with <ref type="function" id="GSDebugAllocationList"> GSDebugAllocationList() </ref> is that this function returns also classes which have no objects allocated at the moment, but which had in the past. </desc> </function> <function type="NSArray*" name="GSDebugAllocationListRecordedObjects" ovadd="1.0.0"> <arg type="Class">c</arg> <desc> This function returns an array containing all the allocated objects of a certain class which have been recorded... to start the recording, you need to invoke <ref type="function" id="GSDebugAllocationRecordObjects"> GSDebugAllocationRecordObjects() </ref> . Presumably, you will immediately call <ref type="method" id="-description" class="NSObject"> [NSObject -description] </ref> on them to find out the objects you are leaking. The objects are returned in an autoreleased array, so until the array is deallocated, the objects are not released. </desc> </function> <function type="int" name="GSDebugAllocationPeak" ovadd="1.0.0"> <arg type="Class">c</arg> <desc> Returns the peak number of instances of the specified class which have been concurrently allocated. If this number is very high, it means at some point in time you had a situation with a huge number of objects of this class allocated - this is an indicator that probably at some point in time your application was using a lot of memory - so you might want to investigate whether you can prevent this problem by inserting autorelease pools in your application's processing loops. </desc> </function> <function type="BOOL" name="GSDebugAllocationRecordObjects" ovadd="1.0.0"> <arg type="Class">c</arg> <arg type="BOOL">newState</arg> <desc> This function activates (or deactivates) tracking all allocated instances of the specified class <var>c</var>. <br /> Turning on tracking implicitly turns on memory debug (counts) for all classes (GSAllocationActive()). <br /> Deactivation of tracking releases all currently tracked instances of the class (but deactivation of general counting does not). <br /> The previous tracking state as reported as the return value of this function. <br /> This tracking can slow your application down, so you should use it only when you are into serious debugging. Usually, you will monitor your application by using the functions <ref type="function" id="GSDebugAllocationList"> GSDebugAllocationList() </ref> and similar, which do not slow things down much and return * the number of allocated instances; when (if) by studying the reports generated by these functions you have found a leak of objects of a certain class, and if you can't figure out how to fix it by looking at the code, you can use this function to start tracking allocated instances of that class, and the following one can sometime allow you to list the leaked objects directly. </desc> </function> <function type="void" name="GSDebugAllocationRemove" ovadd="1.0.0"> <arg type="Class">c</arg> <arg type="id">o</arg> <desc> Used internally by <ref type="function" id="NSDeallocateObject"> NSDeallocateObject() </ref> ... you probably don't need this. </desc> </function> <function type="id" name="GSDebugAllocationTagRecordedObject" ovadd="1.0.0"> <arg type="id">object</arg> <arg type="id">tag</arg> <desc> This function associates the supplied <var>tag</var> with a recorded <var>object</var> and returns the <var>tag</var> which was previously associated with it (if any). <br /> If the <var>object</var> was not recorded, the method returns <code>nil</code> <br /> The <var>tag</var> is retained while it is associated with the <var>object</var>. <br /> If the tagged <var>object</var> is deallocated, the <var>tag</var> is released (so you can track the lifetime of the <var>object</var> by having the <var>tag</var> perform some operation when it is released). <br /> See also the <ref type="function" id="NSDebugFRLog"> NSDebugFRLog() </ref> and <ref type="function" id="NSDebugMRLog"> NSDebugMRLog() </ref> macros. </desc> </function> <function type="int" name="GSDebugAllocationTotal" ovadd="1.0.0"> <arg type="Class">c</arg> <desc> Returns the total number of instances of the specified class <var>c</var> which have been allocated - basically the number of times you have allocated an object of this class. If this number is very high, it means you are creating a lot of objects of this class; even if you are releasing them correctly, you must not forget that allocating and deallocating objects is usually one of the slowest things you can do, so you might want to consider whether you can reduce the number of allocations and deallocations that you are doing - for example, by recycling objects of this class, uniquing them, and/or using some sort of flyweight pattern. It might also be possible that you are unnecessarily creating too many objects of this class. Well - of course some times there is nothing you can do about it. </desc> </function> <function type="void" name="GSSetDebugAllocationFunctions" ovadd="1.0.0"> <arg type="void(*)">newAddObjectFunc</arg> <arg type="void(*)">newRemoveObjectFunc</arg> <desc> This functions allows to set own function callbacks for debugging allocation of objects. Useful if you intend to write your own object allocation code. </desc> </function> <function type="NSUInteger" name="NSCountFrames" ovadd="1.0.0"> <desc> Retrieve stack information. Use caution: uses built-in gcc functions and currently only works up to 100 frames. </desc> </function> <function type="void*" name="NSFrameAddress" ovadd="1.0.0"> <arg type="NSUInteger">offset</arg> <desc> Retrieve stack information. Use caution: uses built-in gcc functions and currently only works up to 100 frames. </desc> </function> <function type="void*" name="NSReturnAddress" ovadd="1.0.0"> <arg type="NSUInteger">offset</arg> <desc> Retrieve stack information. Use caution: uses built-in gcc functions and currently only works up to 100 frames. </desc> </function> </chapter> <!--EndNSDebugFunctions--> <!--StartNSDecimalFunctions--> <chapter> <heading>NSDecimal functions</heading> <p></p> <function type="NSCalculationError" name="NSDecimalAdd" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">left</arg> <arg type="const NSDecimal*">right</arg> <arg type="NSRoundingMode">mode</arg> <desc> Adds two decimals and returns <var>result</var> to 38-digit precision. See the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol for a description of <var>mode</var> and the return value. The <var>result</var> should be preallocated but can be the same as <var>left</var> or <var>right</var>. </desc> </function> <function type="void" name="NSDecimalCompact" ovadd="10.0.0"> <arg type="NSDecimal*">number</arg> <desc> Tries to reduce memory used to store <var>number</var> internally. </desc> </function> <function type="NSComparisonResult" name="NSDecimalCompare" ovadd="10.0.0"> <arg type="const NSDecimal*">leftOperand</arg> <arg type="const NSDecimal*">rightOperand</arg> <desc> Returns <code>NSOrderedDescending</code>, <code>NSOrderedSame</code>, or <code>NSOrderedAscending</code> depending on whether <var>leftOperand</var> is greater than, equal to, or less than <var>rightOperand</var>. </desc> </function> <function type="void" name="NSDecimalCopy" ovadd="10.0.0"> <arg type="NSDecimal*">destination</arg> <arg type="const NSDecimal*">source</arg> <desc> Copies value of decimal number to preallocated <var>destination</var>. </desc> </function> <function type="NSCalculationError" name="NSDecimalDivide" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">l</arg> <arg type="const NSDecimal*">rr</arg> <arg type="NSRoundingMode">mode</arg> <desc> Divides <var>l</var> by <var>rr</var> and returns <var>result</var> to 38-digit precision. See the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol for a description of <var>mode</var> and the return value. The <var>result</var> should be preallocated but can be the same as <var>l</var> or <var>rr</var>. </desc> </function> <function type="double" name="NSDecimalDouble" ovadd="10.0.0"> <arg type="NSDecimal*">number</arg> <desc> Give back the value of a NSDecimal as a <strong>double</strong> in (preallocated) result. </desc> </function> <function type="void" name="NSDecimalFromComponents" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="unsigned long long int">mantissa</arg> <arg type="short int">exponent</arg> <arg type="BOOL">negative</arg> <desc> Create a NSDecimal with a <var>mantissa</var>, <var>exponent</var> and a <var>negative</var> flag in (preallocated) <var>result</var>. </desc> </function> <function type="void" name="NSDecimalFromString" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="NSString*">numberValue</arg> <arg type="NSDictionary*">locale</arg> <desc> Create a NSDecimal from a string using the <var>locale</var>, in (preallocated) <var>result</var>. </desc> </function> <function type="BOOL" name="NSDecimalIsNotANumber" ovadd="10.0.0"> <arg type="const NSDecimal*">decimal</arg> <desc> Returns whether <var>decimal</var> represents an invalid number (i.e., an "NaN" as might result from an overflow or a division by zero). </desc> </function> <function type="void" name="NSDecimalMax" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <desc> Give back the biggest NSDecimal in (preallocated) <var>result</var>. </desc> </function> <function type="void" name="NSDecimalMin" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <desc> Give back the smallest NSDecimal in (preallocated) <var>result</var>. </desc> </function> <function type="NSCalculationError" name="NSDecimalMultiply" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">l</arg> <arg type="const NSDecimal*">r</arg> <arg type="NSRoundingMode">mode</arg> <desc> Multiplies two decimals and returns <var>result</var> to 38-digit precision. See the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol for a description of <var>mode</var> and the return value. The <var>result</var> should be preallocated but can be the same as <var>l</var> or <var>r</var>. </desc> </function> <function type="NSCalculationError" name="NSDecimalMultiplyByPowerOf10" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">n</arg> <arg type="short int">power</arg> <arg type="NSRoundingMode">mode</arg> <desc> Multiplies <var>n</var> by 10^power and returns <var>result</var> to 38-digit precision. See the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol for a description of <var>mode</var> and the return value. The <var>result</var> should be preallocated but can be the same as <var>n</var>. </desc> </function> <function type="NSCalculationError" name="NSDecimalNormalize" ovadd="10.0.0"> <arg type="NSDecimal*">n1</arg> <arg type="NSDecimal*">n2</arg> <arg type="NSRoundingMode">mode</arg> <desc> Sets the exponents of <var>n1</var> and <var>n2</var> equal to one another, adjusting mantissas as necessary to preserve values. This makes certain operations quicker. </desc> </function> <function type="NSCalculationError" name="NSDecimalPower" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">n</arg> <arg type="NSUInteger">power</arg> <arg type="NSRoundingMode">mode</arg> <desc> Raises <var>n</var> to <var>power</var> and returns <var>result</var> to 38-digit precision. See the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol for a description of <var>mode</var> and the return value. The <var>result</var> should be preallocated but can be the same as <var>n</var> or <var>power</var>. </desc> </function> <function type="void" name="NSDecimalRound" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">number</arg> <arg type="NSInteger">scale</arg> <arg type="NSRoundingMode">mode</arg> <desc> Rounds <var>number</var> to <var>result</var> such that it has at most <var>scale</var> digits to the right of its decimal point, according to <var>mode</var> (see the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol). The <var>result</var> should be preallocated but can be the same as <var>number</var>. </desc> </function> <function type="NSString*" name="NSDecimalString" ovadd="10.0.0"> <arg type="const NSDecimal*">decimal</arg> <arg type="NSDictionary*">locale</arg> <desc> Returns a string representing the full <var>decimal</var> value, formatted according to <var>locale</var> (send <code>nil</code> here for default <var>locale</var>). </desc> </function> <function type="NSCalculationError" name="NSDecimalSubtract" ovadd="10.0.0"> <arg type="NSDecimal*">result</arg> <arg type="const NSDecimal*">left</arg> <arg type="const NSDecimal*">right</arg> <arg type="NSRoundingMode">mode</arg> <desc> Subtracts two decimals and returns <var>result</var> to 38-digit precision. See the <ref type="protocol" id="(NSDecimalNumberBehaviors)"><NSDecimalNumberBehaviors></ref> protocol for a description of <var>mode</var> and the return value. The <var>result</var> should be preallocated but can be the same as <var>left</var> or <var>right</var>. </desc> </function> </chapter> <!--EndNSDecimalFunctions--> <!--StartNSExceptionFunctions--> <chapter> <heading>NSException functions</heading> <p></p> <function type="NSUncaughtExceptionHandler*" name="NSGetUncaughtExceptionHandler" ovadd="1.0.0"> <desc> Returns the exception handler called when an exception is generated and not caught by the programmer (by enclosing in <code>NS_DURING</code> and <code>NS_HANDLER</code>... <code>NS_ENDHANDLER</code> ). The default prints an error message and exits the program. You can change this behavior by calling <ref type="function" id="NSSetUncaughtExceptionHandler"> NSSetUncaughtExceptionHandler() </ref> . </desc> </function> <function type="void" name="NSSetUncaughtExceptionHandler" ovadd="1.0.0"> <arg type="NSUncaughtExceptionHandler*">handler</arg> <desc> <p> Sets the exception <var>handler</var> called when an exception is generated and not caught by the programmer (by enclosing in <code>NS_DURING</code> and <code>NS_HANDLER</code> ... <code>NS_ENDHANDLER</code>). The default prints an error message and exits the program. proc should take a single argument of type <code>NSException *</code>. </p> <p> NB. If the exception <var>handler</var> set by this function does not terminate the process, the process will be terminateed anyway. This is a safety precaution to ensure that, in the event of an exception being raised and not handled, the program does not try to continue running in a confused state (possibly doing horrible things like billing customers who shouldn't be billed etc), but shuts down as cleanly as possible. </p> <p> Process termination is normally accomplished by calling the standard exit function of the C runtime library, but if the environment variable CRASH_ON_ABORT is set to <code>YES</code> or TRUE or 1 the termination will be accomplished by calling the abort function instead, which should cause a core dump to be made for debugging. </p> <p> The value of proc should be a pointer to a function taking an <ref type="class" id="NSException">NSException</ref> instance as an argument. </p> </desc> </function> <function type="void" name="NSUncaughtExceptionHandler" ovadd="1.0.0"> <arg type="NSException*">exception</arg> <desc> This is the type of the <var>exception</var> handler called when an <var>exception</var> is generated and not caught by the programmer. See <ref type="function" id="NSGetUncaughtExceptionHandler"> NSGetUncaughtExceptionHandler() </ref> , <ref type="function" id="NSSetUncaughtExceptionHandler"> NSSetUncaughtExceptionHandler() </ref> . </desc> </function> <function type="void" name="_NSAddHandler" ovadd="1.0.0"> <arg type="NSHandler*">handler</arg> <desc> Private support routine. Do not call directly. </desc> </function> <function type="void" name="_NSRemoveHandler" ovadd="1.0.0"> <arg type="NSHandler*">handler</arg> <desc> Private support routine. Do not call directly. </desc> </function> </chapter> <!--EndNSExceptionFunctions--> <!--StartNSGeometryFunctions--> <chapter> <heading>NSGeometry functions</heading> <p></p> <function type="BOOL" name="NSContainsRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="NSRect">bRect</arg> <desc> Returns 'YES' iff <var>aRect</var> totally encloses <var>bRect</var>. NOTE: For this to be the case, <var>aRect</var> cannot be empty, nor can any side of <var>bRect</var> go beyond any side of <var>aRect</var> . Note that this behavior is different than the original OpenStep behavior, where the sides of <var>bRect</var> could not touch <var>aRect</var>. </desc> </function> <function type="void" name="NSDivideRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="NSRect*">slice</arg> <arg type="NSRect*">remainder</arg> <arg type="CGFloat">amount</arg> <arg type="NSRectEdge">edge</arg> <desc> Divides <var>aRect</var> into two rectangles (namely <var>slice</var> and <var>remainder</var>) by "cutting" aRect---parallel to, and a distance <var>amount</var> from the given <var>edge</var> of <var>aRect</var>. You may pass 0 in as either of <var>slice</var> or <var>remainder</var> to avoid obtaining either of the created rectangles. </desc> </function> <function type="BOOL" name="NSEdgeInsetsEqual" ovadd="0.0.0"> <arg type="NSEdgeInsets">e1</arg> <arg type="NSEdgeInsets">e2</arg> <desc> Compares two edge insets for equality. </desc> </function> <function type="NSEdgeInsets" name="NSEdgeInsetsMake" ovadd="10.7.0"> <arg type="CGFloat">top</arg> <arg type="CGFloat">left</arg> <arg type="CGFloat">bottom</arg> <arg type="CGFloat">right</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="BOOL" name="NSEqualPoints" ovadd="1.0.0"> <arg type="NSPoint">aPoint</arg> <arg type="NSPoint">bPoint</arg> <desc> Returns 'YES' iff aPoint's and bPoint's x- and y-coordinates are the same. </desc> </function> <function type="BOOL" name="NSEqualRects" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="NSRect">bRect</arg> <desc> Test geometric relationships... <br /> Returns 'YES' iff aRect's and bRect's origin and size are the same. </desc> </function> <function type="BOOL" name="NSEqualSizes" ovadd="1.0.0"> <arg type="NSSize">aSize</arg> <arg type="NSSize">bSize</arg> <desc> Returns 'YES' iff aSize's and bSize's width and height are the same. </desc> </function> <function type="CGFloat" name="NSHeight" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns aRect's height. </desc> </function> <function type="NSRect" name="NSInsetRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="CGFloat">dX</arg> <arg type="CGFloat">dY</arg> <desc> Returns the rectangle obtained by moving each of aRect's horizontal sides inward by dy and each of aRect's vertical sides inward by dx. <br /> NB. For MacOS-X compatability, this is permitted to return a rectanglew with nagative width or height, strange as that seems. </desc> </function> <function type="NSRect" name="NSIntegralRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns a rectangle obtained by expanding <var>aRect</var> minimally so that all four of its defining components are integers. </desc> </function> <function type="NSRect" name="NSIntersectionRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="NSRect">bRect</arg> <desc> Returns the largest rectangle which lies in both <var>aRect</var> and <var>bRect</var>. If <var>aRect</var> and <var>bRect</var> have empty intersection (or, rather, intersection of measure zero, since this includes having their intersection be only a point or a line), then the empty rectangle is returned. </desc> </function> <function type="BOOL" name="NSIntersectsRect" ovadd="10.0.0"> <arg type="NSRect">aRect</arg> <arg type="NSRect">bRect</arg> <desc> Returns <code>YES</code> if <var>aRect</var> and <var>bRect</var> have non-zero intersection area (intersecting at a line or a point doesn't count). </desc> </function> <function type="BOOL" name="NSIsEmptyRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns 'YES' iff the area of <var>aRect</var> is zero (i.e., iff either of aRect's width or height is negative or zero). </desc> </function> <function type="NSPoint" name="NSMakePoint" ovadd="1.0.0"> <arg type="CGFloat">x</arg> <arg type="CGFloat">y</arg> <desc> Returns an NSPoint having x-coordinate X and y-coordinate Y. </desc> </function> <function type="NSRect" name="NSMakeRect" ovadd="1.0.0"> <arg type="CGFloat">x</arg> <arg type="CGFloat">y</arg> <arg type="CGFloat">w</arg> <arg type="CGFloat">h</arg> <desc> Returns an NSRect having point of origin ( <var>x</var>, <var>y</var>) and size {<var>w</var>, <var>h</var>}. </desc> </function> <function type="NSSize" name="NSMakeSize" ovadd="1.0.0"> <arg type="CGFloat">w</arg> <arg type="CGFloat">h</arg> <desc> Returns an NSSize having width <var>w</var> and height <var>h</var>. </desc> </function> <function type="CGFloat" name="NSMaxX" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns the greatest x-coordinate value still inside <var>aRect</var>. </desc> </function> <function type="CGFloat" name="NSMaxY" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns the greatest y-coordinate value still inside <var>aRect</var>. </desc> </function> <function type="CGFloat" name="NSMidX" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns the x-coordinate of aRect's middle point. </desc> </function> <function type="CGFloat" name="NSMidY" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns the y-coordinate of aRect's middle point. </desc> </function> <function type="CGFloat" name="NSMinX" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns the least x-coordinate value still inside <var>aRect</var>. </desc> </function> <function type="CGFloat" name="NSMinY" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns the least y-coordinate value still inside <var>aRect</var>. </desc> </function> <function type="BOOL" name="NSMouseInRect" ovadd="1.0.0"> <arg type="NSPoint">aPoint</arg> <arg type="NSRect">aRect</arg> <arg type="BOOL">flipped</arg> <desc> Returns 'YES' iff <var>aPoint</var> is inside <var>aRect</var>. </desc> </function> <function type="NSRect" name="NSOffsetRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="CGFloat">dx</arg> <arg type="CGFloat">dy</arg> <desc> Returns the rectangle obtained by translating <var>aRect</var> horizontally by <var>dx</var> and vertically by <var>dy</var>. </desc> </function> <function type="NSPoint" name="NSPointFromString" ovadd="1.0.0"> <arg type="NSString*">string</arg> <desc> Parses point from <var>string</var> of form " <code>{x=a; y=b}</code> ". (0,0) returned if parsing fails. </desc> </function> <function type="BOOL" name="NSPointInRect" ovadd="1.0.0"> <arg type="NSPoint">aPoint</arg> <arg type="NSRect">aRect</arg> <desc> Just like 'NSMouseInRect(<var>aPoint</var>, <var>aRect</var>, <code>YES</code>)'. </desc> </function> <function type="NSRect" name="NSRectFromString" ovadd="1.0.0"> <arg type="NSString*">string</arg> <desc> Parses point from <var>string</var> of form " <code>{x=a; y=b; width=c; height=d}</code> ". Rectangle of 0 size at origin returned if parsing fails. </desc> </function> <function type="NSSize" name="NSSizeFromString" ovadd="1.0.0"> <arg type="NSString*">string</arg> <desc> Parses size from <var>string</var> of form " <code>{width=a; height=b}</code> ". Size of 0,0 returned if parsing fails. </desc> </function> <function type="NSString*" name="NSStringFromPoint" ovadd="1.0.0"> <arg type="NSPoint">aPoint</arg> <desc> Returns an NSString of the form "{x=X; y=Y}", where X and Y are the x- and y-coordinates of <var>aPoint</var>, respectively. <br /> Get a String Representation... </desc> </function> <function type="NSString*" name="NSStringFromRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns an NSString of the form "{x=X; y=Y; width=W; height=H}", where X, Y, W, and H are the x-coordinate, y-coordinate, width, and height of <var>aRect</var>, respectively. </desc> </function> <function type="NSString*" name="NSStringFromSize" ovadd="1.0.0"> <arg type="NSSize">aSize</arg> <desc> Returns an NSString of the form "{width=W; height=H}", where W and H are the width and height of <var>aSize</var>, respectively. </desc> </function> <function type="NSRect" name="NSUnionRect" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <arg type="NSRect">bRect</arg> <desc> Returns the smallest rectangle which contains both <var>aRect</var> and <var>bRect</var> (modulo a set of measure zero). If either of <var>aRect</var> or <var>bRect</var> is an empty rectangle, then the other rectangle is returned. If both are empty, then the empty rectangle is returned. </desc> </function> <function type="CGFloat" name="NSWidth" ovadd="1.0.0"> <arg type="NSRect">aRect</arg> <desc> Returns aRect's width. </desc> </function> </chapter> <!--EndNSGeometryFunctions--> <!--StartNSHashTableFunctions--> <chapter> <heading>NSHashTable functions</heading> <p></p> <function type="NSArray*" name="NSAllHashTableObjects" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="BOOL" name="NSCompareHashTables" ovadd="1.0.0"> <arg type="NSHashTable*">table1</arg> <arg type="NSHashTable*">table2</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSHashTable*" name="NSCopyHashTableWithZone" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <arg type="NSZone*">zone</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSUInteger" name="NSCountHashTable" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSHashTable*" name="NSCreateHashTable" ovadd="1.0.0"> <arg type="NSHashTableCallBacks">callBacks</arg> <arg type="NSUInteger">capacity</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSHashTable*" name="NSCreateHashTableWithZone" ovadd="1.0.0"> <arg type="NSHashTableCallBacks">callBacks</arg> <arg type="NSUInteger">capacity</arg> <arg type="NSZone*">zone</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSEndHashTableEnumeration" ovadd="1.0.0"> <arg type="NSHashEnumerator*">enumerator</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSHashEnumerator" name="NSEnumerateHashTable" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSFreeHashTable" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void*" name="NSHashGet" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <arg type="const void*">element</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSHashInsert" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <arg type="const void*">element</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void*" name="NSHashInsertIfAbsent" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <arg type="const void*">element</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSHashInsertKnownAbsent" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <arg type="const void*">element</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSHashRemove" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <arg type="const void*">element</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void*" name="NSNextHashEnumeratorItem" ovadd="1.0.0"> <arg type="NSHashEnumerator*">enumerator</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSResetHashTable" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSString*" name="NSStringFromHashTable" ovadd="1.0.0"> <arg type="NSHashTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> </chapter> <!--EndNSHashTableFunctions--> <!--StartNSLockFunctions--> <chapter> <heading>NSLock functions</heading> <p></p> <function type="void" name="NSLock_error_handler" ovadd="1.0.0"> <arg type="id">obj</arg> <arg type="SEL">_cmd</arg> <arg type="BOOL">stop</arg> <arg type="NSString*">msg</arg> <desc> <em>Description forthcoming.</em> </desc> </function> </chapter> <!--EndNSLockFunctions--> <!--StartNSMapTableFunctions--> <chapter> <heading>NSMapTable functions</heading> <p></p> <function type="NSArray*" name="NSAllMapTableKeys" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSArray*" name="NSAllMapTableValues" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="BOOL" name="NSCompareMapTables" ovadd="1.0.0"> <arg type="NSMapTable*">table1</arg> <arg type="NSMapTable*">table2</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSMapTable*" name="NSCopyMapTableWithZone" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="NSZone*">zone</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSUInteger" name="NSCountMapTable" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSMapTable*" name="NSCreateMapTable" ovadd="1.0.0"> <arg type="NSMapTableKeyCallBacks">keyCallBacks</arg> <arg type="NSMapTableValueCallBacks">valueCallBacks</arg> <arg type="NSUInteger">capacity</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSMapTable*" name="NSCreateMapTableWithZone" ovadd="1.0.0"> <arg type="NSMapTableKeyCallBacks">keyCallBacks</arg> <arg type="NSMapTableValueCallBacks">valueCallBacks</arg> <arg type="NSUInteger">capacity</arg> <arg type="NSZone*">zone</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSEndMapTableEnumeration" ovadd="1.0.0"> <arg type="NSMapEnumerator*">enumerator</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSMapEnumerator" name="NSEnumerateMapTable" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSFreeMapTable" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void*" name="NSMapGet" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="const void*">key</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSMapInsert" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="const void*">key</arg> <arg type="const void*">value</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void*" name="NSMapInsertIfAbsent" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="const void*">key</arg> <arg type="const void*">value</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSMapInsertKnownAbsent" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="const void*">key</arg> <arg type="const void*">value</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="BOOL" name="NSMapMember" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="const void*">key</arg> <arg type="void**">originalKey</arg> <arg type="void**">value</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSMapRemove" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <arg type="const void*">key</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="BOOL" name="NSNextMapEnumeratorPair" ovadd="1.0.0"> <arg type="NSMapEnumerator*">enumerator</arg> <arg type="void**">key</arg> <arg type="void**">value</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="void" name="NSResetMapTable" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSString*" name="NSStringFromMapTable" ovadd="1.0.0"> <arg type="NSMapTable*">table</arg> <desc> <em>Description forthcoming.</em> </desc> </function> </chapter> <!--EndNSMapTableFunctions--> <!--StartNSObjCRuntimeFunctions--> <chapter> <heading>NSObjCRuntime functions</heading> <p></p> <function type="NSRecursiveLock*" name="GSLogLock" ovadd="0.0.0" ovrem="0.0.0"> <desc> Returns the lock used to protect the GNUstep <ref type="function" id="NSLogv"> NSLogv() </ref> implementation. Use this to protect changes to <ref type="variable" id="_NSLogDescriptor"> _NSLogDescriptor </ref> and <ref type="variable" id="_NSLog_printf_handler"> _NSLog_printf_handler </ref> </desc> </function> <function type="Class" name="NSClassFromString" ovadd="1.0.0"> <arg type="NSString*">aClassName</arg> <desc> Returns the class whose name is supplied in the <var>aClassName</var> argument, or Nil if a <code>nil</code> string is supplied. If no such class has been loaded, the function returns Nil. </desc> </function> <function type="const char*" name="NSGetSizeAndAlignment" ovadd="1.0.0"> <arg type="const char*">typePtr</arg> <arg type="NSUInteger*">sizep</arg> <arg type="NSUInteger*">alignp</arg> <desc> When provided with a C string containing encoded type information, this method extracts size and alignment information for the specified type into the buffers pointed to by <var>sizep</var> and <var>alignp</var>. <br /> If either <var>sizep</var> or <var>alignp</var> is a null pointer, the corresponding data is not extracted. <br /> The function returns a pointer into the type information C string immediately after the decoded information. </desc> </function> <function type="void" name="NSLog" ovadd="1.0.0"> <arg type="NSString*">format</arg> <vararg /> <desc> <p> Provides the standard OpenStep logging facility. For details see the lower level <ref type="function" id="NSLogv"> NSLogv() </ref> function (which this function uses). </p> <p> GNUstep provides powerful alternatives for logging ... see <ref type="function" id="NSDebugLog"> NSDebugLog() </ref> , <ref type="function" id="NSWarnLog">NSWarnLog()</ref> and <ref type="function" id="GSPrintf">GSPrintf()</ref> for example. We recommend the use of <ref type="function" id="NSDebugLog"> NSDebugLog() </ref> and its relatives for debug purposes, and <ref type="function" id="GSPrintf"> GSPrintf() </ref> for general log messages, with <ref type="function" id="NSLog"> NSLog() </ref> being reserved for reporting possible/likely errors. <ref type="function" id="GSPrintf"> GSPrintf() </ref> is declared in GSObjCRuntime.h. </p> </desc> </function> <function type="void" name="NSLog_printf_handler" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSString*">message</arg> <desc> OpenStep spec states that log messages go to stderr, but just in case someone wants them to go somewhere else, they can implement a function like this and assign a pointer to it to _NSLog_printf_handler. </desc> </function> <function type="void" name="NSLogv" ovadd="1.0.0"> <arg type="NSString*">format</arg> <arg type="va_list">args</arg> <desc> The core logging function... <p> The function generates a standard log entry by prepending process ID and date/time information to your message, and ensuring that a newline is present at the end of the message. </p> <p> In GNUstep, the GSLogThread user default may be set to <code>YES</code> in order to instruct this function to include the name (if any) of the current thread after the process ID. This can help you to track the behavior of a multi-threaded program. <br /> Also the GSLogOffset user default may be set to <code>YES</code> in order to instruct this function to include the time zone offset in the timestamp it logs (good when examining debug logs from systems running in different countries). </p> <p> The resulting message is then passed to a handler function to perform actual output. Locking is performed around the call to the function actually writing the message out, to ensure that logging is thread-safe. However, the actual creation of the message written is only as safe as the <ref type="method" id="-description" class="NSObject"> [NSObject -description] </ref> methods of the arguments you supply. </p> <p> The function to write the data is pointed to by <ref type="variable" id="_NSLog_printf_handler"> _NSLog_printf_handler </ref> </p> </desc> </function> <function type="Protocol*" name="NSProtocolFromString" ovadd="10.5.0"> <arg type="NSString*">aProtocolName</arg> <desc> Returns the protocol whose name is supplied in the <var>aProtocolName</var> argument, or 0 if a <code>nil</code> string is supplied. </desc> </function> <function type="SEL" name="NSSelectorFromString" ovadd="1.0.0"> <arg type="NSString*">aSelectorName</arg> <desc> Returns (creating if necessary) the selector whose name is supplied in the <var>aSelectorName</var> argument, or 0 if a <code>nil</code> string is supplied. </desc> </function> <function type="NSString*" name="NSStringFromClass" ovadd="1.0.0"> <arg type="Class">aClass</arg> <desc> Returns an <ref type="class" id="NSString">NSString</ref> object containing the class name for <var>aClass</var>. If <var>aClass</var> is 0, returns <code>nil</code>. </desc> </function> <function type="NSString*" name="NSStringFromProtocol" ovadd="10.5.0"> <arg type="Protocol*">aProtocol</arg> <desc> Returns a string object containing the name for <var>aProtocol</var>. If <var>aProtocol</var> is 0, returns <code>nil</code>. </desc> </function> <function type="NSString*" name="NSStringFromSelector" ovadd="1.0.0"> <arg type="SEL">aSelector</arg> <desc> Returns a string object containing the name for <var>aSelector</var>. If <var>aSelector</var> is 0, returns <code>nil</code>. </desc> </function> </chapter> <!--EndNSObjCRuntimeFunctions--> <!--StartNSObjectFunctions--> <chapter> <heading>NSObject functions</heading> <p></p> <function type="id" name="NSAllocateObject" ovadd="1.0.0"> <arg type="Class">aClass</arg> <arg type="NSUInteger">extraBytes</arg> <arg type="NSZone*">zone</arg> <desc> Used to allocate memory to hold an object, and initialise the class of the object to be <var>aClass</var> etc. The allocated memory will be <var>extraBytes</var> larger than the space actually needed to hold the instance variables of the object. <br /> This function is used by the <ref type="method" id="+allocWithZone:" class="NSObject"> [NSObject +allocWithZone:] </ref> method. </desc> </function> <function type="NSObject*" name="NSCopyObject" ovadd="1.0.0"> <arg type="NSObject*">anObject</arg> <arg type="NSUInteger">extraBytes</arg> <arg type="NSZone*">zone</arg> <desc> Used to copy <var>anObject</var>. This makes a bitwise copy of <var>anObject</var> to memory allocated from <var>zone</var>. The allocated memory will be <var>extraBytes</var> longer than that necessary to actually store the instance variables of the copied object. <br /> </desc> </function> <function type="void" name="NSDeallocateObject" ovadd="1.0.0"> <arg type="id">anObject</arg> <desc> Used to release the memory used by an object. <br /> This function is used by the <ref type="method" id="-dealloc" class="NSObject"> [NSObject -dealloc] </ref> method. </desc> </function> <function type="BOOL" name="NSDecrementExtraRefCountWasZero" ovadd="1.0.0"> <arg type="id">anObject</arg> <desc> Examines the extra reference count for the object and, if non-zero decrements it, otherwise leaves it unchanged. <br /> Returns a flag to say whether the count was zero (and hence whether the extra reference count was decremented). <br /> </desc> </function> <function type="NSUInteger" name="NSExtraRefCount" ovadd="1.0.0"> <arg type="id">anObject</arg> <desc> Return the extra reference count of <var>anObject</var> (a value in the range from 0 to the maximum <strong>unsigned</strong> integer value minus one). <br /> The retain count for an object is this value plus one. </desc> </function> <function type="void" name="NSIncrementExtraRefCount" ovadd="1.0.0"> <arg type="id">anObject</arg> <desc> Increments the extra reference count for <var>anObject</var>. <br /> The GNUstep version raises an exception if the reference count would be incremented to too large a value. <br /> This is used by the <ref type="method" id="-retain" class="NSObject"> [NSObject -retain] </ref> method. </desc> </function> <function type="BOOL" name="NSShouldRetainWithZone" ovadd="1.0.0"> <arg type="NSObject*">anObject</arg> <arg type="NSZone*">requestedZone</arg> <desc> Returns a flag to indicate whether <var>anObject</var> should be retained or copied in order to make a copy in the specified zone. <br /> Basically, this tests to see if <var>anObject</var> was allocated from <var>requestedZone</var> and returns <code>YES</code> if it was. </desc> </function> </chapter> <!--EndNSObjectFunctions--> <!--StartNSPathUtilitiesFunctions--> <chapter> <heading>NSPathUtilities functions</heading> <p></p> <function type="NSMutableDictionary*" name="GNUstepConfig" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSDictionary*">newConfig</arg> <desc> Returns a mutable copy of the system-wide configuration used to determine paths to locate files etc. <br /> If the <var>newConfig</var> argument is non-nil it is used to set the config overriding any other version. You should not change the config after the user defaults system has been initialised as the new config will not be picked up by the defaults system. <br /> <br /> A typical sequence of operation might be to <br /> Call the function with a <code>nil</code> argument to obtain the configuration information currently in use (usually obtained from the main GNUstep configuration file). <br /> Modify the dictionary contents. <br /> Call the function again passing back in the modified config. <br /> <br /> If you call this function with a non-nil argument before the system configuration file has been read, you will prevent the file from being read. However, you must take care doing this that creation of the config dictionary you are going to pass in to the function does not have any side-effects which would cause the config file to be read earlier. <br /> If you want to prevent the user specific config file from being read, you must set the GNUSTEP_USER_CONFIG_FILE value in the dictionary to be an empty string. </desc> </function> <function type="void" name="GNUstepUserConfig" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSMutableDictionary*">config</arg> <arg type="NSString*">userName</arg> <desc> The <var>config</var> dictionary passed to this function should be a system-wide <var>config</var> as provided by <ref type="function" id="GNUstepConfig"> GNUstepConfig() </ref> ... and this function merges in user specific configuration file information if such a file exists and is owned by the user. <br /> NB. If the GNUSTEP_USER_CONFIG_FILE value in the system-wide <var>config</var> is an empty string, no user-specifc <var>config</var> will be read. </desc> </function> <function type="NSString*" name="GSDefaultsRootForUser" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSString*">userName</arg> <desc> Returns the location of the defaults database for the specified user. This uses the same information you get from <ref type="function" id="GNUstepConfig"> GNUstepConfig() </ref> and <ref type="function" id="GNUstepUserConfig"> GNUstepUserConfig() </ref> and builds the path to the defaults database fromm it. <br /> Return the path of the defaults directory for <var>userName</var>. <br /> This examines the GNUSTEP_USER_CONFIG_FILE for the specified user, with settings in it over-riding those in the main GNUstep.conf. </desc> </function> <function type="void" name="GSSetUserName" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSString*">aName</arg> <desc> This extension permits a change of username from that specified in the LOGNAME environment variable. Using it will almost certainly cause trouble if the process does not posses the file access privileges of the new name. This is provided primarily for use by processes that run as system-manager and need to act as particular users. It uses the [NSUserDefaults +resetUserDefaults] extension to reset the defaults system to use the defaults belonging to the new user. </desc> </function> <function type="NSString*" name="NSFullUserName" ovadd="10.0.0"> <desc> Returns the full username of the current user. If unable to determine this, returns the standard user name. </desc> </function> <function type="NSString*" name="NSHomeDirectory" ovadd="1.0.0"> <desc> Return the caller's home directory as an NSString object. Calls <ref type="function" id="NSHomeDirectoryForUser"> NSHomeDirectoryForUser() </ref> to do this. </desc> </function> <function type="NSString*" name="NSHomeDirectoryForUser" ovadd="1.0.0"> <arg type="NSString*">loginName</arg> <desc> Returns loginName's home directory as an NSString object. <br /> On most systems this returns the directory specified in the system's password file (ar at least whatever is returned by the standard operating system API for retrieving password file records), but on ms-windows this is determined by examining the HOMEPATH and HOMEDRIVE environment variables or (if those don't make sense) the USERPROFILE environment variable. </desc> </function> <function type="NSString*" name="NSOpenStepRootDirectory" ovadd="10.0.0"> <desc> Returns the location of the <em>root</em> directory of the file hierarchy. This lets you build paths in a system independent manner (for instance the root on unix is '/' but on windows it is 'C:\') by appending path components to the root. <br /> Don't assume that /System, /Network etc exist in this path (generally they don't)! Use other path utility functions such as <ref type="function" id="NSSearchPathForDirectoriesInDomains">NSSearchPathForDirectoriesInDomains()</ref> to find standard locations for libraries, applications etc. <br /> Refer to the GNUstep File System Hierarchy documentation for more info. </desc> </function> <function type="NSArray*" name="NSSearchPathForDirectoriesInDomains" ovadd="10.0.0"> <arg type="NSSearchPathDirectory">directoryKey</arg> <arg type="NSSearchPathDomainMask">domainMask</arg> <arg type="BOOL">expandTilde</arg> <desc> Returns an array of search paths to look at for resources. <br /> The paths are returned in domain order: USER, LOCAL, NETWORK then SYSTEM. <br /> The presence of a path in this list does <em>not</em> mean that the path actually exists in the filesystem. <br /> If you are wanting to locate an existing resource, you should normally call this function with NSAllDomainsMask, but if you wish to find the path in which you should create a new file, you would generally specify a particular domain, and then create the path in the file system if it does not already exist. </desc> </function> <function type="NSArray*" name="NSStandardApplicationPaths" ovadd="10.0.0"> <desc> Returns the standard paths in which applications are stored and should be searched for. Calls <ref type="function" id="NSSearchPathForDirectoriesInDomains">NSSearchPathForDirectoriesInDomains()</ref> <br /> Refer to the GNUstep File System Hierarchy documentation for more info. </desc> </function> <function type="NSArray*" name="NSStandardLibraryPaths" ovadd="10.0.0"> <desc> Returns the standard paths in which resources are stored and should be searched for. Calls <ref type="function" id="NSSearchPathForDirectoriesInDomains">NSSearchPathForDirectoriesInDomains()</ref> <br /> Refer to the GNUstep File System Hierarchy documentation for more info. </desc> </function> <function type="NSString*" name="NSTemporaryDirectory" ovadd="10.0.0"> <desc> Returns the name of a directory in which temporary files can be stored. Under GNUstep this is a location which is not readable by other users. <br /> If a suitable directory can't be found or created, this function raises an NSGenericException. </desc> </function> <function type="NSString*" name="NSUserName" ovadd="1.0.0"> <desc> Return the caller's login name as an NSString object. <br /> Under unix-like systems, the name associated with the current effective user ID is used. <br /> Under ms-windows, the 'LOGNAME' environment is used, or if that fails, the <ref type="function" id="GetUserName"> GetUserName() </ref> call is used to find the user name. <br /> Raises an exception on failure. </desc> </function> </chapter> <!--EndNSPathUtilitiesFunctions--> <!--StartNSProcessInfoFunctions--> <chapter> <heading>NSProcessInfo functions</heading> <p></p> <function type="BOOL" name="GSDebugSet" gvadd="0.0.0" gvrem="1.17.0"> <arg type="NSString*">level</arg> <desc> Function for rapid testing to see if a debug <var>level</var> is set. <br /> This is used by the debugging macros. <br /> If debug logging has been turned off, this returns <code>NO</code> even if the specified <var>level</var> exists in the set of debug levels. </desc> </function> <function type="void" name="GSInitializeProcess" gvadd="0.0.0" gvrem="1.17.0"> <arg type="int">argc</arg> <arg type="char**">argv</arg> <arg type="char**">envp</arg> <desc> Fallback/override function. <br /> The developer must call this method to initialize the NSProcessInfo system if none of the system-specific hacks to auto-initialize it are working. <br /> It is also safe to call this function to override the effects of the automatic initialisation, which some applications may need to do when using GNUstep libraries embedded within other frameworks. </desc> </function> </chapter> <!--EndNSProcessInfoFunctions--> <!--StartNSRangeFunctions--> <chapter> <heading>NSRange functions</heading> <p></p> <function type="BOOL" name="NSEqualRanges" ovadd="1.0.0"> <arg type="NSRange">range1</arg> <arg type="NSRange">range2</arg> <desc> Returns whether <var>range1</var> and <var>range2</var> have same location and length. </desc> </function> <function type="NSRange" name="NSIntersectionRange" ovadd="1.0.0"> <arg type="NSRange">aRange</arg> <arg type="NSRange">bRange</arg> <desc> Returns range containing indices existing in both <var>aRange</var> and <var>bRange</var>. If the returned length is 0, the location is undefined and should be ignored. </desc> </function> <function type="BOOL" name="NSLocationInRange" ovadd="1.0.0"> <arg type="NSUInteger">location</arg> <arg type="NSRange">range</arg> <desc> Returns whether <var>location</var> is greater than or equal to range's <var>location</var> and less than its max. </desc> </function> <function type="NSRange" name="NSMakeRange" ovadd="1.0.0"> <arg type="NSUInteger">location</arg> <arg type="NSUInteger">length</arg> <desc> Creates new range starting at <var>location</var> and of given <var>length</var>. </desc> </function> <function type="NSUInteger" name="NSMaxRange" ovadd="1.0.0"> <arg type="NSRange">range</arg> <desc> Returns top end of <var>range</var> (location + length). </desc> </function> <function type="NSRange" name="NSRangeFromString" ovadd="1.0.0"> <arg type="NSString*">aString</arg> <desc> Parses range from string of form {location=a, length=b}; returns range with 0 location and length if this fails. </desc> </function> <function type="NSString*" name="NSStringFromRange" ovadd="1.0.0"> <arg type="NSRange">range</arg> <desc> Returns string of form {location=a, length=b}. </desc> </function> <function type="NSRange" name="NSUnionRange" ovadd="1.0.0"> <arg type="NSRange">aRange</arg> <arg type="NSRange">bRange</arg> <desc> Returns range going from minimum of aRange's and bRange's locations to maximum of their two max's. </desc> </function> <function type="void" name="_NSRangeExceptionRaise" ovadd="1.0.0"> <desc> Convenience method for raising an NSRangeException. </desc> </function> </chapter> <!--EndNSRangeFunctions--> <!--StartNSSetFunctions--> <chapter> <heading>NSSet functions</heading> <p></p> <function type="void" name="GSUPurge" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSUInteger">count</arg> <desc> This function purges the global <ref type="class" id="NSCountedSet">NSCountedSet</ref> object used for uniquing. It handles locking as necessary. It can be used to purge the set even when uniquing is turned off. </desc> </function> <function type="id" name="GSUSet" ovadd="0.0.0" ovrem="0.0.0"> <arg type="id">anObject</arg> <arg type="NSUInteger">count</arg> <desc> This function sets the <var>count</var> for the specified object. If the <var>count</var> for the object is set to zero then the object is removed from the global uniquing set. The object is added to the set if necessary. The object returned is the one stored in the set. The function handles locking as necessary. It can be used to alter the set even when uniquing is turned off. </desc> </function> <function type="id" name="GSUnique" ovadd="0.0.0" ovrem="0.0.0"> <arg type="id">anObject</arg> <desc> This function <em>uniques</em> the supplied argument, returning the result. It works by using the <ref type="method" id="-unique:"> [-unique:] </ref> method of a global NSCountedSet object. It handles locking as necessary. If uniquing is turned off, it simply returns its argument. </desc> </function> <function type="void" name="GSUniquing" ovadd="0.0.0" ovrem="0.0.0"> <arg type="BOOL">flag</arg> <desc> This function sets the state of a <var>flag</var> that determines the behavior of the <ref type="function" id="GSUnique"> GSUnique() </ref> function. If the <var>flag</var> is on, uniquing is performed, if it is off the function has no effect. The default is for uniquing to be turned off. </desc> </function> </chapter> <!--EndNSSetFunctions--> <!--StartNSThreadFunctions--> <chapter> <heading>NSThread functions</heading> <p></p> <function type="BOOL" name="GSRegisterCurrentThread" gvadd="0.0.0" gvrem="0.0.0"> <desc> <p> This function is provided to let threads started by some other software library register themselves to be used with the GNUstep system. All such threads should call this function before attempting to use any GNUstep objects. </p> <p> Returns <code>YES</code> if the thread can be registered, <code>NO</code> if it is already registered. </p> <p> Sends out a <code>NSWillBecomeMultiThreadedNotification</code> if the process was not already multithreaded. </p> </desc> </function> <function type="void" name="GSUnregisterCurrentThread" gvadd="0.0.0" gvrem="0.0.0"> <desc> <p> This function is provided to let threads started by some other software library unregister themselves from the GNUstep threading system. </p> <p> Calling this function causes a <code>NSThreadWillExitNotification</code> to be sent out, and destroys the GNUstep NSThread object associated with the thread (like <ref type="method" id="+exit" class="NSThread"> [NSThread +exit] </ref> ) but does not exit the underlying thread. </p> </desc> </function> </chapter> <!--EndNSThreadFunctions--> <!--StartNSZoneFunctions--> <chapter> <heading>NSZone functions</heading> <p></p> <function type="BOOL" name="GSAssignZeroingWeakPointer" ovadd="0.0.0" ovrem="0.0.0"> <arg type="void**">destination</arg> <arg type="void*">source</arg> <desc> This function must be used to assign a value to a zeroing weak pointer. <br /> A zeroing weak pointer is one where, when the garbage collector collects the object pointed to, it also clears the weak pointer. <br /> Assigning zero (<code>nil</code>) will always succeed and has the effect of telling the garbage collector that it no longer needs to track the previously assigned object. Apart from that case, a <var>source</var> needs to be garbage collectable for this function to work, and using a non-garbage collectable value will cause the function to return <code>NO</code>. <br /> If the <var>destination</var> object (the weak pointer watching the <var>source</var> object) belongs to a chunk of memory which may be collected before the <var>source</var> object is collected, it is important that it is finalised and the finalisation code assigns zero to the pointer. <br /> If garbage collection is not in use, this function performs a simple assignment returning <code>YES</code>, unless <var>destination</var> is null in which case it returns <code>NO</code>. </desc> </function> <function type="void" name="GSMakeWeakPointer" ovadd="0.0.0" ovrem="0.0.0"> <arg type="Class">theClass</arg> <arg type="const char*">iVarName</arg> <desc> Called during <ref type="method" id="+initialize"> +initialize </ref> to tell the class that instances created in future should have the specified instance variable as a weak pointer for garbage collection. <br /> NB. making a pointer weak does not mean that it is automatically zeroed when the object it points to is garbage collected. To get that behavior you must asign values to the pointer using the <ref type="function" id="GSAssignZeroingWeakPointer"> GSAssignZeroingWeakPointer() </ref> function. <br /> This function has no effect if the system is not built for garbage collection. </desc> </function> <function type="void*" name="GSOutOfMemory" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSUInteger">size</arg> <arg type="BOOL">retry</arg> <desc> Try to get more memory - the normal process has failed. If we can't do anything, just return a null pointer. Try to do some logging if possible. </desc> </function> <function type="void*" name="NSAllocateCollectable" ovadd="10.4.0" ovrem="0.0.0"> <arg type="NSUInteger">size</arg> <arg type="NSUInteger">options</arg> <desc> Allocate memory. If garbage collection is not enabled this uses the default malloc zone and the <var>options</var> are ignored. <br /> If garbage collection is enabled, the allocate memory is normally not scanned for pointers but is itsself garbage collectable. The <var>options</var> argument is a bitmask in which NSScannedOption sets the memory to be scanned for pointers by the garbage collector, and NSCollectorDisabledOption causes the memory to be excempt from being garbage collected itsself. <br /> In any case the memory returned is zero'ed. </desc> </function> <function type="void*" name="NSAllocateMemoryPages" ovadd="1.0.0"> <arg type="NSUInteger">bytes</arg> <desc> Allocate memory for this process and return a pointer to it (or a null pointer on failure). The allocated memory is page aligned and the actual size of memory allocated is a multiple of the page size. </desc> </function> <function type="void" name="NSCopyMemoryPages" ovadd="1.0.0"> <arg type="const void*">src</arg> <arg type="void*">dest</arg> <arg type="NSUInteger">bytes</arg> <desc> Perform an efficient large scale copy of data from <var>src</var> to <var>dest</var>. The value <var>bytes</var> specifies the length of the data copied. </desc> </function> <function type="NSZone*" name="NSCreateZone" ovadd="1.0.0"> <arg type="NSUInteger">start</arg> <arg type="NSUInteger">gran</arg> <arg type="BOOL">canFree</arg> <desc> Creates a new zone of <var>start</var> bytes, which will grow and shrink by granularity bytes. If <var>canFree</var> is 0, memory in zone is allocated but never freed, meaning allocation will be very fast. The whole zone can still be freed with <ref type="function" id="NSRecycleZone"> NSRecycleZone() </ref> , and you should still call NSZoneFree on memory in the zone that is no longer needed, since a count of allocated pointers is kept and must reach zero before freeing the zone. <br /> If Garbage Collection is enabled, this function does nothing other than log a warning and return the same value as the <ref type="function" id="NSDefaultMallocZone"> NSDefaultMallocZone() </ref> function. </desc> </function> <function type="void" name="NSDeallocateMemoryPages" ovadd="1.0.0"> <arg type="void*">ptr</arg> <arg type="NSUInteger">bytes</arg> <desc> Deallocate memory which was previously allocated using the <ref type="function" id="NSAllocateMemoryPages"> NSAllocateMemoryPages() </ref> function. <br /> The <var>bytes</var> argument should be the same as the value passed to the <ref type="function" id="NSAllocateMemoryPages"> NSAllocateMemoryPages() </ref> function. </desc> </function> <function type="NSZone*" name="NSDefaultMallocZone" ovadd="1.0.0"> <desc> Returns the default zone for memory allocation. Memory created in this zone is the same as memory allocates using the system <ref type="function" id="malloc"> malloc() </ref> function. </desc> </function> <function type="NSUInteger" name="NSLogPageSize" ovadd="1.0.0"> <desc> Return log base 2 of the number of bytes in a memory page. </desc> </function> <function type="id" name="NSMakeCollectable" ovadd="1.0.0"> <arg type="const void*">cf</arg> <desc> <em>Description forthcoming.</em> </desc> </function> <function type="NSUInteger" name="NSPageSize" ovadd="1.0.0"> <desc> Return the number of bytes in a memory page. </desc> </function> <function type="NSUInteger" name="NSRealMemoryAvailable" ovadd="1.0.0"> <desc> Return the number of bytes of real (physical) memory available. </desc> </function> <function type="void*" name="NSReallocateCollectable" ovadd="10.4.0" ovrem="0.0.0"> <arg type="void*">ptr</arg> <arg type="NSUInteger">size</arg> <arg type="NSUInteger">options</arg> <desc> Reallocate memory to be of a different <var>size</var> and/or to have different <var>options</var> settings. The behavior of <var>options</var> is as for the <ref type="function" id="NSAllocateCollectable"> NSAllocateCollectable() </ref> function. </desc> </function> <function type="void" name="NSRecycleZone" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <desc> Return memory for an entire <var>zone</var> to system. In fact, this will not be done unless all memory in the <var>zone</var> has been explicitly freed (by calls to NSZoneFree()). For "non-freeable" zones, the number of <ref type="function" id="NSZoneFree"> NSZoneFree() </ref> calls must simply equal the number of allocation calls. The default <var>zone</var>, on the other hand, cannot be recycled. <br /> If Garbage Collection is enabled, this function has not effect. </desc> </function> <function type="NSUInteger" name="NSRoundDownToMultipleOfPageSize" ovadd="1.0.0"> <arg type="NSUInteger">bytes</arg> <desc> Round <var>bytes</var> down to the nearest multiple of the memory page size, and return it. </desc> </function> <function type="NSUInteger" name="NSRoundUpToMultipleOfPageSize" ovadd="1.0.0"> <arg type="NSUInteger">bytes</arg> <desc> Round <var>bytes</var> up to the nearest multiple of the memory page size, and return it. </desc> </function> <function type="void" name="NSSetZoneName" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <arg type="NSString*">name</arg> <desc> Sets <var>name</var> of the given <var>zone</var> (useful for debugging and logging). </desc> </function> <function type="void*" name="NSZoneCalloc" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <arg type="NSUInteger">elems</arg> <arg type="NSUInteger">bytes</arg> <desc> Allocates and returns cleared memory for <var>elems</var> items of size <var>bytes</var>, in the given <var>zone</var>. Returns NULL if allocation of size 0 requested. Raises <code>NSMallocException</code> if not enough free memory in <var>zone</var> to allocate and no more can be obtained from system, unless using the default <var>zone</var>, in which case NULL is returned. <br /> If Garbage Collection is enabled, this function always allocates non-scanned, non-collectable memory in the <ref type="function" id="NSDefaultMallocZone"> NSDefaultMallocZone() </ref> and the <var>zone</var> argument is ignored. </desc> </function> <function type="BOOL" name="NSZoneCheck" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSZone*">zone</arg> <desc> Deprecated... <br /> Checks integrity of a <var>zone</var>. Not defined by OpenStep or OS X. </desc> </function> <function type="void" name="NSZoneFree" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <arg type="void*">ptr</arg> <desc> Frees memory pointed to by <var>ptr</var> (which should have been allocated by a previous call to <ref type="function" id="NSZoneMalloc"> NSZoneMalloc() </ref> , <ref type="function" id="NSZoneCalloc"> NSZoneCalloc() </ref> , or NSZoneRealloc()) and returns it to <var>zone</var>. Note, if this is a nonfreeable <var>zone</var>, the memory is not actually freed, but the count of number of free()s is updated. <br /> If Garbage Collection is enabled, the <var>zone</var> argument is ignored and this function causes <var>ptr</var> to be deallocated immediately. </desc> </function> <function type="NSZone*" name="NSZoneFromPointer" ovadd="1.0.0"> <arg type="void*">ptr</arg> <desc> Searches and finds the zone <var>ptr</var> was allocated from. The speed depends upon the number of zones and their size. <br /> If Garbage Collection is enabled, this function always returns the same as the <ref type="function" id="NSDefaultMallocZone"> NSDefaultMallocZone() </ref> function. </desc> </function> <function type="void*" name="NSZoneMalloc" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <arg type="NSUInteger">size</arg> <desc> Allocates and returns memory for elems items of <var>size</var> bytes, in the given <var>zone</var>. Returns NULL if allocation of <var>size</var> 0 requested. Raises <code>NSMallocException</code> if not enough free memory in <var>zone</var> to allocate and no more can be obtained from system, unless using the default <var>zone</var>, in which case NULL is returned. <br /> If Garbage Collection is enabled, this function always allocates non-scanned, non-collectable memory in the <ref type="function" id="NSDefaultMallocZone"> NSDefaultMallocZone() </ref> and the <var>zone</var> argument is ignored. </desc> </function> <function type="NSString*" name="NSZoneName" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <desc> Returns the name of the given <var>zone</var> (useful for debugging and logging). </desc> </function> <function type="void*" name="NSZoneRealloc" ovadd="1.0.0"> <arg type="NSZone*">zone</arg> <arg type="void*">ptr</arg> <arg type="NSUInteger">size</arg> <desc> Reallocates the chunk of memory in <var>zone</var> pointed to by <var>ptr</var> to a new one of <var>size</var> bytes. Existing contents in <var>ptr</var> are copied over. Raises an <code>NSMallocException</code> if insufficient memory is available in the <var>zone</var> and no more memory can be obtained from the system, unless using the default <var>zone</var>, in which case NULL is returned. <br /> If Garbage Collection is enabled, the <var>zone</var> argument is ignored. </desc> </function> <function type="struct NSZoneStats" name="NSZoneStats" ovadd="0.0.0" ovrem="0.0.0"> <arg type="NSZone*">zone</arg> <desc> Deprecated... <br /> Obtain statistics about the <var>zone</var>. Implementation emphasis is on correctness, not speed. Not defined by OpenStep or OS X. </desc> </function> </chapter> <!--EndNSZoneFunctions--> <!--EndFunctions--> </body> </gsdoc>