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