diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-10 20:53:30 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2012-09-10 20:53:30 +0100 |
commit | 8ad8200fd7e40095f152b4a3a44da12c8ee817dd (patch) | |
tree | 59fdbb560c0f76c781eed67d2f2a0a8641d744de /src | |
parent | 07ce6153c6341237098b3ba2df68cba720e0927f (diff) | |
download | luagit2-8ad8200fd7e40095f152b4a3a44da12c8ee817dd.tar.gz |
pregenpregen-for-07ce615
Diffstat (limited to 'src')
-rw-r--r-- | src/pre_generated-git2.nobj.c | 1139 |
1 files changed, 853 insertions, 286 deletions
diff --git a/src/pre_generated-git2.nobj.c b/src/pre_generated-git2.nobj.c index f17e37d..c1d3de4 100644 --- a/src/pre_generated-git2.nobj.c +++ b/src/pre_generated-git2.nobj.c @@ -181,6 +181,11 @@ typedef enum { REG_META, } module_reg_type; +typedef struct reg_impl { + const char *if_name; + const void *impl; +} reg_impl; + typedef struct reg_sub_module { obj_type *type; module_reg_type req_type; @@ -190,6 +195,7 @@ typedef struct reg_sub_module { const obj_base *bases; const obj_field *fields; const obj_const *constants; + const reg_impl *implements; int bidirectional_consts; } reg_sub_module; @@ -287,6 +293,9 @@ static obj_type obj_types[] = { #define obj_type_id_Reference 19 #define obj_type_Reference (obj_types[obj_type_id_Reference]) { NULL, 19, OBJ_TYPE_FLAG_WEAK_REF, "Reference" }, +#define obj_type_id_merge 20 +#define obj_type_merge (obj_types[obj_type_id_merge]) + { NULL, 20, OBJ_TYPE_FLAG_WEAK_REF, "merge" }, {NULL, -1, 0, NULL}, }; @@ -401,6 +410,183 @@ static int nobj_try_loading_ffi(lua_State *L, const char *ffi_mod_name, } #endif + +typedef struct { + void *impl; + void *obj; +} obj_implement; + +static FUNC_UNUSED void *obj_implement_luaoptional(lua_State *L, int _index, void **impl, char *if_name) { + void *ud; + if(lua_isnoneornil(L, _index)) { + return NULL; + } + /* get the implements table for this interface. */ + lua_pushlightuserdata(L, if_name); + lua_rawget(L, LUA_REGISTRYINDEX); + + /* get pointer to userdata value & check if it is a userdata value. */ + ud = (obj_implement *)lua_touserdata(L, _index); + if(ud != NULL) { + /* get the userdata's metatable */ + if(lua_getmetatable(L, _index)) { + /* lookup metatable in interface table for this object's implementation of the interface. */ + lua_gettable(L, -2); + } else { + /* no metatable. */ + goto no_interface; + } +#if LUAJIT_FFI + } else if(nobj_ffi_support_enabled_hint) { /* handle cdata. */ + /* get cdata interface check function from interface table. */ + lua_getfield(L, -1, "cdata"); + if(lua_isfunction(L, -1)) { + /* pass cdata to function, return value should be an implmentation. */ + lua_pushvalue(L, _index); + lua_call(L, 1, 1); + /* get pointer to cdata. */ + ud = (void *)lua_topointer(L, _index); + } else { + lua_pop(L, 1); /* pop non-function. */ + goto no_interface; + } +#endif + } else { + goto no_interface; + } + + if(!lua_isnil(L, -1)) { + *impl = lua_touserdata(L, -1); + lua_pop(L, 2); /* pop interface table & implementation. */ + /* object implements interface. */ + return ud; + } else { + lua_pop(L, 1); /* pop nil. */ + } +no_interface: + lua_pop(L, 1); /* pop interface table. */ + return NULL; +} + +static FUNC_UNUSED void *obj_implement_luacheck(lua_State *L, int _index, void **impl, char *type) { + void *ud = obj_implement_luaoptional(L, _index, impl, type); + if(ud == NULL) { +#define ERROR_BUFFER_SIZE 256 + char buf[ERROR_BUFFER_SIZE]; + snprintf(buf, ERROR_BUFFER_SIZE-1,"Expected object with %s interface", type); + /* value doesn't implement this interface. */ + luaL_argerror(L, _index, buf); + } + return ud; +} + +/* use static pointer as key to interfaces table. (version 1.0) */ +static char obj_interfaces_table_key[] = "obj_interfaces<1.0>_table_key"; + +static void obj_get_global_interfaces_table(lua_State *L) { + /* get global interfaces table. */ + lua_getfield(L, LUA_REGISTRYINDEX, obj_interfaces_table_key); + if(lua_isnil(L, -1)) { + /* Need to create global interfaces table. */ + lua_pop(L, 1); /* pop nil */ + lua_createtable(L, 0, 4); /* 0 size array part, small hash part. */ + lua_pushvalue(L, -1); /* dup table. */ + /* store interfaces table in Lua registery. */ + lua_setfield(L, LUA_REGISTRYINDEX, obj_interfaces_table_key); + } +} + +static void obj_get_interface(lua_State *L, const char *name, int global_if_tab) { + /* get a interface's implementation table */ + lua_getfield(L, global_if_tab, name); + if(lua_isnil(L, -1)) { + lua_pop(L, 1); /* pop nil */ + /* new interface. (i.e. no object implement it yet.) + * + * create an empty table for this interface that will be used when an + * implementation is registered for this interface. + */ + lua_createtable(L, 0, 2); /* 0 size array part, small hash part. */ + lua_pushvalue(L, -1); /* dup table. */ + lua_setfield(L, global_if_tab, name); /* store interface in global interfaces table. */ + } +} + +static int obj_get_userdata_interface(lua_State *L) { + /* get the userdata's metatable */ + if(lua_getmetatable(L, 2)) { + /* lookup metatable in interface table for the userdata's implementation of the interface. */ + lua_gettable(L, 1); + if(!lua_isnil(L, -1)) { + /* return the implementation. */ + return 1; + } + } + /* no metatable or no implementation. */ + return 0; +} + +static void obj_interface_register(lua_State *L, char *name, int global_if_tab) { + /* get the table of implementations for this interface. */ + obj_get_interface(L, name, global_if_tab); + + /* check for 'userdata' function. */ + lua_getfield(L, -1, "userdata"); + if(lua_isnil(L, -1)) { + lua_pop(L, 1); /* pop nil. */ + /* add C function for getting a userdata's implementation. */ + lua_pushcfunction(L, obj_get_userdata_interface); + lua_setfield(L, -2, "userdata"); + } else { + /* already have function. */ + lua_pop(L, 1); /* pop C function. */ + } + /* we are going to use a lightuserdata pointer for fast lookup of the interface's impl. table. */ + lua_pushlightuserdata(L, name); + lua_insert(L, -2); + lua_settable(L, LUA_REGISTRYINDEX); +} + +static void obj_register_interfaces(lua_State *L, char *interfaces[]) { + int i; + int if_tab; + /* get global interfaces table. */ + obj_get_global_interfaces_table(L); + if_tab = lua_gettop(L); + + for(i = 0; interfaces[i] != NULL ; i++) { + obj_interface_register(L, interfaces[i], if_tab); + } + lua_pop(L, 1); /* pop global interfaces table. */ +} + +static void obj_type_register_implement(lua_State *L, const reg_impl *impl, int global_if_tab, int mt_tab) { + /* get the table of implementations for this interface. */ + obj_get_interface(L, impl->if_name, global_if_tab); + + /* register object's implement in the interface table. */ + lua_pushvalue(L, mt_tab); + lua_pushlightuserdata(L, (void *)impl->impl); + lua_settable(L, -3); + + lua_pop(L, 1); /* pop inteface table. */ +} + +static void obj_type_register_implements(lua_State *L, const reg_impl *impls) { + int if_tab; + int mt_tab; + /* get absolute position of object's metatable. */ + mt_tab = lua_gettop(L); + /* get global interfaces table. */ + obj_get_global_interfaces_table(L); + if_tab = lua_gettop(L); + + for(; impls->if_name != NULL ; impls++) { + obj_type_register_implement(L, impls, if_tab, mt_tab); + } + lua_pop(L, 1); /* pop global interfaces table. */ +} + #ifndef REG_PACKAGE_IS_CONSTRUCTOR #define REG_PACKAGE_IS_CONSTRUCTOR 1 #endif @@ -496,7 +682,7 @@ static FUNC_UNUSED obj_udata *obj_udata_luacheck_internal(lua_State *L, int _ind return ud; } } - } else if(!lua_isnil(L, _index)) { + } else if(!lua_isnoneornil(L, _index)) { /* handle cdata. */ /* get private table. */ lua_pushlightuserdata(L, obj_udata_private_key); @@ -535,7 +721,7 @@ static FUNC_UNUSED void *obj_udata_luacheck(lua_State *L, int _index, obj_type * static FUNC_UNUSED void *obj_udata_luaoptional(lua_State *L, int _index, obj_type *type) { void *obj = NULL; - if(lua_isnil(L, _index)) { + if(lua_isnoneornil(L, _index)) { return obj; } obj_udata_luacheck_internal(L, _index, &(obj), type, 1); @@ -725,7 +911,7 @@ static FUNC_UNUSED void * obj_simple_udata_luacheck(lua_State *L, int _index, ob return ud; } } - } else if(!lua_isnil(L, _index)) { + } else if(!lua_isnoneornil(L, _index)) { /* handle cdata. */ /* get private table. */ lua_pushlightuserdata(L, obj_udata_private_key); @@ -751,7 +937,7 @@ static FUNC_UNUSED void * obj_simple_udata_luacheck(lua_State *L, int _index, ob } static FUNC_UNUSED void * obj_simple_udata_luaoptional(lua_State *L, int _index, obj_type *type) { - if(lua_isnil(L, _index)) { + if(lua_isnoneornil(L, _index)) { return NULL; } return obj_simple_udata_luacheck(L, _index, type); @@ -992,6 +1178,8 @@ static void obj_type_register(lua_State *L, const reg_sub_module *type_reg, int obj_type_register_constants(L, type_reg->constants, -2, type_reg->bidirectional_consts); + obj_type_register_implements(L, type_reg->implements); + lua_pushliteral(L, "__index"); lua_pushvalue(L, -3); /* dup methods table */ lua_rawset(L, -3); /* metatable.__index = methods */ @@ -1012,6 +1200,12 @@ static FUNC_UNUSED int lua_checktype_ref(lua_State *L, int _index, int _type) { +static char *obj_interfaces[] = { + NULL, +}; + + + #define obj_type_StrArray_check(L, _index) \ (StrArray *)obj_simple_udata_luacheck(L, _index, &(obj_type_StrArray)) #define obj_type_StrArray_optional(L, _index) \ @@ -1287,7 +1481,7 @@ static int odb_backend_read_cb(void **data_p, size_t *len_p, git_otype *type_p, return err; } -static int odb_backend_read_prefix_cb(git_oid *out_oid, void **data_p, size_t *len_p, git_otype *type_p, git_odb_backend *backend, const git_oid *short_oid, unsigned int len) +static int odb_backend_read_prefix_cb(git_oid *out_oid, void **data_p, size_t *len_p, git_otype *type_p, git_odb_backend *backend, const git_oid *short_oid, size_t len) { *data_p = NULL; if(len >= GIT_OID_HEXSZ) { @@ -1454,7 +1648,8 @@ static int StrArray__new__meth(lua_State *L) { /* method: free */ static int StrArray__free__meth(lua_State *L) { - StrArray * this_idx1 = obj_type_StrArray_delete(L,1); + StrArray * this_idx1; + this_idx1 = obj_type_StrArray_delete(L,1); if(this_idx1->strings != 0) { git_strarray_free(this_idx1); this_idx1->strings = NULL; @@ -1465,9 +1660,11 @@ static int StrArray__free__meth(lua_State *L) { /* method: str */ static int StrArray__str__meth(lua_State *L) { - StrArray * this_idx1 = obj_type_StrArray_check(L,1); - size_t n_idx2 = luaL_checkinteger(L,2); + StrArray * this_idx1; + size_t n_idx2; const char * str_idx1 = NULL; + this_idx1 = obj_type_StrArray_check(L,1); + n_idx2 = luaL_checkinteger(L,2); if(n_idx2 < this_idx1->count) { str_idx1 = this_idx1->strings[n_idx2]; } @@ -1478,9 +1675,10 @@ static int StrArray__str__meth(lua_State *L) { /* method: get_array */ static int StrArray__get_array__meth(lua_State *L) { - StrArray * this_idx1 = obj_type_StrArray_check(L,1); + StrArray * this_idx1; size_t n; + this_idx1 = obj_type_StrArray_check(L,1); lua_createtable(L, this_idx1->count, 0); for(n = 0; n < this_idx1->count; n++) { lua_pushstring(L, this_idx1->strings[n]); @@ -1492,8 +1690,9 @@ static int StrArray__get_array__meth(lua_State *L) { /* method: count */ static int StrArray__count__meth(lua_State *L) { - StrArray * this_idx1 = obj_type_StrArray_check(L,1); + StrArray * this_idx1; size_t field_idx1 = 0; + this_idx1 = obj_type_StrArray_check(L,1); field_idx1 = this_idx1->count; lua_pushinteger(L, field_idx1); @@ -1520,11 +1719,14 @@ static void error_code__GitError__push(lua_State *L, GitError err) { case GIT_EBUFS: err_str = "EBUFS"; break; + case GIT_EUSER: + err_str = "EUSER"; + break; case GIT_PASSTHROUGH: err_str = "PASSTHROUGH"; break; - case GIT_REVWALKOVER: - err_str = "REVWALKOVER"; + case GIT_ITEROVER: + err_str = "ITEROVER"; break; case GIT_OK: default: @@ -1541,10 +1743,11 @@ static void error_code__GitError__push(lua_State *L, GitError err) { /* method: open */ static int Repository__open__meth(lua_State *L) { size_t path_len_idx1; - const char * path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); + const char * path_idx1; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Repository * this_idx1; GitError err_idx2 = GIT_OK; + path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); err_idx2 = git_repository_open(&(this_idx1), path_idx1); if(!(GIT_OK != err_idx2)) { obj_type_Repository_push(L, this_idx1, this_flags_idx1); @@ -1558,11 +1761,13 @@ static int Repository__open__meth(lua_State *L) { /* method: init */ static int Repository__init__meth(lua_State *L) { size_t path_len_idx1; - const char * path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); - unsigned int is_bare_idx2 = luaL_checkinteger(L,2); + const char * path_idx1; + unsigned int is_bare_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Repository * this_idx1; GitError err_idx2 = GIT_OK; + path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); + is_bare_idx2 = luaL_checkinteger(L,2); err_idx2 = git_repository_init(&(this_idx1), path_idx1, is_bare_idx2); if(!(GIT_OK != err_idx2)) { obj_type_Repository_push(L, this_idx1, this_flags_idx1); @@ -1576,7 +1781,8 @@ static int Repository__init__meth(lua_State *L) { /* method: _priv */ static int Repository__delete__meth(lua_State *L) { int this_flags_idx1 = 0; - Repository * this_idx1 = obj_type_Repository_delete(L,1,&(this_flags_idx1)); + Repository * this_idx1; + this_idx1 = obj_type_Repository_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_repository_free(this_idx1); return 0; @@ -1584,10 +1790,11 @@ static int Repository__delete__meth(lua_State *L) { /* method: head */ static int Repository__head__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; int head_flags_idx1 = OBJ_UDATA_FLAG_OWN; Reference * head_idx1; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Repository_check(L,1); err_idx2 = git_repository_head(&(head_idx1), this_idx1); if(!(GIT_OK != err_idx2)) { obj_type_Reference_push(L, head_idx1, head_flags_idx1); @@ -1600,8 +1807,9 @@ static int Repository__head__meth(lua_State *L) { /* method: head_detached */ static int Repository__head_detached__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; bool rc_git_repository_head_detached_idx1 = 0; + this_idx1 = obj_type_Repository_check(L,1); rc_git_repository_head_detached_idx1 = git_repository_head_detached(this_idx1); lua_pushboolean(L, rc_git_repository_head_detached_idx1); return 1; @@ -1609,8 +1817,9 @@ static int Repository__head_detached__meth(lua_State *L) { /* method: head_orphan */ static int Repository__head_orphan__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; bool rc_git_repository_head_orphan_idx1 = 0; + this_idx1 = obj_type_Repository_check(L,1); rc_git_repository_head_orphan_idx1 = git_repository_head_orphan(this_idx1); lua_pushboolean(L, rc_git_repository_head_orphan_idx1); return 1; @@ -1618,8 +1827,9 @@ static int Repository__head_orphan__meth(lua_State *L) { /* method: is_empty */ static int Repository__is_empty__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; bool rc_git_repository_is_empty_idx1 = 0; + this_idx1 = obj_type_Repository_check(L,1); rc_git_repository_is_empty_idx1 = git_repository_is_empty(this_idx1); lua_pushboolean(L, rc_git_repository_is_empty_idx1); return 1; @@ -1627,8 +1837,9 @@ static int Repository__is_empty__meth(lua_State *L) { /* method: is_bare */ static int Repository__is_bare__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; bool rc_git_repository_is_bare_idx1 = 0; + this_idx1 = obj_type_Repository_check(L,1); rc_git_repository_is_bare_idx1 = git_repository_is_bare(this_idx1); lua_pushboolean(L, rc_git_repository_is_bare_idx1); return 1; @@ -1636,8 +1847,9 @@ static int Repository__is_bare__meth(lua_State *L) { /* method: path */ static int Repository__path__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; const char * rc_git_repository_path_idx1 = NULL; + this_idx1 = obj_type_Repository_check(L,1); rc_git_repository_path_idx1 = git_repository_path(this_idx1); lua_pushstring(L, rc_git_repository_path_idx1); return 1; @@ -1645,8 +1857,9 @@ static int Repository__path__meth(lua_State *L) { /* method: workdir */ static int Repository__workdir__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; const char * rc_git_repository_workdir_idx1 = NULL; + this_idx1 = obj_type_Repository_check(L,1); rc_git_repository_workdir_idx1 = git_repository_workdir(this_idx1); lua_pushstring(L, rc_git_repository_workdir_idx1); return 1; @@ -1654,11 +1867,15 @@ static int Repository__workdir__meth(lua_State *L) { /* method: set_workdir */ static int Repository__set_workdir__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; size_t workdir_len_idx2; - const char * workdir_idx2 = luaL_checklstring(L,2,&(workdir_len_idx2)); + const char * workdir_idx2; + int update_gitlink_idx3; GitError rc_git_repository_set_workdir_idx1 = GIT_OK; - rc_git_repository_set_workdir_idx1 = git_repository_set_workdir(this_idx1, workdir_idx2); + this_idx1 = obj_type_Repository_check(L,1); + workdir_idx2 = luaL_checklstring(L,2,&(workdir_len_idx2)); + update_gitlink_idx3 = luaL_checkinteger(L,3); + rc_git_repository_set_workdir_idx1 = git_repository_set_workdir(this_idx1, workdir_idx2, update_gitlink_idx3); /* check for error. */ if((GIT_OK != rc_git_repository_set_workdir_idx1)) { lua_pushnil(L); @@ -1672,10 +1889,11 @@ static int Repository__set_workdir__meth(lua_State *L) { /* method: config */ static int Repository__config__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; int config_flags_idx1 = OBJ_UDATA_FLAG_OWN; Config * config_idx1; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Repository_check(L,1); err_idx2 = git_repository_config(&(config_idx1), this_idx1); if(!(GIT_OK != err_idx2)) { obj_type_Config_push(L, config_idx1, config_flags_idx1); @@ -1688,18 +1906,21 @@ static int Repository__config__meth(lua_State *L) { /* method: set_config */ static int Repository__set_config__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); - Config * config_idx2 = obj_type_Config_check(L,2); + Repository * this_idx1; + Config * config_idx2; + this_idx1 = obj_type_Repository_check(L,1); + config_idx2 = obj_type_Config_check(L,2); git_repository_set_config(this_idx1, config_idx2); return 0; } /* method: odb */ static int Repository__odb__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; int odb_flags_idx1 = OBJ_UDATA_FLAG_OWN; ODB * odb_idx1; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Repository_check(L,1); err_idx2 = git_repository_odb(&(odb_idx1), this_idx1); if(!(GIT_OK != err_idx2)) { obj_type_ODB_push(L, odb_idx1, odb_flags_idx1); @@ -1712,18 +1933,21 @@ static int Repository__odb__meth(lua_State *L) { /* method: set_odb */ static int Repository__set_odb__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); - ODB * odb_idx2 = obj_type_ODB_check(L,2); + Repository * this_idx1; + ODB * odb_idx2; + this_idx1 = obj_type_Repository_check(L,1); + odb_idx2 = obj_type_ODB_check(L,2); git_repository_set_odb(this_idx1, odb_idx2); return 0; } /* method: index */ static int Repository__index__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); + Repository * this_idx1; int index_flags_idx1 = OBJ_UDATA_FLAG_OWN; Index * index_idx1; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Repository_check(L,1); err_idx2 = git_repository_index(&(index_idx1), this_idx1); if(!(GIT_OK != err_idx2)) { obj_type_Index_push(L, index_idx1, index_flags_idx1); @@ -1736,8 +1960,10 @@ static int Repository__index__meth(lua_State *L) { /* method: set_index */ static int Repository__set_index__meth(lua_State *L) { - Repository * this_idx1 = obj_type_Repository_check(L,1); - Index * index_idx2 = obj_type_Index_check(L,2); + Repository * this_idx1; + Index * index_idx2; + this_idx1 = obj_type_Repository_check(L,1); + index_idx2 = obj_type_Index_check(L,2); git_repository_set_index(this_idx1, index_idx2); return 0; } @@ -1760,10 +1986,11 @@ static int Config__new__meth(lua_State *L) { /* method: open */ static int Config__open__meth(lua_State *L) { size_t path_len_idx1; - const char * path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); + const char * path_idx1; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Config * this_idx1; GitError err_idx2 = GIT_OK; + path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); err_idx2 = git_config_open_ondisk(&(this_idx1), path_idx1); if(!(GIT_OK != err_idx2)) { obj_type_Config_push(L, this_idx1, this_flags_idx1); @@ -1777,7 +2004,8 @@ static int Config__open__meth(lua_State *L) { /* method: free */ static int Config__free__meth(lua_State *L) { int this_flags_idx1 = 0; - Config * this_idx1 = obj_type_Config_delete(L,1,&(this_flags_idx1)); + Config * this_idx1; + this_idx1 = obj_type_Config_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_config_free(this_idx1); return 0; @@ -1785,11 +2013,14 @@ static int Config__free__meth(lua_State *L) { /* method: add_file_ondisk */ static int Config__add_file_ondisk__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t path_len_idx2; - const char * path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); - int priority_idx3 = luaL_checkinteger(L,3); + const char * path_idx2; + int priority_idx3; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); + priority_idx3 = luaL_checkinteger(L,3); err_idx1 = git_config_add_file_ondisk(this_idx1, path_idx2, priority_idx3); /* check for error. */ if((GIT_OK != err_idx1)) { @@ -1804,11 +2035,13 @@ static int Config__add_file_ondisk__meth(lua_State *L) { /* method: get_int32 */ static int Config__get_int32__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; int32_t out_idx1 = 0; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); err_idx2 = git_config_get_int32(&(out_idx1), this_idx1, name_idx2); if(!(GIT_OK != err_idx2)) { lua_pushinteger(L, out_idx1); @@ -1821,11 +2054,14 @@ static int Config__get_int32__meth(lua_State *L) { /* method: set_int32 */ static int Config__set_int32__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); - int32_t value_idx3 = luaL_checkinteger(L,3); + const char * name_idx2; + int32_t value_idx3; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + value_idx3 = luaL_checkinteger(L,3); err_idx1 = git_config_set_int32(this_idx1, name_idx2, value_idx3); /* check for error. */ if((GIT_OK != err_idx1)) { @@ -1840,11 +2076,13 @@ static int Config__set_int32__meth(lua_State *L) { /* method: get_int64 */ static int Config__get_int64__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; int64_t out_idx1 = 0; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); err_idx2 = git_config_get_int64(&(out_idx1), this_idx1, name_idx2); if(!(GIT_OK != err_idx2)) { lua_pushinteger(L, out_idx1); @@ -1857,11 +2095,14 @@ static int Config__get_int64__meth(lua_State *L) { /* method: set_int64 */ static int Config__set_int64__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); - int64_t value_idx3 = luaL_checkinteger(L,3); + const char * name_idx2; + int64_t value_idx3; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + value_idx3 = luaL_checkinteger(L,3); err_idx1 = git_config_set_int64(this_idx1, name_idx2, value_idx3); /* check for error. */ if((GIT_OK != err_idx1)) { @@ -1876,12 +2117,14 @@ static int Config__set_int64__meth(lua_State *L) { /* method: get_bool */ static int Config__get_bool__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; bool out_idx1 = 0; GitError err_idx2 = GIT_OK; int out_int_idx3 = 0; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); err_idx2 = git_config_get_bool(&(out_int_idx3), this_idx1, name_idx2); out_idx1 = out_int_idx3; @@ -1896,12 +2139,15 @@ static int Config__get_bool__meth(lua_State *L) { /* method: set_bool */ static int Config__set_bool__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); - bool value_idx2 = lua_toboolean(L,2); + Config * this_idx1; + bool value_idx2; size_t name_len_idx3; - const char * name_idx3 = luaL_checklstring(L,3,&(name_len_idx3)); + const char * name_idx3; GitError err_idx1 = GIT_OK; int value_int_idx2 = 0; + this_idx1 = obj_type_Config_check(L,1); + value_idx2 = lua_toboolean(L,2); + name_idx3 = luaL_checklstring(L,3,&(name_len_idx3)); value_int_idx2 = value_idx2 ? 1 : 0; err_idx1 = git_config_set_bool(this_idx1, name_idx3, value_int_idx2); @@ -1918,11 +2164,13 @@ static int Config__set_bool__meth(lua_State *L) { /* method: get_string */ static int Config__get_string__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; const char * out_idx1 = NULL; GitError err_idx2 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); err_idx2 = git_config_get_string(&(out_idx1), this_idx1, name_idx2); if(!(GIT_OK != err_idx2)) { lua_pushstring(L, out_idx1); @@ -1935,12 +2183,15 @@ static int Config__get_string__meth(lua_State *L) { /* method: set_string */ static int Config__set_string__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; size_t value_len_idx3; - const char * value_idx3 = luaL_checklstring(L,3,&(value_len_idx3)); + const char * value_idx3; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + value_idx3 = luaL_checklstring(L,3,&(value_len_idx3)); err_idx1 = git_config_set_string(this_idx1, name_idx2, value_idx3); /* check for error. */ if((GIT_OK != err_idx1)) { @@ -1955,10 +2206,12 @@ static int Config__set_string__meth(lua_State *L) { /* method: delete */ static int Config__delete__meth(lua_State *L) { - Config * this_idx1 = obj_type_Config_check(L,1); + Config * this_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_Config_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); err_idx1 = git_config_delete(this_idx1, name_idx2); /* check for error. */ if((GIT_OK != err_idx1)) { @@ -1974,7 +2227,8 @@ static int Config__delete__meth(lua_State *L) { /* method: free */ static int OdbObject__free__meth(lua_State *L) { int this_flags_idx1 = 0; - OdbObject * this_idx1 = obj_type_OdbObject_delete(L,1,&(this_flags_idx1)); + OdbObject * this_idx1; + this_idx1 = obj_type_OdbObject_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_odb_object_free(this_idx1); return 0; @@ -1982,8 +2236,9 @@ static int OdbObject__free__meth(lua_State *L) { /* method: id */ static int OdbObject__id__meth(lua_State *L) { - OdbObject * this_idx1 = obj_type_OdbObject_check(L,1); + OdbObject * this_idx1; OID id_idx1; + this_idx1 = obj_type_OdbObject_check(L,1); id_idx1 = *git_odb_object_id(this_idx1); obj_type_OID_push(L, id_idx1); return 1; @@ -1991,9 +2246,10 @@ static int OdbObject__id__meth(lua_State *L) { /* method: data */ static int OdbObject__data__meth(lua_State *L) { - OdbObject * this_idx1 = obj_type_OdbObject_check(L,1); + OdbObject * this_idx1; size_t data_len_idx1 = 0; const char * data_idx1 = NULL; + this_idx1 = obj_type_OdbObject_check(L,1); data_idx1 = git_odb_object_data(this_idx1); data_len_idx1 = git_odb_object_size(this_idx1); if(data_idx1 == NULL) lua_pushnil(L); else lua_pushlstring(L, data_idx1,data_len_idx1); @@ -2002,8 +2258,9 @@ static int OdbObject__data__meth(lua_State *L) { /* method: size */ static int OdbObject__size__meth(lua_State *L) { - OdbObject * this_idx1 = obj_type_OdbObject_check(L,1); + OdbObject * this_idx1; size_t rc_git_odb_object_size_idx1 = 0; + this_idx1 = obj_type_OdbObject_check(L,1); rc_git_odb_object_size_idx1 = git_odb_object_size(this_idx1); lua_pushinteger(L, rc_git_odb_object_size_idx1); return 1; @@ -2011,9 +2268,10 @@ static int OdbObject__size__meth(lua_State *L) { /* method: type */ static int OdbObject__type__meth(lua_State *L) { - OdbObject * this_idx1 = obj_type_OdbObject_check(L,1); + OdbObject * this_idx1; git_otype otype_idx1; const char * type_idx2 = NULL; + this_idx1 = obj_type_OdbObject_check(L,1); otype_idx1 = git_odb_object_type(this_idx1); type_idx2 = git_object_type2string(otype_idx1); lua_pushstring(L, type_idx2); @@ -2023,9 +2281,10 @@ static int OdbObject__type__meth(lua_State *L) { /* method: hex */ static int OID__hex__meth(lua_State *L) { size_t str_len_idx1; - const char * str_idx1 = luaL_checklstring(L,1,&(str_len_idx1)); + const char * str_idx1; OID this_idx1; GitError err_idx2 = GIT_OK; + str_idx1 = luaL_checklstring(L,1,&(str_len_idx1)); err_idx2 = git_oid_fromstrn(&(this_idx1), str_idx1, str_len_idx1); if(!(GIT_OK != err_idx2)) { obj_type_OID_push(L, this_idx1); @@ -2039,8 +2298,9 @@ static int OID__hex__meth(lua_State *L) { /* method: raw */ static int OID__raw__meth(lua_State *L) { size_t raw_len_idx1; - const unsigned char * raw_idx1 = (unsigned char *)luaL_checklstring(L,1,&(raw_len_idx1)); + const unsigned char * raw_idx1; OID this_idx1; + raw_idx1 = (unsigned char *)luaL_checklstring(L,1,&(raw_len_idx1)); if(raw_len_idx1 < GIT_OID_RAWSZ) { lua_pushnil(L); lua_pushliteral(L, "Invalid RAW OID"); @@ -2054,8 +2314,9 @@ static int OID__raw__meth(lua_State *L) { /* method: pathfmt */ static int OID__pathfmt__meth(lua_State *L) { - OID this_idx1 = obj_type_OID_check(L,1); + OID this_idx1; const char * ret_idx1 = NULL; + this_idx1 = obj_type_OID_check(L,1); char buf[GIT_OID_HEXSZ+1+1]; git_oid_pathfmt(buf, &(this_idx1)); buf[GIT_OID_HEXSZ] = 0; @@ -2067,8 +2328,9 @@ static int OID__pathfmt__meth(lua_State *L) { /* method: fmt */ static int OID__fmt__meth(lua_State *L) { - OID this_idx1 = obj_type_OID_check(L,1); + OID this_idx1; const char * ret_idx1 = NULL; + this_idx1 = obj_type_OID_check(L,1); char buf[GIT_OID_HEXSZ+1]; git_oid_fmt(buf, &(this_idx1)); buf[GIT_OID_HEXSZ] = 0; @@ -2080,8 +2342,9 @@ static int OID__fmt__meth(lua_State *L) { /* method: __tostring */ static int OID____str____meth(lua_State *L) { - OID this_idx1 = obj_type_OID_check(L,1); + OID this_idx1; const char * ret_idx1 = NULL; + this_idx1 = obj_type_OID_check(L,1); char buf[GIT_OID_HEXSZ+1]; git_oid_fmt(buf, &(this_idx1)); buf[GIT_OID_HEXSZ] = 0; @@ -2093,9 +2356,11 @@ static int OID____str____meth(lua_State *L) { /* method: __eq */ static int OID____eq____meth(lua_State *L) { - OID this_idx1 = obj_type_OID_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + OID this_idx1; + OID id_idx2; int ret_idx1 = 0; + this_idx1 = obj_type_OID_check(L,1); + id_idx2 = obj_type_OID_check(L,2); ret_idx1 = git_oid_cmp(&(this_idx1), &(id_idx2)); lua_pushinteger(L, ret_idx1); return 1; @@ -2103,9 +2368,10 @@ static int OID____eq____meth(lua_State *L) { /* method: new */ static int OID_Shorten__new__meth(lua_State *L) { - size_t min_length_idx1 = luaL_checkinteger(L,1); + size_t min_length_idx1; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; OID_Shorten * this_idx1; + min_length_idx1 = luaL_checkinteger(L,1); this_idx1 = git_oid_shorten_new(min_length_idx1); obj_type_OID_Shorten_push(L, this_idx1, this_flags_idx1); return 1; @@ -2114,7 +2380,8 @@ static int OID_Shorten__new__meth(lua_State *L) { /* method: _priv */ static int OID_Shorten__delete__meth(lua_State *L) { int this_flags_idx1 = 0; - OID_Shorten * this_idx1 = obj_type_OID_Shorten_delete(L,1,&(this_flags_idx1)); + OID_Shorten * this_idx1; + this_idx1 = obj_type_OID_Shorten_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_oid_shorten_free(this_idx1); return 0; @@ -2122,10 +2389,12 @@ static int OID_Shorten__delete__meth(lua_State *L) { /* method: add */ static int OID_Shorten__add__meth(lua_State *L) { - OID_Shorten * this_idx1 = obj_type_OID_Shorten_check(L,1); + OID_Shorten * this_idx1; size_t text_oid_len_idx2; - const char * text_oid_idx2 = luaL_checklstring(L,2,&(text_oid_len_idx2)); + const char * text_oid_idx2; GitError rc_idx1 = GIT_OK; + this_idx1 = obj_type_OID_Shorten_check(L,1); + text_oid_idx2 = luaL_checklstring(L,2,&(text_oid_len_idx2)); rc_idx1 = git_oid_shorten_add(this_idx1, text_oid_idx2); if(rc_idx1 >= 0) { lua_pushinteger(L, rc_idx1); @@ -2161,10 +2430,11 @@ static int ODB__new__meth(lua_State *L) { /* method: open */ static int ODB__open__meth(lua_State *L) { size_t object_dir_len_idx1; - const char * object_dir_idx1 = luaL_checklstring(L,1,&(object_dir_len_idx1)); + const char * object_dir_idx1; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; ODB * this_idx1; GitError err_idx2 = GIT_OK; + object_dir_idx1 = luaL_checklstring(L,1,&(object_dir_len_idx1)); err_idx2 = git_odb_open(&(this_idx1), object_dir_idx1); if(!(GIT_OK != err_idx2)) { obj_type_ODB_push(L, this_idx1, this_flags_idx1); @@ -2178,7 +2448,8 @@ static int ODB__open__meth(lua_State *L) { /* method: free */ static int ODB__free__meth(lua_State *L) { int this_flags_idx1 = 0; - ODB * this_idx1 = obj_type_ODB_delete(L,1,&(this_flags_idx1)); + ODB * this_idx1; + this_idx1 = obj_type_ODB_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_odb_free(this_idx1); return 0; @@ -2186,10 +2457,13 @@ static int ODB__free__meth(lua_State *L) { /* method: add_backend */ static int ODB__add_backend__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); - ODBBackend * backend_idx2 = obj_type_ODBBackend_check(L,2); - int priority_idx3 = luaL_checkinteger(L,3); + ODB * this_idx1; + ODBBackend * backend_idx2; + int priority_idx3; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_ODB_check(L,1); + backend_idx2 = obj_type_ODBBackend_check(L,2); + priority_idx3 = luaL_checkinteger(L,3); err_idx1 = git_odb_add_backend(this_idx1, &(backend_idx2->backend), priority_idx3); ODBBackend_ref(backend_idx2); @@ -2206,10 +2480,13 @@ static int ODB__add_backend__meth(lua_State *L) { /* method: add_alternate */ static int ODB__add_alternate__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); - ODBBackend * backend_idx2 = obj_type_ODBBackend_check(L,2); - int priority_idx3 = luaL_checkinteger(L,3); + ODB * this_idx1; + ODBBackend * backend_idx2; + int priority_idx3; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_ODB_check(L,1); + backend_idx2 = obj_type_ODBBackend_check(L,2); + priority_idx3 = luaL_checkinteger(L,3); err_idx1 = git_odb_add_alternate(this_idx1, &(backend_idx2->backend), priority_idx3); ODBBackend_ref(backend_idx2); @@ -2226,11 +2503,13 @@ static int ODB__add_alternate__meth(lua_State *L) { /* method: read */ static int ODB__read__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + ODB * this_idx1; + OID id_idx2; int out_flags_idx1 = OBJ_UDATA_FLAG_OWN; OdbObject * out_idx1; GitError rc_git_odb_read_idx2 = GIT_OK; + this_idx1 = obj_type_ODB_check(L,1); + id_idx2 = obj_type_OID_check(L,2); rc_git_odb_read_idx2 = git_odb_read(&(out_idx1), this_idx1, &(id_idx2)); if(!(GIT_OK != rc_git_odb_read_idx2)) { obj_type_OdbObject_push(L, out_idx1, out_flags_idx1); @@ -2243,12 +2522,15 @@ static int ODB__read__meth(lua_State *L) { /* method: read_prefix */ static int ODB__read_prefix__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); - OID short_id_idx2 = obj_type_OID_check(L,2); - unsigned int len_idx3 = luaL_checkinteger(L,3); + ODB * this_idx1; + OID short_id_idx2; + unsigned int len_idx3; int out_flags_idx1 = OBJ_UDATA_FLAG_OWN; OdbObject * out_idx1; GitError rc_git_odb_read_prefix_idx2 = GIT_OK; + this_idx1 = obj_type_ODB_check(L,1); + short_id_idx2 = obj_type_OID_check(L,2); + len_idx3 = luaL_checkinteger(L,3); rc_git_odb_read_prefix_idx2 = git_odb_read_prefix(&(out_idx1), this_idx1, &(short_id_idx2), len_idx3); if(!(GIT_OK != rc_git_odb_read_prefix_idx2)) { obj_type_OdbObject_push(L, out_idx1, out_flags_idx1); @@ -2261,12 +2543,14 @@ static int ODB__read_prefix__meth(lua_State *L) { /* method: read_header */ static int ODB__read_header__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + ODB * this_idx1; + OID id_idx2; size_t len_p_idx1 = 0; const char * type_idx2 = NULL; GitError err_idx3 = GIT_OK; git_otype otype_idx4; + this_idx1 = obj_type_ODB_check(L,1); + id_idx2 = obj_type_OID_check(L,2); err_idx3 = git_odb_read_header(&(len_p_idx1), &(otype_idx4), this_idx1, &(id_idx2)); type_idx2 = git_object_type2string(otype_idx4); if(!(GIT_OK != err_idx3)) { @@ -2285,9 +2569,11 @@ static int ODB__read_header__meth(lua_State *L) { /* method: exists */ static int ODB__exists__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + ODB * this_idx1; + OID id_idx2; GitError err_idx1 = GIT_OK; + this_idx1 = obj_type_ODB_check(L,1); + id_idx2 = obj_type_OID_check(L,2); err_idx1 = git_odb_exists(this_idx1, &(id_idx2)); /* check for error. */ if((GIT_OK != err_idx1)) { @@ -2302,14 +2588,17 @@ static int ODB__exists__meth(lua_State *L) { /* method: write */ static int ODB__write__meth(lua_State *L) { - ODB * this_idx1 = obj_type_ODB_check(L,1); + ODB * this_idx1; size_t data_len_idx2; - const char * data_idx2 = luaL_checklstring(L,2,&(data_len_idx2)); + const char * data_idx2; size_t type_len_idx3; - const char * type_idx3 = luaL_checklstring(L,3,&(type_len_idx3)); + const char * type_idx3; OID id_idx1; GitError rc_git_odb_write_idx2 = GIT_OK; git_otype otype_idx3; + this_idx1 = obj_type_ODB_check(L,1); + data_idx2 = luaL_checklstring(L,2,&(data_len_idx2)); + type_idx3 = luaL_checklstring(L,3,&(type_len_idx3)); otype_idx3 = git_object_string2type(type_idx3); rc_git_odb_write_idx2 = git_odb_write(&(id_idx1), this_idx1, data_idx2, data_len_idx2, otype_idx3); if(!(GIT_OK != rc_git_odb_write_idx2)) { @@ -2324,10 +2613,12 @@ static int ODB__write__meth(lua_State *L) { /* method: hash */ static int ODB__hash__func(lua_State *L) { size_t data_len_idx1; - const char * data_idx1 = luaL_checklstring(L,1,&(data_len_idx1)); - git_otype otype_idx2 = luaL_checkinteger(L,2); + const char * data_idx1; + git_otype otype_idx2; OID id_idx1; GitError err_idx2 = GIT_OK; + data_idx1 = luaL_checklstring(L,1,&(data_len_idx1)); + otype_idx2 = luaL_checkinteger(L,2); err_idx2 = git_odb_hash(&(id_idx1), data_idx1, data_len_idx1, otype_idx2); if(!(GIT_OK != err_idx2)) { obj_type_OID_push(L, id_idx1); @@ -2341,10 +2632,12 @@ static int ODB__hash__func(lua_State *L) { /* method: hashfile */ static int ODB__hashfile__func(lua_State *L) { size_t path_len_idx1; - const char * path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); - git_otype otype_idx2 = luaL_checkinteger(L,2); + const char * path_idx1; + git_otype otype_idx2; OID id_idx1; GitError err_idx2 = GIT_OK; + path_idx1 = luaL_checklstring(L,1,&(path_len_idx1)); + otype_idx2 = luaL_checkinteger(L,2); err_idx2 = git_odb_hashfile(&(id_idx1), path_idx1, otype_idx2); if(!(GIT_OK != err_idx2)) { obj_type_OID_push(L, id_idx1); @@ -2386,7 +2679,8 @@ static int ODBBackend__new__meth(lua_State *L) { /* method: _priv */ static int ODBBackend__delete__meth(lua_State *L) { int this_flags_idx1 = 0; - ODBBackend * this_idx1 = obj_type_ODBBackend_delete(L,1,&(this_flags_idx1)); + ODBBackend * this_idx1; + this_idx1 = obj_type_ODBBackend_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } ODBBackend_unref(this_idx1); @@ -2396,10 +2690,11 @@ static int ODBBackend__delete__meth(lua_State *L) { /* method: bare */ static int Index__bare__meth(lua_State *L) { size_t index_path_len_idx1; - const char * index_path_idx1 = luaL_checklstring(L,1,&(index_path_len_idx1)); + const char * index_path_idx1; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Index * this_idx1; GitError err_idx2 = GIT_OK; + index_path_idx1 = luaL_checklstring(L,1,&(index_path_len_idx1)); err_idx2 = git_index_open(&(this_idx1), index_path_idx1); if(!(GIT_OK != err_idx2)) { obj_type_Index_push(L, this_idx1, this_flags_idx1); @@ -2413,7 +2708,8 @@ static int Index__bare__meth(lua_State *L) { /* method: _priv */ static int Index__delete__meth(lua_State *L) { int this_flags_idx1 = 0; - Index * this_idx1 = obj_type_Index_delete(L,1,&(this_flags_idx1)); + Index * this_idx1; + this_idx1 = obj_type_Index_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_index_free(this_idx1); return 0; @@ -2421,15 +2717,17 @@ static int Index__delete__meth(lua_State *L) { /* method: clear */ static int Index__clear__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; + this_idx1 = obj_type_Index_check(L,1); git_index_clear(this_idx1); return 0; } /* method: read */ static int Index__read__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; GitError rc_git_index_read_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); rc_git_index_read_idx1 = git_index_read(this_idx1); /* check for error. */ if((GIT_OK != rc_git_index_read_idx1)) { @@ -2444,8 +2742,9 @@ static int Index__read__meth(lua_State *L) { /* method: write */ static int Index__write__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; GitError rc_git_index_write_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); rc_git_index_write_idx1 = git_index_write(this_idx1); /* check for error. */ if((GIT_OK != rc_git_index_write_idx1)) { @@ -2460,10 +2759,12 @@ static int Index__write__meth(lua_State *L) { /* method: find */ static int Index__find__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; size_t path_len_idx2; - const char * path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); + const char * path_idx2; int rc_git_index_find_idx1 = 0; + this_idx1 = obj_type_Index_check(L,1); + path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); rc_git_index_find_idx1 = git_index_find(this_idx1, path_idx2); lua_pushinteger(L, rc_git_index_find_idx1); return 1; @@ -2471,18 +2772,22 @@ static int Index__find__meth(lua_State *L) { /* method: uniq */ static int Index__uniq__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; + this_idx1 = obj_type_Index_check(L,1); git_index_uniq(this_idx1); return 0; } /* method: add */ static int Index__add__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; size_t path_len_idx2; - const char * path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); - int stage_idx3 = luaL_checkinteger(L,3); + const char * path_idx2; + int stage_idx3; GitError rc_git_index_add_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); + path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); + stage_idx3 = luaL_checkinteger(L,3); rc_git_index_add_idx1 = git_index_add(this_idx1, path_idx2, stage_idx3); /* check for error. */ if((GIT_OK != rc_git_index_add_idx1)) { @@ -2497,9 +2802,11 @@ static int Index__add__meth(lua_State *L) { /* method: add2 */ static int Index__add2__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); - IndexEntry * source_entry_idx2 = obj_type_IndexEntry_check(L,2); + Index * this_idx1; + IndexEntry * source_entry_idx2; GitError rc_git_index_add2_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); + source_entry_idx2 = obj_type_IndexEntry_check(L,2); rc_git_index_add2_idx1 = git_index_add2(this_idx1, source_entry_idx2); /* check for error. */ if((GIT_OK != rc_git_index_add2_idx1)) { @@ -2514,11 +2821,14 @@ static int Index__add2__meth(lua_State *L) { /* method: append */ static int Index__append__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; size_t path_len_idx2; - const char * path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); - int stage_idx3 = luaL_checkinteger(L,3); + const char * path_idx2; + int stage_idx3; GitError rc_git_index_append_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); + path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); + stage_idx3 = luaL_checkinteger(L,3); rc_git_index_append_idx1 = git_index_append(this_idx1, path_idx2, stage_idx3); /* check for error. */ if((GIT_OK != rc_git_index_append_idx1)) { @@ -2533,9 +2843,11 @@ static int Index__append__meth(lua_State *L) { /* method: append2 */ static int Index__append2__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); - IndexEntry * source_entry_idx2 = obj_type_IndexEntry_check(L,2); + Index * this_idx1; + IndexEntry * source_entry_idx2; GitError rc_git_index_append2_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); + source_entry_idx2 = obj_type_IndexEntry_check(L,2); rc_git_index_append2_idx1 = git_index_append2(this_idx1, source_entry_idx2); /* check for error. */ if((GIT_OK != rc_git_index_append2_idx1)) { @@ -2550,9 +2862,11 @@ static int Index__append2__meth(lua_State *L) { /* method: remove */ static int Index__remove__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); - int position_idx2 = luaL_checkinteger(L,2); + Index * this_idx1; + int position_idx2; GitError rc_git_index_remove_idx1 = GIT_OK; + this_idx1 = obj_type_Index_check(L,1); + position_idx2 = luaL_checkinteger(L,2); rc_git_index_remove_idx1 = git_index_remove(this_idx1, position_idx2); /* check for error. */ if((GIT_OK != rc_git_index_remove_idx1)) { @@ -2567,9 +2881,11 @@ static int Index__remove__meth(lua_State *L) { /* method: get */ static int Index__get__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); - int n_idx2 = luaL_checkinteger(L,2); + Index * this_idx1; + int n_idx2; IndexEntry * rc_git_index_get_idx1; + this_idx1 = obj_type_Index_check(L,1); + n_idx2 = luaL_checkinteger(L,2); rc_git_index_get_idx1 = git_index_get(this_idx1, n_idx2); obj_type_IndexEntry_push(L, rc_git_index_get_idx1, 0); return 1; @@ -2577,8 +2893,9 @@ static int Index__get__meth(lua_State *L) { /* method: entrycount */ static int Index__entrycount__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; unsigned int rc_git_index_entrycount_idx1 = 0; + this_idx1 = obj_type_Index_check(L,1); rc_git_index_entrycount_idx1 = git_index_entrycount(this_idx1); lua_pushinteger(L, rc_git_index_entrycount_idx1); return 1; @@ -2586,8 +2903,9 @@ static int Index__entrycount__meth(lua_State *L) { /* method: entrycount_unmerged */ static int Index__entrycount_unmerged__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; unsigned int rc_git_index_entrycount_unmerged_idx1 = 0; + this_idx1 = obj_type_Index_check(L,1); rc_git_index_entrycount_unmerged_idx1 = git_index_entrycount_unmerged(this_idx1); lua_pushinteger(L, rc_git_index_entrycount_unmerged_idx1); return 1; @@ -2595,10 +2913,12 @@ static int Index__entrycount_unmerged__meth(lua_State *L) { /* method: get_unmerged_bypath */ static int Index__get_unmerged_bypath__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); + Index * this_idx1; size_t path_len_idx2; - const char * path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); + const char * path_idx2; const IndexEntryUnmerged * rc_git_index_get_unmerged_bypath_idx1; + this_idx1 = obj_type_Index_check(L,1); + path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); rc_git_index_get_unmerged_bypath_idx1 = git_index_get_unmerged_bypath(this_idx1, path_idx2); obj_type_IndexEntryUnmerged_push(L, rc_git_index_get_unmerged_bypath_idx1, 0); return 1; @@ -2606,9 +2926,11 @@ static int Index__get_unmerged_bypath__meth(lua_State *L) { /* method: get_unmerged_byindex */ static int Index__get_unmerged_byindex__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); - int n_idx2 = luaL_checkinteger(L,2); + Index * this_idx1; + int n_idx2; const IndexEntryUnmerged * rc_git_index_get_unmerged_byindex_idx1; + this_idx1 = obj_type_Index_check(L,1); + n_idx2 = luaL_checkinteger(L,2); rc_git_index_get_unmerged_byindex_idx1 = git_index_get_unmerged_byindex(this_idx1, n_idx2); obj_type_IndexEntryUnmerged_push(L, rc_git_index_get_unmerged_byindex_idx1, 0); return 1; @@ -2616,10 +2938,14 @@ static int Index__get_unmerged_byindex__meth(lua_State *L) { /* method: read_tree */ static int Index__read_tree__meth(lua_State *L) { - Index * this_idx1 = obj_type_Index_check(L,1); - Tree * tree_idx2 = obj_type_Tree_check(L,2); + Index * this_idx1; + Tree * tree_idx2; + void * should_be_null_idx3; GitError rc_git_index_read_tree_idx1 = GIT_OK; - rc_git_index_read_tree_idx1 = git_index_read_tree(this_idx1, tree_idx2); + this_idx1 = obj_type_Index_check(L,1); + tree_idx2 = obj_type_Tree_check(L,2); + should_be_null_idx3 = lua_touserdata(L,3); + rc_git_index_read_tree_idx1 = git_index_read_tree(this_idx1, tree_idx2, should_be_null_idx3); /* check for error. */ if((GIT_OK != rc_git_index_read_tree_idx1)) { lua_pushnil(L); @@ -2644,7 +2970,8 @@ static int IndexEntry__new__meth(lua_State *L) { /* method: _priv */ static int IndexEntry__delete__meth(lua_State *L) { int this_flags_idx1 = 0; - IndexEntry * this_idx1 = obj_type_IndexEntry_delete(L,1,&(this_flags_idx1)); + IndexEntry * this_idx1; + this_idx1 = obj_type_IndexEntry_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } if(this_idx1->path != NULL) { free(this_idx1->path); @@ -2656,8 +2983,9 @@ static int IndexEntry__delete__meth(lua_State *L) { /* method: stage */ static int IndexEntry__stage__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; int rc_git_index_entry_stage_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); rc_git_index_entry_stage_idx1 = git_index_entry_stage(this_idx1); lua_pushinteger(L, rc_git_index_entry_stage_idx1); return 1; @@ -2665,9 +2993,10 @@ static int IndexEntry__stage__meth(lua_State *L) { /* method: ctime */ static int IndexEntry__ctime__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; git_time_t secs_idx1 = 0; unsigned int nanosecs_idx2 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); secs_idx1 = this_idx1->ctime.seconds; nanosecs_idx2 = this_idx1->ctime.nanoseconds; @@ -2678,9 +3007,12 @@ static int IndexEntry__ctime__meth(lua_State *L) { /* method: set_ctime */ static int IndexEntry__set_ctime__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); - git_time_t secs_idx2 = luaL_checkinteger(L,2); - unsigned int nanosecs_idx3 = luaL_checkinteger(L,3); + IndexEntry * this_idx1; + git_time_t secs_idx2; + unsigned int nanosecs_idx3; + this_idx1 = obj_type_IndexEntry_check(L,1); + secs_idx2 = luaL_checkinteger(L,2); + nanosecs_idx3 = luaL_checkinteger(L,3); this_idx1->ctime.seconds = secs_idx2; this_idx1->ctime.nanoseconds = nanosecs_idx3; @@ -2689,9 +3021,10 @@ static int IndexEntry__set_ctime__meth(lua_State *L) { /* method: mtime */ static int IndexEntry__mtime__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; git_time_t secs_idx1 = 0; unsigned int nanosecs_idx2 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); secs_idx1 = this_idx1->mtime.seconds; nanosecs_idx2 = this_idx1->mtime.nanoseconds; @@ -2702,9 +3035,12 @@ static int IndexEntry__mtime__meth(lua_State *L) { /* method: set_mtime */ static int IndexEntry__set_mtime__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); - git_time_t secs_idx2 = luaL_checkinteger(L,2); - unsigned int nanosecs_idx3 = luaL_checkinteger(L,3); + IndexEntry * this_idx1; + git_time_t secs_idx2; + unsigned int nanosecs_idx3; + this_idx1 = obj_type_IndexEntry_check(L,1); + secs_idx2 = luaL_checkinteger(L,2); + nanosecs_idx3 = luaL_checkinteger(L,3); this_idx1->mtime.seconds = secs_idx2; this_idx1->mtime.nanoseconds = nanosecs_idx3; @@ -2713,8 +3049,9 @@ static int IndexEntry__set_mtime__meth(lua_State *L) { /* method: path */ static int IndexEntry__path__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; const char * ret_idx1 = NULL; + this_idx1 = obj_type_IndexEntry_check(L,1); ret_idx1 = this_idx1->path; lua_pushstring(L, ret_idx1); return 1; @@ -2722,9 +3059,11 @@ ret_idx1 = this_idx1->path; /* method: set_path */ static int IndexEntry__set_path__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; size_t val_len_idx2; - const char * val_idx2 = luaL_checklstring(L,2,&(val_len_idx2)); + const char * val_idx2; + this_idx1 = obj_type_IndexEntry_check(L,1); + val_idx2 = luaL_checklstring(L,2,&(val_len_idx2)); if(this_idx1->path != NULL) { free(this_idx1->path); } @@ -2737,8 +3076,9 @@ static int IndexEntry__set_path__meth(lua_State *L) { /* method: dev */ static int IndexEntry__dev__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->dev; lua_pushinteger(L, field_idx1); @@ -2747,8 +3087,9 @@ static int IndexEntry__dev__meth(lua_State *L) { /* method: ino */ static int IndexEntry__ino__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->ino; lua_pushinteger(L, field_idx1); @@ -2757,8 +3098,9 @@ static int IndexEntry__ino__meth(lua_State *L) { /* method: mode */ static int IndexEntry__mode__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->mode; lua_pushinteger(L, field_idx1); @@ -2767,8 +3109,9 @@ static int IndexEntry__mode__meth(lua_State *L) { /* method: uid */ static int IndexEntry__uid__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->uid; lua_pushinteger(L, field_idx1); @@ -2777,8 +3120,9 @@ static int IndexEntry__uid__meth(lua_State *L) { /* method: gid */ static int IndexEntry__gid__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->gid; lua_pushinteger(L, field_idx1); @@ -2787,8 +3131,9 @@ static int IndexEntry__gid__meth(lua_State *L) { /* method: file_size */ static int IndexEntry__file_size__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; off_t field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->file_size; lua_pushinteger(L, field_idx1); @@ -2797,8 +3142,9 @@ static int IndexEntry__file_size__meth(lua_State *L) { /* method: oid */ static int IndexEntry__oid__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; OID field_idx1; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->oid; obj_type_OID_push(L, field_idx1); @@ -2807,8 +3153,9 @@ static int IndexEntry__oid__meth(lua_State *L) { /* method: flags */ static int IndexEntry__flags__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->flags; lua_pushinteger(L, field_idx1); @@ -2817,8 +3164,9 @@ static int IndexEntry__flags__meth(lua_State *L) { /* method: flags_extended */ static int IndexEntry__flags_extended__meth(lua_State *L) { - IndexEntry * this_idx1 = obj_type_IndexEntry_check(L,1); + IndexEntry * this_idx1; unsigned int field_idx1 = 0; + this_idx1 = obj_type_IndexEntry_check(L,1); field_idx1 = this_idx1->flags_extended; lua_pushinteger(L, field_idx1); @@ -2827,9 +3175,11 @@ static int IndexEntry__flags_extended__meth(lua_State *L) { /* method: mode */ static int IndexEntryUnmerged__mode__meth(lua_State *L) { - IndexEntryUnmerged * this_idx1 = obj_type_IndexEntryUnmerged_check(L,1); - int idx_idx2 = luaL_checkinteger(L,2); + IndexEntryUnmerged * this_idx1; + int idx_idx2; unsigned int mode_idx1 = 0; + this_idx1 = obj_type_IndexEntryUnmerged_check(L,1); + idx_idx2 = luaL_checkinteger(L,2); if(idx_idx2 < 0 || idx_idx2 >=3) { return luaL_argerror(L, 2, "Index out-of-bounds (0-2)"); } @@ -2841,9 +3191,11 @@ static int IndexEntryUnmerged__mode__meth(lua_State *L) { /* method: oid */ static int IndexEntryUnmerged__oid__meth(lua_State *L) { - IndexEntryUnmerged * this_idx1 = obj_type_IndexEntryUnmerged_check(L,1); - int idx_idx2 = luaL_checkinteger(L,2); + IndexEntryUnmerged * this_idx1; + int idx_idx2; OID oid_idx1; + this_idx1 = obj_type_IndexEntryUnmerged_check(L,1); + idx_idx2 = luaL_checkinteger(L,2); if(idx_idx2 < 0 || idx_idx2 >=3) { return luaL_argerror(L, 2, "Index out-of-bounds (0-2)"); } @@ -2855,8 +3207,9 @@ static int IndexEntryUnmerged__oid__meth(lua_State *L) { /* method: path */ static int IndexEntryUnmerged__path__meth(lua_State *L) { - IndexEntryUnmerged * this_idx1 = obj_type_IndexEntryUnmerged_check(L,1); + IndexEntryUnmerged * this_idx1; const char * ret_idx1 = NULL; + this_idx1 = obj_type_IndexEntryUnmerged_check(L,1); ret_idx1 = this_idx1->path; lua_pushstring(L, ret_idx1); return 1; @@ -2865,7 +3218,8 @@ ret_idx1 = this_idx1->path; /* method: free */ static int Object__free__meth(lua_State *L) { int this_flags_idx1 = 0; - Object * this_idx1 = obj_type_Object_delete(L,1,&(this_flags_idx1)); + Object * this_idx1; + this_idx1 = obj_type_Object_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_object_free(this_idx1); return 0; @@ -2873,8 +3227,9 @@ static int Object__free__meth(lua_State *L) { /* method: id */ static int Object__id__meth(lua_State *L) { - Object * this_idx1 = obj_type_Object_check(L,1); + Object * this_idx1; OID id_idx1; + this_idx1 = obj_type_Object_check(L,1); id_idx1 = *git_object_id(this_idx1); obj_type_OID_push(L, id_idx1); return 1; @@ -2882,9 +3237,10 @@ static int Object__id__meth(lua_State *L) { /* method: type */ static int Object__type__meth(lua_State *L) { - Object * this_idx1 = obj_type_Object_check(L,1); + Object * this_idx1; git_otype otype_idx1; const char * type_idx2 = NULL; + this_idx1 = obj_type_Object_check(L,1); otype_idx1 = git_object_type(this_idx1); type_idx2 = git_object_type2string(otype_idx1); lua_pushstring(L, type_idx2); @@ -2893,8 +3249,9 @@ static int Object__type__meth(lua_State *L) { /* method: owner */ static int Object__owner__meth(lua_State *L) { - Object * this_idx1 = obj_type_Object_check(L,1); + Object * this_idx1; Repository * rc_git_object_owner_idx1; + this_idx1 = obj_type_Object_check(L,1); rc_git_object_owner_idx1 = git_object_owner(this_idx1); obj_type_Repository_push(L, rc_git_object_owner_idx1, 0); return 1; @@ -2902,8 +3259,9 @@ static int Object__owner__meth(lua_State *L) { /* method: type2string */ static int Object__type2string__func(lua_State *L) { - git_otype otype_idx1 = luaL_checkinteger(L,1); + git_otype otype_idx1; const char * rc_git_object_type2string_idx1 = NULL; + otype_idx1 = luaL_checkinteger(L,1); rc_git_object_type2string_idx1 = git_object_type2string(otype_idx1); lua_pushstring(L, rc_git_object_type2string_idx1); return 1; @@ -2912,8 +3270,9 @@ static int Object__type2string__func(lua_State *L) { /* method: string2type */ static int Object__string2type__func(lua_State *L) { size_t str_len_idx1; - const char * str_idx1 = luaL_checklstring(L,1,&(str_len_idx1)); + const char * str_idx1; git_otype rc_git_object_string2type_idx1; + str_idx1 = luaL_checklstring(L,1,&(str_len_idx1)); rc_git_object_string2type_idx1 = git_object_string2type(str_idx1); lua_pushinteger(L, rc_git_object_string2type_idx1); return 1; @@ -2941,11 +3300,13 @@ static void dyn_caster_Object(void **obj, obj_type **type) { /* method: lookup */ static int Blob__lookup__meth(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + Repository * repo_idx1; + OID id_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Blob * this_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + id_idx2 = obj_type_OID_check(L,2); err_idx2 = git_blob_lookup(&(this_idx1), repo_idx1, &(id_idx2)); if(!(GIT_OK != err_idx2)) { obj_type_Blob_push(L, this_idx1, this_flags_idx1); @@ -2958,11 +3319,13 @@ static int Blob__lookup__meth(lua_State *L) { /* method: fromfile */ static int Blob__fromfile__func(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); + Repository * repo_idx1; size_t path_len_idx2; - const char * path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); + const char * path_idx2; OID written_id_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + path_idx2 = luaL_checklstring(L,2,&(path_len_idx2)); err_idx2 = git_blob_create_fromfile(&(written_id_idx1), repo_idx1, path_idx2); if(!(GIT_OK != err_idx2)) { obj_type_OID_push(L, written_id_idx1); @@ -2975,11 +3338,13 @@ static int Blob__fromfile__func(lua_State *L) { /* method: frombuffer */ static int Blob__frombuffer__func(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); + Repository * repo_idx1; size_t buffer_len_idx2; - const char * buffer_idx2 = luaL_checklstring(L,2,&(buffer_len_idx2)); + const char * buffer_idx2; OID written_id_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + buffer_idx2 = luaL_checklstring(L,2,&(buffer_len_idx2)); err_idx2 = git_blob_create_frombuffer(&(written_id_idx1), repo_idx1, buffer_idx2, buffer_len_idx2); if(!(GIT_OK != err_idx2)) { obj_type_OID_push(L, written_id_idx1); @@ -2992,9 +3357,10 @@ static int Blob__frombuffer__func(lua_State *L) { /* method: rawcontent */ static int Blob__rawcontent__meth(lua_State *L) { - Blob * this_idx1 = obj_type_Blob_check(L,1); + Blob * this_idx1; size_t buff_len_idx1 = 0; const char * buff_idx1 = NULL; + this_idx1 = obj_type_Blob_check(L,1); buff_idx1 = git_blob_rawcontent(this_idx1); buff_len_idx1 = git_blob_rawsize(this_idx1); if(buff_idx1 == NULL) lua_pushnil(L); else lua_pushlstring(L, buff_idx1,buff_len_idx1); @@ -3003,8 +3369,9 @@ static int Blob__rawcontent__meth(lua_State *L) { /* method: rawsize */ static int Blob__rawsize__meth(lua_State *L) { - Blob * this_idx1 = obj_type_Blob_check(L,1); + Blob * this_idx1; int rc_git_blob_rawsize_idx1 = 0; + this_idx1 = obj_type_Blob_check(L,1); rc_git_blob_rawsize_idx1 = git_blob_rawsize(this_idx1); lua_pushinteger(L, rc_git_blob_rawsize_idx1); return 1; @@ -3013,14 +3380,18 @@ static int Blob__rawsize__meth(lua_State *L) { /* method: new */ static int Signature__new__meth(lua_State *L) { size_t name_len_idx1; - const char * name_idx1 = luaL_checklstring(L,1,&(name_len_idx1)); + const char * name_idx1; size_t email_len_idx2; - const char * email_idx2 = luaL_checklstring(L,2,&(email_len_idx2)); - git_time_t time_idx3 = luaL_checkinteger(L,3); - int offset_idx4 = luaL_checkinteger(L,4); + const char * email_idx2; + git_time_t time_idx3; + int offset_idx4; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Signature * this_idx1; GitError rc_git_signature_new_idx2 = GIT_OK; + name_idx1 = luaL_checklstring(L,1,&(name_len_idx1)); + email_idx2 = luaL_checklstring(L,2,&(email_len_idx2)); + time_idx3 = luaL_checkinteger(L,3); + offset_idx4 = luaL_checkinteger(L,4); rc_git_signature_new_idx2 = git_signature_new(&(this_idx1), name_idx1, email_idx2, time_idx3, offset_idx4); if(!(GIT_OK != rc_git_signature_new_idx2)) { obj_type_Signature_push(L, this_idx1, this_flags_idx1); @@ -3034,12 +3405,14 @@ static int Signature__new__meth(lua_State *L) { /* method: now */ static int Signature__now__meth(lua_State *L) { size_t name_len_idx1; - const char * name_idx1 = luaL_checklstring(L,1,&(name_len_idx1)); + const char * name_idx1; size_t email_len_idx2; - const char * email_idx2 = luaL_checklstring(L,2,&(email_len_idx2)); + const char * email_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Signature * this_idx1; GitError rc_git_signature_now_idx2 = GIT_OK; + name_idx1 = luaL_checklstring(L,1,&(name_len_idx1)); + email_idx2 = luaL_checklstring(L,2,&(email_len_idx2)); rc_git_signature_now_idx2 = git_signature_now(&(this_idx1), name_idx1, email_idx2); if(!(GIT_OK != rc_git_signature_now_idx2)) { obj_type_Signature_push(L, this_idx1, this_flags_idx1); @@ -3053,7 +3426,8 @@ static int Signature__now__meth(lua_State *L) { /* method: _priv */ static int Signature__delete__meth(lua_State *L) { int this_flags_idx1 = 0; - Signature * this_idx1 = obj_type_Signature_delete(L,1,&(this_flags_idx1)); + Signature * this_idx1; + this_idx1 = obj_type_Signature_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_signature_free(this_idx1); return 0; @@ -3061,8 +3435,9 @@ static int Signature__delete__meth(lua_State *L) { /* method: name */ static int Signature__name__meth(lua_State *L) { - Signature * this_idx1 = obj_type_Signature_check(L,1); + Signature * this_idx1; const char * name_idx1 = NULL; + this_idx1 = obj_type_Signature_check(L,1); name_idx1 = this_idx1->name; lua_pushstring(L, name_idx1); return 1; @@ -3070,8 +3445,9 @@ name_idx1 = this_idx1->name; /* method: email */ static int Signature__email__meth(lua_State *L) { - Signature * this_idx1 = obj_type_Signature_check(L,1); + Signature * this_idx1; const char * email_idx1 = NULL; + this_idx1 = obj_type_Signature_check(L,1); email_idx1 = this_idx1->email; lua_pushstring(L, email_idx1); return 1; @@ -3079,9 +3455,10 @@ email_idx1 = this_idx1->email; /* method: when */ static int Signature__when__meth(lua_State *L) { - Signature * this_idx1 = obj_type_Signature_check(L,1); + Signature * this_idx1; git_time_t time_idx1 = 0; int offset_idx2 = 0; + this_idx1 = obj_type_Signature_check(L,1); time_idx1 = this_idx1->when.time; offset_idx2 = this_idx1->when.offset; lua_pushinteger(L, time_idx1); lua_pushinteger(L, offset_idx2); @@ -3090,11 +3467,13 @@ time_idx1 = this_idx1->when.time; offset_idx2 = this_idx1->when.offset; /* method: lookup */ static int Commit__lookup__meth(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + Repository * repo_idx1; + OID id_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Commit * this_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + id_idx2 = obj_type_OID_check(L,2); err_idx2 = git_commit_lookup(&(this_idx1), repo_idx1, &(id_idx2)); if(!(GIT_OK != err_idx2)) { obj_type_Commit_push(L, this_idx1, this_flags_idx1); @@ -3107,23 +3486,32 @@ static int Commit__lookup__meth(lua_State *L) { /* method: create */ static int Commit__create__func(lua_State *L) { - OID oid_idx1 = obj_type_OID_check(L,1); - Repository * repo_idx2 = obj_type_Repository_check(L,2); + OID oid_idx1; + Repository * repo_idx2; size_t update_ref_len_idx3; - const char * update_ref_idx3 = luaL_checklstring(L,3,&(update_ref_len_idx3)); - Signature * author_idx4 = obj_type_Signature_check(L,4); - Signature * committer_idx5 = obj_type_Signature_check(L,5); + const char * update_ref_idx3; + Signature * author_idx4; + Signature * committer_idx5; size_t message_encoding_len_idx6; - const char * message_encoding_idx6 = luaL_checklstring(L,6,&(message_encoding_len_idx6)); + const char * message_encoding_idx6; size_t message_len_idx7; - const char * message_idx7 = luaL_checklstring(L,7,&(message_len_idx7)); - Tree * tree_idx8 = obj_type_Tree_check(L,8); - Commit * parent_idx9 = obj_type_Commit_check(L,9); + const char * message_idx7; + Tree * tree_idx8; + Commit * parent_idx9; GitError err_idx1 = GIT_OK; int parent_count = 0; const git_commit **parents; int n; + oid_idx1 = obj_type_OID_check(L,1); + repo_idx2 = obj_type_Repository_check(L,2); + update_ref_idx3 = luaL_checklstring(L,3,&(update_ref_len_idx3)); + author_idx4 = obj_type_Signature_check(L,4); + committer_idx5 = obj_type_Signature_check(L,5); + message_encoding_idx6 = luaL_checklstring(L,6,&(message_encoding_len_idx6)); + message_idx7 = luaL_checklstring(L,7,&(message_len_idx7)); + tree_idx8 = obj_type_Tree_check(L,8); + parent_idx9 = obj_type_Commit_check(L,9); /* count parents. */ parent_count = lua_gettop(L) - 9 + 1; /* valid parents. The first parent commit is already validated. */ @@ -3158,8 +3546,9 @@ static int Commit__create__func(lua_State *L) { /* method: id */ static int Commit__id__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; OID id_idx1; + this_idx1 = obj_type_Commit_check(L,1); id_idx1 = *git_commit_id(this_idx1); obj_type_OID_push(L, id_idx1); return 1; @@ -3167,8 +3556,9 @@ static int Commit__id__meth(lua_State *L) { /* method: message_encoding */ static int Commit__message_encoding__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; const char * rc_git_commit_message_encoding_idx1 = NULL; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_message_encoding_idx1 = git_commit_message_encoding(this_idx1); lua_pushstring(L, rc_git_commit_message_encoding_idx1); return 1; @@ -3176,8 +3566,9 @@ static int Commit__message_encoding__meth(lua_State *L) { /* method: message */ static int Commit__message__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; const char * rc_git_commit_message_idx1 = NULL; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_message_idx1 = git_commit_message(this_idx1); lua_pushstring(L, rc_git_commit_message_idx1); return 1; @@ -3185,8 +3576,9 @@ static int Commit__message__meth(lua_State *L) { /* method: time */ static int Commit__time__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; git_time_t rc_git_commit_time_idx1 = 0; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_time_idx1 = git_commit_time(this_idx1); lua_pushinteger(L, rc_git_commit_time_idx1); return 1; @@ -3194,8 +3586,9 @@ static int Commit__time__meth(lua_State *L) { /* method: time_offset */ static int Commit__time_offset__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; int rc_git_commit_time_offset_idx1 = 0; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_time_offset_idx1 = git_commit_time_offset(this_idx1); lua_pushinteger(L, rc_git_commit_time_offset_idx1); return 1; @@ -3203,8 +3596,9 @@ static int Commit__time_offset__meth(lua_State *L) { /* method: committer */ static int Commit__committer__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; const Signature * rc_git_commit_committer_idx1; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_committer_idx1 = git_commit_committer(this_idx1); obj_type_Signature_push(L, rc_git_commit_committer_idx1, 0); return 1; @@ -3212,8 +3606,9 @@ static int Commit__committer__meth(lua_State *L) { /* method: author */ static int Commit__author__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; const Signature * rc_git_commit_author_idx1; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_author_idx1 = git_commit_author(this_idx1); obj_type_Signature_push(L, rc_git_commit_author_idx1, 0); return 1; @@ -3221,10 +3616,11 @@ static int Commit__author__meth(lua_State *L) { /* method: tree */ static int Commit__tree__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; int tree_flags_idx1 = OBJ_UDATA_FLAG_OWN; Tree * tree_idx1; GitError rc_git_commit_tree_idx2 = GIT_OK; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_tree_idx2 = git_commit_tree(&(tree_idx1), this_idx1); if(!(GIT_OK != rc_git_commit_tree_idx2)) { obj_type_Tree_push(L, tree_idx1, tree_flags_idx1); @@ -3237,8 +3633,9 @@ static int Commit__tree__meth(lua_State *L) { /* method: parentcount */ static int Commit__parentcount__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); + Commit * this_idx1; unsigned int rc_git_commit_parentcount_idx1 = 0; + this_idx1 = obj_type_Commit_check(L,1); rc_git_commit_parentcount_idx1 = git_commit_parentcount(this_idx1); lua_pushinteger(L, rc_git_commit_parentcount_idx1); return 1; @@ -3246,10 +3643,12 @@ static int Commit__parentcount__meth(lua_State *L) { /* method: parent */ static int Commit__parent__meth(lua_State *L) { - Commit * this_idx1 = obj_type_Commit_check(L,1); - unsigned int n_idx2 = luaL_checkinteger(L,2); + Commit * this_idx1; + unsigned int n_idx2; Commit * parent_idx1; GitError rc_git_commit_parent_idx2 = GIT_OK; + this_idx1 = obj_type_Commit_check(L,1); + n_idx2 = luaL_checkinteger(L,2); rc_git_commit_parent_idx2 = git_commit_parent(&(parent_idx1), this_idx1, n_idx2); if(!(GIT_OK != rc_git_commit_parent_idx2)) { obj_type_Commit_push(L, parent_idx1, 0); @@ -3262,11 +3661,13 @@ static int Commit__parent__meth(lua_State *L) { /* method: lookup */ static int Tree__lookup__meth(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + Repository * repo_idx1; + OID id_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Tree * this_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + id_idx2 = obj_type_OID_check(L,2); err_idx2 = git_tree_lookup(&(this_idx1), repo_idx1, &(id_idx2)); if(!(GIT_OK != err_idx2)) { obj_type_Tree_push(L, this_idx1, this_flags_idx1); @@ -3279,8 +3680,9 @@ static int Tree__lookup__meth(lua_State *L) { /* method: entrycount */ static int Tree__entrycount__meth(lua_State *L) { - Tree * this_idx1 = obj_type_Tree_check(L,1); + Tree * this_idx1; size_t rc_git_tree_entrycount_idx1 = 0; + this_idx1 = obj_type_Tree_check(L,1); rc_git_tree_entrycount_idx1 = git_tree_entrycount(this_idx1); lua_pushinteger(L, rc_git_tree_entrycount_idx1); return 1; @@ -3288,10 +3690,12 @@ static int Tree__entrycount__meth(lua_State *L) { /* method: entry_byname */ static int Tree__entry_byname__meth(lua_State *L) { - Tree * this_idx1 = obj_type_Tree_check(L,1); + Tree * this_idx1; size_t filename_len_idx2; - const char * filename_idx2 = luaL_checklstring(L,2,&(filename_len_idx2)); + const char * filename_idx2; const TreeEntry * rc_git_tree_entry_byname_idx1; + this_idx1 = obj_type_Tree_check(L,1); + filename_idx2 = luaL_checklstring(L,2,&(filename_len_idx2)); rc_git_tree_entry_byname_idx1 = git_tree_entry_byname(this_idx1, filename_idx2); obj_type_TreeEntry_push(L, rc_git_tree_entry_byname_idx1, 0); return 1; @@ -3299,9 +3703,11 @@ static int Tree__entry_byname__meth(lua_State *L) { /* method: entry_byindex */ static int Tree__entry_byindex__meth(lua_State *L) { - Tree * this_idx1 = obj_type_Tree_check(L,1); - int index_idx2 = luaL_checkinteger(L,2); + Tree * this_idx1; + int index_idx2; const TreeEntry * rc_git_tree_entry_byindex_idx1; + this_idx1 = obj_type_Tree_check(L,1); + index_idx2 = luaL_checkinteger(L,2); rc_git_tree_entry_byindex_idx1 = git_tree_entry_byindex(this_idx1, index_idx2); obj_type_TreeEntry_push(L, rc_git_tree_entry_byindex_idx1, 0); return 1; @@ -3309,26 +3715,29 @@ static int Tree__entry_byindex__meth(lua_State *L) { /* method: name */ static int TreeEntry__name__meth(lua_State *L) { - TreeEntry * this_idx1 = obj_type_TreeEntry_check(L,1); + TreeEntry * this_idx1; const char * rc_git_tree_entry_name_idx1 = NULL; + this_idx1 = obj_type_TreeEntry_check(L,1); rc_git_tree_entry_name_idx1 = git_tree_entry_name(this_idx1); lua_pushstring(L, rc_git_tree_entry_name_idx1); return 1; } -/* method: attributes */ -static int TreeEntry__attributes__meth(lua_State *L) { - TreeEntry * this_idx1 = obj_type_TreeEntry_check(L,1); - unsigned int rc_git_tree_entry_attributes_idx1 = 0; - rc_git_tree_entry_attributes_idx1 = git_tree_entry_attributes(this_idx1); - lua_pushinteger(L, rc_git_tree_entry_attributes_idx1); +/* method: filemode */ +static int TreeEntry__filemode__meth(lua_State *L) { + TreeEntry * this_idx1; + int rc_git_tree_entry_filemode_idx1 = 0; + this_idx1 = obj_type_TreeEntry_check(L,1); + rc_git_tree_entry_filemode_idx1 = git_tree_entry_filemode(this_idx1); + lua_pushinteger(L, rc_git_tree_entry_filemode_idx1); return 1; } /* method: id */ static int TreeEntry__id__meth(lua_State *L) { - TreeEntry * this_idx1 = obj_type_TreeEntry_check(L,1); + TreeEntry * this_idx1; OID id_idx1; + this_idx1 = obj_type_TreeEntry_check(L,1); id_idx1 = *(git_tree_entry_id(this_idx1)); obj_type_OID_push(L, id_idx1); return 1; @@ -3336,11 +3745,13 @@ id_idx1 = *(git_tree_entry_id(this_idx1)); /* method: object */ static int TreeEntry__object__meth(lua_State *L) { - TreeEntry * this_idx1 = obj_type_TreeEntry_check(L,1); - Repository * repo_idx2 = obj_type_Repository_check(L,2); + TreeEntry * this_idx1; + Repository * repo_idx2; int obj_flags_idx1 = OBJ_UDATA_FLAG_OWN; Object * obj_idx1; GitError rc_git_tree_entry_to_object_idx2 = GIT_OK; + this_idx1 = obj_type_TreeEntry_check(L,1); + repo_idx2 = obj_type_Repository_check(L,2); rc_git_tree_entry_to_object_idx2 = git_tree_entry_to_object(&(obj_idx1), repo_idx2, this_idx1); if(!(GIT_OK != rc_git_tree_entry_to_object_idx2)) { obj_type_Object_push(L, obj_idx1, obj_flags_idx1); @@ -3353,11 +3764,13 @@ static int TreeEntry__object__meth(lua_State *L) { /* method: lookup */ static int Tag__lookup__meth(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + Repository * repo_idx1; + OID id_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Tag * this_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + id_idx2 = obj_type_OID_check(L,2); err_idx2 = git_tag_lookup(&(this_idx1), repo_idx1, &(id_idx2)); if(!(GIT_OK != err_idx2)) { obj_type_Tag_push(L, this_idx1, this_flags_idx1); @@ -3370,9 +3783,10 @@ static int Tag__lookup__meth(lua_State *L) { /* method: target */ static int Tag__target__meth(lua_State *L) { - Tag * this_idx1 = obj_type_Tag_check(L,1); + Tag * this_idx1; Object * out_idx1; GitError rc_git_tag_target_idx2 = GIT_OK; + this_idx1 = obj_type_Tag_check(L,1); rc_git_tag_target_idx2 = git_tag_target(&(out_idx1), this_idx1); if(!(GIT_OK != rc_git_tag_target_idx2)) { obj_type_Object_push(L, out_idx1, 0); @@ -3385,8 +3799,9 @@ static int Tag__target__meth(lua_State *L) { /* method: name */ static int Tag__name__meth(lua_State *L) { - Tag * this_idx1 = obj_type_Tag_check(L,1); + Tag * this_idx1; const char * rc_git_tag_name_idx1 = NULL; + this_idx1 = obj_type_Tag_check(L,1); rc_git_tag_name_idx1 = git_tag_name(this_idx1); lua_pushstring(L, rc_git_tag_name_idx1); return 1; @@ -3394,8 +3809,9 @@ static int Tag__name__meth(lua_State *L) { /* method: tagger */ static int Tag__tagger__meth(lua_State *L) { - Tag * this_idx1 = obj_type_Tag_check(L,1); + Tag * this_idx1; const Signature * rc_git_tag_tagger_idx1; + this_idx1 = obj_type_Tag_check(L,1); rc_git_tag_tagger_idx1 = git_tag_tagger(this_idx1); obj_type_Signature_push(L, rc_git_tag_tagger_idx1, 0); return 1; @@ -3403,8 +3819,9 @@ static int Tag__tagger__meth(lua_State *L) { /* method: message */ static int Tag__message__meth(lua_State *L) { - Tag * this_idx1 = obj_type_Tag_check(L,1); + Tag * this_idx1; const char * rc_git_tag_message_idx1 = NULL; + this_idx1 = obj_type_Tag_check(L,1); rc_git_tag_message_idx1 = git_tag_message(this_idx1); lua_pushstring(L, rc_git_tag_message_idx1); return 1; @@ -3412,10 +3829,11 @@ static int Tag__message__meth(lua_State *L) { /* method: new */ static int RevWalk__new__meth(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); + Repository * repo_idx1; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; RevWalk * this_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); err_idx2 = git_revwalk_new(&(this_idx1), repo_idx1); if(!(GIT_OK != err_idx2)) { obj_type_RevWalk_push(L, this_idx1, this_flags_idx1); @@ -3429,7 +3847,8 @@ static int RevWalk__new__meth(lua_State *L) { /* method: close */ static int RevWalk__close__meth(lua_State *L) { int this_flags_idx1 = 0; - RevWalk * this_idx1 = obj_type_RevWalk_delete(L,1,&(this_flags_idx1)); + RevWalk * this_idx1; + this_idx1 = obj_type_RevWalk_delete(L,1,&(this_flags_idx1)); if(!(this_flags_idx1 & OBJ_UDATA_FLAG_OWN)) { return 0; } git_revwalk_free(this_idx1); return 0; @@ -3437,16 +3856,19 @@ static int RevWalk__close__meth(lua_State *L) { /* method: reset */ static int RevWalk__reset__meth(lua_State *L) { - RevWalk * this_idx1 = obj_type_RevWalk_check(L,1); + RevWalk * this_idx1; + this_idx1 = obj_type_RevWalk_check(L,1); git_revwalk_reset(this_idx1); return 0; } /* method: push */ static int RevWalk__push__meth(lua_State *L) { - RevWalk * this_idx1 = obj_type_RevWalk_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + RevWalk * this_idx1; + OID id_idx2; GitError rc_git_revwalk_push_idx1 = GIT_OK; + this_idx1 = obj_type_RevWalk_check(L,1); + id_idx2 = obj_type_OID_check(L,2); rc_git_revwalk_push_idx1 = git_revwalk_push(this_idx1, &(id_idx2)); /* check for error. */ if((GIT_OK != rc_git_revwalk_push_idx1)) { @@ -3461,9 +3883,11 @@ static int RevWalk__push__meth(lua_State *L) { /* method: hide */ static int RevWalk__hide__meth(lua_State *L) { - RevWalk * this_idx1 = obj_type_RevWalk_check(L,1); - OID id_idx2 = obj_type_OID_check(L,2); + RevWalk * this_idx1; + OID id_idx2; GitError rc_git_revwalk_hide_idx1 = GIT_OK; + this_idx1 = obj_type_RevWalk_check(L,1); + id_idx2 = obj_type_OID_check(L,2); rc_git_revwalk_hide_idx1 = git_revwalk_hide(this_idx1, &(id_idx2)); /* check for error. */ if((GIT_OK != rc_git_revwalk_hide_idx1)) { @@ -3478,9 +3902,10 @@ static int RevWalk__hide__meth(lua_State *L) { /* method: next */ static int RevWalk__next__meth(lua_State *L) { - RevWalk * this_idx1 = obj_type_RevWalk_check(L,1); + RevWalk * this_idx1; OID id_idx1; GitError rc_git_revwalk_next_idx2 = GIT_OK; + this_idx1 = obj_type_RevWalk_check(L,1); rc_git_revwalk_next_idx2 = git_revwalk_next(&(id_idx1), this_idx1); if(!(GIT_OK != rc_git_revwalk_next_idx2)) { obj_type_OID_push(L, id_idx1); @@ -3493,16 +3918,19 @@ static int RevWalk__next__meth(lua_State *L) { /* method: sorting */ static int RevWalk__sorting__meth(lua_State *L) { - RevWalk * this_idx1 = obj_type_RevWalk_check(L,1); - unsigned int sort_mode_idx2 = luaL_checkinteger(L,2); + RevWalk * this_idx1; + unsigned int sort_mode_idx2; + this_idx1 = obj_type_RevWalk_check(L,1); + sort_mode_idx2 = luaL_checkinteger(L,2); git_revwalk_sorting(this_idx1, sort_mode_idx2); return 0; } /* method: repository */ static int RevWalk__repository__meth(lua_State *L) { - RevWalk * this_idx1 = obj_type_RevWalk_check(L,1); + RevWalk * this_idx1; Repository * rc_git_revwalk_repository_idx1; + this_idx1 = obj_type_RevWalk_check(L,1); rc_git_revwalk_repository_idx1 = git_revwalk_repository(this_idx1); obj_type_Repository_push(L, rc_git_revwalk_repository_idx1, 0); return 1; @@ -3510,12 +3938,14 @@ static int RevWalk__repository__meth(lua_State *L) { /* method: lookup */ static int Reference__lookup__meth(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); + Repository * repo_idx1; size_t name_len_idx2; - const char * name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); + const char * name_idx2; int this_flags_idx1 = OBJ_UDATA_FLAG_OWN; Reference * this_idx1; GitError err_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + name_idx2 = luaL_checklstring(L,2,&(name_len_idx2)); err_idx2 = git_reference_lookup(&(this_idx1), repo_idx1, name_idx2); if(!(GIT_OK != err_idx2)) { obj_type_Reference_push(L, this_idx1, this_flags_idx1); @@ -3528,8 +3958,9 @@ static int Reference__lookup__meth(lua_State *L) { /* method: oid */ static int Reference__oid__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; OID rc_git_reference_oid_idx1; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_oid_idx1 = *git_reference_oid(this_idx1); obj_type_OID_push(L, rc_git_reference_oid_idx1); return 1; @@ -3537,9 +3968,11 @@ static int Reference__oid__meth(lua_State *L) { /* method: set_oid */ static int Reference__set_oid__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); - OID oid_idx2 = obj_type_OID_check(L,2); + Reference * this_idx1; + OID oid_idx2; GitError rc_git_reference_set_oid_idx1 = GIT_OK; + this_idx1 = obj_type_Reference_check(L,1); + oid_idx2 = obj_type_OID_check(L,2); rc_git_reference_set_oid_idx1 = git_reference_set_oid(this_idx1, &(oid_idx2)); /* check for error. */ if((GIT_OK != rc_git_reference_set_oid_idx1)) { @@ -3554,8 +3987,9 @@ static int Reference__set_oid__meth(lua_State *L) { /* method: target */ static int Reference__target__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; const char * rc_git_reference_target_idx1 = NULL; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_target_idx1 = git_reference_target(this_idx1); lua_pushstring(L, rc_git_reference_target_idx1); return 1; @@ -3563,10 +3997,12 @@ static int Reference__target__meth(lua_State *L) { /* method: set_target */ static int Reference__set_target__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; size_t target_len_idx2; - const char * target_idx2 = luaL_checklstring(L,2,&(target_len_idx2)); + const char * target_idx2; GitError rc_git_reference_set_target_idx1 = GIT_OK; + this_idx1 = obj_type_Reference_check(L,1); + target_idx2 = luaL_checklstring(L,2,&(target_len_idx2)); rc_git_reference_set_target_idx1 = git_reference_set_target(this_idx1, target_idx2); /* check for error. */ if((GIT_OK != rc_git_reference_set_target_idx1)) { @@ -3581,8 +4017,9 @@ static int Reference__set_target__meth(lua_State *L) { /* method: type */ static int Reference__type__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; git_ref_t rc_git_reference_type_idx1; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_type_idx1 = git_reference_type(this_idx1); lua_pushinteger(L, rc_git_reference_type_idx1); return 1; @@ -3590,8 +4027,9 @@ static int Reference__type__meth(lua_State *L) { /* method: name */ static int Reference__name__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; const char * rc_git_reference_name_idx1 = NULL; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_name_idx1 = git_reference_name(this_idx1); lua_pushstring(L, rc_git_reference_name_idx1); return 1; @@ -3599,9 +4037,10 @@ static int Reference__name__meth(lua_State *L) { /* method: resolve */ static int Reference__resolve__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; Reference * resolved_ref_idx1; GitError rc_git_reference_resolve_idx2 = GIT_OK; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_resolve_idx2 = git_reference_resolve(&(resolved_ref_idx1), this_idx1); if(!(GIT_OK != rc_git_reference_resolve_idx2)) { obj_type_Reference_push(L, resolved_ref_idx1, 0); @@ -3614,8 +4053,9 @@ static int Reference__resolve__meth(lua_State *L) { /* method: owner */ static int Reference__owner__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; Repository * rc_git_reference_owner_idx1; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_owner_idx1 = git_reference_owner(this_idx1); obj_type_Repository_push(L, rc_git_reference_owner_idx1, 0); return 1; @@ -3623,11 +4063,14 @@ static int Reference__owner__meth(lua_State *L) { /* method: rename */ static int Reference__rename__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; size_t new_name_len_idx2; - const char * new_name_idx2 = luaL_checklstring(L,2,&(new_name_len_idx2)); - bool force_idx3 = lua_toboolean(L,3); + const char * new_name_idx2; + bool force_idx3; GitError rc_git_reference_rename_idx1 = GIT_OK; + this_idx1 = obj_type_Reference_check(L,1); + new_name_idx2 = luaL_checklstring(L,2,&(new_name_len_idx2)); + force_idx3 = lua_toboolean(L,3); rc_git_reference_rename_idx1 = git_reference_rename(this_idx1, new_name_idx2, force_idx3); /* check for error. */ if((GIT_OK != rc_git_reference_rename_idx1)) { @@ -3642,8 +4085,9 @@ static int Reference__rename__meth(lua_State *L) { /* method: delete */ static int Reference__delete__meth(lua_State *L) { - Reference * this_idx1 = obj_type_Reference_check(L,1); + Reference * this_idx1; GitError rc_git_reference_delete_idx1 = GIT_OK; + this_idx1 = obj_type_Reference_check(L,1); rc_git_reference_delete_idx1 = git_reference_delete(this_idx1); /* check for error. */ if((GIT_OK != rc_git_reference_delete_idx1)) { @@ -3658,8 +4102,9 @@ static int Reference__delete__meth(lua_State *L) { /* method: packall */ static int Reference__packall__func(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); + Repository * repo_idx1; GitError rc_git_reference_packall_idx1 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); rc_git_reference_packall_idx1 = git_reference_packall(repo_idx1); /* check for error. */ if((GIT_OK != rc_git_reference_packall_idx1)) { @@ -3674,13 +4119,15 @@ static int Reference__packall__func(lua_State *L) { /* method: list */ static int Reference__list__func(lua_State *L) { - Repository * repo_idx1 = obj_type_Repository_check(L,1); - unsigned int list_flags_idx2 = luaL_checkinteger(L,2); + Repository * repo_idx1; + unsigned int list_flags_idx2; StrArray array_idx1_store; StrArray * array_idx1 = &(array_idx1_store); GitError err_idx2 = GIT_OK; git_strarray tmp_array = { .strings = NULL, .count = 0 }; + repo_idx1 = obj_type_Repository_check(L,1); + list_flags_idx2 = luaL_checkinteger(L,2); /* push this onto stack now, just encase there is a out-of-memory error. */ array_idx1 = obj_type_StrArray_push(L, &tmp_array); err_idx2 = git_reference_list(array_idx1, repo_idx1, list_flags_idx2); @@ -3701,6 +4148,26 @@ static int Reference__list__func(lua_State *L) { return 2; } +/* method: base */ +static int merge__base__func(lua_State *L) { + Repository * repo_idx1; + OID one_idx2; + OID two_idx3; + OID base_idx1; + GitError int_idx2 = GIT_OK; + repo_idx1 = obj_type_Repository_check(L,1); + one_idx2 = obj_type_OID_check(L,2); + two_idx3 = obj_type_OID_check(L,3); + int_idx2 = git_merge_base(&(base_idx1), repo_idx1, &(one_idx2), &(two_idx3)); + if(!(GIT_OK != int_idx2)) { + obj_type_OID_push(L, base_idx1); + } else { + lua_pushnil(L); + } + error_code__GitError__push(L, int_idx2); + return 2; +} + static const luaL_reg obj_StrArray_pub_funcs[] = { @@ -3735,6 +4202,10 @@ static const obj_const obj_StrArray_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_StrArray_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Repository_pub_funcs[] = { {"open", Repository__open__meth}, {"init", Repository__init__meth}, @@ -3778,6 +4249,10 @@ static const obj_const obj_Repository_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Repository_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Config_pub_funcs[] = { {"new", Config__new__meth}, {"open", Config__open__meth}, @@ -3818,6 +4293,10 @@ static const obj_const obj_Config_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Config_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_OdbObject_pub_funcs[] = { {NULL, NULL} }; @@ -3850,6 +4329,10 @@ static const obj_const obj_OdbObject_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_OdbObject_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_OID_pub_funcs[] = { {"hex", OID__hex__meth}, {"raw", OID__raw__meth}, @@ -3889,6 +4372,10 @@ static const obj_const obj_OID_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_OID_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_OID_Shorten_pub_funcs[] = { {"new", OID_Shorten__new__meth}, {NULL, NULL} @@ -3918,6 +4405,10 @@ static const obj_const obj_OID_Shorten_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_OID_Shorten_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_ODB_pub_funcs[] = { {"new", ODB__new__meth}, {"open", ODB__open__meth}, @@ -3957,6 +4448,10 @@ static const obj_const obj_ODB_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_ODB_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_ODBBackend_pub_funcs[] = { {"new", ODBBackend__new__meth}, {NULL, NULL} @@ -3985,6 +4480,10 @@ static const obj_const obj_ODBBackend_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_ODBBackend_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Index_pub_funcs[] = { {"bare", Index__bare__meth}, {NULL, NULL} @@ -4029,6 +4528,10 @@ static const obj_const obj_Index_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Index_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_IndexEntry_pub_funcs[] = { {"new", IndexEntry__new__meth}, {NULL, NULL} @@ -4078,6 +4581,10 @@ static const obj_const obj_IndexEntry_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_IndexEntry_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_IndexEntryUnmerged_pub_funcs[] = { {NULL, NULL} }; @@ -4107,6 +4614,10 @@ static const obj_const obj_IndexEntryUnmerged_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_IndexEntryUnmerged_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Object_pub_funcs[] = { {"type2string", Object__type2string__func}, {"string2type", Object__string2type__func}, @@ -4140,6 +4651,10 @@ static const obj_const obj_Object_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Object_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Blob_pub_funcs[] = { {"lookup", Blob__lookup__meth}, {"fromfile", Blob__fromfile__func}, @@ -4177,6 +4692,10 @@ static const obj_const obj_Blob_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Blob_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Signature_pub_funcs[] = { {"new", Signature__new__meth}, {"now", Signature__now__meth}, @@ -4209,6 +4728,10 @@ static const obj_const obj_Signature_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Signature_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Commit_pub_funcs[] = { {"lookup", Commit__lookup__meth}, {"create", Commit__create__func}, @@ -4252,6 +4775,10 @@ static const obj_const obj_Commit_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Commit_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Tree_pub_funcs[] = { {"lookup", Tree__lookup__meth}, {NULL, NULL} @@ -4288,13 +4815,17 @@ static const obj_const obj_Tree_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Tree_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_TreeEntry_pub_funcs[] = { {NULL, NULL} }; static const luaL_reg obj_TreeEntry_methods[] = { {"name", TreeEntry__name__meth}, - {"attributes", TreeEntry__attributes__meth}, + {"filemode", TreeEntry__filemode__meth}, {"id", TreeEntry__id__meth}, {"object", TreeEntry__object__meth}, {NULL, NULL} @@ -4318,6 +4849,10 @@ static const obj_const obj_TreeEntry_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_TreeEntry_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Tag_pub_funcs[] = { {"lookup", Tag__lookup__meth}, {NULL, NULL} @@ -4355,6 +4890,10 @@ static const obj_const obj_Tag_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Tag_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_RevWalk_pub_funcs[] = { {"new", RevWalk__new__meth}, {NULL, NULL} @@ -4394,6 +4933,10 @@ static const obj_const obj_RevWalk_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_RevWalk_implements[] = { + {NULL, NULL} +}; + static const luaL_reg obj_Reference_pub_funcs[] = { {"lookup", Reference__lookup__meth}, {"packall", Reference__packall__func}, @@ -4433,14 +4976,31 @@ static const obj_const obj_Reference_constants[] = { {NULL, NULL, 0.0 , 0} }; +static const reg_impl obj_Reference_implements[] = { + {NULL, NULL} +}; + +static const luaL_reg obj_merge_pub_funcs[] = { + {"base", merge__base__func}, + {NULL, NULL} +}; + +static const obj_const obj_merge_constants[] = { + {NULL, NULL, 0.0 , 0} +}; + +static const reg_impl obj_merge_implements[] = { + {NULL, NULL} +}; + static const luaL_reg git2_function[] = { {"version", git2__version__func}, {NULL, NULL} }; static const obj_const git2_constants[] = { -#ifdef GIT_REVWALKOVER - {"REVWALKOVER", NULL, GIT_REVWALKOVER, CONST_NUMBER}, +#ifdef GIT_EUSER + {"EUSER", NULL, GIT_EUSER, CONST_NUMBER}, #endif #ifdef GIT_ERROR {"ERROR", NULL, GIT_ERROR, CONST_NUMBER}, @@ -4453,11 +5013,14 @@ static const obj_const git2_constants[] = { #ifdef GIT_EAMBIGUOUS {"EAMBIGUOUS", NULL, GIT_EAMBIGUOUS, CONST_NUMBER}, #endif + {"REF_PACKED", NULL, 4, CONST_NUMBER}, #ifdef GIT_OK {"OK", NULL, GIT_OK, CONST_NUMBER}, #endif - {"REF_PACKED", NULL, 4, CONST_NUMBER}, {"REF_HAS_PEEL", NULL, 8, CONST_NUMBER}, +#ifdef GIT_ITEROVER + {"ITEROVER", NULL, GIT_ITEROVER, CONST_NUMBER}, +#endif #ifdef GIT_EBUFS {"EBUFS", NULL, GIT_EBUFS, CONST_NUMBER}, #endif @@ -4475,27 +5038,28 @@ static const obj_const git2_constants[] = { static const reg_sub_module reg_sub_modules[] = { - { &(obj_type_StrArray), REG_OBJECT, obj_StrArray_pub_funcs, obj_StrArray_methods, obj_StrArray_metas, obj_StrArray_bases, obj_StrArray_fields, obj_StrArray_constants, 0}, - { &(obj_type_Repository), REG_OBJECT, obj_Repository_pub_funcs, obj_Repository_methods, obj_Repository_metas, obj_Repository_bases, obj_Repository_fields, obj_Repository_constants, 0}, - { &(obj_type_Config), REG_OBJECT, obj_Config_pub_funcs, obj_Config_methods, obj_Config_metas, obj_Config_bases, obj_Config_fields, obj_Config_constants, 0}, - { &(obj_type_OdbObject), REG_OBJECT, obj_OdbObject_pub_funcs, obj_OdbObject_methods, obj_OdbObject_metas, obj_OdbObject_bases, obj_OdbObject_fields, obj_OdbObject_constants, 0}, - { &(obj_type_OID), REG_OBJECT, obj_OID_pub_funcs, obj_OID_methods, obj_OID_metas, obj_OID_bases, obj_OID_fields, obj_OID_constants, 0}, - { &(obj_type_OID_Shorten), REG_OBJECT, obj_OID_Shorten_pub_funcs, obj_OID_Shorten_methods, obj_OID_Shorten_metas, obj_OID_Shorten_bases, obj_OID_Shorten_fields, obj_OID_Shorten_constants, 0}, - { &(obj_type_ODB), REG_OBJECT, obj_ODB_pub_funcs, obj_ODB_methods, obj_ODB_metas, obj_ODB_bases, obj_ODB_fields, obj_ODB_constants, 0}, - { &(obj_type_ODBBackend), REG_OBJECT, obj_ODBBackend_pub_funcs, obj_ODBBackend_methods, obj_ODBBackend_metas, obj_ODBBackend_bases, obj_ODBBackend_fields, obj_ODBBackend_constants, 0}, - { &(obj_type_Index), REG_OBJECT, obj_Index_pub_funcs, obj_Index_methods, obj_Index_metas, obj_Index_bases, obj_Index_fields, obj_Index_constants, 0}, - { &(obj_type_IndexEntry), REG_OBJECT, obj_IndexEntry_pub_funcs, obj_IndexEntry_methods, obj_IndexEntry_metas, obj_IndexEntry_bases, obj_IndexEntry_fields, obj_IndexEntry_constants, 0}, - { &(obj_type_IndexEntryUnmerged), REG_OBJECT, obj_IndexEntryUnmerged_pub_funcs, obj_IndexEntryUnmerged_methods, obj_IndexEntryUnmerged_metas, obj_IndexEntryUnmerged_bases, obj_IndexEntryUnmerged_fields, obj_IndexEntryUnmerged_constants, 0}, - { &(obj_type_Object), REG_OBJECT, obj_Object_pub_funcs, obj_Object_methods, obj_Object_metas, obj_Object_bases, obj_Object_fields, obj_Object_constants, 0}, - { &(obj_type_Blob), REG_OBJECT, obj_Blob_pub_funcs, obj_Blob_methods, obj_Blob_metas, obj_Blob_bases, obj_Blob_fields, obj_Blob_constants, 0}, - { &(obj_type_Signature), REG_OBJECT, obj_Signature_pub_funcs, obj_Signature_methods, obj_Signature_metas, obj_Signature_bases, obj_Signature_fields, obj_Signature_constants, 0}, - { &(obj_type_Commit), REG_OBJECT, obj_Commit_pub_funcs, obj_Commit_methods, obj_Commit_metas, obj_Commit_bases, obj_Commit_fields, obj_Commit_constants, 0}, - { &(obj_type_Tree), REG_OBJECT, obj_Tree_pub_funcs, obj_Tree_methods, obj_Tree_metas, obj_Tree_bases, obj_Tree_fields, obj_Tree_constants, 0}, - { &(obj_type_TreeEntry), REG_OBJECT, obj_TreeEntry_pub_funcs, obj_TreeEntry_methods, obj_TreeEntry_metas, obj_TreeEntry_bases, obj_TreeEntry_fields, obj_TreeEntry_constants, 0}, - { &(obj_type_Tag), REG_OBJECT, obj_Tag_pub_funcs, obj_Tag_methods, obj_Tag_metas, obj_Tag_bases, obj_Tag_fields, obj_Tag_constants, 0}, - { &(obj_type_RevWalk), REG_OBJECT, obj_RevWalk_pub_funcs, obj_RevWalk_methods, obj_RevWalk_metas, obj_RevWalk_bases, obj_RevWalk_fields, obj_RevWalk_constants, 0}, - { &(obj_type_Reference), REG_OBJECT, obj_Reference_pub_funcs, obj_Reference_methods, obj_Reference_metas, obj_Reference_bases, obj_Reference_fields, obj_Reference_constants, 0}, - {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, 0} + { &(obj_type_StrArray), REG_OBJECT, obj_StrArray_pub_funcs, obj_StrArray_methods, obj_StrArray_metas, obj_StrArray_bases, obj_StrArray_fields, obj_StrArray_constants, obj_StrArray_implements, 0}, + { &(obj_type_Repository), REG_OBJECT, obj_Repository_pub_funcs, obj_Repository_methods, obj_Repository_metas, obj_Repository_bases, obj_Repository_fields, obj_Repository_constants, obj_Repository_implements, 0}, + { &(obj_type_Config), REG_OBJECT, obj_Config_pub_funcs, obj_Config_methods, obj_Config_metas, obj_Config_bases, obj_Config_fields, obj_Config_constants, obj_Config_implements, 0}, + { &(obj_type_OdbObject), REG_OBJECT, obj_OdbObject_pub_funcs, obj_OdbObject_methods, obj_OdbObject_metas, obj_OdbObject_bases, obj_OdbObject_fields, obj_OdbObject_constants, obj_OdbObject_implements, 0}, + { &(obj_type_OID), REG_OBJECT, obj_OID_pub_funcs, obj_OID_methods, obj_OID_metas, obj_OID_bases, obj_OID_fields, obj_OID_constants, obj_OID_implements, 0}, + { &(obj_type_OID_Shorten), REG_OBJECT, obj_OID_Shorten_pub_funcs, obj_OID_Shorten_methods, obj_OID_Shorten_metas, obj_OID_Shorten_bases, obj_OID_Shorten_fields, obj_OID_Shorten_constants, obj_OID_Shorten_implements, 0}, + { &(obj_type_ODB), REG_OBJECT, obj_ODB_pub_funcs, obj_ODB_methods, obj_ODB_metas, obj_ODB_bases, obj_ODB_fields, obj_ODB_constants, obj_ODB_implements, 0}, + { &(obj_type_ODBBackend), REG_OBJECT, obj_ODBBackend_pub_funcs, obj_ODBBackend_methods, obj_ODBBackend_metas, obj_ODBBackend_bases, obj_ODBBackend_fields, obj_ODBBackend_constants, obj_ODBBackend_implements, 0}, + { &(obj_type_Index), REG_OBJECT, obj_Index_pub_funcs, obj_Index_methods, obj_Index_metas, obj_Index_bases, obj_Index_fields, obj_Index_constants, obj_Index_implements, 0}, + { &(obj_type_IndexEntry), REG_OBJECT, obj_IndexEntry_pub_funcs, obj_IndexEntry_methods, obj_IndexEntry_metas, obj_IndexEntry_bases, obj_IndexEntry_fields, obj_IndexEntry_constants, obj_IndexEntry_implements, 0}, + { &(obj_type_IndexEntryUnmerged), REG_OBJECT, obj_IndexEntryUnmerged_pub_funcs, obj_IndexEntryUnmerged_methods, obj_IndexEntryUnmerged_metas, obj_IndexEntryUnmerged_bases, obj_IndexEntryUnmerged_fields, obj_IndexEntryUnmerged_constants, obj_IndexEntryUnmerged_implements, 0}, + { &(obj_type_Object), REG_OBJECT, obj_Object_pub_funcs, obj_Object_methods, obj_Object_metas, obj_Object_bases, obj_Object_fields, obj_Object_constants, obj_Object_implements, 0}, + { &(obj_type_Blob), REG_OBJECT, obj_Blob_pub_funcs, obj_Blob_methods, obj_Blob_metas, obj_Blob_bases, obj_Blob_fields, obj_Blob_constants, obj_Blob_implements, 0}, + { &(obj_type_Signature), REG_OBJECT, obj_Signature_pub_funcs, obj_Signature_methods, obj_Signature_metas, obj_Signature_bases, obj_Signature_fields, obj_Signature_constants, obj_Signature_implements, 0}, + { &(obj_type_Commit), REG_OBJECT, obj_Commit_pub_funcs, obj_Commit_methods, obj_Commit_metas, obj_Commit_bases, obj_Commit_fields, obj_Commit_constants, obj_Commit_implements, 0}, + { &(obj_type_Tree), REG_OBJECT, obj_Tree_pub_funcs, obj_Tree_methods, obj_Tree_metas, obj_Tree_bases, obj_Tree_fields, obj_Tree_constants, obj_Tree_implements, 0}, + { &(obj_type_TreeEntry), REG_OBJECT, obj_TreeEntry_pub_funcs, obj_TreeEntry_methods, obj_TreeEntry_metas, obj_TreeEntry_bases, obj_TreeEntry_fields, obj_TreeEntry_constants, obj_TreeEntry_implements, 0}, + { &(obj_type_Tag), REG_OBJECT, obj_Tag_pub_funcs, obj_Tag_methods, obj_Tag_metas, obj_Tag_bases, obj_Tag_fields, obj_Tag_constants, obj_Tag_implements, 0}, + { &(obj_type_RevWalk), REG_OBJECT, obj_RevWalk_pub_funcs, obj_RevWalk_methods, obj_RevWalk_metas, obj_RevWalk_bases, obj_RevWalk_fields, obj_RevWalk_constants, obj_RevWalk_implements, 0}, + { &(obj_type_Reference), REG_OBJECT, obj_Reference_pub_funcs, obj_Reference_methods, obj_Reference_metas, obj_Reference_bases, obj_Reference_fields, obj_Reference_constants, obj_Reference_implements, 0}, + { &(obj_type_merge), REG_PACKAGE, obj_merge_pub_funcs, NULL, NULL, NULL, NULL, obj_merge_constants, NULL, 0}, + {NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0} }; @@ -4541,6 +5105,9 @@ LUA_NOBJ_API int luaopen_git2(lua_State *L) { const luaL_Reg *submodules = submodule_libs; int priv_table = -1; + /* register interfaces */ + obj_register_interfaces(L, obj_interfaces); + /* private table to hold reference to object metatables. */ lua_newtable(L); priv_table = lua_gettop(L); @@ -4582,7 +5149,7 @@ LUA_NOBJ_API int luaopen_git2(lua_State *L) { #if LUAJIT_FFI if(nobj_check_ffi_support(L)) { - nobj_try_loading_ffi(L, "git2", git2_ffi_lua_code, + nobj_try_loading_ffi(L, "git2.nobj.ffi.lua", git2_ffi_lua_code, git2_ffi_export, priv_table); } #endif |