squareball 0.2.0.28-7bb8 A general-purpose library for C99

- Main Page
- Data Structures
- Files
- Examples

- File List
- Globals

All Data Structures Files Functions Variables Typedefs
sb-slist.h
Go to the documentation of this file.
1 /*
2 * squareball: A general-purpose library for C99.
3 * Copyright (C) 2014-2018 Rafael G. Martins <rafael@rafaelmartins.eng.br>
4 *
5 * This program can be distributed under the terms of the BSD License.
6 * See the file LICENSE.
7 */
8
9 #ifndef _SQUAREBALL_SLIST_H
10 #define _SQUAREBALL_SLIST_H
11
12 #include "sb-mem.h"
13
22 typedef struct _sb_slist_t {
23
25 struct _sb_slist_t *next;
26
28 void *data;
29
30 } sb_slist_t;
31
40 sb_slist_t* sb_slist_append(sb_slist_t *l, void *data);
41
50 sb_slist_t* sb_slist_prepend(sb_slist_t *l, void *data);
51
57 void sb_slist_free(sb_slist_t *l);
58
66 void sb_slist_free_full(sb_slist_t *l, sb_free_func_t free_func);
67
74 size_t sb_slist_length(sb_slist_t *l);
75
78 #endif /* _SQUAREBALL_SLIST_H */
sb_slist_free
void sb_slist_free(sb_slist_t *l)
sb_slist_free_full
void sb_slist_free_full(sb_slist_t *l, sb_free_func_t free_func)
sb_slist_prepend
sb_slist_t * sb_slist_prepend(sb_slist_t *l, void *data)
sb_slist_length
size_t sb_slist_length(sb_slist_t *l)
sb_slist_t::next
struct _sb_slist_t * next
Definition: sb-slist.h:25
sb_slist_t
Definition: sb-slist.h:22
sb_slist_t::data
void * data
Definition: sb-slist.h:28
sb-mem.h
Memory allocation related helpers.
sb_free_func_t
void(* sb_free_func_t)(void *ptr)
Definition: sb-mem.h:29
sb_slist_append
sb_slist_t * sb_slist_append(sb_slist_t *l, void *data)