int mco_lews_strcmp(const char *str, const char *buf, mco_uint2 start_pos, mco_uint2 buf_size);
str
buf
start_pos
buf where comparison begins.buf_size
buf.This function compares the null-terminated string
strwith a segment of the bufferbuf, starting at offsetstart_posand spanning exactlymco_strlen(str)bytes—provided that the buffer has sufficient remaining length (i.e.,start_pos + strlen(str) <= buf_size).The comparison is case-sensitive and stops as soon as a mismatch is found or the entire string is matched.
... const char *uri = "/api/perf?hello=12&word=42 HTTP/1.1\r\n"; ... int res = mco_lews_strcmp("api", uri, 1, 4); ASSERT_EQ(1, res); ...
1
str matches the contents of buf starting at start_pos.0
str at the specified position.