2 * Copyright 2008-2009 Katholieke Universiteit Leuven
4 * Use of this software is governed by the MIT license
6 * Written by Sven Verdoolaege, K.U.Leuven, Departement
7 * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
14 #include <isl/printer_type.h>
16 #if defined(__cplusplus)
20 #define ISL_DECLARE_LIST_TYPE(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 __isl_null isl_##EL##_list *isl_##EL##_list_free( \
32 __isl_take isl_##EL##_list *list); \
33 __isl_give isl_##EL##_list *isl_##EL##_list_add( \
34 __isl_take isl_##EL##_list *list, \
35 __isl_take struct isl_##EL *el); \
36 __isl_give isl_##EL##_list *isl_##EL##_list_insert( \
37 __isl_take isl_##EL##_list *list, unsigned pos, \
38 __isl_take struct isl_##EL *el); \
39 __isl_give isl_##EL##_list *isl_##EL##_list_drop( \
40 __isl_take isl_##EL##_list *list, unsigned first, unsigned n); \
41 __isl_give isl_##EL##_list *isl_##EL##_list_swap( \
42 __isl_take isl_##EL##_list *list, unsigned pos1, \
44 __isl_give isl_##EL##_list *isl_##EL##_list_reverse( \
45 __isl_take isl_##EL##_list *list); \
46 __isl_give isl_##EL##_list *isl_##EL##_list_concat( \
47 __isl_take isl_##EL##_list *list1, \
48 __isl_take isl_##EL##_list *list2); \
49 isl_size isl_##EL##_list_size(__isl_keep isl_##EL##_list *list); \
50 isl_size isl_##EL##_list_n_##EL(__isl_keep isl_##EL##_list *list); \
51 __isl_give isl_##EL *isl_##EL##_list_get_at( \
52 __isl_keep isl_##EL##_list *list, int index); \
53 __isl_give struct isl_##EL *isl_##EL##_list_get_##EL( \
54 __isl_keep isl_##EL##_list *list, int index); \
55 __isl_give struct isl_##EL##_list *isl_##EL##_list_set_##EL( \
56 __isl_take struct isl_##EL##_list *list, int index, \
57 __isl_take struct isl_##EL *el); \
58 isl_stat isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \
59 isl_stat (*fn)(__isl_take struct isl_##EL *el, void *user), \
61 __isl_give isl_##EL##_list *isl_##EL##_list_map( \
62 __isl_take isl_##EL##_list *list, \
63 __isl_give isl_##EL * (*fn)(__isl_take isl_##EL *el, \
66 __isl_give isl_##EL##_list *isl_##EL##_list_sort( \
67 __isl_take isl_##EL##_list *list, \
68 int (*cmp)(__isl_keep struct isl_##EL *a, \
69 __isl_keep struct isl_##EL *b, \
70 void *user), void *user); \
71 isl_stat isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \
72 isl_bool (*follows)(__isl_keep struct isl_##EL *a, \
73 __isl_keep struct isl_##EL *b, void *user), \
75 isl_stat (*fn)(__isl_take isl_##EL##_list *scc, void *user), \
77 __isl_give isl_printer *isl_printer_print_##EL##_list( \
78 __isl_take isl_printer *p, __isl_keep isl_##EL##_list *list); \
79 void isl_##EL##_list_dump(__isl_keep isl_##EL##_list *list);
81 #define ISL_DECLARE_LIST(EL) \
82 ISL_DECLARE_LIST_TYPE(EL) \
83 ISL_DECLARE_LIST_FN(EL)
85 #if defined(__cplusplus)