UniMRCP
1.3.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
apr-toolkit
include
apt_obj_list.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008-2014 Arsen Chaloyan
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*
16
* $Id: apt_obj_list.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef APT_OBJ_LIST_H
20
#define APT_OBJ_LIST_H
21
22
/**
23
* @file apt_obj_list.h
24
* @brief List of Opaque void* Objects
25
*/
26
27
#include "
apt.h
"
28
29
APT_BEGIN_EXTERN_C
30
31
32
/** Opaque list declaration */
33
typedef
struct
apt_obj_list_t
apt_obj_list_t
;
34
/** Opaque list element declaration */
35
typedef
struct
apt_list_elem_t
apt_list_elem_t
;
36
37
/**
38
* Create list.
39
* @param pool the pool to allocate list from
40
* @return the created list
41
*/
42
APT_DECLARE
(
apt_obj_list_t
*)
apt_list_create
(apr_pool_t *pool);
43
44
/**
45
* Destroy list.
46
* @param list the list to destroy
47
*/
48
APT_DECLARE
(
void
)
apt_list_destroy
(
apt_obj_list_t
*list);
49
50
/**
51
* Push object to the list as first in, first out.
52
* @param list the list to push object to
53
* @param obj the object to push
54
* @param pool the pool to allocate list element from
55
* @return the inserted element
56
*/
57
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_push_back
(
apt_obj_list_t
*list,
void
*obj, apr_pool_t *pool);
58
59
/**
60
* Pop object from the list as first in, first out.
61
* @param list the list to pop message from
62
* @return the popped object (if any)
63
*/
64
APT_DECLARE
(
void
*)
apt_list_pop_front
(
apt_obj_list_t
*list);
65
66
/**
67
* Retrieve object of the first element in the list.
68
* @param list the list to retrieve from
69
*/
70
APT_DECLARE
(
void
*)
apt_list_head
(const
apt_obj_list_t
*list);
71
72
/**
73
* Retrieve object of the last element in the list.
74
* @param list the list to retrieve from
75
*/
76
APT_DECLARE
(
void
*)
apt_obj_list_tail
(const
apt_obj_list_t
*list);
77
78
79
/**
80
* Retrieve the first element of the list.
81
* @param list the list to retrieve from
82
*/
83
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_first_elem_get
(const
apt_obj_list_t
*list);
84
85
/**
86
* Retrieve the last element of the list.
87
* @param list the list to retrieve from
88
*/
89
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_last_elem_get
(const
apt_obj_list_t
*list);
90
91
/**
92
* Retrieve the next element of the list.
93
* @param list the list to retrieve from
94
* @param elem the element to retrieve next element from
95
*/
96
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_next_elem_get
(const
apt_obj_list_t
*list,
apt_list_elem_t
*elem);
97
98
/**
99
* Retrieve the prev element of the list.
100
* @param list the list to retrieve from
101
* @param elem the element to retrieve prev element from
102
*/
103
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_prev_elem_get
(const
apt_obj_list_t
*list,
apt_list_elem_t
*elem);
104
105
/**
106
* Insert element to the list.
107
* @param list the list to insert element to
108
* @param elem the element to insert before
109
* @param obj the object to insert
110
* @param pool the pool to allocate list element from
111
* @return the inserted element
112
*/
113
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_elem_insert
(
apt_obj_list_t
*list,
apt_list_elem_t
*elem,
void
*obj, apr_pool_t *pool);
114
115
/**
116
* Remove element from the list.
117
* @param list the list to remove element from
118
* @param elem the element to remove
119
* @return the next element (if any)
120
*/
121
APT_DECLARE
(
apt_list_elem_t
*)
apt_list_elem_remove
(
apt_obj_list_t
*list,
apt_list_elem_t
*elem);
122
123
/**
124
* Query whether the list is empty.
125
* @param list the list to query
126
* @return TRUE if empty, otherwise FALSE
127
*/
128
APT_DECLARE
(
apt_bool_t
)
apt_list_is_empty
(const
apt_obj_list_t
*list);
129
130
/**
131
* Retrieve the object associated with element.
132
* @param elem the element to retrieve object from
133
*/
134
APT_DECLARE
(
void
*)
apt_list_elem_object_get
(const
apt_list_elem_t
*elem);
135
136
137
APT_END_EXTERN_C
138
139
#endif
/* APT_OBJ_LIST_H */
Generated on Mon Feb 2 2015 19:41:38 for UniMRCP by
1.8.3.1