flint_sys/
flint.rs

1#![allow(non_camel_case_types)]
2
3use crate::deps::*;
4use libc::{c_char, c_int, c_uint, c_void, size_t, FILE};
5
6pub type __builtin_va_list = [__va_list_tag; 1usize];
7
8#[repr(C)]
9#[derive(Debug, Copy, Clone)]
10pub struct __va_list_tag {
11    pub gp_offset: c_uint,
12    pub fp_offset: c_uint,
13    pub overflow_arg_area: *mut c_void,
14    pub reg_save_area: *mut c_void,
15}
16
17#[repr(C)]
18#[derive(Debug, Copy, Clone)]
19pub struct __locale_data {
20    pub _address: u8,
21}
22
23#[repr(C)]
24#[derive(Copy, Clone)]
25pub struct flint_rand_s {
26    pub gmp_state: gmp_randstate_t,
27    pub gmp_init: c_int,
28    pub __randval: mp_limb_t,
29    pub __randval2: mp_limb_t,
30}
31
32pub type flint_rand_t = [flint_rand_s; 1usize];
33//pub type flint_rand_t = flint_rand_s;
34
35pub type flint_bitcnt_t = mp_limb_t;
36
37pub type flint_mpfr = __mpfr_struct;
38
39pub type thread_pool_handle = c_int;
40
41pub type flint_cleanup_function_t = ::std::option::Option<unsafe extern "C" fn()>;
42
43extern "C" {
44    pub static rec_word_tab: [c_int; 256usize];
45    pub static mut flint_version: [c_char; 0usize];
46    pub fn flint_malloc(size: size_t) -> *mut c_void;
47    pub fn flint_realloc(ptr: *mut c_void, size: size_t) -> *mut c_void;
48    pub fn flint_calloc(num: size_t, size: size_t) -> *mut c_void;
49    pub fn flint_free(ptr: *mut c_void);
50    pub fn flint_register_cleanup_function(cleanup_function: flint_cleanup_function_t);
51    pub fn flint_cleanup();
52    pub fn flint_cleanup_master();
53    pub fn __flint_set_memory_functions(
54        alloc_func: ::std::option::Option<unsafe extern "C" fn(arg1: size_t) -> *mut c_void>,
55        calloc_func: ::std::option::Option<
56            unsafe extern "C" fn(arg1: size_t, arg2: size_t) -> *mut c_void,
57        >,
58        realloc_func: ::std::option::Option<
59            unsafe extern "C" fn(arg1: *mut c_void, arg2: size_t) -> *mut c_void,
60        >,
61        free_func: ::std::option::Option<unsafe extern "C" fn(arg1: *mut c_void)>,
62    );
63    pub fn flint_abort();
64    pub fn flint_get_num_threads() -> c_int;
65    pub fn flint_set_num_threads(num_threads: c_int);
66    pub fn _flint_set_num_workers(num_workers: c_int);
67    pub fn flint_set_num_workers(num_workers: c_int) -> c_int;
68    pub fn flint_reset_num_workers(max_workers: c_int);
69    pub fn flint_set_thread_affinity(cpus: *mut c_int, length: mp_limb_signed_t) -> c_int;
70    pub fn flint_restore_thread_affinity() -> c_int;
71    pub fn flint_test_multiplier() -> c_int;
72    pub fn flint_randinit(state: *mut flint_rand_s);
73    pub fn flint_randseed(state: *mut flint_rand_s, seed1: mp_limb_t, seed2: mp_limb_t);
74    pub fn flint_get_randseed(
75        seed1: *mut mp_limb_t,
76        seed2: *mut mp_limb_t,
77        state: *mut flint_rand_s,
78    );
79    pub fn _flint_rand_init_gmp(state: *mut flint_rand_s);
80    pub fn flint_randclear(state: *mut flint_rand_s);
81    pub fn flint_rand_alloc() -> *mut flint_rand_s;
82    pub fn flint_rand_free(state: *mut flint_rand_s);
83    pub fn parse_fmt(floating: *mut c_int, fmt: *const c_char) -> c_int;
84    pub fn flint_printf(str_: *const c_char, ...) -> c_int;
85    pub fn flint_vprintf(str_: *const c_char, ap: *mut __va_list_tag) -> c_int;
86    pub fn flint_fprintf(f: *mut FILE, str_: *const c_char, ...) -> c_int;
87    pub fn flint_sprintf(s: *mut c_char, str_: *const c_char, ...) -> c_int;
88    pub fn flint_scanf(str_: *const c_char, ...) -> c_int;
89    pub fn flint_fscanf(f: *mut FILE, str_: *const c_char, ...) -> c_int;
90    pub fn flint_sscanf(s: *const c_char, str_: *const c_char, ...) -> c_int;
91    pub fn flint_mul_sizes(x: mp_limb_signed_t, y: mp_limb_signed_t) -> mp_limb_signed_t;
92}