hide isl_ctx internals
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 16 Mar 2011 15:19:45 +0000 (16:19 +0100)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 16 Mar 2011 15:19:45 +0000 (16:19 +0100)
Signed-off-by: Sven Verdoolaege <skimo@kotnet.org>
29 files changed:
Makefile.am
basis_reduction_templ.c
include/isl/ctx.h
isl_affine_hull.c
isl_bernstein.c
isl_blk.c
isl_bound.c
isl_convex_hull.c
isl_ctx.c
isl_ctx_private.h [new file with mode: 0644]
isl_ilp.c
isl_input.c
isl_lp.c
isl_map.c
isl_map_piplib.c
isl_map_simplify.c
isl_mat.c
isl_name.c
isl_output.c
isl_polynomial.c
isl_range.c
isl_reordering.c
isl_sample.c
isl_scan.c
isl_seq.c
isl_tab_pip.c
isl_test.c
isl_transitive_closure.c
isl_vec.c

index 6018f4f..55b51ae 100644 (file)
@@ -47,6 +47,7 @@ libisl_la_SOURCES = \
        isl_constraint.c \
        isl_convex_hull.c \
        isl_ctx.c \
+       isl_ctx_private.h \
        isl_dim.c \
        isl_dim_private.h \
        isl_div.c \
index 4f6145d..dd90a15 100644 (file)
@@ -11,6 +11,7 @@
  */
 
 #include <stdlib.h>
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include "isl_basis_reduction.h"
 
index 456d3dd..0316013 100644 (file)
@@ -67,29 +67,7 @@ enum isl_error {
        isl_error_invalid,
        isl_error_unsupported
 };
-struct isl_ctx {
-       int                     ref;
-
-       struct isl_stats        *stats;
-
-       int                      opt_allocated;
-       struct isl_options      *opt;
-       void                    *user_opt;
-       struct isl_arg          *user_arg;
-
-       isl_int                 zero;
-       isl_int                 one;
-       isl_int                 two;
-       isl_int                 negone;
-
-       isl_int                 normalize_gcd;
-
-       int                     n_cached;
-       struct isl_blk          cache[ISL_BLK_CACHE_SIZE];
-       struct isl_hash_table   name_hash;
-
-       enum isl_error          error;
-};
+struct isl_ctx;
 typedef struct isl_ctx isl_ctx;
 
 /* Some helper macros */
@@ -117,8 +95,7 @@ typedef struct isl_ctx isl_ctx;
 
 #define isl_die(ctx,errno,msg,code)                                    \
        do {                                                            \
-               if (ctx)                                                \
-                       ctx->error = errno;                             \
+               isl_ctx_set_error(ctx, errno);                          \
                fprintf(stderr, "%s:%d: %s\n", __FILE__, __LINE__, msg);        \
                code;                                                   \
        } while (0)
@@ -155,6 +132,7 @@ st *isl_ctx_peek_ ## prefix(isl_ctx *ctx)                           \
 
 enum isl_error isl_ctx_last_error(isl_ctx *ctx);
 void isl_ctx_reset_error(isl_ctx *ctx);
+void isl_ctx_set_error(isl_ctx *ctx, enum isl_error error);
 
 #if defined(__cplusplus)
 }
index adf66cd..396b56c 100644 (file)
@@ -7,8 +7,8 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
-#include <isl/ctx.h>
 #include <isl/seq.h>
 #include <isl/set.h>
 #include <isl/lp.h>
index 0d1a6ce..afeccf6 100644 (file)
@@ -13,6 +13,7 @@
  * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/set.h>
 #include <isl/seq.h>
index 9adb690..d581f2d 100644 (file)
--- a/isl_blk.c
+++ b/isl_blk.c
@@ -8,7 +8,7 @@
  */
 
 #include <isl/blk.h>
