diff 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
line wrap: on
line diff
--- a/include/mb_types.h	Wed Dec 10 17:15:26 2008 +0800
+++ b/include/mb_types.h	Fri Dec 12 00:33:54 2008 +0800
@@ -224,4 +224,27 @@
     mb_obj_t *(*get_obj_with_name)(mb_sprite_t *sprite, const char *id);
 };
 
+
+/*! \defgroup mb_sprite_lsym Sprite with linear symbol table.
+ * @{
+ */ 
+struct _mb_sprite_lsym_entry {
+    const char *sym;
+    const int offset;
+};
+typedef struct _mb_sprite_lsym_entry mb_sprite_lsym_entry_t;
+
+/*! \brief A sub-type of mb_sprite_t with linear symbol table.
+ *
+ * This type of sprite search symbols with linear/or binary searching.
+ */
+struct _mb_sprite_lsym {
+    mb_sprite_t sprite;
+    int num_entries;
+    mb_sprite_lsym_entry_t *entries;
+};
+typedef struct _mb_sprite_lsym mb_sprite_lsym_t;
+
+/* @} */
+
 #endif /* __MB_TYPES_H_ */