/**************************************************************************1*2* Copyright 2010 LunarG, Inc.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR18* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,19* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL20* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER21* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING22* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER23* DEALINGS IN THE SOFTWARE.24*25**************************************************************************/262728#ifndef EGLARRAY_INCLUDED29#define EGLARRAY_INCLUDED3031#include "c99_compat.h"3233#include "egltypedefs.h"343536#ifdef __cplusplus37extern "C" {38#endif3940typedef EGLBoolean (*_EGLArrayForEach)(void *elem, void *foreach_data);414243struct _egl_array {44const char *Name;45EGLint MaxSize;4647void **Elements;48EGLint Size;49};505152extern _EGLArray *53_eglCreateArray(const char *name, EGLint init_size);545556extern void57_eglDestroyArray(_EGLArray *array, void (*free_cb)(void *));585960extern void61_eglAppendArray(_EGLArray *array, void *elem);626364extern void65_eglEraseArray(_EGLArray *array, EGLint i, void (*free_cb)(void *));666768void *69_eglFindArray(_EGLArray *array, void *elem);707172extern EGLint73_eglFilterArray(_EGLArray *array, void **data, EGLint size,74_EGLArrayForEach filter, void *filter_data);757677EGLint78_eglFlattenArray(_EGLArray *array, void *buffer, EGLint elem_size, EGLint size,79_EGLArrayForEach flatten);808182static inline EGLint83_eglGetArraySize(_EGLArray *array)84{85return (array) ? array->Size : 0;86}878889#ifdef __cplusplus90}91#endif9293#endif /* EGLARRAY_INCLUDED */949596