os/graphics/graphicscomposition/openwfcompositionengine/common/include/owfarray.h
Update contrib.
1 /* Copyright (c) 2009 The Khronos Group Inc.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and/or associated documentation files (the
5 * "Materials"), to deal in the Materials without restriction, including
6 * without limitation the rights to use, copy, modify, merge, publish,
7 * distribute, sublicense, and/or sell copies of the Materials, and to
8 * permit persons to whom the Materials are furnished to do so, subject to
9 * the following conditions:
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Materials.
14 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20 * MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
34 typedef void* OWF_ARRAY_ITEM;
37 OWF_ARRAY_ITEM* items;
43 * Initialize array object
45 * \param array Array object
48 OWF_Array_Initialize(OWF_ARRAY* array);
51 * Reset array. Frees resources allocated by the array.
52 * Doesn't destroy the actual contents (managed
53 * by the array user). The array can be safely reused afterwards.
55 * \param array Array object
58 OWF_Array_Reset(OWF_ARRAY* array);
61 * Destroy array. Free all resources allocated
64 * \param array Array object
67 OWF_Array_Destroy(OWF_ARRAY* array);
70 * Append item to array
72 * \param array Array object
73 * \param item Item to add
75 * \return OWF_TRUE if the operation succeeded, OWF_FALSE otherwise
77 OWF_API_CALL OWFboolean
78 OWF_Array_AppendItem(OWF_ARRAY* array,
82 * Insert item into the array
84 * \param array Array object
85 * \param position Where the item should be inserted at
86 * \param item Item to insert
88 * \return OWF_TRUE if the operation succeeded, OWF_FALSE otherwise
90 OWF_API_CALL OWFboolean
91 OWF_Array_InsertItem(OWF_ARRAY* array,
96 * Remove item (by value) from the array
98 * \param array Array object
99 * \param item Item to remove
101 * \return Removed item or NULL if the item is invalid.
104 OWF_API_CALL OWF_ARRAY_ITEM
105 OWF_Array_RemoveItem(OWF_ARRAY* array,
106 OWF_ARRAY_ITEM item);
109 * Remove item (by index) from the array
111 * \param array Array object
112 * \param position Index of the item to remove
114 * \return Removed item or NULL if the index is out of bounds.
116 OWF_API_CALL OWF_ARRAY_ITEM
117 OWF_Array_RemoveItemAt(OWF_ARRAY* array,
121 * Get item from array
123 * \param array Array object
124 * \param position Index of the item to fetch (0..array.length-1)
126 * \return Item or NULL, if the position argument is out of bounds.
129 OWF_API_CALL OWF_ARRAY_ITEM
130 OWF_Array_GetItemAt(OWF_ARRAY* array,