callback to count number of instructions in uc_emu_start() should be executed first. fix #727
This commit is contained in:
22
list.c
22
list.c
@ -22,6 +22,28 @@ void list_clear(struct list *list)
|
||||
list->tail = NULL;
|
||||
}
|
||||
|
||||
// insert a new item at the begin of the list.
|
||||
// returns generated linked list node, or NULL on failure
|
||||
void *list_insert(struct list *list, void *data)
|
||||
{
|
||||
struct list_item *item = malloc(sizeof(struct list_item));
|
||||
if (item == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
item->data = data;
|
||||
item->next = list->head;
|
||||
|
||||
if (list->tail == NULL) {
|
||||
list->tail = item;
|
||||
}
|
||||
|
||||
list->head = item;
|
||||
|
||||
return item;
|
||||
}
|
||||
|
||||
// append a new item at the end of the list.
|
||||
// returns generated linked list node, or NULL on failure
|
||||
void *list_append(struct list *list, void *data)
|
||||
{
|
||||
|
Reference in New Issue
Block a user