2018-12-19 18:01:53 +00:00
|
|
|
byte strzlen(pointer str) {
|
|
|
|
byte index
|
|
|
|
index = 0
|
2019-08-15 22:46:11 +00:00
|
|
|
while str[index] != nullchar {
|
2018-12-19 18:01:53 +00:00
|
|
|
index += 1
|
|
|
|
}
|
|
|
|
return index
|
|
|
|
}
|
|
|
|
|
|
|
|
sbyte strzcmp(pointer str1, pointer str2) {
|
|
|
|
byte i1
|
|
|
|
byte i2
|
|
|
|
i1 = 0
|
|
|
|
i2 = 0
|
|
|
|
while true {
|
|
|
|
if str1[i1] != str2[i2] {
|
|
|
|
if str1[i1] < str2[i2] { return -1 }
|
|
|
|
return 1
|
|
|
|
}
|
2019-08-15 22:46:11 +00:00
|
|
|
if str1[i1] == nullchar {
|
2018-12-19 18:01:53 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
i1 += 1
|
|
|
|
i2 += 1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void strzcopy(pointer dest, pointer src) {
|
|
|
|
byte i
|
|
|
|
byte c
|
|
|
|
i = 0
|
|
|
|
do {
|
|
|
|
c = src[i]
|
|
|
|
dest[i] = c
|
|
|
|
i += 1
|
2019-08-15 22:46:11 +00:00
|
|
|
} while c != nullchar
|
2018-12-19 18:01:53 +00:00
|
|
|
}
|
2019-11-04 01:29:16 +00:00
|
|
|
|
|
|
|
void strzpaste(pointer dest, pointer src) {
|
|
|
|
byte i
|
|
|
|
byte c
|
|
|
|
i = 0
|
|
|
|
while true {
|
|
|
|
c = src[i]
|
|
|
|
if c == nullchar { return }
|
|
|
|
dest[i] = c
|
|
|
|
i += 1
|
|
|
|
}
|
|
|
|
}
|