libgit2

git_odb_open_wstream

Version:

Open a stream to write an object into the ODB

The type and final length of the object must be specified when opening the stream.

The returned stream will be of type GIT_STREAM_WRONLY and will have the following methods:

  • stream->write: write n bytes into the stream - stream->finalize_write: close the stream and store the object in the odb - stream->free: free the stream

The streaming write won't be effective until stream->finalize_write is called and returns without an error

The stream must always be free'd or will leak memory.

See

Signature

int git_odb_open_wstream(git_odb_stream **stream, git_odb *db, size_t size, git_otype type);

Parameters

In
stream

pointer where to store the stream

In
db

object database where the stream will write

size_t
In
size

final size of the object that will be written

In
type

type of the object that will be written

Returns

int

0 if the stream was created; error code otherwise

Versions