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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
pub const LBCELL: i32 = -5;
const GRPOFF: i32 = -2;
//$Procedure PODEGD ( Pod, end group, double precision )
pub fn PODEGD(POD: &mut [f64], ctx: &mut Context) -> f2rust_std::Result<()> {
let mut POD = DummyArrayMut::new(POD, LBCELL..);
let mut NUMBER: i32 = 0;
let mut OFFSET: i32 = 0;
//
// SPICELIB functions
//
//
// Local parameters
//
//
// Local variables
//
//
// Standard SPICE error handling.
//
if spicelib::RETURN(ctx) {
return Ok(());
} else {
spicelib::CHKIN(b"PODEGD", ctx)?;
}
//
// At any given time, the offset of the active group is stored
// in location GRPOFF of the control area, so POD(GRPOFF) tells
// us the location of the element preceding the active group.
//
// This element is a backward pointer, containing the offset of
// the previous group; and so on, with turtles all the way down.
// For example, consider a pod with three groups
//
// G. <10>
// 1. Bob
// 2. Carol
// 3. Ted
// 4. Alice
// 5. <0>
// 6. Fred
// 7. Wilma
// 8. Barney
// 9. Bettey
// 10. <5>
// 11. Ricky
// 12. Lucy
// 13. Fred
// 14. Ethel
//
// When the second group was created, the offset of the first
// group (zero) was appended to the pod; the location of this
// offset became the offset for the second group. When the
// third group was created, the offset of the second group (5)
// was appended; the location of this offset became the offset for
// the third group. The offset for the third group is located
// in element GRPOFF.
//
// To remove a group then, all that is necessary is to look at
// element GRPOFF to get the offset of the current group; go to
// that location to get the offset of the previous group; and
// move that offset into element GRPOFF. The new cardinality,
// of course, should be one less than the original offset (9).
//
// If the pod contains only one group, it can't be removed, but
// it can be emptied by setting the cardinality of the pod to
// zero.
//
//
PODOND(POD.as_slice(), &mut OFFSET, &mut NUMBER, ctx)?;
if (OFFSET == 0) {
spicelib::SCARDD(0, POD.as_slice_mut(), ctx)?;
} else {
POD[GRPOFF] = POD[OFFSET];
spicelib::SCARDD((OFFSET - 1), POD.as_slice_mut(), ctx)?;
}
spicelib::CHKOUT(b"PODEGD", ctx)?;
Ok(())
}