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

19 lines
387 B
V
Raw Normal View History

2020-01-23 05:26:30 +03:00
module picohttpparser
2020-08-09 12:22:11 +03:00
[inline] [unsafe]
2020-01-23 05:26:30 +03:00
fn cpy(dst, src byteptr, len int) int {
unsafe { C.memcpy(dst, src, len) }
2020-01-23 05:26:30 +03:00
return len
}
[inline]
pub fn cmp(dst, 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]
pub fn cmpn(dst, src string, n int) bool {
return unsafe { C.memcmp(dst.str, src.str, n) == 0 }
2020-01-23 05:26:30 +03:00
}