2020-01-23 05:26:30 +03:00
|
|
|
module picohttpparser
|
|
|
|
|
2020-10-21 12:23:03 +03:00
|
|
|
[inline]
|
|
|
|
[unsafe]
|
|
|
|
fn cpy(dst byteptr, src byteptr, len int) int {
|
|
|
|
unsafe {C.memcpy(dst, src, len)}
|
2020-01-23 05:26:30 +03:00
|
|
|
return len
|
|
|
|
}
|
|
|
|
|
|
|
|
[inline]
|
2020-10-21 12:23:03 +03:00
|
|
|
pub fn cmp(dst string, src string) bool {
|
|
|
|
if dst.len != src.len {
|
|
|
|
return false
|
|
|
|
}
|
|
|
|
return unsafe {C.memcmp(dst.str, src.str, src.len) == 0}
|
2020-01-23 05:26:30 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
[inline]
|
2020-10-21 12:23:03 +03:00
|
|
|
pub fn cmpn(dst string, src string, n int) bool {
|
|
|
|
return unsafe {C.memcmp(dst.str, src.str, n) == 0}
|
2020-01-23 05:26:30 +03:00
|
|
|
}
|