X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=isl_list.c;h=bb926b714b0697d2acb5c9c792122a6f49a8d153;hb=de51a9bc4da5dd3f1f9f57c2362da6f9752c44e0;hp=db2a608495602d9aa9a9fe67a9652097ae6f33ba;hpb=f3c292bf31fbb13ce50a8877ee71910897276a24;p=platform%2Fupstream%2Fisl.git diff --git a/isl_list.c b/isl_list.c index db2a608..bb926b7 100644 --- a/isl_list.c +++ b/isl_list.c @@ -1,62 +1,49 @@ /* * 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 */ -#include +#include +#include #include +#include +#include -struct isl_basic_set_list *isl_basic_set_list_alloc(struct isl_ctx *ctx, int n) -{ - struct isl_basic_set_list *list; - - isl_assert(ctx, n >= 0, return NULL); - list = isl_alloc(ctx, struct isl_basic_set_list, - sizeof(struct isl_basic_set_list) + - (n - 1) * sizeof(struct isl_basic_set *)); - if (!list) - return NULL; - - list->ctx = ctx; - isl_ctx_ref(ctx); - list->ref = 1; - list->size = n; - list->n = 0; - return list; -} - -struct isl_basic_set_list *isl_basic_set_list_add( - struct isl_basic_set_list *list, - struct isl_basic_set *bset) -{ - if (!list || !bset) - goto error; - isl_assert(list->ctx, list->n < list->size, goto error); - list->p[list->n] = bset; - list->n++; - return list; -error: - isl_basic_set_free(bset); - isl_basic_set_list_free(list); - return NULL; -} - -void isl_basic_set_list_free(struct isl_basic_set_list *list) -{ - int i; - - if (!list) - return; - - if (--list->ref > 0) - return; - - isl_ctx_deref(list->ctx); - for (i = 0; i < list->n; ++i) - isl_basic_set_free(list->p[i]); - free(list); -} +#undef BASE +#define BASE constraint + +#include + +#undef BASE +#define BASE basic_set + +#include + +#undef BASE +#define BASE set + +#include + +#undef BASE +#define BASE aff + +#include + +#undef BASE +#define BASE pw_aff + +#include + +#undef BASE +#define BASE band + +#include + +#undef BASE +#define BASE id + +#include