[libgit2-glib] Add ggit_get_capabilities
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Add ggit_get_capabilities
- Date: Mon, 25 Mar 2013 07:16:01 +0000 (UTC)
commit b3cc0584cd2d825f90b5413baa1e1b0203718ef7
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Mon Mar 25 08:15:44 2013 +0100
Add ggit_get_capabilities
libgit2-glib/ggit-main.c | 13 +++++++++++++
libgit2-glib/ggit-main.h | 3 +++
libgit2-glib/ggit-types.c | 3 +++
libgit2-glib/ggit-types.h | 6 ++++++
4 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-main.c b/libgit2-glib/ggit-main.c
index 01b01a6..0d9d826 100644
--- a/libgit2-glib/ggit-main.c
+++ b/libgit2-glib/ggit-main.c
@@ -23,6 +23,19 @@
#include "ggit-main.h"
/**
+ * ggit_get_capabilities:
+ *
+ * Gets the capabilities of the library.
+ *
+ * Returns: a #GgitCapFlags.
+ */
+GgitCapFlags
+ggit_get_capabilities (void)
+{
+ return git_libgit2_capabilities ();
+}
+
+/**
* ggit_init:
*
* Call this function before using any other libgit2-glib function.
diff --git a/libgit2-glib/ggit-main.h b/libgit2-glib/ggit-main.h
index 167243f..bcba0be 100644
--- a/libgit2-glib/ggit-main.h
+++ b/libgit2-glib/ggit-main.h
@@ -22,9 +22,12 @@
#define __GGIT_MAIN_H__
#include <glib.h>
+#include <libgit2-glib/ggit-types.h>
G_BEGIN_DECLS
+GgitCapFlags ggit_get_capabilities (void);
+
void ggit_init (void);
G_END_DECLS
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index 7e83d2b..096be29 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -39,6 +39,9 @@
ASSERT_ENUM (GGIT_BRANCH_LOCAL, GIT_BRANCH_LOCAL);
ASSERT_ENUM (GGIT_BRANCH_REMOTE, GIT_BRANCH_REMOTE);
+ASSERT_ENUM (GGIT_CAP_THREADS, GIT_CAP_THREADS);
+ASSERT_ENUM (GGIT_CAP_HTTPS, GIT_CAP_HTTPS);
+
ASSERT_ENUM (GGIT_CONFIG_LEVEL_SYSTEM, GIT_CONFIG_LEVEL_SYSTEM);
ASSERT_ENUM (GGIT_CONFIG_LEVEL_XDG, GIT_CONFIG_LEVEL_XDG);
ASSERT_ENUM (GGIT_CONFIG_LEVEL_GLOBAL, GIT_CONFIG_LEVEL_GLOBAL);
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index 30b60eb..7a0997f 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -305,6 +305,12 @@ typedef enum
GGIT_BRANCH_REMOTE = 2
} GgitBranchType;
+typedef enum
+{
+ GGIT_CAP_THREADS = 1 << 0,
+ GGIT_CAP_HTTPS = 1 << 1
+} GgitCapFlags;
+
/**
* GgitConfigLevel:
* @GGIT_CONFIG_LEVEL_SYSTEM: System-wide configuration file.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]