1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
const LINLEN: i32 = 256;
//$Procedure CNFIRM_1 ( Return status of a yes/no query )
pub fn CNFIRM_1(PRMPT: &[u8], TORF: &mut bool, ctx: &mut Context) -> f2rust_std::Result<()> {
let mut RESPNS = [b' '; LINLEN as usize];
let mut YESNO: bool = false;
//
// SPICELIB functions
//
// None.
//
//
// Local Parameters
//
//
// Local Variables
//
//
// Do while we have not gotten a yes/no response
//
YESNO = false;
while !YESNO {
//
// Prompt for a response
//
spicelib::PROMPT(PRMPT, &mut RESPNS, ctx)?;
//
// Left justify the response string, RESPNS, and convert it to
// uppercase.
//
spicelib::LJUST(&RESPNS.clone(), &mut RESPNS);
spicelib::UCASE(&RESPNS.clone(), &mut RESPNS, ctx);
if (fstr::eq(&RESPNS, b"Y") || fstr::eq(&RESPNS, b"YES")) {
*TORF = true;
YESNO = true;
} else if (fstr::eq(&RESPNS, b"N") || fstr::eq(&RESPNS, b"NO")) {
*TORF = false;
YESNO = true;
}
}
Ok(())
}