]>
Commit | Line | Data |
---|---|---|
799e22ea CMN |
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 the called before any other libgit2 function in | |
18 | * order to set up global state and threading. | |
19 | * | |
6d91dc53 ET |
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. | |
799e22ea | 23 | * |
6d91dc53 | 24 | * @return the number of initializations of the library, or an error code. |
799e22ea CMN |
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 | |
6d91dc53 ET |
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). | |
799e22ea | 35 | * |
6d91dc53 ET |
36 | * @return the number of remaining initializations of the library, or an |
37 | * error code. | |
799e22ea | 38 | */ |
6d91dc53 | 39 | GIT_EXTERN(int) git_libgit2_shutdown(void); |
799e22ea CMN |
40 | |
41 | /** @} */ | |
42 | GIT_END_DECL | |
43 | #endif | |
44 |