2020-01-23 02:26:30 +00:00
|
|
|
module picohttpparser
|
|
|
|
|
2021-05-08 10:32:29 +00:00
|
|
|
[inline; unsafe]
|
2022-04-15 15:25:45 +00:00
|
|
|
fn cpy(dst &u8, src &u8, len int) int {
|
2021-05-08 10:32:29 +00:00
|
|
|
unsafe { C.memcpy(dst, src, len) }
|
2020-01-23 02:26:30 +00:00
|
|
|
return len
|
|
|
|
}
|
|
|
|
|
|
|
|
[inline]
|
2020-10-21 09:23:03 +00:00
|
|
|
pub fn cmp(dst string, src string) bool {
|
|
|
|
if dst.len != src.len {
|
|
|
|
return false
|
|
|
|
}
|
2021-05-08 10:32:29 +00:00
|
|
|
return unsafe { C.memcmp(dst.str, src.str, src.len) == 0 }
|
2020-01-23 02:26:30 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
[inline]
|
2020-10-21 09:23:03 +00:00
|
|
|
pub fn cmpn(dst string, src string, n int) bool {
|
2021-05-08 10:32:29 +00:00
|
|
|
return unsafe { C.memcmp(dst.str, src.str, n) == 0 }
|
2020-01-23 02:26:30 +00:00
|
|
|
}
|