add *_list_get_ctx
[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 GNU LGPLv2.1 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
15 #if defined(__cplusplus)
16 extern "C" {
17 #endif
18
19 #define ISL_DECLARE_LIST(EL)                                            \
20 struct isl_##EL;                                                        \
21 struct isl_##EL##_list;                                                 \
22 typedef struct isl_##EL##_list isl_##EL##_list;                         \
23 isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list);     \
24 __isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \
25 __isl_give isl_##EL##_list *isl_##EL##_list_copy(                       \
26         __isl_keep isl_##EL##_list *list);                              \
27 void isl_##EL##_list_free(__isl_take isl_##EL##_list *list);            \
28 __isl_give isl_##EL##_list *isl_##EL##_list_add(                        \
29         __isl_take isl_##EL##_list *list,                               \
30         __isl_take struct isl_##EL *el);
31
32 ISL_DECLARE_LIST(basic_set)
33 ISL_DECLARE_LIST(set)
34
35 #if defined(__cplusplus)
36 }
37 #endif
38
39 #endif