diff --git a/generate/descriptor.json b/generate/descriptor.json index 0131afbd1..d260176d6 100644 --- a/generate/descriptor.json +++ b/generate/descriptor.json @@ -30,6 +30,37 @@ }, "blame": { + "cType": "git_blame", + "forwardDeclare": true, + + "functions": { + "git_blame_init_options": { + "ignore": false + }, + + "git_blame_get_hunk_count": { + "ignore": false, + "args": [{ "shouldAlloc": true }] + }, + + "git_blame_get_hunk_byindex": { + "ignore": false, + "args": [{ "shouldAlloc": true }] + }, + + "git_blame_get_hunk_byline": { + "ignore": false, + "args": [{ "shouldAlloc": true }] + }, + + "git_blame_file": { + "ignore": false + }, + + "git_blame_buffer": { + "ignore": false + } + } }, "blob": { @@ -85,7 +116,64 @@ }, "branch": { - "cType": null + "cType": "git_reference", + "altType": "git_branch", + + "dependencies": [ + "../include/wrapper.h", + "../include/commit.h", + "../include/refs.h", + "node_buffer.h" + ], + + "functions": { + "git_branch_create": { + "ignore": false, + "isConstructorMethod": true + }, + + "git_branch_delete": { + "ignore": false + }, + + "git_branch_is_head": { + "ignore": false + }, + + "git_branch_iterator_free": { + "ignore": true + }, + + "git_branch_iterator_new": { + "ignore": true + }, + + "git_branch_lookup": { + "ignore": false, + "isConstructorMethod": true, + "args": [{}, {}, {}, { "isSelf": false }] + }, + + "git_branch_move": { + "ignore": false + }, + + "git_branch_name": { + "ignore": false + }, + + "git_branch_next": { + "ignore": true + }, + + "git_branch_set_upstream": { + "ignore": false + }, + + "git_branch_upstream": { + "ignore": false + } + } }, "buffer": { diff --git a/generate/filters/cpp_to_v8.js b/generate/filters/cpp_to_v8.js index dcf017a4f..0f306fea6 100644 --- a/generate/filters/cpp_to_v8.js +++ b/generate/filters/cpp_to_v8.js @@ -1,5 +1,9 @@ var isV8Value = require("./is_v8_value"); module.exports = function(cppClassName) { + if (cppClassName === "Integer") { + cppClassName = "Number"; + } + return isV8Value(cppClassName) ? cppClassName : "Object"; }; diff --git a/generate/partials/convert_from_v8.cc b/generate/partials/convert_from_v8.cc index 0d0fabdd8..238b29495 100644 --- a/generate/partials/convert_from_v8.cc +++ b/generate/partials/convert_from_v8.cc @@ -4,11 +4,11 @@ if (args[{{ jsArg }}]->Is{{ cppClassName|cppToV8 }}()) { {%endif%} - {%if cppClassName == 'String' %} + {%if cppClassName == 'String'%} String::Utf8Value {{ name }}(args[{{ jsArg }}]->ToString()); from_{{ name }} = ({{ cType }}) strdup(*{{ name }}); - {%elsif cppClassName == 'Array' %} + {%elsif cppClassName == 'Array'%} Array *tmp_{{ name }} = Array::Cast(*args[{{ jsArg }}]); from_{{ name }} = ({{ cType }})malloc(tmp_{{ name }}->Length() * sizeof({{ cType|replace '**' '*' }})); @@ -18,8 +18,8 @@ --%} from_{{ name }}[i] = ObjectWrap::Unwrap<{{ arrayElementCppClassName }}>(tmp_{{ name }}->Get(NanNew(static_cast(i)))->ToObject())->GetValue(); } - {%elsif cppClassName == 'Function' %} - {%elsif cppClassName == 'Buffer' %} + {%elsif cppClassName == 'Function'%} + {%elsif cppClassName == 'Buffer'%} from_{{ name }} = Buffer::Data(args[{{ jsArg }}]->ToObject()); {%elsif cppClassName|isV8Value %} diff --git a/generate/partials/doc.cc b/generate/partials/doc.cc index dd01b6487..158a48113 100644 --- a/generate/partials/doc.cc +++ b/generate/partials/doc.cc @@ -1,15 +1,15 @@ /** - {%each args as arg %} - {%if not arg.isReturn %} - {%if not arg.isSelf %} +{%each args as arg %} + {%if not arg.isReturn %} + {%if not arg.isSelf %} * @param {{ arg.jsClassName }} {{ arg.name }} - {%endif%} - {%endif%} - {%endeach%}{%each .|returnsInfo as returnInfo %} - {%if isAsync %} + {%endif%} + {%endif%} +{%endeach%}{%each .|returnsInfo as returnInfo %} + {%if isAsync %} * @param {{ returnInfo.jsOrCppClassName }} callback - {%else%} + {%else%} * @return {{ returnInfo.jsOrCppClassName }} {%if returnInfo.name %}{{ returnInfo.name }}{%else%}result{%endif%} - {%endif%} - {%endeach%} + {%endif%} +{%endeach%} */ diff --git a/generate/setup.js b/generate/setup.js index 72000e516..1db9a4c80 100644 --- a/generate/setup.js +++ b/generate/setup.js @@ -251,7 +251,7 @@ fileNames.forEach(function(fileName, index) { var funcDescriptor = libgit2.functions[functionName]; var descriptor = {}; - var cType = file.cType || "git_" + file.filename.slice(0, -2); + var cType = file.altType || file.cType || "git_" + file.filename.slice(0, -2); // From the hand maintained file. var functionDescriptor = functions ? functions[functionName] || ident : ident; diff --git a/generate/templates/binding.gyp b/generate/templates/binding.gyp index 3959a26ed..dc2de328b 100644 --- a/generate/templates/binding.gyp +++ b/generate/templates/binding.gyp @@ -50,6 +50,6 @@ } ] ] - }, + } ] } diff --git a/generate/templates/class_content.cc b/generate/templates/class_content.cc index 36a3935b1..55d039c5b 100644 --- a/generate/templates/class_content.cc +++ b/generate/templates/class_content.cc @@ -1,4 +1,4 @@ -// This is a generated file, modify: generate/templates/class.cc. +// This is a generated file, modify: generate/templates/class_content.cc. #include #include diff --git a/generate/templates/struct_content.cc b/generate/templates/struct_content.cc index 1ce10417e..2856b7c55 100644 --- a/generate/templates/struct_content.cc +++ b/generate/templates/struct_content.cc @@ -1,4 +1,4 @@ -// This is a generated file, modify: generate/templates/class.cc. +// This is a generated file, modify: generate/templates/struct_content.cc. #include #include #include diff --git a/generate/types.json b/generate/types.json index 64e5bc003..508fd82c8 100644 --- a/generate/types.json +++ b/generate/types.json @@ -100,8 +100,8 @@ "js": "isBinary" }, "git_branch_create": { - "cpp": "BranchCreate", - "js": "branchCreate" + "cpp": "Create", + "js": "create" }, "git_reference **": { "js": "Reference", @@ -112,8 +112,8 @@ "js": "Commit" }, "git_branch_delete": { - "cpp": "BranchDelete", - "js": "branchDelete" + "cpp": "Delete", + "js": "delete" }, "git_reference *": { "js": "Reference", @@ -132,28 +132,28 @@ "cpp": "BranchForeachCb" }, "git_branch_move": { - "cpp": "BranchMove", - "js": "branchMove" + "cpp": "Move", + "js": "move" }, "git_branch_lookup": { - "cpp": "BranchLookup", - "js": "branchLookup" + "cpp": "Lookup", + "js": "lookup" }, "git_branch_t": { - "js": "BranchT", - "cpp": "BranchT" + "js": "Number", + "cpp": "Int32" }, "git_branch_name": { - "cpp": "BranchName", - "js": "branchName" + "cpp": "Name", + "js": "name" }, "git_branch_upstream": { - "cpp": "BranchUpstream", - "js": "branchUpstream" + "cpp": "Upstream", + "js": "upstream" }, "git_branch_set_upstream": { - "cpp": "BranchSetUpstream", - "js": "branchSetUpstream" + "cpp": "SetUpstream", + "js": "setUpstream" }, "git_branch_upstream_name": { "cpp": "BranchUpstreamName", @@ -164,8 +164,8 @@ "cpp": "String" }, "git_branch_is_head": { - "cpp": "BranchIsHead", - "js": "branchIsHead" + "cpp": "IsHead", + "js": "isHead" }, "git_branch_remote_name": { "cpp": "BranchRemoteName", @@ -2889,96 +2889,96 @@ "js": "Branch" }, "git_branch_create *": { - "cpp": "BranchCreate", - "js": "branchCreate" + "cpp": "Create", + "js": "create" }, "const git_branch_create *": { - "cpp": "BranchCreate", - "js": "branchCreate" + "cpp": "Create", + "js": "create" }, "git_branch_delete *": { - "cpp": "BranchDelete", - "js": "branchDelete" + "cpp": "Delete", + "js": "delete" }, "const git_branch_delete *": { - "cpp": "BranchDelete", - "js": "branchDelete" + "cpp": "Delete", + "js": "delete" }, "git_branch_iterator_new": { - "cpp": "BranchIteratorNew", - "js": "branchIteratorNew" + "cpp": "IteratorNew", + "js": "iteratorNew" }, "git_branch_iterator_new *": { - "cpp": "BranchIteratorNew", - "js": "branchIteratorNew" + "cpp": "IteratorNew", + "js": "iteratorNew" }, "const git_branch_iterator_new *": { - "cpp": "BranchIteratorNew", - "js": "branchIteratorNew" + "cpp": "IteratorNew", + "js": "iteratorNew" }, "git_branch_next": { - "cpp": "BranchNext", - "js": "branchNext" + "cpp": "Next", + "js": "next" }, "git_branch_next *": { - "cpp": "BranchNext", - "js": "branchNext" + "cpp": "Next", + "js": "next" }, "const git_branch_next *": { - "cpp": "BranchNext", - "js": "branchNext" + "cpp": "Next", + "js": "next" }, "git_branch_iterator_free": { - "cpp": "BranchIteratorFree", - "js": "branchIteratorFree" + "cpp": "IteratorFree", + "js": "iteratorFree" }, "git_branch_iterator_free *": { - "cpp": "BranchIteratorFree", - "js": "branchIteratorFree" + "cpp": "IteratorFree", + "js": "iteratorFree" }, "const git_branch_iterator_free *": { - "cpp": "BranchIteratorFree", - "js": "branchIteratorFree" + "cpp": "IteratorFree", + "js": "iteratorFree" }, "git_branch_move *": { - "cpp": "BranchMove", - "js": "branchMove" + "cpp": "Move", + "js": "move" }, "const git_branch_move *": { - "cpp": "BranchMove", - "js": "branchMove" + "cpp": "Move", + "js": "move" }, "git_branch_lookup *": { - "cpp": "BranchLookup", - "js": "branchLookup" + "cpp": "Lookup", + "js": "lookup" }, "const git_branch_lookup *": { - "cpp": "BranchLookup", - "js": "branchLookup" + "cpp": "Lookup", + "js": "lookup" }, "git_branch_name *": { - "cpp": "BranchName", - "js": "branchName" + "cpp": "Name", + "js": "name" }, "const git_branch_name *": { - "cpp": "BranchName", - "js": "branchName" + "cpp": "Name", + "js": "name" }, "git_branch_upstream *": { - "cpp": "BranchUpstream", - "js": "branchUpstream" + "cpp": "Upstream", + "js": "upstream" }, "const git_branch_upstream *": { - "cpp": "BranchUpstream", - "js": "branchUpstream" + "cpp": "Upstream", + "js": "upstream" }, "git_branch_set_upstream *": { - "cpp": "BranchSetUpstream", - "js": "branchSetUpstream" + "cpp": "SetUpstream", + "js": "setUpstream" }, "const git_branch_set_upstream *": { - "cpp": "BranchSetUpstream", - "js": "branchSetUpstream" + "cpp": "SetUpstream", + "js": "setUpstream" }, "git_branch_upstream_name *": { "cpp": "BranchUpstreamName", @@ -2989,12 +2989,12 @@ "js": "branchUpstreamName" }, "git_branch_is_head *": { - "cpp": "BranchIsHead", - "js": "branchIsHead" + "cpp": "IsHead", + "js": "isHead" }, "const git_branch_is_head *": { - "cpp": "BranchIsHead", - "js": "branchIsHead" + "cpp": "IsHead", + "js": "isHead" }, "git_branch_remote_name *": { "cpp": "BranchRemoteName", @@ -9239,5 +9239,17 @@ "const git_cred_acquire_cb *": { "cpp": "GitCredAcquireCb", "js": "CredAcquireCb" + }, + "git_blame_init_options": { + "cpp": "InitOptions", + "js": "initOptions" + }, + "git_blame_init_options *": { + "cpp": "InitOptions", + "js": "initOptions" + }, + "const git_blame_init_options *": { + "cpp": "InitOptions", + "js": "initOptions" } } \ No newline at end of file