use std::path::PathBuf;
#[allow(unused_variables)]
pub fn setup_(m: *const crate::ported::zsh_h::module) -> i32 { 0 }
#[allow(unused_variables)]
pub fn features_(m: *const crate::ported::zsh_h::module, features: &mut Vec<String>) -> i32 { 1 }
#[allow(unused_variables)]
pub fn enables_(m: *const crate::ported::zsh_h::module, enables: &mut Option<Vec<i32>>) -> i32 { 0 }
pub fn check_dotfile(dotdir: &str, fname: &str) -> i32 { let mut p = PathBuf::from(dotdir); p.push(fname); if p.exists() { 0 } else { -1 } }
#[allow(unused_variables)]
pub fn boot_(m: *const crate::ported::zsh_h::module) -> i32 { let mut dotdir: String = crate::ported::params::getsparam("ZDOTDIR")
.unwrap_or_default();
let spaths: Vec<String> = std::env::var("ZSH_SITESCRIPT_DIR").ok()
.into_iter()
.chain(std::env::var("ZSH_SCRIPT_DIR").ok())
.chain(std::iter::once("/etc/zsh".to_string()))
.collect();
if !crate::ported::zsh_h::EMULATION(crate::ported::zsh_h::EMULATE_ZSH) {
return 0; }
if dotdir.is_empty() {
dotdir = std::env::var("HOME").unwrap_or_default(); if dotdir.is_empty() {
return 0; }
}
if check_dotfile(&dotdir, ".zshenv") == 0 || check_dotfile(&dotdir, ".zprofile") == 0 || check_dotfile(&dotdir, ".zshrc") == 0 || check_dotfile(&dotdir, ".zlogin") == 0 { return 0; }
for sp in &spaths { let buf = format!("{}/newuser", sp); if crate::ported::init::source(&buf) != SOURCE_NOT_FOUND { break; }
}
0 }
const SOURCE_NOT_FOUND: i32 = 1;
#[allow(unused_variables)]
pub fn cleanup_(m: *const crate::ported::zsh_h::module) -> i32 { 0 }
#[allow(unused_variables)]
pub fn finish_(m: *const crate::ported::zsh_h::module) -> i32 { 0 }