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 *)); ...@@ -38,6 +38,8 @@ extern int url_get_path __P ((const url_t, char *, size_t, size_t *));
38 extern int url_get_query __P ((const url_t, char *, size_t, size_t *)); 38 extern int url_get_query __P ((const url_t, char *, size_t, size_t *));
39 extern const char* url_to_string __P ((const url_t)); 39 extern const char* url_to_string __P ((const url_t));
40 40
41 extern int url_is_scheme __P ((url_t, const char* scheme));
42
41 extern int url_is_same_scheme __P ((url_t, url_t)); 43 extern int url_is_same_scheme __P ((url_t, url_t));
42 extern int url_is_same_user __P ((url_t, url_t)); 44 extern int url_is_same_user __P ((url_t, url_t));
43 extern int url_is_same_path __P ((url_t, url_t)); 45 extern int url_is_same_path __P ((url_t, url_t));
......
...@@ -429,6 +429,14 @@ url_to_string (const url_t url) ...@@ -429,6 +429,14 @@ url_to_string (const url_t url)
429 return url->name; 429 return url->name;
430 } 430 }
431 431
432 int url_is_scheme (url_t url, const char* scheme)
433 {
434 if(url && scheme && url->scheme && strcasecmp(url->scheme, scheme) == 0)
435 return 1;
436
437 return 0;
438 }
439
432 int 440 int
433 url_is_same_scheme (url_t url1, url_t url2) 441 url_is_same_scheme (url_t url1, url_t url2)
434 { 442 {
......