add tile_shift_point_loops option
[platform/upstream/isl.git] / include / isl / ctx.h
index 915bf11..3d88697 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2008-2009 Katholieke Universiteit Leuven
  *
- * Use of this software is governed by the GNU LGPLv2.1 license
+ * Use of this software is governed by the MIT license
  *
  * Written by Sven Verdoolaege, K.U.Leuven, Departement
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
@@ -125,7 +125,7 @@ typedef struct isl_ctx isl_ctx;
                code;                                                   \
        } while (0)
 
-void isl_handle_error(isl_ctx *ctx, int error, const char *msg,
+void isl_handle_error(isl_ctx *ctx, enum isl_error error, const char *msg,
        const char *file, int line);
 
 #define isl_assert4(ctx,test,code,errno)                               \
@@ -190,6 +190,36 @@ int prefix ## _set_ ## field(isl_ctx *ctx, int val)                        \
        return 0;                                                       \
 }
 
+#define ISL_CTX_GET_STR_DEF(prefix,st,args,field)                      \
+const char *prefix ## _get_ ## field(isl_ctx *ctx)                     \
+{                                                                      \
+       st *options;                                                    \
+       options = isl_ctx_peek_ ## prefix(ctx);                         \
+       if (!options)                                                   \
+               isl_die(ctx, isl_error_invalid,                         \
+                       "isl_ctx does not reference " #prefix,          \
+                       return NULL);                                   \
+       return options->field;                                          \
+}
+
+#define ISL_CTX_SET_STR_DEF(prefix,st,args,field)                      \
+int prefix ## _set_ ## field(isl_ctx *ctx, const char *val)            \
+{                                                                      \
+       st *options;                                                    \
+       options = isl_ctx_peek_ ## prefix(ctx);                         \
+       if (!options)                                                   \
+               isl_die(ctx, isl_error_invalid,                         \
+                       "isl_ctx does not reference " #prefix,          \
+                       return -1);                                     \
+       if (!val)                                                       \
+               return -1;                                              \
+       free(options->field);                                           \
+       options->field = strdup(val);                                   \
+       if (!options->field)                                            \
+               return -1;                                              \
+       return 0;                                                       \
+}
+
 #define ISL_CTX_GET_BOOL_DEF(prefix,st,args,field)                     \
        ISL_CTX_GET_INT_DEF(prefix,st,args,field)