Commit 61f4ca50 61f4ca507cc3d95d700bcb924a896bec5139e75f by Wojciech Polak

(mu_url_init): New function.

1 parent 0d780de1
...@@ -546,3 +546,23 @@ mu_url_is_ticket (mu_url_t ticket, mu_url_t url) ...@@ -546,3 +546,23 @@ mu_url_is_ticket (mu_url_t ticket, mu_url_t url)
546 /* Guess it matches. */ 546 /* Guess it matches. */
547 return 1; 547 return 1;
548 } 548 }
549
550 int
551 mu_url_init (mu_url_t url, int port, const char *scheme)
552 {
553 int status = 0;
554
555 url->_destroy = NULL;
556
557 status = mu_url_parse (url);
558 if (status)
559 return status;
560
561 if (!mu_url_is_scheme (url, scheme))
562 return EINVAL;
563
564 if (url->port == 0)
565 url->port = port;
566
567 return status;
568 }
......