Mercurial > MadButterfly
comparison include/mb_types.h @ 210:3fadd2f2742e
M4 macros to generate code for dynamic loading.
- Introduce sprite.
- Add mb_sprite_t and mb_sprite_lsym_t
- mb_sprite_lsym_t is sprite with symbol that searched with linear search.
- Add mb_sprite_lsym_t as first member variable of sprite.
- Add symbol table to generated C code.
author | Thinker K.F. Li <thinker@branda.to> |
---|---|
date | Fri, 12 Dec 2008 00:33:54 +0800 |
parents | 6f63aa67ed83 |
children | 41eab0a10651 |
comparison
equal
deleted
inserted
replaced
209:6f63aa67ed83 | 210:3fadd2f2742e |
---|---|
222 struct _mb_sprite { | 222 struct _mb_sprite { |
223 void (*free)(mb_sprite_t *); | 223 void (*free)(mb_sprite_t *); |
224 mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id); | 224 mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id); |
225 }; | 225 }; |
226 | 226 |
227 | |
228 /*! \defgroup mb_sprite_lsym Sprite with linear symbol table. | |
229 * @{ | |
230 */ | |
231 struct _mb_sprite_lsym_entry { | |
232 const char *sym; | |
233 const int offset; | |
234 }; | |
235 typedef struct _mb_sprite_lsym_entry mb_sprite_lsym_entry_t; | |
236 | |
237 /*! \brief A sub-type of mb_sprite_t with linear symbol table. | |
238 * | |
239 * This type of sprite search symbols with linear/or binary searching. | |
240 */ | |
241 struct _mb_sprite_lsym { | |
242 mb_sprite_t sprite; | |
243 int num_entries; | |
244 mb_sprite_lsym_entry_t *entries; | |
245 }; | |
246 typedef struct _mb_sprite_lsym mb_sprite_lsym_t; | |
247 | |
248 /* @} */ | |
249 | |
227 #endif /* __MB_TYPES_H_ */ | 250 #endif /* __MB_TYPES_H_ */ |