Reorder alphabetically

This commit is contained in:
Peter Limkilde Svendsen
2025-02-02 22:28:32 +01:00
parent ef6b64a7c2
commit b0c6991f57
+34 -34
View File
@@ -107,11 +107,6 @@ static TIMEZONE_NAMES: Mutex<OnceCell<BTreeSet<CString>>> = Mutex::new(OnceCell:
// Hold `TIMEZONE_LOCK` when updating `tzname`, `timezone`, and `daylight`.
static TIMEZONE_LOCK: Mutex<(Option<CString>, Option<CString>)> = Mutex::new((None, None));
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html>.
#[allow(non_upper_case_globals)]
#[no_mangle]
pub static mut tzname: TzName = TzName([ptr::null_mut(); 2]);
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html>.
#[allow(non_upper_case_globals)]
#[no_mangle]
@@ -122,6 +117,11 @@ pub static mut daylight: c_int = 0;
#[no_mangle]
pub static mut timezone: c_long = 0;
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html>.
#[allow(non_upper_case_globals)]
#[no_mangle]
pub static mut tzname: TzName = TzName([ptr::null_mut(); 2]);
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/basedefs/time.h.html>.
#[repr(C)]
pub struct itimerspec {
@@ -526,6 +526,12 @@ pub unsafe extern "C" fn time(tloc: *mut time_t) -> time_t {
ts.tv_sec
}
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man3/timegm.3.html>.
#[no_mangle]
pub unsafe extern "C" fn timegm(tm: *mut tm) -> time_t {
mktime(tm)
}
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man3/timegm.3.html>.
#[deprecated]
#[no_mangle]
@@ -534,12 +540,6 @@ pub unsafe extern "C" fn timelocal(tm: *mut tm) -> time_t {
timegm(tm)
}
/// Non-POSIX, see <https://www.man7.org/linux/man-pages/man3/timegm.3.html>.
#[no_mangle]
pub unsafe extern "C" fn timegm(tm: *mut tm) -> time_t {
mktime(tm)
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_create.html>.
// #[no_mangle]
pub extern "C" fn timer_create(
@@ -556,6 +556,29 @@ pub extern "C" fn timer_delete(timerid: timer_t) -> c_int {
unimplemented!();
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html>.
// #[no_mangle]
pub extern "C" fn timer_getoverrun(timerid: timer_t) -> c_int {
unimplemented!();
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html>.
// #[no_mangle]
pub extern "C" fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int {
unimplemented!();
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html>.
// #[no_mangle]
pub extern "C" fn timer_settime(
timerid: timer_t,
flags: c_int,
value: *const itimerspec,
ovalue: *mut itimerspec,
) -> c_int {
unimplemented!();
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/tzset.html>.
#[no_mangle]
pub unsafe extern "C" fn tzset() {
@@ -574,29 +597,6 @@ pub unsafe extern "C" fn tzset() {
set_timezone(&mut lock, &std_time, dst_time)
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html>.
// #[no_mangle]
pub extern "C" fn timer_settime(
timerid: timer_t,
flags: c_int,
value: *const itimerspec,
ovalue: *mut itimerspec,
) -> c_int {
unimplemented!();
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html>.
// #[no_mangle]
pub extern "C" fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int {
unimplemented!();
}
/// See <https://pubs.opengroup.org/onlinepubs/9799919799/functions/timer_getoverrun.html>.
// #[no_mangle]
pub extern "C" fn timer_getoverrun(timerid: timer_t) -> c_int {
unimplemented!();
}
fn clear_timezone(guard: &mut MutexGuard<'_, (Option<CString>, Option<CString>)>) {
guard.0 = None;
guard.1 = None;