Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 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_type.h> |
||
15 | |||
16 | #if defined(__cplusplus) |
||
17 | extern "C" { |
||
18 | #endif |
||
19 | |||
20 | #define ISL_DECLARE_LIST_TYPE2(EL,EXPORT) \ |
||
21 | struct isl_##EL; \ |
||
22 | struct EXPORT isl_##EL##_list; \ |
||
23 | typedef struct isl_##EL##_list isl_##EL##_list; |
||
24 | #define ISL_DECLARE_LIST_TYPE(EL) \ |
||
25 | ISL_DECLARE_LIST_TYPE2(EL,) |
||
26 | #define ISL_DECLARE_EXPORTED_LIST_TYPE(EL) \ |
||
27 | ISL_DECLARE_LIST_TYPE2(EL,__isl_export) |
||
28 | #define ISL_DECLARE_LIST_FN3(EL,CONSTRUCTOR,EXPORT) \ |
||
29 | isl_ctx *isl_##EL##_list_get_ctx(__isl_keep isl_##EL##_list *list); \ |
||
30 | EXPORT \ |
||
31 | __isl_give isl_##EL##_list *isl_##EL##_to_list(__isl_take isl_##EL *el);\ |
||
32 | CONSTRUCTOR \ |
||
33 | __isl_give isl_##EL##_list *isl_##EL##_list_from_##EL( \ |
||
34 | __isl_take isl_##EL *el); \ |
||
35 | CONSTRUCTOR \ |
||
36 | __isl_give isl_##EL##_list *isl_##EL##_list_alloc(isl_ctx *ctx, int n); \ |
||
37 | __isl_give isl_##EL##_list *isl_##EL##_list_copy( \ |
||
38 | __isl_keep isl_##EL##_list *list); \ |
||
39 | __isl_null isl_##EL##_list *isl_##EL##_list_free( \ |
||
40 | __isl_take isl_##EL##_list *list); \ |
||
41 | EXPORT \ |
||
42 | __isl_give isl_##EL##_list *isl_##EL##_list_add( \ |
||
43 | __isl_take isl_##EL##_list *list, \ |
||
44 | __isl_take isl_##EL *el); \ |
||
45 | EXPORT \ |
||
46 | __isl_give isl_##EL##_list *isl_##EL##_list_insert( \ |
||
47 | __isl_take isl_##EL##_list *list, unsigned pos, \ |
||
48 | __isl_take isl_##EL *el); \ |
||
49 | EXPORT \ |
||
50 | __isl_give isl_##EL##_list *isl_##EL##_list_drop( \ |
||
51 | __isl_take isl_##EL##_list *list, unsigned first, unsigned n); \ |
||
52 | EXPORT \ |
||
53 | __isl_give isl_##EL##_list *isl_##EL##_list_clear( \ |
||
54 | __isl_take isl_##EL##_list *list); \ |
||
55 | __isl_give isl_##EL##_list *isl_##EL##_list_swap( \ |
||
56 | __isl_take isl_##EL##_list *list, unsigned pos1, \ |
||
57 | unsigned pos2); \ |
||
58 | __isl_give isl_##EL##_list *isl_##EL##_list_reverse( \ |
||
59 | __isl_take isl_##EL##_list *list); \ |
||
60 | EXPORT \ |
||
61 | __isl_give isl_##EL##_list *isl_##EL##_list_concat( \ |
||
62 | __isl_take isl_##EL##_list *list1, \ |
||
63 | __isl_take isl_##EL##_list *list2); \ |
||
64 | EXPORT \ |
||
65 | isl_size isl_##EL##_list_size(__isl_keep isl_##EL##_list *list); \ |
||
66 | isl_size isl_##EL##_list_n_##EL(__isl_keep isl_##EL##_list *list); \ |
||
67 | EXPORT \ |
||
68 | __isl_give isl_##EL *isl_##EL##_list_get_at( \ |
||
69 | __isl_keep isl_##EL##_list *list, int index); \ |
||
70 | __isl_give struct isl_##EL *isl_##EL##_list_get_##EL( \ |
||
71 | __isl_keep isl_##EL##_list *list, int index); \ |
||
72 | __isl_give struct isl_##EL##_list *isl_##EL##_list_set_##EL( \ |
||
73 | __isl_take struct isl_##EL##_list *list, int index, \ |
||
74 | __isl_take struct isl_##EL *el); \ |
||
75 | EXPORT \ |
||
76 | isl_stat isl_##EL##_list_foreach(__isl_keep isl_##EL##_list *list, \ |
||
77 | isl_stat (*fn)(__isl_take isl_##EL *el, void *user), \ |
||
78 | void *user); \ |
||
79 | isl_bool isl_##EL##_list_every(__isl_keep isl_##EL##_list *list, \ |
||
80 | isl_bool (*test)(__isl_keep isl_##EL *el, void *user), \ |
||
81 | void *user); \ |
||
82 | __isl_give isl_##EL##_list *isl_##EL##_list_map( \ |
||
83 | __isl_take isl_##EL##_list *list, \ |
||
84 | __isl_give isl_##EL * (*fn)(__isl_take isl_##EL *el, \ |
||
85 | void *user), \ |
||
86 | void *user); \ |
||
87 | __isl_give isl_##EL##_list *isl_##EL##_list_sort( \ |
||
88 | __isl_take isl_##EL##_list *list, \ |
||
89 | int (*cmp)(__isl_keep struct isl_##EL *a, \ |
||
90 | __isl_keep struct isl_##EL *b, \ |
||
91 | void *user), void *user); \ |
||
92 | isl_stat isl_##EL##_list_foreach_scc(__isl_keep isl_##EL##_list *list, \ |
||
93 | isl_bool (*follows)(__isl_keep struct isl_##EL *a, \ |
||
94 | __isl_keep struct isl_##EL *b, void *user), \ |
||
95 | void *follows_user, \ |
||
96 | isl_stat (*fn)(__isl_take isl_##EL##_list *scc, void *user), \ |
||
97 | void *fn_user); \ |
||
98 | __isl_give char *isl_##EL##_list_to_str( \ |
||
99 | __isl_keep isl_##EL##_list *list); \ |
||
100 | __isl_give isl_printer *isl_printer_print_##EL##_list( \ |
||
101 | __isl_take isl_printer *p, __isl_keep isl_##EL##_list *list); \ |
||
102 | void isl_##EL##_list_dump(__isl_keep isl_##EL##_list *list); |
||
103 | #define ISL_DECLARE_LIST_FN(EL) \ |
||
104 | ISL_DECLARE_LIST_FN3(EL,,) |
||
105 | #define ISL_DECLARE_EXPORTED_LIST_FN(EL) \ |
||
106 | ISL_DECLARE_LIST_FN3(EL,__isl_constructor,__isl_export) |
||
107 | #define ISL_DECLARE_LIST_FN_READ2(EL,CONSTRUCTOR) \ |
||
108 | CONSTRUCTOR \ |
||
109 | __isl_give isl_##EL##_list *isl_##EL##_list_read_from_str( \ |
||
110 | isl_ctx *ctx, const char *str); |
||
111 | #define ISL_DECLARE_LIST_FN_READ(EL) \ |
||
112 | ISL_DECLARE_LIST_FN_READ2(EL,) |
||
113 | #define ISL_DECLARE_EXPORTED_LIST_FN_READ(EL) \ |
||
114 | ISL_DECLARE_LIST_FN_READ2(EL,__isl_constructor) |
||
115 | |||
116 | #define ISL_DECLARE_LIST(EL) \ |
||
117 | ISL_DECLARE_LIST_TYPE(EL) \ |
||
118 | ISL_DECLARE_LIST_FN(EL) |
||
119 | #define ISL_DECLARE_EXPORTED_LIST(EL) \ |
||
120 | ISL_DECLARE_EXPORTED_LIST_TYPE(EL) \ |
||
121 | ISL_DECLARE_EXPORTED_LIST_FN(EL) |
||
122 | |||
123 | #if defined(__cplusplus) |
||
124 | } |
||
125 | #endif |
||
126 | |||
127 | #endif |