libgit2

git_transport_register

Version:

Add a custom transport definition, to be used in addition to the built-in set of transports that come with libgit2.

The caller is responsible for synchronizing calls to git_transport_register and git_transport_unregister with other calls to the library that instantiate transports.

Signature

int git_transport_register(const char *prefix, git_transport_cb cb, void *param);

Parameters

const char *
In
prefix

The scheme (ending in "://") to match, i.e. "git://"

In
cb

The callback used to create an instance of the transport

void *
In
param

A fixed parameter to pass to cb at creation time

Returns

int

0 or an error code

Versions