feat: preprocess native argv into sentinel slices
This commit is contained in:
+1
-17
@@ -6,21 +6,5 @@ Init :: struct {
|
||||
}
|
||||
|
||||
Args :: struct {
|
||||
values [][*;0]u8
|
||||
}
|
||||
|
||||
argument_count func(args Args) usize {
|
||||
return args.values.len
|
||||
}
|
||||
|
||||
argument func(args Args, index usize) ?[;0]u8 {
|
||||
if index >= argument_count(args) {
|
||||
return null
|
||||
}
|
||||
pointer :: args.values[index]
|
||||
length usize := 0
|
||||
while pointer[length] != 0 {
|
||||
length += 1
|
||||
}
|
||||
return pointer[..length;0]
|
||||
values [][;0]u8
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user