10#ifndef __UTILS_STACK_H__
11#define __UTILS_STACK_H__
25#define STACK_PUSH(s, element) stack_push (s, (void *) element)
53static const cyaml_schema_field_t stack_fields_schema[] = {
54 YAML_FIELD_INT (
Stack, max_length),
59static const cyaml_schema_value_t stack_schema = {
73stack_size (
Stack * s);
76stack_is_empty (
Stack * s);
79stack_is_full (
Stack * s);
82stack_peek (
Stack * s);
85stack_peek_last (
Stack * s);
88stack_push (
Stack * s,
void * element);
100stack_free_members (
Stack * s);
103stack_free (
Stack * s);
#define YAML_VALUE_PTR(cc, fields_schema)
Schema to be used as a pointer.
void * stack_pop_last(Stack *s)
Pops the last element and moves everything back.
Stack * stack_new(int length)
Creates a new stack of the given size.
gint top
Index of the top of the stack.
int max_length
Max stack size, or -1 for unlimited.