diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2014-01-26 16:11:18 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-01-27 04:44:05 +0100 |
| commit | ee550477d1c22273d6d9701b444041ff101144ec (patch) | |
| tree | d512e555ecfb8c9e94cc2c2bbff435f4a47b3598 /include | |
| parent | b25d87c9cdef0bc09007c756d7e52f15eb4622d7 (diff) | |
| download | libgit2-ee550477d1c22273d6d9701b444041ff101144ec.tar.gz | |
config: use git_buf for returning paths
Again, we already did this internally, so simply remove the conversions.
Diffstat (limited to 'include')
| -rw-r--r-- | include/git2/config.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/include/git2/config.h b/include/git2/config.h index f650f1b41..663b4f6ba 100644 --- a/include/git2/config.h +++ b/include/git2/config.h @@ -9,6 +9,7 @@ #include "common.h" #include "types.h" +#include "buffer.h" /** * @file git2/config.h @@ -90,11 +91,10 @@ typedef struct { * This method will not guess the path to the xdg compatible * config file (.config/git/config). * - * @param out Buffer to store the path in - * @param length size of the buffer in bytes - * @return 0 if a global configuration file has been found. Its path will be stored in `buffer`. + * @param out Pointer to a user-allocated git_buf in which to store the path + * @return 0 if a global configuration file has been found. Its path will be stored in `out`. */ -GIT_EXTERN(int) git_config_find_global(char *out, size_t length); +GIT_EXTERN(int) git_config_find_global(git_buf *out); /** * Locate the path to the global xdg compatible configuration file @@ -107,25 +107,23 @@ GIT_EXTERN(int) git_config_find_global(char *out, size_t length); * may be used on any `git_config` call to load the * xdg compatible configuration file. * - * @param out Buffer to store the path in - * @param length size of the buffer in bytes + * @param out Pointer to a user-allocated git_buf in which to store the path * @return 0 if a xdg compatible configuration file has been - * found. Its path will be stored in `buffer`. + * found. Its path will be stored in `out`. */ -GIT_EXTERN(int) git_config_find_xdg(char *out, size_t length); +GIT_EXTERN(int) git_config_find_xdg(git_buf *out); /** * Locate the path to the system configuration file * * If /etc/gitconfig doesn't exist, it will look for * %PROGRAMFILES%\Git\etc\gitconfig. - - * @param out Buffer to store the path in - * @param length size of the buffer in bytes + * + * @param out Pointer to a user-allocated git_buf in which to store the path * @return 0 if a system configuration file has been - * found. Its path will be stored in `buffer`. + * found. Its path will be stored in `out`. */ -GIT_EXTERN(int) git_config_find_system(char *out, size_t length); +GIT_EXTERN(int) git_config_find_system(git_buf *out); /** * Open the global, XDG and system configuration files |
