1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/picohttpparser/misc.v
2022-04-15 18:25:45 +03:00

21 lines
403 B
V

module picohttpparser
[inline; unsafe]
fn cpy(dst &u8, src &u8, len int) int {
unsafe { C.memcpy(dst, src, len) }
return len
}
[inline]
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 }
}
[inline]
pub fn cmpn(dst string, src string, n int) bool {
return unsafe { C.memcmp(dst.str, src.str, n) == 0 }
}