(mu_url_init): New function.
Showing
1 changed file
with
20 additions
and
0 deletions
... | @@ -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 | } | ... | ... |
-
Please register or sign in to post a comment