Main Page
Classes
Files
File List
File Members
include
s3_arraylist.h
Go to the documentation of this file.
1
2
#ifndef _S3_ARRAYLIST_H
3
#define _S3_ARRAYLIST_H
4
5
#include "
sphinx3_export.h
"
6
#ifdef __cplusplus
7
extern
"C"
{
8
#endif
9
10
#define S3_ARRAYLIST_DEFAULT_SIZE 16
11
12
/* s3_arraylist.h - Defines a storage structure for generic, dynamic
13
* sequences. It also implements fast queue and stack operations.
14
*/
15
16
typedef
struct
s3_arraylist_s
{
17
void
**
array
;
18
int
head
;
19
int
count
;
20
int
max
;
21
}
s3_arraylist_t
;
22
23
/*----------------------------------
24
| Initialization and destruction |
25
----------------------------------*/
26
33
void
34
s3_arraylist_init
(
s3_arraylist_t
*_arraylist);
35
43
void
44
s3_arraylist_init_size
(
s3_arraylist_t
*_arraylist,
int
_size);
45
53
void
54
s3_arraylist_close
(
s3_arraylist_t
*_arraylist);
55
63
void
64
s3_arraylist_clear
(
s3_arraylist_t
*_arraylist);
65
66
/*--------------------------
67
| Array style operations |
68
--------------------------*/
69
83
void
84
s3_arraylist_set
(
s3_arraylist_t
*_arraylist,
int
_pos,
void
*_ptr);
85
94
void
*
95
s3_arraylist_get
(
s3_arraylist_t
*_arraylist,
int
_pos);
96
106
void
*
107
s3_arraylist_replace
(
s3_arraylist_t
*_arraylist,
int
_pos,
void
*_ptr);
108
109
/*-------------------------
110
| List style operations |
111
-------------------------*/
112
121
void
*
122
s3_arraylist_remove
(
s3_arraylist_t
*_arraylist,
int
_pos);
123
133
void
134
s3_arraylist_insert
(
s3_arraylist_t
*_arraylist,
int
_pos,
void
*_ptr);
135
143
void
144
s3_arraylist_append
(
s3_arraylist_t
*_arraylist,
void
*_ptr);
145
153
void
154
s3_arraylist_prepend
(
s3_arraylist_t
*_arraylist,
void
*_ptr);
155
162
void
*
163
s3_arraylist_pop
(
s3_arraylist_t
*_arraylist);
164
171
void
*
172
s3_arraylist_dequeue
(
s3_arraylist_t
*_arraylist);
173
174
/*---------------------------
175
| Miscellaneus operations |
176
---------------------------*/
177
184
S3DECODER_EXPORT
185
int
186
s3_arraylist_count
(
s3_arraylist_t
*_arraylist);
187
195
void
**
196
s3_arraylist_to_array
(
s3_arraylist_t
*_arraylist);
197
198
#ifdef __cplusplus
199
}
200
#endif
201
#endif
Generated by
1.8.1.1