2 * Copyright 2012 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.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
8 * http://www.tizenopensource.org/license
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.
17 #define dlist_remove_data(list, data) do { \
19 l = dlist_find_data(list, data); \
20 list = dlist_remove(list, l); \
23 #define dlist_foreach(list, l, data) \
24 for ((l) = (list); ((data) = dlist_data(l)); (l) = dlist_next(l))
26 #define dlist_foreach_safe(list, l, n, data) \
27 for ((l) = (list), (n) = dlist_next(l); \
28 ((data) = dlist_data(l)); \
29 (l) = (n), (n) = dlist_next(l))
33 extern struct dlist *dlist_append(struct dlist *list, void *data);
34 extern struct dlist *dlist_prepend(struct dlist *list, void *data);
35 extern struct dlist *dlist_remove(struct dlist *list, struct dlist *l);
36 extern struct dlist *dlist_find_data(struct dlist *list, void *data);
37 extern void *dlist_data(struct dlist *l);
38 extern struct dlist *dlist_next(struct dlist *l);
39 extern struct dlist *dlist_prev(struct dlist *l);
40 extern int dlist_count(struct dlist *l);
41 extern struct dlist *dlist_nth(struct dlist *l, int nth);