summaryrefslogtreecommitdiff
path: root/examples/alsa_timed_audio/stack.h
blob: 495a004c5d7195104f309eee25e91d818f5f4fd5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef STACK_H
#define STACK_H

#include <linked_list.h>

typedef linked_list_t stack_t;
typedef linked_list_element_t stack_element_t;

#define STATIC_STACK_INIT NULL

static inline stack_t stack_init()
{
	return ll_init();
}

static inline stack_t stack_alloc()
{
	return ll_alloc();
}

static inline bool stack_is_valid( stack_t stack )
{
	return ll_is_valid( stack );
}

static inline void stack_init_element( stack_element_t *element )
{
	ll_init_element( element );
}


static inline bool push( stack_t stack, stack_element_t *element )
{
	return ll_add_head( stack, element );
}

static inline void free_stack_element( stack_element_t *element )
{
	ll_free_element( element );
}

static inline linked_list_t get_list( stack_t stack )
{
	return (linked_list_t) stack;
}

stack_element_t *
pop( stack_t stack );

#endif/*STACK_H*/