-#include <isl/ctx.h>
+#include <isl_ctx_private.h>
 
 struct isl_blk isl_blk_empty()
 {
index b25c2f6..3828f8d 100644 (file)
@@ -8,6 +8,7 @@
  * 91893 Orsay, France 
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl_bound.h>
 #include <isl_bernstein.h>
index 1a9194a..b0e3ed9 100644 (file)
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/lp.h>
 #include <isl/map.h>
index 5f0b2a6..c1e7951 100644 (file)
--- a/isl_ctx.c
+++ b/isl_ctx.c
@@ -7,7 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
-#include <isl/ctx.h>
+#include <isl_ctx_private.h>
 #include <isl/vec.h>
 
 static struct isl_options *find_nested_options(struct isl_arg *arg,
@@ -160,3 +160,9 @@ 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;
+}
diff --git a/isl_ctx_private.h b/isl_ctx_private.h
new file mode 100644 (file)
index 0000000..fdaed32
--- /dev/null
@@ -0,0 +1,25 @@
+#include <isl/ctx.h>
+
+struct isl_ctx {
+       int                     ref;
+
+       struct isl_stats        *stats;
+
+       int                      opt_allocated;
+       struct isl_options      *opt;
+       void                    *user_opt;
+       struct isl_arg          *user_arg;
+
+       isl_int                 zero;
+       isl_int                 one;
+       isl_int                 two;
+       isl_int                 negone;
+
+       isl_int                 normalize_gcd;
+
+       int                     n_cached;
+       struct isl_blk          cache[ISL_BLK_CACHE_SIZE];
+       struct isl_hash_table   name_hash;
+
+       enum isl_error          error;
+};
index 83c313e..3d3bb92 100644 (file)
--- a/isl_ilp.c
+++ b/isl_ilp.c
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/ilp.h>
 #include "isl_sample.h"
index c914aa9..0756379 100644 (file)
@@ -14,6 +14,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <strings.h>
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/set.h>
 #include <isl/seq.h>
index 0e6a345..8c85a60 100644 (file)
--- a/isl_lp.c
+++ b/isl_lp.c
@@ -7,8 +7,8 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
-#include <isl/ctx.h>
 #include <isl/lp.h>
 #include "isl_lp_piplib.h"
 #include <isl/seq.h>
index 9008276..57f207a 100644 (file)
--- a/isl_map.c
+++ b/isl_map.c
@@ -12,8 +12,8 @@
 
 #include <string.h>
 #include <strings.h>
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
-#include <isl/ctx.h>
 #include <isl/blk.h>
 #include "isl_dim_private.h"
 #include "isl_equalities.h"
index e39ee9f..b1434eb 100644 (file)
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/set.h>
 #include <isl/map.h>
index 093d1ca..157d6b7 100644 (file)
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include "isl_equalities.h"
 #include <isl/map.h>
index 18b9966..cb7db6b 100644 (file)
--- a/isl_mat.c
+++ b/isl_mat.c
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl/dim.h>
 #include <isl/seq.h>
 #include <isl_mat_private.h>
index 4925c9b..a9a6382 100644 (file)
@@ -8,6 +8,7 @@
  */
 
 #include <string.h>
+#include <isl_ctx_private.h>
 #include "isl_name.h"
 
 struct isl_name *isl_name_alloc(struct isl_ctx *ctx, const char *s)
index fa0f6ce..ffdb3e2 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/set.h>
 #include <isl/seq.h>
index 27c2ed0..4ac53ab 100644 (file)
@@ -9,6 +9,7 @@
  */
 
 #include <stdlib.h>
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl_factorization.h>
 #include <isl/lp.h>
index 359ae28..d31f277 100644 (file)
@@ -1,3 +1,4 @@
+#include <isl_ctx_private.h>
 #include <isl/constraint.h>
 #include <isl/set.h>
 #include <isl_polynomial_private.h>
index 94a1832..6a5b014 100644 (file)
@@ -8,6 +8,7 @@
  * 91893 Orsay, France
  */
 
+#include <isl_ctx_private.h>
 #include <isl_dim_private.h>
 #include <isl_reordering.h>
 
index 812bb10..fd01261 100644 (file)
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include "isl_sample.h"
 #include "isl_sample_piplib.h"
index f32f5e6..64654be 100644 (file)
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include "isl_basis_reduction.h"
 #include "isl_scan.h"
index 36d6b65..757e729 100644 (file)
--- a/isl_seq.c
+++ b/isl_seq.c
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl/seq.h>
 
 void isl_seq_clr(isl_int *p, unsigned len)
index 1f2ab1b..b63d3b7 100644 (file)
@@ -10,6 +10,7 @@
  * ZAC des vignes, 4 rue Jacques Monod, 91893 Orsay, France 
  */
 
+#include <isl_ctx_private.h>
 #include "isl_map_private.h"
 #include <isl/seq.h>
 #include "isl_tab.h"
index 1e7a6b5..2d398f4 100644 (file)
@@ -10,8 +10,8 @@
 #include <assert.h>
 #include <stdio.h>
 #include <limits.h>
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
-#include <isl/ctx.h>
 #include <isl/set.h>
 #include <isl/flow.h>
 #include <isl/constraint.h>
index 1e68574..629eb74 100644 (file)
@@ -8,6 +8,7 @@
  * 91893 Orsay, France 
  */
 
+#include <isl_ctx_private.h>
 #include <isl_map_private.h>
 #include <isl/map.h>
 #include <isl/seq.h>
index 38a55a7..2efe123 100644 (file)
--- a/isl_vec.c
+++ b/isl_vec.c
@@ -7,6 +7,7 @@
  * Computerwetenschappen, Celestijnenlaan 200A, B-3001 Leuven, Belgium
  */
 
+#include <isl_ctx_private.h>
 #include <isl/seq.h>
 #include <isl/vec.h>