# distutils: libraries = flint
# distutils: depends = flint/aprcl.h

################################################################################
# This file is auto-generated by the script
#   SAGE_ROOT/tools/flint-autogen/flint_autogen.py.
# From the commit 3e2c3a3e091106a25ca9c6fba28e02f2cbcd654a
# Do not modify by hand! Fix and rerun the script instead.
################################################################################

from libc.stdio cimport FILE
from sage.libs.gmp.types cimport *
from sage.libs.mpfr.types cimport *
from sage.libs.flint.types cimport *

cdef extern from "flint_wrap.h":
    bint aprcl_is_prime(const fmpz_t n) noexcept
    bint aprcl_is_prime_jacobi(const fmpz_t n) noexcept
    bint aprcl_is_prime_gauss(const fmpz_t n) noexcept
    primality_test_status _aprcl_is_prime_jacobi(const fmpz_t n, const aprcl_config config) noexcept
    primality_test_status _aprcl_is_prime_gauss(const fmpz_t n, const aprcl_config config) noexcept
    bint aprcl_is_prime_gauss_min_R(const fmpz_t n, ulong R) noexcept
    bint aprcl_is_prime_final_division(const fmpz_t n, const fmpz_t s, ulong r) noexcept
    void aprcl_config_gauss_init(aprcl_config conf, const fmpz_t n) noexcept
    void aprcl_config_gauss_init_min_R(aprcl_config conf, const fmpz_t n, ulong R) noexcept
    void aprcl_config_gauss_clear(aprcl_config conf) noexcept
    ulong aprcl_R_value(const fmpz_t n) noexcept
    void aprcl_config_jacobi_init(aprcl_config conf, const fmpz_t n) noexcept
    void aprcl_config_jacobi_clear(aprcl_config conf) noexcept
    void unity_zp_init(unity_zp f, ulong p, ulong exp, const fmpz_t n) noexcept
    void unity_zp_clear(unity_zp f) noexcept
    void unity_zp_copy(unity_zp f, const unity_zp g) noexcept
    void unity_zp_swap(unity_zp f, unity_zp q) noexcept
    void unity_zp_set_zero(unity_zp f) noexcept
    slong unity_zp_is_unity(unity_zp f) noexcept
    bint unity_zp_equal(unity_zp f, unity_zp g) noexcept
    void unity_zp_print(const unity_zp f) noexcept
    void unity_zp_coeff_set_fmpz(unity_zp f, ulong ind, const fmpz_t x) noexcept
    void unity_zp_coeff_set_ui(unity_zp f, ulong ind, ulong x) noexcept
    void unity_zp_coeff_add_fmpz(unity_zp f, ulong ind, const fmpz_t x) noexcept
    void unity_zp_coeff_add_ui(unity_zp f, ulong ind, ulong x) noexcept
    void unity_zp_coeff_inc(unity_zp f, ulong ind) noexcept
    void unity_zp_coeff_dec(unity_zp f, ulong ind) noexcept
    void unity_zp_mul_scalar_fmpz(unity_zp f, const unity_zp g, const fmpz_t s) noexcept
    void unity_zp_mul_scalar_ui(unity_zp f, const unity_zp g, ulong s) noexcept
    void unity_zp_add(unity_zp f, const unity_zp g, const unity_zp h) noexcept
    void unity_zp_mul(unity_zp f, const unity_zp g, const unity_zp h) noexcept
    void unity_zp_sqr(unity_zp f, const unity_zp g) noexcept
    void unity_zp_mul_inplace(unity_zp f, const unity_zp g, const unity_zp h, fmpz_t * t) noexcept
    void unity_zp_sqr_inplace(unity_zp f, const unity_zp g, fmpz_t * t) noexcept
    void unity_zp_pow_fmpz(unity_zp f, const unity_zp g, const fmpz_t pow) noexcept
    void unity_zp_pow_ui(unity_zp f, const unity_zp g, ulong pow) noexcept
    ulong _unity_zp_pow_select_k(const fmpz_t n) noexcept
    void unity_zp_pow_2k_fmpz(unity_zp f, const unity_zp g, const fmpz_t pow) noexcept
    void unity_zp_pow_2k_ui(unity_zp f, const unity_zp g, ulong pow) noexcept
    void unity_zp_pow_sliding_fmpz(unity_zp f, unity_zp g, const fmpz_t pow) noexcept
    void _unity_zp_reduce_cyclotomic_divmod(unity_zp f) noexcept
    void _unity_zp_reduce_cyclotomic(unity_zp f) noexcept
    void unity_zp_reduce_cyclotomic(unity_zp f, const unity_zp g) noexcept
    void unity_zp_aut(unity_zp f, const unity_zp g, ulong x) noexcept
    void unity_zp_aut_inv(unity_zp f, const unity_zp g, ulong x) noexcept
    void unity_zp_jacobi_sum_pq(unity_zp f, ulong q, ulong p) noexcept
    void unity_zp_jacobi_sum_2q_one(unity_zp f, ulong q) noexcept
    void unity_zp_jacobi_sum_2q_two(unity_zp f, ulong q) noexcept
    void unity_zpq_init(unity_zpq f, ulong q, ulong p, const fmpz_t n) noexcept
    void unity_zpq_clear(unity_zpq f) noexcept
    void unity_zpq_copy(unity_zpq f, const unity_zpq g) noexcept
    void unity_zpq_swap(unity_zpq f, unity_zpq q) noexcept
    bint unity_zpq_equal(const unity_zpq f, const unity_zpq g) noexcept
    slong unity_zpq_p_unity(const unity_zpq f) noexcept
    bint unity_zpq_is_p_unity(const unity_zpq f) noexcept
    bint unity_zpq_is_p_unity_generator(const unity_zpq f) noexcept
    void unity_zpq_coeff_set_fmpz(unity_zpq f, slong i, slong j, const fmpz_t x) noexcept
    void unity_zpq_coeff_set_ui(unity_zpq f, slong i, slong j, ulong x) noexcept
    void unity_zpq_coeff_add(unity_zpq f, slong i, slong j, const fmpz_t x) noexcept
    void unity_zpq_add(unity_zpq f, const unity_zpq g, const unity_zpq h) noexcept
    void unity_zpq_mul(unity_zpq f, const unity_zpq g, const unity_zpq h) noexcept
    void _unity_zpq_mul_unity_p(unity_zpq f) noexcept
    void unity_zpq_mul_unity_p_pow(unity_zpq f, const unity_zpq g, slong k) noexcept
    void unity_zpq_pow(unity_zpq f, const unity_zpq g, const fmpz_t p) noexcept
    void unity_zpq_pow_ui(unity_zpq f, const unity_zpq g, ulong p) noexcept
    void unity_zpq_gauss_sum(unity_zpq f, ulong q, ulong p) noexcept
    void unity_zpq_gauss_sum_sigma_pow(unity_zpq f, ulong q, ulong p) noexcept
