summaryrefslogtreecommitdiff
path: root/src/netops.h
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-10-03 06:20:20 -0700
committerBen Straub <bs@github.com>2013-10-03 06:20:20 -0700
commitfc1f7d4f15ecc3f42dbde7fc0a30933cb89152bc (patch)
tree1446cb018eb05571b4eff101ceae937688e83a1d /src/netops.h
parentde8fe729efd350ae5cb1ef25ffb08f92c6f706b9 (diff)
parentab1368766240cfe861729642abe1cddd01c0203e (diff)
downloadlibgit2-fc1f7d4f15ecc3f42dbde7fc0a30933cb89152bc.tar.gz
Merge branch 'development' into blame
Conflicts: include/git2.h
Diffstat (limited to 'src/netops.h')
-rw-r--r--src/netops.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/netops.h b/src/netops.h
index d352bf3b6..5c105d6e3 100644
--- a/src/netops.h
+++ b/src/netops.h
@@ -66,6 +66,29 @@ int gitno_send(gitno_socket *socket, const char *msg, size_t len, int flags);
int gitno_close(gitno_socket *s);
int gitno_select_in(gitno_buffer *buf, long int sec, long int usec);
+typedef struct gitno_connection_data {
+ char *host;
+ char *port;
+ char *path;
+ char *user;
+ char *pass;
+ bool use_ssl;
+} gitno_connection_data;
+
+/*
+ * This replaces all the pointers in `data` with freshly-allocated strings,
+ * that the caller is responsible for freeing.
+ * `gitno_connection_data_free_ptrs` is good for this.
+ */
+
+int gitno_connection_data_from_url(
+ gitno_connection_data *data,
+ const char *url,
+ const char *service_suffix);
+
+/* This frees all the pointers IN the struct, but not the struct itself. */
+void gitno_connection_data_free_ptrs(gitno_connection_data *data);
+
int gitno_extract_url_parts(
char **host,
char **port,