Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions git2.nobj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ c_function "version" {
]],
},
subfiles {
"src/checkout_options.nobj.lua",
"src/diff_find_options.nobj.lua",
"src/diff_options.nobj.lua",
"src/diff_delta.nobj.lua",
"src/diff_stat.nobj.lua",
"src/diff_file.nobj.lua",
"src/diff.nobj.lua",
"src/status_options.nobj.lua",
"src/status_list.nobj.lua",
"src/status_entry.nobj.lua",
"src/strarray.nobj.lua",
"src/error.nobj.lua",
"src/repository.nobj.lua",
Expand Down
161 changes: 161 additions & 0 deletions src/checkout_options.nobj.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
-- Copyright (c) 2010-2012 by Robert G. Jakabosky <bobby@sharedrealm.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.

object "CheckoutOptions" {
c_source [[
typedef git_checkout_options CheckoutOptions;
]],
constants {
VERSION = 1,
SAFE = 0,
FORCE = 2,
RECREATE_MISSING = 4,
ALLOW_CONFLICTS = 16,
REMOVE_UNTRACKED = 32,
REMOVE_IGNORED = 64,
UPDATE_ONLY = 128,
DONT_UPDATE_INDEX = 256,
NO_REFRESH = 512,
SKIP_UNMERGED = 1024,
USE_OURS = 2048,
USE_THEIRS = 4096,
DISABLE_PATHSPEC_MATCH = 8192,
SKIP_LOCKED_DIRECTORIES = 262144,
DONT_OVERWRITE_IGNORED = 524288,
CONFLICT_STYLE_MERGE = 1048576,
CONFLICT_STYLE_DIFF3 = 2097152,
DONT_REMOVE_EXISTING = 4194304,
DONT_WRITE_INDEX = 8388608,
DRY_RUN = 16777216,
CONFLICT_STYLE_ZDIFF3 = 33554432,
NONE = 1073741824,
UPDATE_SUBMODULES = 65536,
UPDATE_SUBMODULES_IF_CHANGED = 131072,
},
constructor "init" {
c_source [[
${this} = calloc(1, sizeof(CheckoutOptions));
git_checkout_options_init(${this}, GIT_STATUS_OPTIONS_VERSION);
]],
},
destructor {
c_source [[
free(${this});
]]
},
field "unsigned int" "version",
field "unsigned int" "checkout_strategy",
method "set_checkout_strategy" {
var_in { "unsigned int", "checkout_strategy" },
c_source [[
${this}->checkout_strategy = ${checkout_strategy};
]],
},
field "int" "disable_filters",
method "set_disable_filters" {
var_in { "int", "disable_filters" },
c_source [[
${this}->disable_filters = ${disable_filters};
]],
},
field "unsigned int" "dir_mode",
method "set_dir_mode" {
var_in { "unsigned int", "dir_mode" },
c_source [[
${this}->dir_mode = ${dir_mode};
]],
},
field "unsigned int" "file_mode",
method "set_file_mode" {
var_in { "unsigned int", "file_mode" },
c_source [[
${this}->file_mode = ${file_mode};
]],
},
field "int" "file_open_flags",
method "set_file_open_flags" {
var_in { "int", "file_open_flags" },
c_source [[
${this}->file_open_flags = ${file_open_flags};
]],
},
field "unsigned int" "notify_flags",
method "set_notify_flags" {
var_in { "unsigned int", "notify_flags" },
c_source [[
${this}->notify_flags = ${notify_flags};
]],
},
method "paths" {
var_out { "StrArray *", "paths" },
c_source [[
${paths} = &${this}->paths;
]],
},
method "set_paths" {
var_in { "StrArray *", "paths" },
c_source [[
${this}->paths.strings = ${paths}->strings;
${this}->paths.count = ${paths}->count;
]],
},
field "Tree *" "baseline",
method "set_baseline" {
var_in { "Tree *", "baseline" },
c_source [[
${this}->baseline = ${baseline};
]],
},
field "Index *" "baseline_index",
method "set_baseline_index" {
var_in { "Index *", "baseline_index" },
c_source [[
${this}->baseline_index = ${baseline_index};
]],
},
field "const char *" "target_directory",
method "set_target_directory" {
var_in { "const char *", "target_directory" },
c_source [[
${this}->target_directory = ${target_directory};
]],
},
field "const char *" "ancestor_label",
method "set_ancestor_label" {
var_in { "const char *", "ancestor_label" },
c_source [[
${this}->ancestor_label = ${ancestor_label};
]],
},
field "const char *" "our_label",
method "set_our_label" {
var_in { "const char *", "our_label" },
c_source [[
${this}->our_label = ${our_label};
]],
},
field "const char *" "their_label",
method "set_their_label" {
var_in { "const char *", "their_label" },
c_source [[
${this}->their_label = ${their_label};
]],
},
}
46 changes: 46 additions & 0 deletions src/diff.nobj.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
-- Copyright (c) 2010-2012 by Robert G. Jakabosky <bobby@sharedrealm.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.

object "Diff" {
c_source [[
typedef git_diff Diff;
]],
constructor "index_to_workdir" {
c_call { "GitError", "err" } "git_diff_index_to_workdir" { "Diff *", "&this>1", "Repository *", "repo", "Index *", "index", "DiffOptions *", "opts" },
},
constructor "tree_to_index" {
c_call { "GitError", "err" } "git_diff_tree_to_index" { "Diff *", "&this>1", "Repository *", "repo", "Tree *", "tree", "Index *", "index", "DiffOptions *", "opts" },
},
constructor "tree_to_workdir_with_index" {
c_call { "GitError", "err" } "git_diff_tree_to_workdir_with_index" { "Diff *", "&this>1", "Repository *", "repo", "Tree *", "tree", "DiffOptions *", "opts" },
},
constructor "tree_to_tree" {
c_call { "GitError", "err" } "git_diff_tree_to_tree" { "Diff *", "&this>1", "Repository *", "repo", "Tree *", "tree", "Tree *", "tree", "DiffOptions *", "opts" },
},
destructor {
c_method_call "void" "git_diff_free" {}
},
method "num" {
c_method_call { "size_t", "count" } "git_diff_num_deltas" {},
},
method "find_similar" {
c_method_call { "GitError", "err" } "git_diff_find_similar" { "DiffFindOptions *", "opts" },
},
}
57 changes: 57 additions & 0 deletions src/diff_delta.nobj.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
-- Copyright (c) 2010-2012 by Robert G. Jakabosky <bobby@sharedrealm.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.

object "DiffDelta" {
c_source [[
typedef git_diff_delta DiffDelta;
]],
constants {
UNMODIFIED = 0,
ADDED = 1,
DELETED = 2,
MODIFIED = 3,
RENAMED = 4,
COPIED = 5,
IGNORED = 6,
UNTRACKED = 7,
TYPECHANGE = 8,
UNREADABLE = 9,
CONFLICTED = 10,
},
constructor "get" {
c_call "const DiffDelta *>1" "git_diff_get_delta" { "Diff *", "diff", "size_t", "idx" },
},
field "unsigned int" "status",
field "uint32_t" "flags",
field "uint16_t" "similarity",
field "uint16_t" "nfiles",
method "old_file" {
var_out { "DiffFile *", "old_file" },
c_source [[
${old_file} = &${this}->old_file;
]],
},
method "new_file" {
var_out { "DiffFile *", "new_file" },
c_source [[
${new_file} = &${this}->new_file;
]],
},
}
47 changes: 47 additions & 0 deletions src/diff_file.nobj.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
-- Copyright (c) 2010-2012 by Robert G. Jakabosky <bobby@sharedrealm.com>
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.

object "DiffFile" {
c_source [[
typedef git_diff_file DiffFile;
]],
constants {
BINARY = 1,
NOT_BINARY = 2,
VALID_ID = 4,
EXISTS = 8,
VALID_SIZE = 16,
},
destructor {
c_source [[
if(${this}->path != NULL) {
free((void *)${this}->path);
${this}->path = NULL;
}
free(${this});
]]
},
field "OID" "id",
field "const char *" "path",
field "uint64_t" "size",
field "uint32_t" "flags",
field "uint16_t" "mode",
field "uint16_t" "id_abbrev",
}
Loading