mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 23:37:38 +00:00
Add function to query for compile time settings.
This commit is contained in:
parent
2340b18102
commit
e564e4969c
@ -103,6 +103,29 @@ GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
|
|||||||
*/
|
*/
|
||||||
GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev);
|
GIT_EXTERN(void) git_libgit2_version(int *major, int *minor, int *rev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Combinations of these values describe the capabilities of libgit2.
|
||||||
|
*/
|
||||||
|
enum {
|
||||||
|
GIT_CAP_THREADS = ( 1 << 0 ),
|
||||||
|
GIT_CAP_HTTPS = ( 1 << 1 )
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Query compile time options for libgit2.
|
||||||
|
*
|
||||||
|
* @return A combination of GIT_CAP_* values.
|
||||||
|
*
|
||||||
|
* - GIT_CAP_THREADS
|
||||||
|
* Libgit2 was compiled with thread support. Note that thread support is still to be seen as a
|
||||||
|
* 'work in progress'.
|
||||||
|
*
|
||||||
|
* - GIT_CAP_HTTPS
|
||||||
|
* Libgit2 supports the https:// protocol. This requires the open ssl library to be
|
||||||
|
* found when compiling libgit2.
|
||||||
|
*/
|
||||||
|
GIT_EXTERN(int) git_libgit2_capabilities(void);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
GIT_END_DECL
|
GIT_END_DECL
|
||||||
#endif
|
#endif
|
||||||
|
12
src/util.c
12
src/util.c
@ -22,6 +22,18 @@ void git_libgit2_version(int *major, int *minor, int *rev)
|
|||||||
*rev = LIBGIT2_VER_REVISION;
|
*rev = LIBGIT2_VER_REVISION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int git_libgit2_capabilities()
|
||||||
|
{
|
||||||
|
return 0
|
||||||
|
#ifdef GIT_THREADS
|
||||||
|
| GIT_CAP_THREADS
|
||||||
|
#endif
|
||||||
|
#ifdef GIT_SSL
|
||||||
|
| GIT_CAP_HTTPS
|
||||||
|
#endif
|
||||||
|
;
|
||||||
|
}
|
||||||
|
|
||||||
void git_strarray_free(git_strarray *array)
|
void git_strarray_free(git_strarray *array)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
Loading…
Reference in New Issue
Block a user