1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/core/include/clist.h
2014-02-11 18:45:06 +01:00

49 lines
1.1 KiB
C

/*
* Copyright (C) 2013 Freie Universität Berlin
*
* This file is subject to the terms and conditions of the GNU Lesser General
* Public License. See the file LICENSE in the top level directory for more
* details.
*/
/**
* @addtogroup core_util
* @{
*
* @file clist.h
* @brief Circular linkes list
*
* @author Freie Universität Berlin, Computer Systems & Telematics
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef __CLIST_H
#define __CLIST_H
typedef struct clist_node_t {
struct clist_node_t *next;
struct clist_node_t *prev;
unsigned int data;
} clist_node_t;
/* inserts new_node after node */
void clist_add(clist_node_t **node, clist_node_t *new_node);
/* removes node. */
void clist_remove(clist_node_t **list, clist_node_t *node);
/* advances the circle list. second list entry will be first, first is last. */
/*void clist_advance(clist_node_t** list);*/
static inline void clist_advance(clist_node_t **list)
{
*list = (*list)->next;
}
#if ENABLE_DEBUG
void clist_print(clist_node_t *clist);
#endif
/** @} */
#endif // __CLIST_H