[PATCH v2 3/6] connect: expose parse_connect_url()
From: Patrick Steinhardt <hidden>
Date: 2016-06-15 23:05:56
Subsystem:
the rest · Maintainer:
Linus Torvalds
Expose parse_connect_url which is to be used later in this patch series. Signed-off-by: Patrick Steinhardt <redacted> --- connect.c | 13 +------------ connect.h | 13 +++++++++++++ 2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/connect.c b/connect.c
index c0144d8..bdbcee4 100644
--- a/connect.c
+++ b/connect.c@@ -228,13 +228,6 @@ int server_supports(const char *feature) return !!server_feature_value(feature, NULL); } -enum protocol { - PROTO_LOCAL = 1, - PROTO_FILE, - PROTO_SSH, - PROTO_GIT -}; - int url_is_local_not_ssh(const char *url) { const char *colon = strchr(url, ':');
@@ -580,11 +573,7 @@ static char *get_port(char *host) return NULL; } -/* - * Extract protocol and relevant parts from the specified connection URL. - * The caller must free() the returned strings. - */ -static enum protocol parse_connect_url(const char *url_orig, char **ret_host, +enum protocol parse_connect_url(const char *url_orig, char **ret_host, char **ret_path) { char *url;
diff --git a/connect.h b/connect.h
index c41a685..245890f 100644
--- a/connect.h
+++ b/connect.h@@ -11,4 +11,17 @@ extern int parse_feature_request(const char *features, const char *feature); extern const char *server_feature_value(const char *feature, int *len_ret); extern int url_is_local_not_ssh(const char *url); +enum protocol { + PROTO_LOCAL = 1, + PROTO_FILE, + PROTO_SSH, + PROTO_GIT +}; + +/* + * Extract protocol and relevant parts from the specified connection URL. + * The caller must free() the returned strings. + */ +extern enum protocol parse_connect_url(const char *url_orig, char **ret_host, char **ret_path); + #endif
--
2.5.0