Rename global.c to libgit2.c Now that we've identified that our global settings really aren't global at all, and refactored the library to match that, change global.c to libgit2.c, which is especially nice since the prefix of the functions matches the filename.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
diff --git a/src/global.c b/src/global.c
deleted file mode 100644
index e6b7f46..0000000
--- a/src/global.c
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (C) the libgit2 contributors. All rights reserved.
- *
- * This file is part of libgit2, distributed under the GNU GPL v2 with
- * a Linking Exception. For full terms see the included COPYING file.
- */
-
-#include "runtime.h"
-
-#include "alloc.h"
-#include "threadstate.h"
-#include "hash.h"
-#include "sysdir.h"
-#include "filter.h"
-#include "settings.h"
-#include "mwindow.h"
-#include "merge_driver.h"
-#include "pool.h"
-#include "streams/registry.h"
-#include "streams/mbedtls.h"
-#include "streams/openssl.h"
-#include "thread-utils.h"
-#include "git2/global.h"
-#include "transports/ssh.h"
-#include "win32/w32_stack.h"
-
-int git_libgit2_init(void)
-{
- static git_runtime_init_fn init_fns[] = {
- git_allocator_global_init,
- git_threadstate_global_init,
- git_threads_global_init,
- git_hash_global_init,
- git_sysdir_global_init,
- git_filter_global_init,
- git_merge_driver_global_init,
- git_transport_ssh_global_init,
- git_stream_registry_global_init,
- git_openssl_stream_global_init,
- git_mbedtls_stream_global_init,
- git_mwindow_global_init,
- git_pool_global_init,
- git_settings_global_init
- };
-
- return git_runtime_init(init_fns, ARRAY_SIZE(init_fns));
-}
-
-int git_libgit2_shutdown(void)
-{
- return git_runtime_shutdown();
-}
diff --git a/src/libgit2.c b/src/libgit2.c
new file mode 100644
index 0000000..e6b7f46
--- /dev/null
+++ b/src/libgit2.c
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#include "runtime.h"
+
+#include "alloc.h"
+#include "threadstate.h"
+#include "hash.h"
+#include "sysdir.h"
+#include "filter.h"
+#include "settings.h"
+#include "mwindow.h"
+#include "merge_driver.h"
+#include "pool.h"
+#include "streams/registry.h"
+#include "streams/mbedtls.h"
+#include "streams/openssl.h"
+#include "thread-utils.h"
+#include "git2/global.h"
+#include "transports/ssh.h"
+#include "win32/w32_stack.h"
+
+int git_libgit2_init(void)
+{
+ static git_runtime_init_fn init_fns[] = {
+ git_allocator_global_init,
+ git_threadstate_global_init,
+ git_threads_global_init,
+ git_hash_global_init,
+ git_sysdir_global_init,
+ git_filter_global_init,
+ git_merge_driver_global_init,
+ git_transport_ssh_global_init,
+ git_stream_registry_global_init,
+ git_openssl_stream_global_init,
+ git_mbedtls_stream_global_init,
+ git_mwindow_global_init,
+ git_pool_global_init,
+ git_settings_global_init
+ };
+
+ return git_runtime_init(init_fns, ARRAY_SIZE(init_fns));
+}
+
+int git_libgit2_shutdown(void)
+{
+ return git_runtime_shutdown();
+}