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
//
// GENERATED FILE
//
use super::*;
use f2rust_std::*;
//$Procedure UPTO ( Up to the next index of a substring )
pub fn UPTO(STRING: &[u8], SUBSTR: &[u8], START: i32) -> i32 {
let mut UPTO: i32 = 0;
let mut STRLEN: i32 = 0;
let mut I: i32 = 0;
let mut B: i32 = 0;
//
// Local variables
//
//
// Just like it says in the header.
//
STRLEN = intrinsics::LEN(STRING);
B = intrinsics::MAX0(&[1, START]);
if (B > STRLEN) {
UPTO = 0;
} else {
I = intrinsics::INDEX(fstr::substr(STRING, B..), SUBSTR);
if (I > 0) {
UPTO = ((B + I) - 2);
} else {
UPTO = STRLEN;
}
}
UPTO
}