aboutsummaryrefslogtreecommitdiff
path: root/v_windows/v/old/vlib/picohttpparser/misc.v
blob: 6c8e1e7b79dcf63a0fabf94badebb644eac9f00d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
module picohttpparser

[inline; unsafe]
fn cpy(dst &byte, src &byte, 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 }
}