Libparserutils
include
parserutils
utils
stack.h
Go to the documentation of this file.
1
/*
2
* This file is part of LibParserUtils.
3
* Licensed under the MIT License,
4
* http://www.opensource.org/licenses/mit-license.php
5
* Copyright 2008 John-Mark Bell <jmb@netsurf-browser.org>
6
*/
7
8
#ifndef parserutils_utils_stack_h_
9
#define parserutils_utils_stack_h_
10
11
#ifdef __cplusplus
12
extern
"C"
13
{
14
#endif
15
16
#include <stddef.h>
17
18
#include <
parserutils/errors.h
>
19
#include <
parserutils/functypes.h
>
20
21
struct
parserutils_stack
;
22
typedef
struct
parserutils_stack
parserutils_stack
;
23
24
parserutils_error
parserutils_stack_create
(
size_t
item_size
,
size_t
chunk_size
,
25
parserutils_stack
**stack);
26
parserutils_error
parserutils_stack_destroy
(
parserutils_stack
*stack);
27
28
parserutils_error
parserutils_stack_push
(
parserutils_stack
*stack,
29
const
void
*item);
30
parserutils_error
parserutils_stack_pop
(
parserutils_stack
*stack,
void
*item);
31
32
void
*
parserutils_stack_get_current
(
parserutils_stack
*stack);
33
34
#ifdef __cplusplus
35
}
36
#endif
37
38
#endif
39
parserutils_stack_push
parserutils_error parserutils_stack_push(parserutils_stack *stack, const void *item)
Push an item onto the stack.
Definition:
stack.c:87
parserutils_stack_destroy
parserutils_error parserutils_stack_destroy(parserutils_stack *stack)
Destroy a stack instance.
Definition:
stack.c:69
parserutils_stack::chunk_size
size_t chunk_size
Size of a stack chunk.
Definition:
stack.c:19
parserutils_stack_create
parserutils_error parserutils_stack_create(size_t item_size, size_t chunk_size, parserutils_stack **stack)
Create a stack.
Definition:
stack.c:35
errors.h
parserutils_stack_pop
parserutils_error parserutils_stack_pop(parserutils_stack *stack, void *item)
Pop an item off a stack.
Definition:
stack.c:126
parserutils_stack_get_current
void * parserutils_stack_get_current(parserutils_stack *stack)
Retrieve a pointer to the current item on the stack.
Definition:
stack.c:151
functypes.h
parserutils_error
parserutils_error
Definition:
errors.h:18
parserutils_stack::item_size
size_t item_size
Size of an item in the stack.
Definition:
stack.c:18
parserutils_stack
Stack object.
Definition:
stack.c:16
Generated by
1.8.17