[libgit2-glib] Bind ggit_config_get_entry
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgit2-glib] Bind ggit_config_get_entry
- Date: Sat, 8 Aug 2015 10:08:58 +0000 (UTC)
commit 1d2a2b64bd4e45548850cf0f4d30a7a207eb0097
Author: Jesse van den Kieboom <jessevdk gnome org>
Date: Sat Aug 8 12:08:24 2015 +0200
Bind ggit_config_get_entry
libgit2-glib/ggit-config.c | 35 +++++++++++++++++++++++++++++++++++
libgit2-glib/ggit-config.h | 5 +++++
2 files changed, 40 insertions(+), 0 deletions(-)
---
diff --git a/libgit2-glib/ggit-config.c b/libgit2-glib/ggit-config.c
index 18cba01..8bfef6a 100644
--- a/libgit2-glib/ggit-config.c
+++ b/libgit2-glib/ggit-config.c
@@ -557,6 +557,41 @@ ggit_config_set_string (GgitConfig *config,
}
/**
+ * ggit_config_get_entry:
+ * @config: a #GgitConfig.
+ * @name: the configuration name.
+ * @error: a #GError for error reporting, or %NULL.
+ *
+ * Get #GgitConfigEntry of a config variable.
+ *
+ * Returns: (transfer full): the entry of @name, or %NULL if such a value
+ * does not exist.
+ *
+ **/
+GgitConfigEntry *
+ggit_config_get_entry (GgitConfig *config,
+ const gchar *name,
+ GError **error)
+{
+ git_config_entry *entry;
+ gint ret;
+
+ g_return_val_if_fail (GGIT_IS_CONFIG (config), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ ret = git_config_get_entry (&entry, _ggit_native_get (config), name);
+
+ if (ret != GIT_OK)
+ {
+ _ggit_error_set (error, ret);
+ return NULL;
+ }
+
+ return _ggit_config_entry_wrap (entry);
+}
+
+/**
* ggit_config_delete_entry:
* @config: a #GgitConfig.
* @name: the configuration value.
diff --git a/libgit2-glib/ggit-config.h b/libgit2-glib/ggit-config.h
index 4013bc0..ca01c14 100644
--- a/libgit2-glib/ggit-config.h
+++ b/libgit2-glib/ggit-config.h
@@ -85,6 +85,11 @@ gboolean ggit_config_set_string (GgitConfig *config,
const gchar *value,
GError **error);
+GgitConfigEntry *
+ ggit_config_get_entry (GgitConfig *config,
+ const gchar *name,
+ GError **error);
+
gboolean ggit_config_delete_entry (GgitConfig *config,
const gchar *name,
GError **error);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]