add isl_ast_build_alloc
[isl.git] / include / isl / hmap.h
blob41cd06f8700f2e4e854387a849dd7813a0a85e2d
1 #include <isl/ctx.h>
2 #include <isl/printer.h>
4 #if defined(__cplusplus)
5 extern "C" {
6 #endif
8 #define ISL_xCAT(A,B) A ## B
9 #define ISL_CAT(A,B) ISL_xCAT(A,B)
10 #define ISL_KEY ISL_CAT(isl_,ISL_KEY_BASE)
11 #define ISL_VAL ISL_CAT(isl_,ISL_VAL_BASE)
12 #define ISL_xFN(TYPE,NAME) TYPE ## _ ## NAME
13 #define ISL_FN(TYPE,NAME) ISL_xFN(TYPE,NAME)
14 #define ISL_xHMAP(KEY,VAL_BASE) KEY ## _to_ ## VAL_BASE
15 #define ISL_yHMAP(KEY,VAL_BASE) ISL_xHMAP(KEY,VAL_BASE)
16 #define ISL_HMAP ISL_yHMAP(ISL_KEY,ISL_VAL_BASE)
17 #define ISL_HMAP_BASE ISL_yHMAP(ISL_KEY_BASE,ISL_VAL_BASE)
19 struct ISL_HMAP;
20 typedef struct ISL_HMAP ISL_HMAP;
22 __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,alloc)(isl_ctx *ctx, int min_size);
23 __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,copy)(__isl_keep ISL_HMAP *hmap);
24 __isl_null ISL_HMAP *ISL_FN(ISL_HMAP,free)(__isl_take ISL_HMAP *hmap);
26 isl_ctx *ISL_FN(ISL_HMAP,get_ctx)(__isl_keep ISL_HMAP *hmap);
28 int ISL_FN(ISL_HMAP,has)(__isl_keep ISL_HMAP *hmap, __isl_keep ISL_KEY *key);
29 __isl_give ISL_VAL *ISL_FN(ISL_HMAP,get)(__isl_keep ISL_HMAP *hmap,
30 __isl_take ISL_KEY *key);
31 __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,set)(__isl_take ISL_HMAP *hmap,
32 __isl_take ISL_KEY *key, __isl_take ISL_VAL *val);
33 __isl_give ISL_HMAP *ISL_FN(ISL_HMAP,drop)(__isl_take ISL_HMAP *hmap,
34 __isl_take ISL_KEY *key);
36 int ISL_FN(ISL_HMAP,foreach)(__isl_keep ISL_HMAP *hmap,
37 int (*fn)(__isl_take ISL_KEY *key, __isl_take ISL_VAL *val, void *user),
38 void *user);
40 __isl_give isl_printer *ISL_FN(isl_printer_print,ISL_HMAP_BASE)(
41 __isl_take isl_printer *p, __isl_keep ISL_HMAP *hmap);
42 void ISL_FN(ISL_HMAP,dump)(__isl_keep ISL_HMAP *hmap);
44 #undef ISL_xCAT
45 #undef ISL_CAT
46 #undef ISL_KEY
47 #undef ISL_VAL
48 #undef ISL_xFN
49 #undef ISL_FN
50 #undef ISL_xHMAP
51 #undef ISL_yHMAP
52 #undef ISL_HMAP
54 #if defined(__cplusplus)
56 #endif