From ab6e81997cf8c5bcf7d1778bb32d8e01425b13f1 Mon Sep 17 00:00:00 2001 From: "Rafael G. Martins" Date: Thu, 22 Dec 2016 20:48:33 +0100 Subject: common: utils: added bc_slist_pop() --- src/common/utils.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/common/utils.c') diff --git a/src/common/utils.c b/src/common/utils.c index 97fa671..c78229d 100644 --- a/src/common/utils.c +++ b/src/common/utils.c @@ -105,6 +105,19 @@ bc_slist_length(bc_slist_t *l) } +bc_slist_t* +bc_slist_pop(bc_slist_t *l, void **data) +{ + if (l == NULL) + return l; + bc_slist_t *tmp = l; + l = l->next; + *data = tmp->data; + free(tmp); + return l; +} + + char* bc_strdup(const char *s) { -- cgit v1.2.3-18-g5258