UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
30 
31 
32 /** Opaque list declaration */
34 /** Opaque list element declaration */
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  */
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  */
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  */
84 
85 /**
86  * Retrieve the last element of the list.
87  * @param list the list to retrieve from
88  */
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  */
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  */
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  */
122 
123 /**
124  * Query whether the list is empty.
125  * @param list the list to query
126  * @return TRUE if empty, otherwise FALSE
127  */
129 
130 /**
131  * Retrieve the object associated with element.
132  * @param elem the element to retrieve object from
133  */
135 
136 
138 
139 #endif /* APT_OBJ_LIST_H */