File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,11 @@ int git_net_url_parse(git_net_url *url, const char *given)
153153 return error ;
154154}
155155
156+ bool git_net_url_valid (git_net_url * url )
157+ {
158+ return (url -> host && url -> port && url -> path );
159+ }
160+
156161int git_net_url_is_default_port (git_net_url * url )
157162{
158163 return (strcmp (url -> port , default_port_for_scheme (url -> scheme )) == 0 );
Original file line number Diff line number Diff line change @@ -22,15 +22,18 @@ typedef struct git_net_url {
2222#define GIT_NET_URL_INIT { NULL }
2323
2424/** Parses a string containing a URL into a structure. */
25- int git_net_url_parse (git_net_url * url , const char * str );
25+ extern int git_net_url_parse (git_net_url * url , const char * str );
26+
27+ /** Ensures that a URL is minimally valid (contains a host, port and path) */
28+ extern bool git_net_url_valid (git_net_url * url );
2629
2730/** Returns nonzero if the URL is on the default port. */
28- int git_net_url_is_default_port (git_net_url * url );
31+ extern int git_net_url_is_default_port (git_net_url * url );
2932
3033/** Swaps the contents of one URL for another. */
31- void git_net_url_swap (git_net_url * a , git_net_url * b );
34+ extern void git_net_url_swap (git_net_url * a , git_net_url * b );
3235
3336/** Disposes the contents of the structure. */
34- void git_net_url_dispose (git_net_url * url );
37+ extern void git_net_url_dispose (git_net_url * url );
3538
3639#endif
You can’t perform that action at this time.
0 commit comments