git_config_get_mapped

Query the value of a config variable and return it mapped to an integer constant.

This is a helper method to easily map different possible values to a variable to integer constants that easily identify them.

A mapping array looks as follows:

git_configmap[] autocrlf_mapping = { {GIT_CVAR_FALSE, null, GIT_AUTO_CRLF_FALSE}, {GIT_CVAR_TRUE, null, GIT_AUTO_CRLF_TRUE}, {GIT_CVAR_STRING, "input", GIT_AUTO_CRLF_INPUT}, {GIT_CVAR_STRING, "default", GIT_AUTO_CRLF_DEFAULT}};

On any "false" value for the variable (e.g. "false", "FALSE", "no"), the mapping will store GIT_AUTO_CRLF_FALSE in the out parameter.

The same thing applies for any "true" value such as "true", "yes" or "1", storing the GIT_AUTO_CRLF_TRUE variable.

Otherwise, if the value matches the string "input" (with case insensitive comparison), the given constant will be stored in out, and likewise for "default".

If not a single match can be made to store in out, an error code will be returned.

@param out_ place to store the result of the mapping @param cfg config file to get the variables from @param name name of the config variable to lookup @param maps array of git_configmap objects specifying the possible mappings @param map_n number of mapping objects in maps @return 0 on success, error code otherwise

extern (C) nothrow @nogc
int
git_config_get_mapped
(
int* out_
,,
const(char)* name
,,
size_t map_n
)

Meta