Skip to content

Commit

Permalink
Merge pull request #12 from deinst/master
Browse files Browse the repository at this point in the history
Added restypes to function that return pointers
fredrik-johansson authored Dec 17, 2020
2 parents 5d430ff + 28f4af1 commit 170cbdf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pycalcium/pyca.py
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ class _fmpz_struct(ctypes.Structure):

# ctypes.cast(x, ctypes.POINTER(ctypes.c_ulong))
# ctypes.POINTER(ctypes.c_ulong)
libflint.flint_malloc.restype = ctypes.c_void_p

class ca_struct(ctypes.Structure):
"""Low-level wrapper for ca_struct, for internal use by ctypes."""
@@ -87,18 +88,25 @@ class ca_mat_struct(ctypes.Structure):
('c', ctypes.c_long),
('rows', ctypes.c_void_p)]

libcalcium.ca_mat_entry_ptr.restype = ctypes.POINTER(ca_mat_struct)

class ca_vec_struct(ctypes.Structure):
"""Low-level wrapper for ca_vec_struct, for internal use by ctypes."""
_fields_ = [('entries', ctypes.c_void_p),
('length', ctypes.c_long),
('alloc', ctypes.c_long)]

libcalcium.ca_vec_entry_ptr.restype = ctypes.POINTER(ca_vec_struct)


class ca_poly_struct(ctypes.Structure):
"""Low-level wrapper for ca_poly_struct, for internal use by ctypes."""
_fields_ = [('coeffs', ctypes.c_void_p),
('length', ctypes.c_long),
('alloc', ctypes.c_long)]

libcalcium.ca_poly_coeff_ptr.restype = ctypes.POINTER(ca_struct)

class ca_poly_vec_struct(ctypes.Structure):
"""Low-level wrapper for ca_poly_vec_struct, for internal use by ctypes."""
_fields_ = [('entries', ctypes.POINTER(ca_poly_struct)),

0 comments on commit 170cbdf

Please sign in to comment.