Up

Functions

Authors

Richard Frith-Macdonald

Contents -

  1. Function index
  2. Macro index
  3. GSCategories functions
  4. GSIArray functions
  5. GSIMap functions
  6. GSObjCRuntime functions

Function index

Function

Macro index

GSCategories functions

GSCurrentThread

NSThread* GSCurrentThread();

Description forthcoming.


GSCurrentThreadDictionary

NSMutableDictionary* GSCurrentThreadDictionary();

Description forthcoming.


GSDebugFunctionMsg

NSString* GSDebugFunctionMsg(const char* func, const char* file, int line, NSString* fmt);

Description forthcoming.


GSDebugMethodMsg

NSString* GSDebugMethodMsg(id obj, SEL sel, const char* file, int line, NSString* fmt);

Description forthcoming.


GSDebugSet

BOOL GSDebugSet(NSString* level);

Description forthcoming.


GSEncodingName

NSString* GSEncodingName(NSStringEncoding availableEncodingValue);

Description forthcoming.


GetEncodingName

NSString* GetEncodingName(NSStringEncoding availableEncodingValue);

Description forthcoming.


NSDecimalFromComponents

void NSDecimalFromComponents(NSDecimal* result, unsigned long long int mantissa, short int exponent, BOOL negative);

Description forthcoming.


NSStandardLibraryPaths

NSArray* NSStandardLibraryPaths();

Description forthcoming.


GSIArray functions

GSIArrayAddItem

void GSIArrayAddItem(GSIArray array, GSIArrayItem item);

Description forthcoming.


GSIArrayAddItemNoRetain

void GSIArrayAddItemNoRetain(GSIArray array, GSIArrayItem item);

Description forthcoming.


GSIArrayCapacity

unsigned int GSIArrayCapacity(GSIArray array);

Description forthcoming.


GSIArrayCheckSort

void GSIArrayCheckSort(GSIArray array, NSComparisonResult(*) sorter);

Description forthcoming.


GSIArrayClear

void GSIArrayClear(GSIArray array);

Description forthcoming.


GSIArrayCopyWithZone

GSIArray GSIArrayCopyWithZone(GSIArray array, NSZone* zone);

Description forthcoming.


GSIArrayCount

unsigned int GSIArrayCount(GSIArray array);

Description forthcoming.


GSIArrayEmpty

void GSIArrayEmpty(GSIArray array);

Description forthcoming.


GSIArrayGrow

void GSIArrayGrow(GSIArray array);

Description forthcoming.


GSIArrayGrowTo

void GSIArrayGrowTo(GSIArray array, unsigned int next);

Description forthcoming.


GSIArrayInitWithZoneAndCapacity

GSIArray GSIArrayInitWithZoneAndCapacity(GSIArray array, NSZone* zone, size_t capacity);

Description forthcoming.


GSIArrayInitWithZoneAndStaticCapacity

GSIArray GSIArrayInitWithZoneAndStaticCapacity(GSIArray array, NSZone* zone, size_t capacity, GSIArrayItem* buffer);

Description forthcoming.


GSIArrayInsertItem

void GSIArrayInsertItem(GSIArray array, GSIArrayItem item, unsigned int index);

Description forthcoming.


GSIArrayInsertItemNoRetain

void GSIArrayInsertItemNoRetain(GSIArray array, GSIArrayItem item, unsigned int index);

Description forthcoming.


GSIArrayInsertSorted

void GSIArrayInsertSorted(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);

Description forthcoming.


GSIArrayInsertSortedNoRetain

void GSIArrayInsertSortedNoRetain(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);

Description forthcoming.


GSIArrayInsertionPosition

unsigned int GSIArrayInsertionPosition(GSIArray array, GSIArrayItem item, NSComparisonResult(*) sorter);

Description forthcoming.


GSIArrayItemAtIndex

GSIArrayItem GSIArrayItemAtIndex(GSIArray array, unsigned int index);

Description forthcoming.


GSIArrayItems

GSIArrayItem* GSIArrayItems(GSIArray array);

Description forthcoming.


GSIArrayLastItem

GSIArrayItem GSIArrayLastItem(GSIArray array);

Description forthcoming.


GSIArrayRemoveAllItems

void GSIArrayRemoveAllItems(GSIArray array);

Description forthcoming.


GSIArrayRemoveItemAtIndex

void GSIArrayRemoveItemAtIndex(GSIArray array, unsigned int index);

Description forthcoming.


GSIArrayRemoveItemAtIndexNoRelease

void GSIArrayRemoveItemAtIndexNoRelease(GSIArray array, unsigned int index);

Description forthcoming.


GSIArrayRemoveItemsFromIndex

void GSIArrayRemoveItemsFromIndex(GSIArray array, unsigned int index);

Description forthcoming.


GSIArrayRemoveLastItem

void GSIArrayRemoveLastItem(GSIArray array);

Description forthcoming.


GSIArraySetItemAtIndex

void GSIArraySetItemAtIndex(GSIArray array, GSIArrayItem item, unsigned int index);

Description forthcoming.


GSIMap functions

GSIMapAddKey

