Commit ae646ae4 ae646ae4de46f802ec0b2c923384859e3f0b3447 by Sam Roberts

url_is_scheme(url_t, const char*): new function

1 parent 1a68a669
......@@ -38,6 +38,8 @@ extern int url_get_path __P ((const url_t, char *, size_t, size_t *));
extern int url_get_query __P ((const url_t, char *, size_t, size_t *));
extern const char* url_to_string __P ((const url_t));
extern int url_is_scheme __P ((url_t, const char* scheme));
extern int url_is_same_scheme __P ((url_t, url_t));
extern int url_is_same_user __P ((url_t, url_t));
extern int url_is_same_path __P ((url_t, url_t));
......
......@@ -429,6 +429,14 @@ url_to_string (const url_t url)
return url->name;
}
int url_is_scheme (url_t url, const char* scheme)
{
if(url && scheme && url->scheme && strcasecmp(url->scheme, scheme) == 0)
return 1;
return 0;
}
int
url_is_same_scheme (url_t url1, url_t url2)
{
......