Files
git/contrib/libgit-sys/public_symbol_export.h
Josh Steadmon d76eb0dccc libgit-sys: also export some config_set functions
In preparation for implementing a higher-level Rust API for accessing
Git configs, export some of the upstream configset API via libgitpub and
libgit-sys. Since this will be exercised as part of the higher-level API
in the next commit, no tests have been added for libgit-sys.

While we're at it, add git_configset_alloc() and git_configset_free()
functions in libgitpub so that callers can manage config_set structs on
the heap. This also allows non-C external consumers to treat config_sets
as opaque structs.

Co-authored-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Calvin Wan <calvinwan@google.com>
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2025-01-29 15:06:50 -08:00

19 lines
568 B
C

#ifndef PUBLIC_SYMBOL_EXPORT_H
#define PUBLIC_SYMBOL_EXPORT_H
struct libgit_config_set *libgit_configset_alloc(void);
void libgit_configset_free(struct libgit_config_set *cs);
int libgit_configset_add_file(struct libgit_config_set *cs, const char *filename);
int libgit_configset_get_int(struct libgit_config_set *cs, const char *key, int *dest);
int libgit_configset_get_string(struct libgit_config_set *cs, const char *key, char **dest);
const char *libgit_user_agent(void);
const char *libgit_user_agent_sanitized(void);
#endif /* PUBLIC_SYMBOL_EXPORT_H */