v/vlib/picohttpparser/misc.v

21 lines
403 B
V
Raw Normal View History

2020-01-23 03:26:30 +01:00
module picohttpparser
[inline; unsafe]
2022-04-15 17:25:45 +02:00
fn cpy(dst &u8, src &u8, len int) int {
unsafe { C.memcpy(dst, src, len) }
2020-01-23 03:26:30 +01:00
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 }
2020-01-23 03:26:30 +01:00
}
[inline]
pub fn cmpn(dst string, src string, n int) bool {
return unsafe { C.memcmp(dst.str, src.str, n) == 0 }
2020-01-23 03:26:30 +01:00
}