| 181 static int cx_arl_insert_iter( |
181 static int cx_arl_insert_iter( |
| 182 struct cx_iterator_s *iter, |
182 struct cx_iterator_s *iter, |
| 183 void const *elem, |
183 void const *elem, |
| 184 int prepend |
184 int prepend |
| 185 ) { |
185 ) { |
| 186 return 1; |
186 struct cx_list_s *list = iter->src_handle; |
| |
187 if (iter->index < list->size) { |
| |
188 int result = cx_arl_insert( |
| |
189 list, |
| |
190 iter->index + 1 - prepend, |
| |
191 elem |
| |
192 ); |
| |
193 if (result == 0 && prepend != 0) { |
| |
194 iter->index++; |
| |
195 iter->elem_handle = ((char *) iter->elem_handle) + list->itemsize; |
| |
196 } |
| |
197 return result; |
| |
198 } else { |
| |
199 int result = cx_arl_add(list, elem); |
| |
200 iter->index = list->size; |
| |
201 return result; |
| |
202 } |
| 187 } |
203 } |
| 188 |
204 |
| 189 static int cx_arl_remove( |
205 static int cx_arl_remove( |
| 190 struct cx_list_s *list, |
206 struct cx_list_s *list, |
| 191 size_t index |
207 size_t index |