[Biococoa-dev] Greetings

Scott Christley schristley at mac.com
Sun Sep 24 17:45:28 EDT 2006

On Sep 22, 2006, at 10:07 PM, Koen van der Drift wrote:

> I am not familiar with GNUStep, but from what you are writing, we  
> need to start using macros for various functions?

Yes, it looks to be straight forward as most use of CoreFoundation  
appears to be working with arrays.  So I've created an internal  
header file with macros like this.

// Variable declarations
#define DECLARE_INDEX(variable) CFIndex variable

// Range operations
#define MAKE_RANGE(location, length) \
      CFRangeMake( (location), (length) )

// Array operations
#define ARRAY_GET_VALUE_AT_INDEX(array, index) \
      CFArrayGetValueAtIndex( (CFMutableArrayRef) (array), (index) )

#define ARRAY_APPEND_VALUE(array, object) \
      CFArrayAppendValue ( (CFMutableArrayRef) (array), (object) )

#define ARRAY_INSERT_VALUE_AT_INDEX(array, index, object) \
      CFArrayInsertValueAtIndex ( (CFMutableArrayRef) (array),  
(index), (object) )

#define ARRAY_RANGE_CONTAINS_VALUE(array, range, object) \
      CFArrayContainsValue ( (CFArrayRef) (array), (range), (object) )

#define ARRAY_GET_COUNT(array) \
      CFArrayGetCount ( (CFArrayRef) (array) )

// Set operations
#define SET_CONTAINS_VALUE(set, object) \
      CFSetContainsValue( (CFSetRef) (set), (object));


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.bioinformatics.org/pipermail/biococoa-dev/attachments/20060924/fb92bc55/attachment.html>

More information about the Biococoa-dev mailing list