compat.rs: group declarations

This commit is contained in:
Johannes Altmanninger 2023-12-03 11:34:11 +01:00
parent 43e2d7b48c
commit 31ecc5e0f9
2 changed files with 19 additions and 12 deletions

View File

@ -3,44 +3,50 @@ use std::sync::atomic::AtomicPtr;
use libc::c_int;
use once_cell::sync::Lazy;
#[allow(non_snake_case)]
pub fn MB_CUR_MAX() -> usize {
unsafe { C_MB_CUR_MAX() }
}
extern "C" {
fn C_MB_CUR_MAX() -> usize;
}
#[allow(non_snake_case)]
pub fn ST_LOCAL() -> u64 {
unsafe { C_ST_LOCAL() }
}
extern "C" {
fn C_ST_LOCAL() -> u64;
}
#[allow(non_snake_case)]
pub fn MNT_LOCAL() -> u64 {
unsafe { C_MNT_LOCAL() }
}
extern "C" {
fn C_MNT_LOCAL() -> u64;
}
#[allow(non_snake_case)]
pub fn _CS_PATH() -> i32 {
unsafe { C_CS_PATH() }
}
extern "C" {
fn C_CS_PATH() -> i32;
}
#[allow(non_snake_case)]
pub static _PATH_BSHELL: AtomicPtr<i8> = AtomicPtr::new(std::ptr::null_mut());
extern "C" {
pub fn C_PATH_BSHELL() -> *const i8;
}
#[allow(non_snake_case)]
pub static _PC_CASE_SENSITIVE: Lazy<c_int> = Lazy::new(|| unsafe { C_PC_CASE_SENSITIVE() });
extern "C" {
fn C_PC_CASE_SENSITIVE() -> c_int;
}
extern "C" {
fn C_MB_CUR_MAX() -> usize;
fn C_ST_LOCAL() -> u64;
fn C_MNT_LOCAL() -> u64;
fn C_CS_PATH() -> i32;
pub(crate) fn confstr(
name: libc::c_int,
buf: *mut libc::c_char,
len: libc::size_t,
) -> libc::size_t;
pub fn C_PATH_BSHELL() -> *const i8;
fn C_PC_CASE_SENSITIVE() -> c_int;
pub fn C_O_EXLOCK() -> c_int;
pub fn stdout_stream() -> *mut libc::FILE;
pub fn UVAR_FILE_SET_MTIME_HACK() -> bool;

View File

@ -32,6 +32,7 @@ mod ast;
mod autoload;
mod builtins;
mod color;
#[allow(non_snake_case)]
mod compat;
mod complete;
mod curses;