PULSAR  1.0.0
Parallel Ultra Light Systolic Array Runtime
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Go to the documentation of this file.
15 #ifndef ICL_DEQUE_H
16 #define ICL_DEQUE_H
18 #include <limits.h>
19 #include <stdlib.h>
20 #include <pthread.h>
21 #include "icl_list.h"
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
28 typedef struct icl_deque_s {
29  pthread_spinlock_t spinlock;
31  int size;
32 } icl_deque_t;
35 int icl_deque_destroy(icl_deque_t *deque, void (*free_func)(void*));
36 icl_node_t* icl_deque_first(icl_deque_t *deque);
37 icl_node_t* icl_deque_next(icl_deque_t *deque, icl_node_t *node);
38 icl_node_t* icl_deque_append(icl_deque_t *deque, void *data);
39 icl_node_t* icl_deque_prepend(icl_deque_t *deque, void *data);
40 int icl_deque_delete(icl_deque_t *deque, icl_node_t *node, void (*free_func)(void*));
41 int icl_deque_size(icl_deque_t *deque);
43 #ifdef __cplusplus
44 }
45 #endif
47 #endif /* ICL_DEQUE_H */
icl_node_t * icl_deque_append(icl_deque_t *deque, void *data)
Insert the node at the end of the deque.
Definition: icl_deque.c:118
icl_deque_t * icl_deque_new()
deque constructor
Definition: icl_deque.c:23
int icl_deque_size(icl_deque_t *deque)
Return the deque size.
Definition: icl_deque.c:189
icl_node_t * icl_deque_next(icl_deque_t *deque, icl_node_t *node)
Get the next node in the deque.
Definition: icl_deque.c:97
icl_node_t * icl_deque_first(icl_deque_t *deque)
Get the first node in the deque.
Definition: icl_deque.c:76
dependency free linked list
icl_list_t * list
Definition: icl_deque.h:30
icl_list_t icl_node_t
Definition: icl_deque.h:27
int icl_deque_destroy(icl_deque_t *deque, void(*free_func)(void *))
deque destructor
Definition: icl_deque.c:53
int icl_deque_delete(icl_deque_t *deque, icl_node_t *node, void(*free_func)(void *))
Delete the node from the deque.
Definition: icl_deque.c:164
pthread_spinlock_t spinlock
Definition: icl_deque.h:29
struct icl_deque_s icl_deque_t
icl_node_t * icl_deque_prepend(icl_deque_t *deque, void *data)
Insert the node at the front of the deque.
Definition: icl_deque.c:140