00001 /* 00002 * squareball: A general-purpose library for C99. 00003 * Copyright (C) 2014-2018 Rafael G. Martins <rafael@rafaelmartins.eng.br> 00004 * 00005 * This program can be distributed under the terms of the BSD License. 00006 * See the file LICENSE. 00007 */ 00008 00009 #ifndef _SQUAREBALL_SLIST_H 00010 #define _SQUAREBALL_SLIST_H 00011 00012 #include "sb-mem.h" 00013 00022 typedef struct _sb_slist_t { 00023 00025 struct _sb_slist_t *next; 00026 00028 void *data; 00029 00030 } sb_slist_t; 00031 00040 sb_slist_t* sb_slist_append(sb_slist_t *l, void *data); 00041 00050 sb_slist_t* sb_slist_prepend(sb_slist_t *l, void *data); 00051 00057 void sb_slist_free(sb_slist_t *l); 00058 00066 void sb_slist_free_full(sb_slist_t *l, sb_free_func_t free_func); 00067 00074 size_t sb_slist_length(sb_slist_t *l); 00075 00078 #endif /* _SQUAREBALL_SLIST_H */