summaryrefslogtreecommitdiffstats
path: root/list.c
diff options
context:
space:
mode:
authorFreeArtMan <dos21h@gmail.com>2015-06-09 17:51:57 +0300
committerFreeArtMan <dos21h@gmail.com>2015-06-09 17:51:57 +0300
commit712439932ce9ac04fa6354cd4603046232121974 (patch)
tree26b9db563fd09d353add5ea4abdddd0d3b1edacb /list.c
parent5e5e5b1cbcb98eda7e0c52a367c66b944b480eda (diff)
downloadmicrobbs-712439932ce9ac04fa6354cd4603046232121974.tar.gz
microbbs-712439932ce9ac04fa6354cd4603046232121974.zip
Added twitting messages
Diffstat (limited to 'list.c')
-rw-r--r--list.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/list.c b/list.c
index 7e7f732..a6e5e83 100644
--- a/list.c
+++ b/list.c
@@ -90,6 +90,24 @@ void* llist_pop( struct List *list )
return NULL;
}
+void* llist_popf( struct List *list )
+{
+ void *ptr = NULL;
+ struct ListNode *node = list->first;
+ struct ListNode *next;
+ if ( node )
+ {
+ next = node->next;
+
+ list->count -= 1;
+ list->first = next;
+ if ( list->first == NULL )
+ list->last = NULL;
+ ptr = node->val;
+ free( node );
+ }
+ return ptr;
+}
void llist_push( struct List *list, void *ptr )
{