/* Core Foundation arrays. Copyright (C) 2001 Johan Rydberg. All Rights Reserved. This file is part of Crust. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef __CoreFoundation_CFArray_h #define __CoreFoundation_CFArray_h 1 #include struct CFArray { CFRuntimeBase runtime_base; int count; int max_count; CFTypeRef *array; }; typedef struct CFArray *CFArrayRef; /* Create a new array from C array ARRAY. COUNT is number of elements in ARRAY. ARRAY can be NULL if count is zero. */ CF_EXTERN CFArrayRef CFArrayCreate (int count, CFTypeRef *array); /* Returns number of elements in ARRAY. */ CF_EXTERN int CFArrayCount (CFArrayRef array); /* Returns element at POSITION in ARRAY. */ CF_EXTERN CFTypeRef CFArrayAt (CFArrayRef array, int position); /* Set element at POSITION in ARRAY to VALUE. POSITION may not be greater than current number of elements + 1. */ CF_EXTERN void CFArraySetAt (CFArrayRef array, int position, CFTypeRef value); /* Convenience function for inserting VALUE at the end of ARRAY. */ CF_EXTERN void CFArrayAppend (CFArrayRef array, CFTypeRef value); /* Return position for VALUE in ARRAY. Returns a negative value if VALUE was not to be found in ARRAY. */ CF_EXTERN int CFArrayValueAt (CFArrayRef array, CFTypeRef value); #endif /* CFArray.h */