diff options
author | Matthew Bowen <matthew@mgbowen.com> | 2014-03-05 21:49:23 -0500 |
---|---|---|
committer | Matthew Bowen <matthew@mgbowen.com> | 2014-03-05 21:49:23 -0500 |
commit | b9f819978c571cc806827e8b3ebc1a58a0755999 (patch) | |
tree | 64c94ef334360b064a3bdf9b6069c1422f727150 /include/git2/transport.h | |
parent | a064dc2d0b6206116a35be4b62c58c3c1170d5de (diff) | |
download | libgit2-b9f819978c571cc806827e8b3ebc1a58a0755999.tar.gz |
Added function-based initializers for every options struct.
The basic structure of each function is courtesy of arrbee.
Diffstat (limited to 'include/git2/transport.h')
-rw-r--r-- | include/git2/transport.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/include/git2/transport.h b/include/git2/transport.h index 039321088..f2b0c630d 100644 --- a/include/git2/transport.h +++ b/include/git2/transport.h @@ -280,6 +280,19 @@ struct git_transport { #define GIT_TRANSPORT_INIT {GIT_TRANSPORT_VERSION} /** + * Initializes a `git_transport` with default values. Equivalent to + * creating an instance with GIT_TRANSPORT_INIT. + * + * @param opts the `git_transport` instance to initialize. + * @param version the version of the struct; you should pass + * `GIT_TRANSPORT_VERSION` here. + * @return Zero on success; -1 on failure. + */ +GIT_EXTERN(int) git_transport_init( + git_transport* opts, + int version); + +/** * Function to use to create a transport from a URL. The transport database * is scanned to find a transport that implements the scheme of the URI (i.e. * git:// or http://) and a transport object is returned to the caller. |