summaryrefslogtreecommitdiff
path: root/src/git/common.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-10-28 02:07:18 +0300
committerVicent Marti <tanoku@gmail.com>2010-10-28 02:07:18 +0300
commit585190183b47dc991605abcfbe3afb57220a0f29 (patch)
treef8a1f2572f667296a5b5121c64c74bb353557c93 /src/git/common.h
parent2d16373cb8d8c22b3ec99a6936b82821e99e64a5 (diff)
downloadlibgit2-585190183b47dc991605abcfbe3afb57220a0f29.tar.gz
Fix internal memory management on the library
String mememory is now managed in a much more sane manner. Fixes include: - git_person email and name is no longer limited to 64 characters - git_tree_entry filename is no longer limited to 255 characters - raw objects are properly opened & closed the minimum amount of times required for parsing - unit tests no longer leak - removed 5 other misc memory leaks as reported by Valgrind - tree writeback no longer segfaults on rare ocassions The git_person struct is no longer public. It is now managed by the library, and getter methods are in place to access its internal attributes. Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/git/common.h')
-rw-r--r--src/git/common.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/git/common.h b/src/git/common.h
index 6d4858d71..35408413d 100644
--- a/src/git/common.h
+++ b/src/git/common.h
@@ -2,6 +2,7 @@
#define INCLUDE_git_common_h__
#include "thread-utils.h"
+#include <time.h>
#ifdef __cplusplus
# define GIT_BEGIN_DECL extern "C" {
@@ -94,12 +95,13 @@ typedef struct git_repository git_repository;
/** Representation of a generic object in a repository */
typedef struct git_object git_object;
+
/** Parsed representation of a person */
-typedef struct git_person {
- char name[64]; /**< Full name */
- char email[64]; /**< Email address */
- time_t time; /**< Time when this person committed the change */
-} git_person;
+typedef struct git_person git_person;
+
+const char *git_person_name(git_person *person);
+const char *git_person_email(git_person *person);
+time_t git_person_time(git_person *person);
/** @} */
GIT_END_DECL