libgit2

git_hashsig_create

Version:

Compute a similarity signature for a text buffer

If you have passed the option GIT_HASHSIG_IGNORE_WHITESPACE, then the whitespace will be removed from the buffer while it is being processed, modifying the buffer in place. Sorry about that!

Signature

int git_hashsig_create(git_hashsig **out, const char *buf, size_t buflen, git_hashsig_option_t opts);

Parameters

In
out

The computed similarity signature.

const char *
In
buf

The input buffer.

size_t
In
buflen

The input buffer size.

In
opts

The signature computation options (see above).

Returns

int

0 on success, GIT_EBUFS if the buffer doesn't contain enough data to compute a valid signature (unless GIT_HASHSIG_ALLOW_SMALL_FILES is set), or error code.

Versions