isl_flow.c: sched_info_alloc: use isl_val
[platform/upstream/isl.git] / include / isl / list.h
1 /*
2  * Copyright 2008-2009 Katholieke Universiteit Leuven
3  *
4  * Use of this software is governed by the MIT license
5  *
6  * Written by Sven Verdoolaege, K.U.Leuven, Departement
7  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
8  */
9
10 #ifndef ISL_LIST_H
11 #define ISL_LIST_H
12
13 #include <isl/ctx.h>
14 #include <isl/printer.h>
15
16 #if defined(__cplusplus)
17 extern "C" {
18 #endif
19
20 #define ISL_DECLARE_LIST_TYPE(EL)                                       \
21 struct isl_##EL;                                                        \
22 struct isl_##EL##_list;                                                 \
23 typedef struct isl_##EL##_list isl_##EL##_list;
24 #define ISL_DECLARE_LIST_FN(EL)                                         \
25 isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list);     \
26 __isl_give isl_##EL##_list *isl_##EL##_list_from_##EL(                  \
27         __isl_take struct isl_##EL *el);                                \
28 __isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \
29 __isl_give isl_##EL##_list *isl_##EL##_list_copy(                       \
30         __isl_keep isl_##EL##_list *list);                              \
31 void *isl_##EL##_list_free(__isl_take isl_##EL##_list *list);           \
32 __isl_give isl_##EL##_list *isl_##EL##_list_add(                        \
33         __isl_take isl_##EL##_list *list,                               \
34         __isl_take struct isl_##EL *el);                                \
35 __isl_give isl_##EL##_list *isl_##EL##_list_insert(                     \
36         __isl_take isl_##EL##_list *list, unsigned pos,                 \
37         __isl_take struct isl_##EL *el);                                \
38 __isl_give isl_##EL##_list *isl_##EL##_list_drop(                       \
39         __isl_take isl_##EL##_list *list, unsigned first, unsigned n);  \
40 __isl_give isl_##EL##_list *isl_##EL##_list_concat(                     \
41         __isl_take isl_##EL##_list *list1,                              \
42         __isl_take isl_##EL##_list *list2);                             \
43 int isl_##EL##_list_n_##EL(__isl_keep isl_##EL##_list *list);           \
44 __isl_give struct isl_##EL *isl_##EL##_list_get_##EL(                   \
45         __isl_keep isl_##EL##_list *list, int index);                   \
46 __isl_give struct isl_##EL##_list *isl_##EL##_list_set_##EL(            \
47         __isl_take struct isl_##EL##_list *list, int index,             \
48         __isl_take struct isl_##EL *el);                                \
49 int isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list,           \
50         int (*fn)(__isl_take struct isl_##EL *el, void *user),          \
51         void *user);                                                    \
52 __isl_give isl_##EL##_list *isl_##EL##_list_sort(                       \
53         __isl_take isl_##EL##_list *list,                               \
54         int (*cmp)(__isl_keep struct isl_##EL *a,                       \
55                 __isl_keep struct isl_##EL *b,                          \
56                 void *user), void *user);                               \
57 int isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list,       \
58         int (*follows)(__isl_keep struct isl_##EL *a,                   \
59                         __isl_keep struct isl_##EL *b, void *user),     \
60         void *follows_user,                                             \
61         int (*fn)(__isl_take isl_##EL##_list *scc, void *user),         \
62         void *fn_user);                                                 \
63 __isl_give isl_printer *isl_printer_print_##EL##_list(                  \
64         __isl_take isl_printer *p, __isl_keep isl_##EL##_list *list);   \
65 void isl_##EL##_list_dump(__isl_keep isl_##EL##_list *list);
66
67 #define ISL_DECLARE_LIST(EL)                                            \
68         ISL_DECLARE_LIST_TYPE(EL)                                       \
69         ISL_DECLARE_LIST_FN(EL)
70
71 #if defined(__cplusplus)
72 }
73 #endif
74
75 #endif