libgit2

git_config_foreach

Version:

Perform an operation on each config variable.

The callback receives the normalized name and value of each variable in the config backend, and the data pointer passed to this function. As soon as one of the callback functions returns something other than 0, this function stops iterating and returns GIT_EUSER.

Signature

int git_config_foreach(const git_config *cfg, git_config_foreach_cb callback, void *payload);

Parameters

In
cfg

where to get the variables from

In
callback

the function to call on each variable

void *
In
payload

the data to pass to the callback

Returns

int

0 on success, GIT_EUSER on non-zero callback, or error code

Versions