GSIMapNode GSIMapAddKey(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapAddKeyNoRetain

GSIMapNode GSIMapAddKeyNoRetain(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapAddNodeToBucket

void GSIMapAddNodeToBucket(GSIMapBucket bucket, GSIMapNode node);

Description forthcoming.


GSIMapAddNodeToMap

void GSIMapAddNodeToMap(GSIMapTable map, GSIMapNode node);

Description forthcoming.


GSIMapAddPair

GSIMapNode GSIMapAddPair(GSIMapTable map, GSIMapKey key, GSIMapVal value);

Description forthcoming.


GSIMapAddPairNoRetain

GSIMapNode GSIMapAddPairNoRetain(GSIMapTable map, GSIMapKey key, GSIMapVal value);

Description forthcoming.


GSIMapBucketForKey

GSIMapBucket GSIMapBucketForKey(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapCleanMap

void GSIMapCleanMap(GSIMapTable map);

Description forthcoming.


GSIMapEmptyMap

void GSIMapEmptyMap(GSIMapTable map);

Description forthcoming.


GSIMapEndEnumerator

void GSIMapEndEnumerator(GSIMapEnumerator enumerator);

Tidies up after map enumeration... effectively destroys the enumerator.


GSIMapEnumeratorBucket

GSIMapBucket GSIMapEnumeratorBucket(GSIMapEnumerator enumerator);

Returns the bucket from which the next node in the enumeration will come. Once the next node has been enumerated, you can use the bucket and node to remove the node from the map using the GSIMapRemoveNodeFromMap() function.


GSIMapEnumeratorForMap

GSIMapEnumerator_t GSIMapEnumeratorForMap(GSIMapTable map);

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.


GSIMapEnumeratorNextNode

GSIMapNode GSIMapEnumeratorNextNode(GSIMapEnumerator enumerator);

Returns the next node in the map, or a nul pointer if at the end.


GSIMapFreeNode

void GSIMapFreeNode(GSIMapTable map, GSIMapNode node);

Description forthcoming.


GSIMapInitWithZoneAndCapacity

void GSIMapInitWithZoneAndCapacity(GSIMapTable map, NSZone* zone, size_t capacity);

Description forthcoming.


GSIMapLinkNodeIntoBucket

void GSIMapLinkNodeIntoBucket(GSIMapBucket bucket, GSIMapNode node);

Description forthcoming.


GSIMapMoreNodes

void GSIMapMoreNodes(GSIMapTable map, unsigned int required);

Description forthcoming.


GSIMapNewNode

GSIMapNode GSIMapNewNode(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapNodeForKey

GSIMapNode GSIMapNodeForKey(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapNodeForKeyInBucket

GSIMapNode GSIMapNodeForKeyInBucket(GSIMapTable map, GSIMapBucket bucket, GSIMapKey key);

Description forthcoming.


GSIMapNodeForSimpleKey

GSIMapNode GSIMapNodeForSimpleKey(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapPickBucket

GSIMapBucket GSIMapPickBucket(unsigned int hash, GSIMapBucket buckets, size_t bucketCount);

Description forthcoming.


GSIMapRemangleBuckets

void GSIMapRemangleBuckets(GSIMapTable map, GSIMapBucket old_buckets, size_t old_bucketCount, GSIMapBucket new_buckets, size_t new_bucketCount);

Description forthcoming.


GSIMapRemoveKey

void GSIMapRemoveKey(GSIMapTable map, GSIMapKey key);

Description forthcoming.


GSIMapRemoveNodeFromBucket

void GSIMapRemoveNodeFromBucket(GSIMapBucket bucket, GSIMapNode node);

Description forthcoming.


GSIMapRemoveNodeFromMap

void GSIMapRemoveNodeFromMap(GSIMapTable map, GSIMapBucket bkt, GSIMapNode node);

Description forthcoming.


GSIMapResize

void GSIMapResize(GSIMapTable map, size_t new_capacity);

Description forthcoming.


GSIMapRightSizeMap

void GSIMapRightSizeMap(GSIMapTable map, size_t capacity);

Description forthcoming.


GSIMapUnlinkNodeFromBucket

void GSIMapUnlinkNodeFromBucket(GSIMapBucket bucket, GSIMapNode node);

Description forthcoming.


GSObjCRuntime functions

GSAddMethodList

void GSAddMethodList(Class class, GSMethodList list, BOOL toInstanceMethods);

Add the method list to the class as the first list to be searched during method invocation for the given class. Depending on toInstanceMethods, this list will be added as an instance or a class method list. If the list is in use by another class , behavior is undefined. Create a new list with GSAllocMethodList() or use GSRemoveMethodList() to remove a list before inserting it in a class.

After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.

This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.


GSAllocMethodList

GSMethodList GSAllocMethodList(unsigned int count);

Returns a pointer to objc_malloc'ed memory large enough to hold a struct objc_method_list with 'count' number of struct objc_method entries. The memory returned is initialized with 0, including the method count and next method list fields.

This function is intended for use in conjunction with GSAppendMethodToList() to fill the memory and GSAddMethodList() to activate the method list.

After method list manipulation you should call GSFlushMethodCacheForClass() for the changes to take effect.

WARNING: Manipulating the runtime structures can be hazardous!

This function should currently (June 2004) be considered WIP. Please follow potential changes (Name, parameters,...) closely until it stabilizes.


GSAllocateMutexAt

void GSAllocateMutexAt(objc_mutex_t* request);

Allocate a new objc_mutex_t and store it in the location pointed to by request. A mutex is only created if the value pointed to by request is NULL. This function is thread safe in the sense that multiple threads my call this function with the same value of request and only one will actually set the mutex. It is the users responsibility that no one else attempts to set the mutex pointed to. This function should be used with objc_mutex_t variables which were statically initialized to NULL like:

 void function (void)
 {
   static objc_mutex_t my_lock = NULL;
   if (my_lock == NULL)
     GSAllocateMutexAt(



Up