From 7234fdbb0cb0dd45ed1d6e7814c91e596126ee25 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Mon, 9 Oct 2017 11:54:11 +0200 Subject: Implement matching on the calltrace (#17) * Implement matching on the calltrace--- src/sp_list.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/sp_list.c') diff --git a/src/sp_list.c b/src/sp_list.c index 04154b7..112d822 100644 --- a/src/sp_list.c +++ b/src/sp_list.c @@ -35,3 +35,21 @@ void sp_list_insert(sp_node_t *list, void *data) { list->next = new; } } + +void sp_list_prepend(sp_node_t *list, void *data) { + if (list->head == NULL) { + list->data = data; + list->next = NULL; + list->head = list; + } else { + sp_node_t *new = pecalloc(sizeof(*new), 1, 1); + + new->next = list->next; + list->next = new; + + new->head = list; + + new->data = list->data; + list->data = data; + } +} \ No newline at end of file -- cgit v1.3