2020-01-23 03:26:30 +01:00
|
|
|
module picohttpparser
|
|
|
|
|
2020-08-09 11:22:11 +02:00
|
|
|
[inline] [unsafe]
|
2020-01-23 03:26:30 +01:00
|
|
|
fn cpy(dst, src byteptr, len int) int {
|
2020-07-22 20:42:51 +02:00
|
|
|
unsafe { C.memcpy(dst, src, len) }
|
2020-01-23 03:26:30 +01:00
|
|
|
return len
|
|
|
|
}
|
|
|
|
|
|
|
|
[inline]
|
|
|
|
pub fn cmp(dst, src string) bool {
|
|
|
|
if dst.len != src.len { return false }
|
2020-07-22 20:42:51 +02:00
|
|
|
return unsafe { C.memcmp(dst.str, src.str, src.len) == 0 }
|
2020-01-23 03:26:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
[inline]
|
|
|
|
pub fn cmpn(dst, src string, n int) bool {
|
2020-07-22 20:42:51 +02:00
|
|
|
return unsafe { C.memcmp(dst.str, src.str, n) == 0 }
|
2020-01-23 03:26:30 +01:00
|
|
|
}
|