* hb_list_add ********************************************************************** * Adds an item at the end of the list, making it bigger if necessary. * Can safely be called with a NULL pointer to add, it will be ignored. *********************************************************************/
| 4128 | * Can safely be called with a NULL pointer to add, it will be ignored. |
| 4129 | *********************************************************************/ |
| 4130 | void hb_list_add( hb_list_t * l, void * p ) |
| 4131 | { |
| 4132 | if( !p ) |
| 4133 | { |
| 4134 | return; |
| 4135 | } |
| 4136 | |
| 4137 | if( l->items_count == l->items_alloc ) |
| 4138 | { |
| 4139 | /* We need a bigger boat */ |
| 4140 | l->items_alloc += HB_LIST_DEFAULT_SIZE; |
| 4141 | l->items = realloc( l->items, |
| 4142 | l->items_alloc * sizeof( void * ) ); |
| 4143 | } |
| 4144 | |
| 4145 | l->items[l->items_count] = p; |
| 4146 | (l->items_count)++; |
| 4147 | } |
| 4148 | |
| 4149 | void hb_list_add_dup( hb_list_t * l, void * p, int size ) |
| 4150 | { |
no outgoing calls