1use libc::{c_char, c_double, c_int};
9
10pub use librebound_sys::ffi::*;
14
15#[repr(C)]
21pub struct assist_ephem {
22 _opaque: [u8; 0],
23}
24
25#[repr(C)]
27pub struct assist_extras {
28 _opaque: [u8; 0],
29}
30
31pub const ASSIST_BODY_SUN: c_int = 0;
37pub const ASSIST_BODY_MERCURY: c_int = 1;
38pub const ASSIST_BODY_VENUS: c_int = 2;
39pub const ASSIST_BODY_EARTH: c_int = 3;
40pub const ASSIST_BODY_MOON: c_int = 4;
41pub const ASSIST_BODY_MARS: c_int = 5;
42pub const ASSIST_BODY_JUPITER: c_int = 6;
43pub const ASSIST_BODY_SATURN: c_int = 7;
44pub const ASSIST_BODY_URANUS: c_int = 8;
45pub const ASSIST_BODY_NEPTUNE: c_int = 9;
46pub const ASSIST_BODY_PLUTO: c_int = 10;
47pub const ASSIST_BODY_NPLANETS: c_int = 11;
48
49pub const ASSIST_FORCE_SUN: c_int = 0x01;
51pub const ASSIST_FORCE_PLANETS: c_int = 0x02;
52pub const ASSIST_FORCE_ASTEROIDS: c_int = 0x04;
53pub const ASSIST_FORCE_NON_GRAVITATIONAL: c_int = 0x08;
54pub const ASSIST_FORCE_EARTH_HARMONICS: c_int = 0x10;
55pub const ASSIST_FORCE_SUN_HARMONICS: c_int = 0x20;
56pub const ASSIST_FORCE_GR_EIH: c_int = 0x40;
57pub const ASSIST_FORCE_GR_SIMPLE: c_int = 0x80;
58pub const ASSIST_FORCE_GR_POTENTIAL: c_int = 0x100;
59
60pub const ASSIST_FORCES_DEFAULT: c_int = ASSIST_FORCE_SUN
62 | ASSIST_FORCE_PLANETS
63 | ASSIST_FORCE_ASTEROIDS
64 | ASSIST_FORCE_EARTH_HARMONICS
65 | ASSIST_FORCE_SUN_HARMONICS
66 | ASSIST_FORCE_GR_EIH;
67
68pub const ASSIST_SUCCESS: c_int = 0;
70pub const ASSIST_ERROR_EPHEM_FILE: c_int = 1;
71pub const ASSIST_ERROR_AST_FILE: c_int = 2;
72
73unsafe extern "C" {
78 pub fn assist_ephem_create(
79 planets_path: *const c_char,
80 asteroids_path: *const c_char,
81 ) -> *mut assist_ephem;
82 pub fn assist_ephem_free(ephem: *mut assist_ephem);
83
84 pub fn assist_attach(sim: *mut reb_simulation, ephem: *mut assist_ephem) -> *mut assist_extras;
85 pub fn assist_free(ax: *mut assist_extras);
86 pub fn assist_detach(sim: *mut reb_simulation, ax: *mut assist_extras);
87
88 pub fn assist_get_particle(
89 ephem: *const assist_ephem,
90 particle_id: c_int,
91 t: c_double,
92 ) -> reb_particle;
93 pub fn assist_get_particle_with_error(
94 ephem: *const assist_ephem,
95 particle_id: c_int,
96 t: c_double,
97 error: *mut c_int,
98 ) -> reb_particle;
99
100 pub fn assist_integrate_or_interpolate(ax: *mut assist_extras, t: c_double);
101}
102
103unsafe extern "C" {
108 pub fn assist_rs_ephem_cache_reset(ax: *mut assist_extras);
110
111 pub fn assist_rs_extras_get_forces(ax: *const assist_extras) -> c_int;
113 pub fn assist_rs_extras_set_forces(ax: *mut assist_extras, f: c_int);
114 pub fn assist_rs_extras_get_geocentric(ax: *const assist_extras) -> c_int;
115 pub fn assist_rs_extras_set_geocentric(ax: *mut assist_extras, g: c_int);
116 pub fn assist_rs_extras_get_particle_params(ax: *const assist_extras) -> *mut c_double;
117 pub fn assist_rs_extras_set_particle_params(ax: *mut assist_extras, p: *mut c_double);
118
119 pub fn assist_rs_extras_get_alpha(ax: *const assist_extras) -> c_double;
121 pub fn assist_rs_extras_set_alpha(ax: *mut assist_extras, v: c_double);
122 pub fn assist_rs_extras_get_nk(ax: *const assist_extras) -> c_double;
123 pub fn assist_rs_extras_set_nk(ax: *mut assist_extras, v: c_double);
124 pub fn assist_rs_extras_get_nm(ax: *const assist_extras) -> c_double;
125 pub fn assist_rs_extras_set_nm(ax: *mut assist_extras, v: c_double);
126 pub fn assist_rs_extras_get_nn(ax: *const assist_extras) -> c_double;
127 pub fn assist_rs_extras_set_nn(ax: *mut assist_extras, v: c_double);
128 pub fn assist_rs_extras_get_r0(ax: *const assist_extras) -> c_double;
129 pub fn assist_rs_extras_set_r0(ax: *mut assist_extras, v: c_double);
130
131 pub fn assist_rs_ephem_get_jd_ref(ephem: *const assist_ephem) -> c_double;
133 pub fn assist_rs_ephem_set_jd_ref(ephem: *mut assist_ephem, jd: c_double);
134 pub fn assist_rs_ephem_get_au(ephem: *const assist_ephem) -> c_double;
135 pub fn assist_rs_ephem_get_clight(ephem: *const assist_ephem) -> c_double;
136 pub fn assist_rs_ephem_get_c_au_per_day(ephem: *const assist_ephem) -> c_double;
137 pub fn assist_rs_ephem_get_re(ephem: *const assist_ephem) -> c_double;
138 pub fn assist_rs_ephem_get_re_eq(ephem: *const assist_ephem) -> c_double;
139 pub fn assist_rs_ephem_get_emrat(ephem: *const assist_ephem) -> c_double;
140}