AX_SUBMODULE: only check submodule status in git repository
[barvinok.git] / interface / isl.py.top.pet
blob0416f259cfb8bf6e0653e20c85669ad906e8b6ea
1 from ctypes import *
3 isl = cdll.LoadLibrary("libbarvinok.so")
4 pet = cdll.LoadLibrary("libpet.so")
5 libc = cdll.LoadLibrary("libc.so.6")
7 class Error(Exception):
8     pass
10 class Context:
11     defaultInstance = None
13     def __init__(self):
14         ptr = pet.isl_ctx_alloc_with_pet_options()
15         self.ptr = ptr
17     def __del__(self):
18         isl.isl_ctx_free(self)
20     def from_param(self):
21         return c_void_p(self.ptr)
23     @staticmethod
24     def getDefaultInstance():
25         if Context.defaultInstance == None:
26             Context.defaultInstance = Context()
27         return Context.defaultInstance
29 pet.isl_ctx_alloc_with_pet_options.restype = c_void_p
30 isl.isl_ctx_free.argtypes = [Context]