aboutsummaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/init.c b/src/init.c
index edecb95e..2ebcedf6 100644
--- a/src/init.c
+++ b/src/init.c
@@ -261,4 +261,23 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,
#endif /* _WIN32 */
+/**
+ * @internal
+ * @brief Return whether the library is initialized
+ *
+ * @returns true if the library is initialized; false otherwise.
+ *
+ * @see ssh_init()
+ */
+bool is_ssh_initialized() {
+
+ bool is_initialized = false;
+
+ ssh_mutex_lock(&ssh_init_mutex);
+ is_initialized = _ssh_initialized > 0;
+ ssh_mutex_unlock(&ssh_init_mutex);
+
+ return is_initialized;
+}
+
/** @} */