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
55
56
57
58
59
60
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
//$Procedure TSTTXT (Create at test text file.)
pub fn TSTTXT(
NAMTXT: &[u8],
TXT: CharArray,
NLINES: i32,
LOAD: bool,
KEEP: bool,
ctx: &mut Context,
) -> f2rust_std::Result<()> {
let TXT = DummyCharArray::new(TXT, None, 1..);
let mut UNIT: i32 = 0;
//
// Local Variables.
//
KILFIL(NAMTXT, ctx)?;
//
// Create the text file.
//
UNIT = 6;
spicelib::TXTOPN(NAMTXT, &mut UNIT, ctx)?;
spicelib::WRITLA(NLINES, TXT.as_arg(), UNIT, ctx)?;
{
use f2rust_std::io;
let specs = io::CloseSpecs {
unit: Some(UNIT),
..Default::default()
};
ctx.close(specs)?;
}
//
// If this file needs to be loaded. Do it now. If not we are
// done and can return.
//
if LOAD {
spicelib::LDPOOL(NAMTXT, ctx)?;
if KEEP {
TFILES(NAMTXT, ctx);
return Ok(());
} else {
KILFIL(NAMTXT, ctx)?;
}
}
TFILES(NAMTXT, ctx);
Ok(())
}