diff options
author | Russell Belfer <rb@github.com> | 2012-04-25 10:36:01 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-04-25 11:18:08 -0700 |
commit | 01fed0a8f9b80e80c8f76cde29fc0d66cb77fff7 (patch) | |
tree | 817dbac7a66529c1a25d26cc256b819564b6cb03 /src/repository.h | |
parent | ada488bfe720d0df8187b5b58e326a13b7bdc678 (diff) | |
download | libgit2-01fed0a8f9b80e80c8f76cde29fc0d66cb77fff7.tar.gz |
Convert hashtable usage over to khash
This updates khash.h with some extra features (like error checking
on allocations, ability to use wrapped malloc, foreach calls, etc),
creates two high-level wrappers around khash: `git_khash_str` and
`git_khash_oid` for string-to-void-ptr and oid-to-void-ptr tables,
then converts all of the old usage of `git_hashtable` over to use
these new hashtables.
For `git_khash_str`, I've tried to create a set of macros that
yield an API not too unlike the old `git_hashtable` API. Since
the oid hashtable is only used in one file, I haven't bother to
set up all those macros and just use the khash APIs directly for
now.
Diffstat (limited to 'src/repository.h')
-rw-r--r-- | src/repository.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/repository.h b/src/repository.h index 178f29742..f53fa697e 100644 --- a/src/repository.h +++ b/src/repository.h @@ -13,13 +13,13 @@ #include "git2/repository.h" #include "git2/object.h" -#include "hashtable.h" #include "index.h" #include "cache.h" #include "refs.h" #include "buffer.h" #include "odb.h" #include "attr.h" +#include "khash_str.h" #define DOT_GIT ".git" #define GIT_DIR DOT_GIT "/" @@ -83,7 +83,7 @@ struct git_repository { git_cache objects; git_refcache references; git_attr_cache attrcache; - git_hashtable *submodules; + git_khash_str *submodules; char *path_repository; char *workdir; |