Change mg_match_prefix_n to take mg_str

Part of general drive to use mg_str instead of pointer + length.
Adda unit test for mg_match_prefix.

PUBLISHED_FROM=1402506769b0941c6dbe6ae06e03e41df32d6008
This commit is contained in:
Deomid Ryabkov authored and rojer committed 2016-04-01 03:14:35 +01:00
1 parent 673796fb3a
commit f49df51544
2 files changed
+31 -29

No files matched your search

+1 -2
View File
@@ -1881,8 +1881,7 @@ const char *mg_next_comma_list_entry(const char *list, struct mg_str *val,
* Match is case-insensitive. Return number of bytes matched, or -1 if no match.
*/
int mg_match_prefix(const char *pattern, int pattern_len, const char *str);
int mg_match_prefix_n(const char *pattern, int pattern_len, const char *str,
int str_len);
int mg_match_prefix_n(const struct mg_str pattern, const struct mg_str str);
/*
* A helper function for creating mg_str struct from plain C string.