add isl_point_get_dim
[platform/upstream/isl.git] / isl_ctx.c
index 46337d1..5b37bf5 100644 (file)
--- a/isl_ctx.c
+++ b/isl_ctx.c
@@ -7,8 +7,8 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
-#include "isl_ctx.h"
-#include "isl_vec.h"
+#include <isl_ctx_private.h>
+#include <isl/vec.h>
 
 static struct isl_options *find_nested_options(struct isl_arg *arg,
        void *opt, struct isl_arg *wanted)
@@ -93,6 +93,9 @@ isl_ctx *isl_ctx_alloc_with_options(struct isl_arg *arg, void *user_opt)
        isl_int_init(ctx->normalize_gcd);
 
        ctx->n_cached = 0;
+       ctx->n_miss = 0;
+
+       ctx->error = isl_error_none;
 
        return ctx;
 error:
@@ -148,3 +151,36 @@ struct isl_options *isl_ctx_options(isl_ctx *ctx)
                return NULL;
        return ctx->opt;
 }
+
+enum isl_error isl_ctx_last_error(isl_ctx *ctx)
+{
+       return ctx->error;
+}
+
+void isl_ctx_reset_error(isl_ctx *ctx)
+{
+       ctx->error = isl_error_none;
+}
+
+void isl_ctx_set_error(isl_ctx *ctx, enum isl_error error)
+{
+       if (ctx)
+               ctx->error = error;
+}
+
+void isl_ctx_abort(isl_ctx *ctx)
+{
+       if (ctx)
+               ctx->abort = 1;
+}
+
+void isl_ctx_resume(isl_ctx *ctx)
+{
+       if (ctx)
+               ctx->abort = 0;
+}
+
+int isl_ctx_aborted(isl_ctx *ctx)
+{
+       return ctx ? ctx->abort : -1;
+}