From c14454ee9f12e70a9c858c61831e23bc09432e45 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Duke\" Leto" Date: Wed, 9 Nov 2011 16:01:57 -0800 Subject: [PATCH] Give Git2.Index a proper home and list all the current subsystems in setup.winxed --- .gitignore | 1 + setup.winxed | 3 +++ src/Git2/Common.winxed | 31 ++-------------------------- src/Git2/Index.winxed | 41 ++++++++++++++++++++++++++++++++++++++ src/Git2/Repository.winxed | 1 + 5 files changed, 48 insertions(+), 29 deletions(-) create mode 100644 src/Git2/Index.winxed diff --git a/.gitignore b/.gitignore index e4a3ee3..cb32a17 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ src/Git2/Cache.pir src/Git2/Common.pir src/Git2/RefCache.pir src/Git2/Repository.pir +src/Git2/Index.pir diff --git a/setup.winxed b/setup.winxed index aa8341b..31d8d02 100644 --- a/setup.winxed +++ b/setup.winxed @@ -40,7 +40,10 @@ function main[main](argv) { function setup_stable_libraries(var parrot_libgit2) { var libs = [ + 'Cache', 'Common', + 'Index', + 'RefCache', 'Repository' ]; diff --git a/src/Git2/Common.winxed b/src/Git2/Common.winxed index e4cfb7e..525fa42 100644 --- a/src/Git2/Common.winxed +++ b/src/Git2/Common.winxed @@ -21,34 +21,7 @@ function cstring(string s) { } namespace Git2 { - class Index { - function Index() { - /* - struct git_index { - git_repository *repository; - char *index_file_path; - - time_t last_modified; - git_vector entries; - - unsigned int on_disk:1; - git_index_tree *tree; - - git_vector unmerged; - }; - */ - return new 'StructView'([ DATATYPE_STRUCT, 3, - DATATYPE_PTR, - DATATYPE_PTR, - DATATYPE_GIT_TIME_T, - DATATYPE_PTR, - DATATYPE_UINT, - DATATYPE_PTR, - DATATYPE_PTR - ]); - } - } class Branch { function Branch() { /* @@ -58,8 +31,8 @@ namespace Git2 { }; */ return new 'StructView'([ DATATYPE_STRUCT, 2, - DATATYPE_PTR, - DATATYPE_PTR + DATATYPE_PTR, + DATATYPE_PTR ]); } } diff --git a/src/Git2/Index.winxed b/src/Git2/Index.winxed new file mode 100644 index 0000000..a417b20 --- /dev/null +++ b/src/Git2/Index.winxed @@ -0,0 +1,41 @@ +$include_const 'datatypes.pasm'; +$include_const "iglobals.pasm"; +const int DATATYPE_SIZE_T = DATATYPE_LONG; // TODO: probe for appropriate type +const int DATATYPE_GIT_TIME_T = DATATYPE_INT64; // TODO: probe for support + +namespace Git2 { + class Index { + function get_sv() { + /* + struct git_index { + git_repository *repository; + char *index_file_path; + + time_t last_modified; + git_vector entries; + + unsigned int on_disk:1; + git_index_tree *tree; + + git_vector unmerged; + }; + */ + + var sv = 'StructView'([ DATATYPE_STRUCT, 3, + DATATYPE_PTR, + DATATYPE_PTR, + DATATYPE_GIT_TIME_T, + DATATYPE_PTR, + DATATYPE_UINT, + DATATYPE_PTR, + DATATYPE_PTR + ]); + + while (1) { yield(sv); } + } + var ptr; + function Index() { + self.ptr = self.get_sv().alloc(); + } + } +} diff --git a/src/Git2/Repository.winxed b/src/Git2/Repository.winxed index 60c4484..13e0d02 100644 --- a/src/Git2/Repository.winxed +++ b/src/Git2/Repository.winxed @@ -7,6 +7,7 @@ function load[anon,load]() { load_bytecode('./src/git2.pbc'); load_bytecode('./src/Git2/Common.pbc'); load_bytecode('./src/Git2/Cache.pbc'); + load_bytecode('./src/Git2/Index.pbc'); load_bytecode('./src/Git2/RefCache.pbc'); }