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 returns that value.

Signature

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

Parameters

In
cfg

where to get the variables from

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

the function to call on each variable

void *
In
payload

the data to pass to the callback

Returns

int

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

Versions