libgit2

git_config_foreach

Version:

Perform an operation on each config variable.

The callback is passed a pointer to a config variable name and the data pointer passed to this function. As soon as one of the callback functions returns something other than 0, this function returns that value.

Signature

int git_config_foreach(git_config *cfg, int (*)(const char *, void *) callback, void *data);

Parameters

In
cfg

where to get the variables from

int (*)(const char *, void *)
In
callback

the function to call on each variable

void *
In
data

the data to pass to the callback

Returns

int

GIT_SUCCESS or the return value of the callback which didn't return 0

Versions