SDLGameEngine

include/sgelist.h

Go to the documentation of this file.
00001 #ifndef _SGEMEM_H
00002 #define _SGEMEN_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 
00031 typedef struct {
00035         char *id;
00036 
00040         void *data;
00041 
00043         void *prev;
00044         void *next;
00045 } SGELISTENTRY;
00046 
00047 typedef struct {
00051         Uint32 numberOfEntries;
00052 
00054         SGELISTENTRY *first;
00055         SGELISTENTRY *last;
00056         SGELISTENTRY *entries;
00057 } SGELIST;
00058 
00066 typedef void(SGELISTFUNCTION)(const char *id, void *data);
00067 
00074 SGELIST *sgeListNew(void);
00075 
00083 SGELISTENTRY *sgeListAdd(SGELIST *l, const char *id, void *data);
00084 
00093 SGELISTENTRY *sgeListInsert(SGELIST *l, SGELISTENTRY *le, const char *id, void *data);
00094 
00101 SGELISTENTRY *sgeListSearch(SGELIST *l, char *id);
00102 
00111 void sgeListRemove(SGELIST *l, char *id);
00112 
00120 void sgeListForEach(SGELIST *l, SGELISTFUNCTION function);
00121 
00127 void sgeListDestroy(SGELIST *l);
00128 
00129 // }@
00130 
00131 #ifdef __cplusplus
00132 }
00133 #endif
00134 
00135 #endif
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines