diff options
| author | Junio C Hamano <gitster@pobox.com> | 2023-10-10 11:39:14 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-10-10 11:39:14 -0700 |
| commit | a7a2d10421b735944f376f1de53b437bfbb93e88 (patch) | |
| tree | 7004d754ae7d6fc1e51820f556d0570da835e42c /parse.h | |
| parent | 3df51ea0a5ef88b801ab30ca28f159b898183926 (diff) | |
| parent | b1bda751739d90e1a94b47397676bcb8eebf16d5 (diff) | |
| download | git-a7a2d10421b735944f376f1de53b437bfbb93e88.tar.gz | |
Merge branch 'cw/prelim-cleanup'
Shuffle some bits across headers and sources to prepare for
libification effort.
* cw/prelim-cleanup:
parse: separate out parsing functions from config.h
config: correct bad boolean env value error message
wrapper: reduce scope of remove_or_warn()
hex-ll: separate out non-hash-algo functions
Diffstat (limited to 'parse.h')
| -rw-r--r-- | parse.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/parse.h b/parse.h new file mode 100644 index 0000000000..07d2193d69 --- /dev/null +++ b/parse.h @@ -0,0 +1,20 @@ +#ifndef PARSE_H +#define PARSE_H + +int git_parse_signed(const char *value, intmax_t *ret, intmax_t max); +int git_parse_ssize_t(const char *, ssize_t *); +int git_parse_ulong(const char *, unsigned long *); +int git_parse_int(const char *value, int *ret); +int git_parse_int64(const char *value, int64_t *ret); + +/** + * Same as `git_config_bool`, except that it returns -1 on error rather + * than dying. + */ +int git_parse_maybe_bool(const char *); +int git_parse_maybe_bool_text(const char *value); + +int git_env_bool(const char *, int); +unsigned long git_env_ulong(const char *, unsigned long); + +#endif /* PARSE_H */ |
