The Sequence Toolkit
www.sequence-toolkit.com
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
include
stk_sequence_api.h
Go to the documentation of this file.
1
8
#ifndef STK_SEQUENCE_API_H
9
#define STK_SEQUENCE_API_H
10
11
#include "
stk_sequence.h
"
12
#include "
stk_service.h
"
13
#include "
stk_env.h
"
14
29
stk_sequence_t
*
stk_create_sequence
(
stk_env_t
*env,
char
*name,
stk_sequence_id
id
,
stk_sequence_type
type,
stk_service_type
svctype,
stk_options_t
*options);
30
35
stk_ret
stk_destroy_sequence
(
stk_sequence_t
*seq);
36
42
void
stk_hold_sequence
(
stk_sequence_t
*seq);
43
52
stk_sequence_id
stk_acquire_sequence_id
(
stk_env_t
*env,
stk_service_type
type);
53
58
stk_ret
stk_release_sequence_id
(
stk_env_t
*env,
stk_sequence_id
);
59
75
stk_ret
stk_add_reference_to_sequence
(
stk_sequence_t
*seq,
void
*data_ptr,
stk_uint64
sz,
stk_uint64
user_type);
76
94
stk_ret
stk_add_sequence_reference_in_sequence
(
stk_sequence_t
*seq,
stk_sequence_t
*merge_seq,
stk_uint64
user_type);
95
104
stk_ret
stk_update_ref_data_in_sequence
(
stk_sequence_t
*seq,
stk_generation_id
*gen_id);
105
111
stk_ret
stk_copy_to_sequence
(
stk_sequence_t
*seq,
void
*data_ptr,
stk_uint64
sz,
stk_uint64
user_type);
112
123
stk_ret
stk_copy_to_sequence_meta_data
(
stk_sequence_t
*seq,
void
*data_ptr,
stk_uint64
sz,
stk_uint64
user_type);
124
132
stk_uint64
stk_remove_sequence_data_by_type
(
stk_sequence_t
*seq,
stk_uint64
user_type,
stk_uint64
max_instances);
133
139
stk_sequence_id
stk_get_sequence_id
(
stk_sequence_t
*seq);
140
145
stk_ret
stk_set_sequence_id
(
stk_sequence_t
*seq,
stk_sequence_id
id
);
146
152
stk_sequence_type
stk_get_sequence_type
(
stk_sequence_t
*seq);
153
158
stk_ret
stk_set_sequence_type
(
stk_sequence_t
*seq,
stk_sequence_type
type);
159
165
stk_ret
stk_set_sequence_name
(
stk_sequence_t
*seq,
char
*name);
166
171
char
*
stk_get_sequence_name
(
stk_sequence_t
*seq);
172
177
stk_generation_id
stk_bump_sequence_generation
(
stk_sequence_t
*seq);
178
182
stk_generation_id
stk_get_sequence_generation
(
stk_sequence_t
*seq);
183
188
stk_env_t
*
stk_env_from_sequence
(
stk_sequence_t
*seq);
189
196
int
stk_number_of_sequence_elements
(
stk_sequence_t
*seq);
197
203
int
stk_has_any_sequence_elements
(
stk_sequence_t
*seq);
204
209
stk_ret
stk_alloc_in_sequence
(
stk_sequence_t
*seq,
stk_uint64
sz,
stk_uint64
user_type);
210
216
void
*
stk_last_sequence_element
(
stk_sequence_t
*seq);
217
218
/*
219
* Following APIs are used to iterate over a sequence.
220
* stk_iterate_sequence() is used when you want to apply a function as a callback to each element,
221
* else a traditional set of iterator APIs allows app code to navigate a sequence.
222
*/
223
235
stk_ret
stk_iterate_sequence
(
stk_sequence_t
*seq,
stk_sequence_cb
element_cb,
void
*clientd);
236
248
stk_ret
stk_iterate_complete_sequence
(
stk_sequence_t
*seq,
249
stk_sequence_cb
before_cb,
stk_sequence_cb
element_cb,
stk_sequence_cb
after_cb,
void
*clientd);
250
262
stk_sequence_iterator_t
*
stk_sequence_iterator
(
stk_sequence_t
*seq);
263
268
stk_ret
stk_end_sequence_iterator
(
stk_sequence_iterator_t
*seqiter);
269
274
void
*
stk_sequence_iterator_realloc_segment
(
stk_sequence_iterator_t
*seqiter,
stk_uint64
sz);
275
280
void
*
stk_sequence_iterator_ensure_segment_size
(
stk_sequence_iterator_t
*seqiter,
stk_uint64
sz);
281
286
void
*
stk_sequence_iterator_data
(
stk_sequence_iterator_t
*seqiter);
287
292
void
*
stk_sequence_iterator_next
(
stk_sequence_iterator_t
*seqiter);
293
298
void
*
stk_sequence_iterator_prev
(
stk_sequence_iterator_t
*seqiter);
299
304
stk_ret
stk_sequence_iterator_copy_data
(
stk_sequence_iterator_t
*seqiter,
void
*data_ptr,
stk_uint64
sz);
305
310
stk_uint64
stk_sequence_iterator_data_size
(
stk_sequence_iterator_t
*seqiter);
311
316
stk_uint64
stk_sequence_iterator_alloc_size
(
stk_sequence_iterator_t
*seqiter);
317
325
stk_ret
stk_sequence_iterator_set_size
(
stk_sequence_iterator_t
*seqiter,
stk_uint64
sz);
326
332
stk_ret
stk_sequence_iterator_set_user_type
(
stk_sequence_iterator_t
*seqiter,
stk_uint64
user_type);
333
340
stk_ret
stk_sequence_find_data_by_type
(
stk_sequence_t
*seq,
stk_uint64
user_type,
void
**data_ptr,
stk_uint64
*sz);
341
347
stk_ret
stk_sequence_find_meta_data_by_type
(
stk_sequence_t
*seq,
stk_uint64
user_type,
void
**data_ptr,
stk_uint64
*sz);
348
#endif
Sequence Toolkit
API, Wed Apr 15 2015 22:32:53