|
SDLGameEngine
|
00001 #ifndef _SGEARRAY_H 00002 #define _SGEARRAY_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 00012 /* 00013 * Copyright (c) 2007 Heiko Irrgang 00014 * 00015 * The license and distribution terms for this file may be 00016 * found in the file COPYING in this distribution or at 00017 * http://93-interactive.com/cms/products/software/sdl-game-engine/license/ 00018 */ 00019 00033 typedef struct { 00037 Uint32 numberOfElements; 00038 00042 void **element; 00043 void (*freeFunction)(Uint32, void *); 00044 } SGEARRAY; 00045 00052 SGEARRAY *sgeArrayNew(void); 00053 00063 SGEARRAY *sgeAutoArrayNew(void (*function)(Uint32, void *)); 00064 00074 void sgeArrayDestroy(SGEARRAY *a); 00075 00082 void sgeArrayAdd(SGEARRAY *a, void *e); 00083 00091 void sgeArrayInsert(SGEARRAY *a, Uint32 offset, void *e); 00092 00100 void sgeArrayReplace(SGEARRAY *a, Uint32 offset, void *e); 00101 00108 void *sgeArrayGet(SGEARRAY *a, Uint32 offset); 00109 00119 void sgeArrayRemove(SGEARRAY *a, Uint32 offset); 00120 00131 void sgeArrayForEach(SGEARRAY *a, void function(Uint32, void *)); 00132 00138 extern Uint32 sgeArraySize(SGEARRAY *a); 00139 00140 // }@ 00141 00142 #ifdef __cplusplus 00143 } 00144 #endif 00145 00146 #endif