Rev 4743 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4743 | Rev 4756 | ||
---|---|---|---|
Line 49... | Line 49... | ||
49 | /** Internal magic value for an item consistency check. |
49 | /** Internal magic value for an item consistency check. |
50 | */ |
50 | */ |
51 | #define INT_MAP_ITEM_MAGIC_VALUE 0x55667788 |
51 | #define INT_MAP_ITEM_MAGIC_VALUE 0x55667788 |
52 | 52 | ||
53 | /** Integer to generic type map declaration. |
53 | /** Integer to generic type map declaration. |
54 | * @param name Name of the map. Input parameter. |
54 | * @param[in] name Name of the map. |
55 | * @param type Inner object type. Input parameter |
55 | * @param[in] type Inner object type. |
56 | */ |
56 | */ |
57 | #define INT_MAP_DECLARE( name, type ) \ |
57 | #define INT_MAP_DECLARE( name, type ) \ |
58 | \ |
58 | \ |
59 | typedef struct name name##_t; \ |
59 | typedef struct name name##_t; \ |
60 | typedef name##_t * name##_ref; \ |
60 | typedef name##_t * name##_ref; \ |
Line 87... | Line 87... | ||
87 | void name##_item_destroy( name##_item_ref item ); \ |
87 | void name##_item_destroy( name##_item_ref item ); \ |
88 | int name##_item_is_valid( name##_item_ref item ); |
88 | int name##_item_is_valid( name##_item_ref item ); |
89 | 89 | ||
90 | /** Integer to generic type map implementation. |
90 | /** Integer to generic type map implementation. |
91 | * Should follow declaration with the same parameters. |
91 | * Should follow declaration with the same parameters. |
92 | * @param name Name of the map. Input parameter. |
92 | * @param[in] name Name of the map. |
93 | * @param type Inner object type. Input parameter |
93 | * @param[in] type Inner object type. |
94 | */ |
94 | */ |
95 | #define INT_MAP_IMPLEMENT( name, type ) \ |
95 | #define INT_MAP_IMPLEMENT( name, type ) \ |
96 | \ |
96 | \ |
97 | int name##_add( name##_ref map, int key, type * value ){ \ |
97 | int name##_add( name##_ref map, int key, type * value ){ \ |
98 | if( name##_is_valid( map )){ \ |
98 | if( name##_is_valid( map )){ \ |