2020-06-16 21:57:41 +00:00
|
|
|
#ifndef WFP_SLIST_H
|
|
|
|
#define WFP_SLIST_H
|
2019-04-17 20:51:16 +00:00
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
#include <stdbool.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_slist_item
|
2019-04-17 20:51:16 +00:00
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_slist_item * next;
|
2019-04-17 20:51:16 +00:00
|
|
|
};
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_slist
|
2019-04-17 20:51:16 +00:00
|
|
|
{
|
2020-06-16 21:57:41 +00:00
|
|
|
struct wfp_slist_item head;
|
|
|
|
struct wfp_slist_item * last;
|
2019-04-17 20:51:16 +00:00
|
|
|
};
|
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void wfp_slist_init(
|
|
|
|
struct wfp_slist * list);
|
2019-04-17 20:51:16 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern bool wfp_slist_empty(
|
|
|
|
struct wfp_slist * list);
|
2019-04-17 20:51:16 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern struct wfp_slist_item * wfp_slist_first(
|
|
|
|
struct wfp_slist * list);
|
2019-04-26 18:50:57 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern void wfp_slist_append(
|
|
|
|
struct wfp_slist * list,
|
|
|
|
struct wfp_slist_item * item);
|
2019-04-17 20:51:16 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern struct wfp_slist_item * wfp_slist_remove_first(
|
|
|
|
struct wfp_slist * list);
|
2019-04-17 20:51:16 +00:00
|
|
|
|
2020-06-16 21:57:41 +00:00
|
|
|
extern struct wfp_slist_item * wfp_slist_remove_after(
|
|
|
|
struct wfp_slist * list,
|
|
|
|
struct wfp_slist_item * prev);
|
2019-04-17 20:51:16 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|