]> git.proxmox.com Git - libgit2.git/commitdiff
Separated git_strarray from common.h. Added doxy comments.
authorPaul Thompson <p.r.thompson@ieee.org>
Thu, 11 Oct 2012 12:04:08 +0000 (23:04 +1100)
committerPaul Thompson <p.r.thompson@ieee.org>
Thu, 11 Oct 2012 12:04:08 +0000 (23:04 +1100)
include/git2/checkout.h
include/git2/common.h
include/git2/refs.h
include/git2/remote.h
include/git2/strarray.h [new file with mode: 0644]
include/git2/tag.h
src/buffer.h

index ef3badbe994055e2d8beac18bcaaebc2333e5d0f..a4d0a0cef77039e7bfc7a3f471f356c066ad2a78 100644 (file)
@@ -10,7 +10,7 @@
 #include "common.h"
 #include "types.h"
 #include "indexer.h"
-
+#include "strarray.h"
 
 /**
  * @file git2/checkout.h
index 0af37e81f3697da82ee36995702ec8c225b61fcf..dd6909f90de952660b0cd7f7547e87d874b3683b 100644 (file)
@@ -85,14 +85,6 @@ GIT_BEGIN_DECL
  */
 #define GIT_PATH_MAX 4096
 
-typedef struct {
-       char **strings;
-       size_t count;
-} git_strarray;
-
-GIT_EXTERN(void) git_strarray_free(git_strarray *array);
-GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
-
 /**
  * Return the version of the libgit2 library
  * being currently used.
@@ -128,4 +120,5 @@ GIT_EXTERN(int) git_libgit2_capabilities(void);
 
 /** @} */
 GIT_END_DECL
+
 #endif
index 10b73f0c989f1a7e1303215a81ac015978a29284..001c2bcc797ba148fc7149b84fd912aa1a2f3738 100644 (file)
@@ -10,6 +10,7 @@
 #include "common.h"
 #include "types.h"
 #include "oid.h"
+#include "strarray.h"
 
 /**
  * @file git2/refs.h
index c015289e8bc952dc45e7baa62eb8137e30725b77..a40daec811639bd74e8e3e2a728c57c019ada23f 100644 (file)
@@ -12,6 +12,7 @@
 #include "refspec.h"
 #include "net.h"
 #include "indexer.h"
+#include "strarray.h"
 
 /**
  * @file git2/remote.h
diff --git a/include/git2/strarray.h b/include/git2/strarray.h
new file mode 100644 (file)
index 0000000..f6092fa
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2009-2012 the libgit2 contributors
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+#ifndef INCLUDE_git_strarray_h__
+#define INCLUDE_git_strarray_h__
+
+#include "common.h"
+
+/**
+ * @file git2/strarray.h
+ * @brief Git string array routines
+ * @defgroup git_strarray Git string array routines
+ * @ingroup Git
+ * @{
+ */
+GIT_BEGIN_DECL
+
+/** Array of strings */
+typedef struct _git_strarray git_strarray;
+struct _git_strarray {
+    char **strings;
+    size_t count;
+};
+
+/**
+ * Close a string array object
+ *
+ * This method must always be called once a git_strarray is no
+ * longer needed, otherwise memory will leak.
+ *
+ * @param array array to close
+ */
+GIT_EXTERN(void) git_strarray_free(git_strarray *array);
+
+/**
+ * Copy a string array object from source to target.
+ * 
+ * Note: target is overwritten and hence should be empty, 
+ * otherwise its contents are leaked.
+ *
+ * @param tgt target
+ * @param src source
+ */
+GIT_EXTERN(int) git_strarray_copy(git_strarray *tgt, const git_strarray *src);
+
+
+/** @} */
+GIT_END_DECL
+
+#endif
index 08504aef433658de5b6127f0a78c4abb36cfd03c..5602914f7247bee5b79e70eca5ac1031df5549e6 100644 (file)
@@ -11,6 +11,7 @@
 #include "types.h"
 #include "oid.h"
 #include "object.h"
+#include "strarray.h"
 
 /**
  * @file git2/tag.h
index 94b7e0e22791da27295fb684df245048fdfc60a5..2aae06c7cb473fef56803948c27eac57bb136afa 100644 (file)
@@ -8,6 +8,7 @@
 #define INCLUDE_buffer_h__
 
 #include "common.h"
+#include "git2/strarray.h"
 #include <stdarg.h>
 
 typedef struct {