use super::*;
use f2rust_std::*;
pub const LBCELL: i32 = -5;
pub fn LBUPD_1(
NLINE: i32,
NCOM: i32,
PTRS: &mut [i32],
ctx: &mut Context,
) -> f2rust_std::Result<()> {
let mut PTRS = DummyArrayMut::new(PTRS, LBCELL..);
if spicelib::RETURN(ctx) {
return Ok(());
} else {
spicelib::CHKIN(b"LBUPD_1", ctx)?;
if (((NLINE < 0) || (NCOM < 1))
|| (((NLINE + NCOM) * 2) > spicelib::SIZEI(PTRS.as_slice(), ctx)?))
{
spicelib::SETMSG(b"Tried to store # lines, # holes.", ctx);
spicelib::ERRINT(b"#", NLINE, ctx);
spicelib::ERRINT(b"#", NCOM, ctx);
spicelib::SIGERR(b"SPICE(LBCORRUPTED)", ctx)?;
spicelib::CHKOUT(b"LBUPD_1", ctx)?;
return Ok(());
}
}
PTRS[-2] = NLINE;
spicelib::SCARDI((2 * (NLINE + NCOM)), PTRS.as_slice_mut(), ctx)?;
spicelib::CHKOUT(b"LBUPD_1", ctx)?;
Ok(())
}