Skip to content

Commit

Permalink
Give Git2.Index a proper home and list all the current subsystems in …
Browse files Browse the repository at this point in the history
…setup.winxed
  • Loading branch information
leto committed Nov 10, 2011
1 parent 1dfe1d8 commit c14454e
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -8,3 +8,4 @@ src/Git2/Cache.pir
src/Git2/Common.pir
src/Git2/RefCache.pir
src/Git2/Repository.pir
src/Git2/Index.pir
3 changes: 3 additions & 0 deletions setup.winxed
Expand Up @@ -40,7 +40,10 @@ function main[main](argv) {

function setup_stable_libraries(var parrot_libgit2) {
var libs = [
'Cache',
'Common',
'Index',
'RefCache',
'Repository'
];

Expand Down
31 changes: 2 additions & 29 deletions src/Git2/Common.winxed
Expand Up @@ -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() {
/*
Expand All @@ -58,8 +31,8 @@ namespace Git2 {
};
*/
return new 'StructView'([ DATATYPE_STRUCT, 2,
DATATYPE_PTR,
DATATYPE_PTR
DATATYPE_PTR,
DATATYPE_PTR
]);
}
}
Expand Down
41 changes: 41 additions & 0 deletions 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();
}
}
}
1 change: 1 addition & 0 deletions src/Git2/Repository.winxed
Expand Up @@ -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');
}

Expand Down

0 comments on commit c14454e

Please sign in to comment.