use core::ffi::{c_char, c_int, c_void};

pub const RTLD_LAZY: c_int = 1 << 0;
pub const RTLD_NOW: c_int = 0 << 0;
pub const RTLD_LOCAL: c_int = 1 << 1;
pub const RTLD_GLOBAL: c_int = 0 << 1;

#[derive(Clone, Copy)]
#[repr(C)]
pub struct Dl_info {
    pub dli_fname: *const c_char,
    pub dli_fbase: *mut c_void,
    pub dli_sname: *const c_char,
    pub dli_saddr: *mut c_void,
}

#[linkage = "weak"]
#[no_mangle]
unsafe extern "C" fn dlclose(_dl: *mut c_void) -> c_int {
    unreachable!()
}

#[linkage = "weak"]
#[no_mangle]
unsafe extern "C" fn dlerror() -> *mut c_char {
    unreachable!()
}

#[linkage = "weak"]
#[no_mangle]
unsafe extern "C" fn dlopen(_path: *const c_char, _flags: c_int) -> *mut c_void {
    unreachable!()
}

#[linkage = "weak"]
#[no_mangle]
unsafe extern "C" fn dlsym(_dl: *mut c_void, _name: *const c_char) -> *mut c_void {
    unreachable!()
}

// Non-POSIX
#[linkage = "weak"]
#[no_mangle]
unsafe extern "C" fn dladdr(_addr: *mut c_void, _info: *mut Dl_info) -> c_int {
    unreachable!()
}

#[linkage = "weak"]
#[no_mangle]
unsafe extern "C" fn dladdr1(
    _addr: *mut c_void,
    _info: *mut Dl_info,
    _extra_info: *mut *mut c_void,
    _flags: c_int,
) -> c_int {
    unreachable!()
}
