1 /*
2  * Copyright (C) the libgit2 contributors. All rights reserved.
3  *
4  * This file is part of libgit2, distributed under the GNU GPL v2 with
5  * a Linking Exception. For full terms see the included COPYING file.
6  */
7 #ifndef INCLUDE_git_global_h__
8 #define INCLUDE_git_global_h__
9 
10 #include "common.h"
11 
12 GIT_BEGIN_DECL
13 
14 /**
15  * Init the global state
16  *
17  * This function must be called before any other libgit2 function in
18  * order to set up global state and threading.
19  *
20  * This function may be called multiple times - it will return the number
21  * of times the initialization has been called (including this one) that have
22  * not subsequently been shutdown.
23  *
24  * @return the number of initializations of the library, or an error code.
25  */
26 GIT_EXTERN(int) git_libgit2_init(void);
27 
28 /**
29  * Shutdown the global state
30  *
31  * Clean up the global state and threading context after calling it as
32  * many times as `git_libgit2_init()` was called - it will return the
33  * number of remainining initializations that have not been shutdown
34  * (after this one).
35  *
36  * @return the number of remaining initializations of the library, or an
37  * error code.
38  */
39 GIT_EXTERN(int) git_libgit2_shutdown(void);
40 
41 /** @} */
42 GIT_END_DECL
43 #endif
44 
45