diff --git a/Readme.md b/Readme.md index c105f51..8a5b645 100644 --- a/Readme.md +++ b/Readme.md @@ -10,14 +10,19 @@ allowing you to write native speed custom Git applications in any language which * [WrapC](https://github.com/eiffel-wrap-c/WrapC) tool. * [Libgit2 v0.28.3](https://github.com/libgit2/libgit2/releases). -== Status == +### Status The binding is work in progress. Tested on Linux and Windows 64 bits. ## Examples -* Git Init: `shows how to initialize a new repo` -* Git Status: `shows how to use the status APIs` +* [Git Init](./examples/init): `shows how to initialize a new repo` +* [Git Status](./examples/status): `shows how to use the status APIs` +* [Git Add](./examples/add) `shows how to modify the index` +* [Git Checkout](./examples/checkout) `shows how to perform checkouts`. +* [Git Describe](./examples/describe) `shows how to describe commits`. +* [Git ls-files](./examples/ls_files) `shows how to view all files currently in the index.` +* [Git push](./examples/push) `shows how to git push `. [Guide to linking libgit2](https://libgit2.org/docs/guides/build-and-link/) on various platforms @@ -28,6 +33,7 @@ On Linux to install version 0.28.3 you will need to do the following. $ cmake .. $ sudo cmake --build . --target install + Optionally you can use [vckpg](https://github.com/Microsoft/vcpkg), a C++ Library Manager for Windows, Linux, and MacOS. Windows example @@ -48,3 +54,4 @@ Linux example + diff --git a/examples/push/application.e b/examples/push/application.e new file mode 100644 index 0000000..f912e68 --- /dev/null +++ b/examples/push/application.e @@ -0,0 +1,286 @@ +note + description: "[ + libgit2 "push" example - shows how to git push + ]" + +class APPLICATION + +inherit + + COMMAND_LINE_PARSER + rename + make as make_command_line_parser + end + +create + make + +feature {NONE} --Initialization + + make + + do + create git_repository + path := "." + remote := "" + branch := "" + + make_command_line_parser + process_arguments + push_repository + end + + +feature -- Intiialize Repository + + push_repository + local + ini: INTEGER + repo: GIT_REPOSITORY_STRUCT_API + iniopts: GIT_REPOSITORY_INIT_OPTIONS_STRUCT_API + l_remote: GIT_REMOTE_STRUCT_API + git_remote: GIT_REMOTE + refspec: STRING + l_options: GIT_PUSH_OPTIONS_STRUCT_API + a_array: GIT_STRARRAY_STRUCT_API + callbacks: GIT_REMOTE_CALLBACKS_STRUCT_API + callback_dispatcher: GIT_CRED_ACQUIRE_CB_DISPATCHER + + do + ini := {LIBGIT2_INITIALIZER_API}.git_libgit2_init + print ("%N Intializing Libgit2") + create repo.make + + if git_repository.git_repository_open (repo, (create {PATH}.make_from_string (path)).out) < 0 then + print ("%NCould not open repository") + {EXCEPTIONS}.die (1) + end + + + -- get the remote + create l_remote.make + + create git_remote + if git_remote.git_remote_lookup (l_remote, repo, remote) < 0 then + print ("%NCould not get remote repository " + remote) + {EXCEPTIONS}.die (1) + end + + create callbacks.make + if git_remote.git_remote_init_callbacks (callbacks, 1) < 0 then + print ("%NCould not intialize callback ") + {EXCEPTIONS}.die (1) + end + + create callback_dispatcher.make (agent cred_acquire_cb ) + callbacks.set_credentials (callback_dispatcher.c_dispatcher) + + -- connect to remote + if git_remote.git_remote_connect (l_remote, {GIT_DIRECTION_ENUM_API}.git_direction_push, callbacks, Void, Void) < 0 then + print ("%NCould not connect to remote repository " + remote) + {EXCEPTIONS}.die (1) + end + + + -- add a push refspec + create refspec.make_from_string ("refs/heads/") + refspec.append (branch) + + if git_remote.git_remote_add_push (repo, remote, refspec + ":" + refspec) < 0 then + print ("%NCould not add push ") + {EXCEPTIONS}.die (1) + end + + -- configure options + create l_options.make + if git_remote.git_push_init_options (l_options, 1) < 0 then + print ("%NCould not configure options ") + {EXCEPTIONS}.die (1) + end + + create a_array.make + init_array (a_array, {ARRAY [STRING]}<>) + + -- do the push + if git_remote.git_remote_upload (l_remote, a_array, l_options) < 0 then + print ("%NCould not do push ") + {EXCEPTIONS}.die (1) + end + + git_repository.git_repository_free (repo) + git_remote.git_remote_free (l_remote) + + end + + init_array (a_array: GIT_STRARRAY_STRUCT_API; l_array: ARRAY [STRING]) + local + mp: MANAGED_POINTER + do + create mp.make (l_array.count * {PLATFORM}.pointer_bytes) + across l_array as ic loop + mp.put_pointer ((create {C_STRING}.make (ic.item)).item, (ic.cursor_index - 1) * {PLATFORM}.pointer_bytes ) + end + a_array.set_count (l_array.count) + a_array.set_strings (mp.item) + end + + + + cred_acquire_cb (a_cred: POINTER; a_url: POINTER; a_username_from_url: POINTER; a_allowed_types: INTEGER; a_payload: POINTER): INTEGER + local + l_user_name: STRING + exit: BOOLEAN + cred: GIT_CRED_STRUCT_API + git_cred: GIT_CREDENTIALS_API + l_password: STRING + l_privkey: STRING + l_pubkey: STRING + do + + if a_username_from_url /= default_pointer then + l_user_name := (create {C_STRING}.make_by_pointer (a_username_from_url)).string + exit := l_user_name.is_empty + else + print ("%NUsername:") + io.read_line + l_user_name := io.last_string.twin + exit := l_user_name.is_empty + end + + if not exit and then a_allowed_types & {GIT_CREDTYPE_T_ENUM_API}.GIT_CREDTYPE_SSH_KEY > 0 then + print ("%NSSH key:") + io.read_line + l_privkey := io.last_string.twin + print ("%NPassword:") + l_password := read_password + if l_password.is_empty or l_privkey.is_empty then + exit := True + end + create l_pubkey.make_from_string (l_password) + l_pubkey.append_string (".pub") + create git_cred + create cred.make_by_pointer (a_cred) + Result := git_cred.git_cred_ssh_key_new(cred, l_user_name, l_pubkey, l_privkey, l_password) + elseif not exit and then a_allowed_types & {GIT_CREDTYPE_T_ENUM_API}.GIT_CREDTYPE_USERPASS_PLAINTEXT > 0 then + print ("%NPassword:") + l_password := read_password + exit := l_password.is_empty + if not exit then + create git_cred + create cred.make_by_pointer (a_cred) + Result := git_cred.git_cred_userpass_plaintext_new(cred, l_user_name, l_password) + end + else + if not exit then + create git_cred + create cred.make_by_pointer (a_cred) + Result := git_cred.git_cred_username_new (cred, l_user_name) + end + end + + end + +feature {NONE} -- Process Arguments + + process_arguments + -- Process command line arguments + local + shared_value: STRING + do + if match_long_option ("git-dir") then + if is_next_option_long_option and then has_next_option_value then + create path.make_from_string (next_option_value) + consume_option + else + print("%N Missing command line parameter --git-dir=") + usage + {EXCEPTIONS}.die (1) + end + end + if has_next_option and then not is_next_option_long_option then + create remote.make_from_string (next_option) + consume_option + else + print("%N Missing command line parameter %N") + usage + {EXCEPTIONS}.die (1) + end + if has_next_option and then not is_next_option_long_option then + create branch.make_from_string (next_option) + consume_option + else + print("%N Missing command line parameter %N") + usage + {EXCEPTIONS}.die (1) + end + end + + usage + local + str: STRING + do + str := "[ + git_push [--git-dir=] + + + ]" + + print("%N") + print (str) + end + + read_password: STRING + local + l_ptr: POINTER + do + l_ptr := c_read_password + if l_ptr /= default_pointer then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + else + Result := "" + end + end + + c_read_password: POINTER + external "C inline" + alias + "[ + #define ENTER 13 + #define TAB 9 + #define BKSP 8 + + char* pwd; + + int i = 0; + char ch; + + while(1){ + ch = getch(); //get key + + if(ch == ENTER || ch == TAB){ + pwd[i] = '\0'; + break; + }else if(ch == BKSP){ + if(i > 0){ + i--; + printf("\b \b"); //for backspace + } + }else{ + pwd[i++] = ch; + printf("* \b"); //to replace password character with * + } + }//while ends here + + return pwd; + ]" + end + + +feature -- Options + + path: STRING + remote: STRING + branch: STRING + git_repository: LIBGIT2_REPOSITORY + +end diff --git a/examples/push/command_line_parser.e b/examples/push/command_line_parser.e new file mode 100644 index 0000000..772932b --- /dev/null +++ b/examples/push/command_line_parser.e @@ -0,0 +1,174 @@ +note + description: "Summary description for {COMMAND_LINE_PARSER}." + date: "$Date$" + revision: "$Revision$" + +class + COMMAND_LINE_PARSER + +inherit + + ARGUMENTS_32 + +create + make + + +feature {NONE} -- Initialization + + make + -- Create a new command-line parser. + do + reset + end + +feature -- Operations + + reset + -- Reset internal option position to first option + -- must be called before first use. + do + next_option_position := 1 + end + + consume_option + -- Move `next_token_position' to the next token position. + do + next_option_position := next_option_position + 1 + end + +feature -- Status report + + has_next_option: BOOLEAN + -- Is there an unconsumed token left? + do + Result := is_valid_option_position (next_option_position) + end + + is_next_option_long_option: BOOLEAN + -- Is the next option a long option (with or without a value)? + local + arg: STRING_32 + do + if has_next_option then + arg := next_option.as_string_32 + Result := arg.count >= 2 and then + arg.substring (1, 2).same_string ("--") + end + end + + has_next_option_value: BOOLEAN + -- Has the next option a value? + require + has_next_option: has_next_option + next_option_is_long_option: is_next_option_long_option + local + i: INTEGER + arg: STRING_32 + do + arg := next_option.as_string_32 + i := arg.index_of ('=', 1) + Result := (i >= 1 and i < arg.count) + end + +feature -- Access + + next_option: STRING_32 + -- Next option on command-line + require + has_next_option: has_next_option + do + Result := argument (next_option_position).as_string_32 + ensure + next_option_not_void: Result /= Void + end + + next_option_value: STRING_32 + -- Value of next option + require + next_option_is_long_option: is_next_option_long_option + has_next_option_value: has_next_option_value + local + i: INTEGER + arg: STRING_32 + do + arg := next_option.as_string_32 + i := arg.index_of ('=', 1) + Result := arg.substring (i + 1, arg.count) + ensure + next_option_value_not_void: Result /= Void + end + +feature -- Matching + + match_long_option (an_option_name: STRING): BOOLEAN + -- Is there a next option on the command-line and + -- is this option a long option whose name is + -- `an_option_name' (Note that `an_option_name' + -- does not contain the leading '--' characters)? + require + an_option_name_not_void: an_option_name /= Void + local + arg: STRING_32 + nb: INTEGER + do + if has_next_option then + arg := next_option.as_string_32 + nb := an_option_name.count + 2 + if + arg.count >= nb and then + (arg.item (1) = '-' and + arg.item (2) = '-') and then + arg.substring (3, nb).same_string (an_option_name) + then + Result := (arg.count = nb or else arg.item (nb + 1) = '=') + end + end + end + +feature {NONE} -- Implementation + + next_option_position: INTEGER + -- Index of next option + + is_valid_option_position (i: INTEGER): BOOLEAN + -- Is `i' a valid token position? + do + Result := (i >= 1 and i <= argument_count) + end + +feature -- Status report + + has_long_option (an_option_name: STRING): BOOLEAN + -- Is there a long option on the command-line whose name is + -- `an_option_name' (note that `an_option_name' does not + -- contain the leading '--' characters)? + require + an_option_name_not_void: an_option_name /= Void + local + i: INTEGER + arg: STRING_32 + nb: INTEGER + do + from + i := 1 + until + (i > argument_count) or Result + loop + arg := argument (i).as_string_32 + nb := an_option_name.count + 2 + if + arg.count >= nb and then + (arg.item (1) = '-' and + arg.item (2) = '-') and then + arg.substring (3, nb).same_string (an_option_name) + then + Result := (arg.count = nb or else arg.item (nb + 1) = '=') + end + + i := i + 1 + end + end + +end + diff --git a/examples/push/git_push.ecf b/examples/push/git_push.ecf new file mode 100644 index 0000000..d40c7e6 --- /dev/null +++ b/examples/push/git_push.ecf @@ -0,0 +1,20 @@ + + + + + + /CVS$ + /EIFGENs$ + /\.git$ + /\.svn$ + + + + + + + + + diff --git a/library/config.xml b/library/config.xml index faace63..ed0ab20 100644 --- a/library/config.xml +++ b/library/config.xml @@ -538,8 +538,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + diff --git a/library/generated_wrapper/c/include/ewg_libgit2_callback_c_glue_code.h b/library/generated_wrapper/c/include/ewg_libgit2_callback_c_glue_code.h index 0af5e67..5249f23 100644 --- a/library/generated_wrapper/c/include/ewg_libgit2_callback_c_glue_code.h +++ b/library/generated_wrapper/c/include/ewg_libgit2_callback_c_glue_code.h @@ -103,4 +103,21 @@ void set_git_checkout_perfdata_cb_entry (void* a_class, void* a_feature); void call_git_checkout_perfdata_cb (void *a_function, git_checkout_perfdata const *perfdata, void *payload); +#include + +typedef int (*git_cred_acquire_cb_eiffel_feature) (void *a_class, git_cred **cred, char const *url, char const *username_from_url, unsigned int allowed_types, void *payload); + +void* get_git_cred_acquire_cb_stub (); + +struct git_cred_acquire_cb_entry_struct +{ + void* a_class; + git_cred_acquire_cb_eiffel_feature feature; +}; + +void set_git_cred_acquire_cb_entry (void* a_class, void* a_feature); + +int call_git_cred_acquire_cb (void *a_function, git_cred **cred, char const *url, char const *username_from_url, unsigned int allowed_types, void *payload); + + #endif diff --git a/library/generated_wrapper/c/src/ewg_libgit2_callback_c_glue_code.c b/library/generated_wrapper/c/src/ewg_libgit2_callback_c_glue_code.c index f33b61b..c4dca0d 100644 --- a/library/generated_wrapper/c/src/ewg_libgit2_callback_c_glue_code.c +++ b/library/generated_wrapper/c/src/ewg_libgit2_callback_c_glue_code.c @@ -160,3 +160,29 @@ void call_git_checkout_perfdata_cb (void *a_function, git_checkout_perfdata cons ((void (*) (git_checkout_perfdata const *perfdata, void *payload))a_function) (perfdata, payload); } +struct git_cred_acquire_cb_entry_struct git_cred_acquire_cb_entry = {NULL, NULL}; + +int git_cred_acquire_cb_stub (git_cred **cred, char const *url, char const *username_from_url, unsigned int allowed_types, void *payload) +{ + if (git_cred_acquire_cb_entry.a_class != NULL && git_cred_acquire_cb_entry.feature != NULL) + { + return git_cred_acquire_cb_entry.feature (eif_access(git_cred_acquire_cb_entry.a_class), cred, url, username_from_url, allowed_types, payload); + } +} + +void set_git_cred_acquire_cb_entry (void* a_class, void* a_feature) +{ + git_cred_acquire_cb_entry.a_class = eif_adopt(a_class); + git_cred_acquire_cb_entry.feature = (git_cred_acquire_cb_eiffel_feature) a_feature; +} + +void* get_git_cred_acquire_cb_stub () +{ + return (void*) git_cred_acquire_cb_stub; +} + +int call_git_cred_acquire_cb (void *a_function, git_cred **cred, char const *url, char const *username_from_url, unsigned int allowed_types, void *payload) +{ + return ((int (*) (git_cred **cred, char const *url, char const *username_from_url, unsigned int allowed_types, void *payload))a_function) (cred, url, username_from_url, allowed_types, payload); +} + diff --git a/library/generated_wrapper/eiffel/ewg_libgit2_callback_c_glue_code_functions_api.e b/library/generated_wrapper/eiffel/ewg_libgit2_callback_c_glue_code_functions_api.e index 5589210..bdb2861 100644 --- a/library/generated_wrapper/eiffel/ewg_libgit2_callback_c_glue_code_functions_api.e +++ b/library/generated_wrapper/eiffel/ewg_libgit2_callback_c_glue_code_functions_api.e @@ -140,6 +140,30 @@ feature -- Access c_call_git_checkout_perfdata_cb (a_function, perfdata.item, payload) end + get_git_cred_acquire_cb_stub: POINTER + external + "C inline use " + alias + "[ + return get_git_cred_acquire_cb_stub (); + ]" + end + + set_git_cred_acquire_cb_entry (a_class: GIT_CRED_ACQUIRE_CB_DISPATCHER; a_feature: POINTER) + do + c_set_git_cred_acquire_cb_entry (a_class, a_feature) + end + + call_git_cred_acquire_cb (a_function: POINTER; cred: GIT_CRED_STRUCT_API; url: STRING; username_from_url: STRING; allowed_types: INTEGER; payload: POINTER): INTEGER + local + url_c_string: C_STRING + username_from_url_c_string: C_STRING + do + create url_c_string.make (url) + create username_from_url_c_string.make (username_from_url) + Result := c_call_git_cred_acquire_cb (a_function, cred.item, url_c_string.item, username_from_url_c_string.item, allowed_types, payload) + end + feature -- Externals c_set_git_index_matched_path_cb_entry (a_class: GIT_INDEX_MATCHED_PATH_CB_DISPATCHER; a_feature: POINTER) @@ -250,6 +274,24 @@ feature -- Externals ]" end + c_set_git_cred_acquire_cb_entry (a_class: GIT_CRED_ACQUIRE_CB_DISPATCHER; a_feature: POINTER) + external + "C inline use " + alias + "[ + set_git_cred_acquire_cb_entry ((void*)$a_class, (void*)$a_feature); + ]" + end + + c_call_git_cred_acquire_cb (a_function: POINTER; cred: POINTER; url: POINTER; username_from_url: POINTER; allowed_types: INTEGER; payload: POINTER): INTEGER + external + "C inline use " + alias + "[ + return call_git_cred_acquire_cb ((void*)$a_function, (git_cred**)$cred, (char const*)$url, (char const*)$username_from_url, (unsigned int)$allowed_types, (void*)$payload); + ]" + end + feature -- Externals Address end diff --git a/library/generated_wrapper/eiffel/git_cred_acquire_cb_dispatcher.e b/library/generated_wrapper/eiffel/git_cred_acquire_cb_dispatcher.e new file mode 100644 index 0000000..46e0d86 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_acquire_cb_dispatcher.e @@ -0,0 +1,44 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_ACQUIRE_CB_DISPATCHER + +inherit + + EWG_LIBGIT2_CALLBACK_C_GLUE_CODE_FUNCTIONS_API + export {NONE} all end +create + make + +feature -- Initialization + + make (a_routine: like routine) + -- Dispatcher initialization + do + routine := a_routine + set_git_cred_acquire_cb_entry (Current, $on_callback) + end + +feature --Access: Routine + + routine: FUNCTION [TUPLE [a_cred: POINTER; a_url: POINTER; a_username_from_url: POINTER; a_allowed_types: INTEGER; a_payload: POINTER], INTEGER] + --Eiffel routine to be call on callback. + +feature --Access: Dispatcher + + c_dispatcher: POINTER + do + Result := get_git_cred_acquire_cb_stub + end + +feature --Access: Callback + + on_callback (a_cred: POINTER; a_url: POINTER; a_username_from_url: POINTER; a_allowed_types: INTEGER; a_payload: POINTER): INTEGER + do + Result := routine (a_cred, a_url, a_username_from_url, a_allowed_types, a_payload) + end + +end diff --git a/library/generated_wrapper/eiffel/git_cred_ssh_custom_struct_api.e b/library/generated_wrapper/eiffel/git_cred_ssh_custom_struct_api.e new file mode 100644 index 0000000..0254d67 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_ssh_custom_struct_api.e @@ -0,0 +1,305 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_SSH_CUSTOM_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + parent: detachable GIT_CRED_STRUCT_API + -- Access member `parent` + require + exists: exists + do + if attached c_parent (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_parent (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_parent (item) + end + + set_parent (a_value: GIT_CRED_STRUCT_API) + -- Set member `parent` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_parent (item, a_value.item) + ensure + parent_set: attached parent as l_value implies l_value.item = a_value.item + end + + username: detachable STRING + -- Access member `username` + require + exists: exists + do + if attached c_username (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_username (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_username (a_value: STRING) + -- Change the value of member `username` to `a_value`. + require + exists: exists + do + set_c_username (item, (create {C_STRING}.make (a_value)).item ) + end + + publickey: detachable STRING + -- Access member `publickey` + require + exists: exists + do + if attached c_publickey (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_publickey (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_publickey (a_value: STRING) + -- Change the value of member `publickey` to `a_value`. + require + exists: exists + do + set_c_publickey (item, (create {C_STRING}.make (a_value)).item ) + end + + publickey_len: INTEGER + -- Access member `publickey_len` + require + exists: exists + do + Result := c_publickey_len (item) + ensure + result_correct: Result = c_publickey_len (item) + end + + set_publickey_len (a_value: INTEGER) + -- Change the value of member `publickey_len` to `a_value`. + require + exists: exists + do + set_c_publickey_len (item, a_value) + ensure + publickey_len_set: a_value = publickey_len + end + + sign_callback: POINTER + -- Access member `sign_callback` + require + exists: exists + do + Result := c_sign_callback (item) + ensure + result_correct: Result = c_sign_callback (item) + end + + set_sign_callback (a_value: POINTER) + -- Change the value of member `sign_callback` to `a_value`. + require + exists: exists + do + set_c_sign_callback (item, a_value) + ensure + sign_callback_set: a_value = sign_callback + end + + payload: POINTER + -- Access member `payload` + require + exists: exists + do + Result := c_payload (item) + ensure + result_correct: Result = c_payload (item) + end + + set_payload (a_value: POINTER) + -- Change the value of member `payload` to `a_value`. + require + exists: exists + do + set_c_payload (item, a_value) + ensure + payload_set: a_value = payload + end + +feature {NONE} -- Implementation wrapper for struct struct git_cred_ssh_custom + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_cred_ssh_custom)" + end + + c_parent (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((struct git_cred_ssh_custom*)$an_item)->parent + ]" + end + + set_c_parent (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->parent = *(git_cred*)$a_value + ]" + end + + c_username (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->username + ]" + end + + set_c_username (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->username = (char*)$a_value + ]" + ensure + username_set: a_value = c_username (an_item) + end + + c_publickey (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->publickey + ]" + end + + set_c_publickey (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->publickey = (char*)$a_value + ]" + ensure + publickey_set: a_value = c_publickey (an_item) + end + + c_publickey_len (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->publickey_len + ]" + end + + set_c_publickey_len (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->publickey_len = (size_t)$a_value + ]" + ensure + publickey_len_set: a_value = c_publickey_len (an_item) + end + + c_sign_callback (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->sign_callback + ]" + end + + set_c_sign_callback (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->sign_callback = (git_cred_sign_callback)$a_value + ]" + ensure + sign_callback_set: a_value = c_sign_callback (an_item) + end + + c_payload (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->payload + ]" + end + + set_c_payload (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_custom*)$an_item)->payload = (void*)$a_value + ]" + ensure + payload_set: a_value = c_payload (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_cred_ssh_interactive_struct_api.e b/library/generated_wrapper/eiffel/git_cred_ssh_interactive_struct_api.e new file mode 100644 index 0000000..4832ef9 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_ssh_interactive_struct_api.e @@ -0,0 +1,216 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_SSH_INTERACTIVE_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + parent: detachable GIT_CRED_STRUCT_API + -- Access member `parent` + require + exists: exists + do + if attached c_parent (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_parent (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_parent (item) + end + + set_parent (a_value: GIT_CRED_STRUCT_API) + -- Set member `parent` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_parent (item, a_value.item) + ensure + parent_set: attached parent as l_value implies l_value.item = a_value.item + end + + username: detachable STRING + -- Access member `username` + require + exists: exists + do + if attached c_username (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_username (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_username (a_value: STRING) + -- Change the value of member `username` to `a_value`. + require + exists: exists + do + set_c_username (item, (create {C_STRING}.make (a_value)).item ) + end + + prompt_callback: POINTER + -- Access member `prompt_callback` + require + exists: exists + do + Result := c_prompt_callback (item) + ensure + result_correct: Result = c_prompt_callback (item) + end + + set_prompt_callback (a_value: POINTER) + -- Change the value of member `prompt_callback` to `a_value`. + require + exists: exists + do + set_c_prompt_callback (item, a_value) + ensure + prompt_callback_set: a_value = prompt_callback + end + + payload: POINTER + -- Access member `payload` + require + exists: exists + do + Result := c_payload (item) + ensure + result_correct: Result = c_payload (item) + end + + set_payload (a_value: POINTER) + -- Change the value of member `payload` to `a_value`. + require + exists: exists + do + set_c_payload (item, a_value) + ensure + payload_set: a_value = payload + end + +feature {NONE} -- Implementation wrapper for struct struct git_cred_ssh_interactive + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_cred_ssh_interactive)" + end + + c_parent (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((struct git_cred_ssh_interactive*)$an_item)->parent + ]" + end + + set_c_parent (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->parent = *(git_cred*)$a_value + ]" + end + + c_username (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->username + ]" + end + + set_c_username (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->username = (char*)$a_value + ]" + ensure + username_set: a_value = c_username (an_item) + end + + c_prompt_callback (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->prompt_callback + ]" + end + + set_c_prompt_callback (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->prompt_callback = (git_cred_ssh_interactive_callback)$a_value + ]" + ensure + prompt_callback_set: a_value = c_prompt_callback (an_item) + end + + c_payload (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->payload + ]" + end + + set_c_payload (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_interactive*)$an_item)->payload = (void*)$a_value + ]" + ensure + payload_set: a_value = c_payload (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_cred_ssh_key_struct_api.e b/library/generated_wrapper/eiffel/git_cred_ssh_key_struct_api.e new file mode 100644 index 0000000..a0aacc2 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_ssh_key_struct_api.e @@ -0,0 +1,263 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_SSH_KEY_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + parent: detachable GIT_CRED_STRUCT_API + -- Access member `parent` + require + exists: exists + do + if attached c_parent (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_parent (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_parent (item) + end + + set_parent (a_value: GIT_CRED_STRUCT_API) + -- Set member `parent` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_parent (item, a_value.item) + ensure + parent_set: attached parent as l_value implies l_value.item = a_value.item + end + + username: detachable STRING + -- Access member `username` + require + exists: exists + do + if attached c_username (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_username (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_username (a_value: STRING) + -- Change the value of member `username` to `a_value`. + require + exists: exists + do + set_c_username (item, (create {C_STRING}.make (a_value)).item ) + end + + publickey: detachable STRING + -- Access member `publickey` + require + exists: exists + do + if attached c_publickey (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_publickey (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_publickey (a_value: STRING) + -- Change the value of member `publickey` to `a_value`. + require + exists: exists + do + set_c_publickey (item, (create {C_STRING}.make (a_value)).item ) + end + + privatekey: detachable STRING + -- Access member `privatekey` + require + exists: exists + do + if attached c_privatekey (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_privatekey (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_privatekey (a_value: STRING) + -- Change the value of member `privatekey` to `a_value`. + require + exists: exists + do + set_c_privatekey (item, (create {C_STRING}.make (a_value)).item ) + end + + passphrase: detachable STRING + -- Access member `passphrase` + require + exists: exists + do + if attached c_passphrase (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_passphrase (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_passphrase (a_value: STRING) + -- Change the value of member `passphrase` to `a_value`. + require + exists: exists + do + set_c_passphrase (item, (create {C_STRING}.make (a_value)).item ) + end + +feature {NONE} -- Implementation wrapper for struct struct git_cred_ssh_key + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_cred_ssh_key)" + end + + c_parent (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((struct git_cred_ssh_key*)$an_item)->parent + ]" + end + + set_c_parent (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->parent = *(git_cred*)$a_value + ]" + end + + c_username (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->username + ]" + end + + set_c_username (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->username = (char*)$a_value + ]" + ensure + username_set: a_value = c_username (an_item) + end + + c_publickey (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->publickey + ]" + end + + set_c_publickey (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->publickey = (char*)$a_value + ]" + ensure + publickey_set: a_value = c_publickey (an_item) + end + + c_privatekey (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->privatekey + ]" + end + + set_c_privatekey (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->privatekey = (char*)$a_value + ]" + ensure + privatekey_set: a_value = c_privatekey (an_item) + end + + c_passphrase (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->passphrase + ]" + end + + set_c_passphrase (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_ssh_key*)$an_item)->passphrase = (char*)$a_value + ]" + ensure + passphrase_set: a_value = c_passphrase (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_cred_struct_api.e b/library/generated_wrapper/eiffel/git_cred_struct_api.e new file mode 100644 index 0000000..7b3c1ed --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_struct_api.e @@ -0,0 +1,125 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + credtype: INTEGER + -- Access member `credtype` + require + exists: exists + do + Result := c_credtype (item) + ensure + result_correct: Result = c_credtype (item) + end + + set_credtype (a_value: INTEGER) + -- Change the value of member `credtype` to `a_value`. + require + exists: exists + do + set_c_credtype (item, a_value) + ensure + credtype_set: a_value = credtype + end + + free: POINTER + -- Access member `free` + require + exists: exists + do + Result := c_free (item) + ensure + result_correct: Result = c_free (item) + end + + set_free (a_value: POINTER) + -- Change the value of member `free` to `a_value`. + require + exists: exists + do + set_c_free (item, a_value) + ensure + free_set: a_value = free + end + +feature {NONE} -- Implementation wrapper for struct struct git_cred + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_cred)" + end + + c_credtype (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred*)$an_item)->credtype + ]" + end + + set_c_credtype (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred*)$an_item)->credtype = (git_credtype_t)$a_value + ]" + ensure + credtype_set: a_value = c_credtype (an_item) + end + + c_free (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred*)$an_item)->free + ]" + end + + set_c_free (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred*)$an_item)->free = (void (*) (git_cred *cred))$a_value + ]" + ensure + free_set: a_value = c_free (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_cred_username_struct_api.e b/library/generated_wrapper/eiffel/git_cred_username_struct_api.e new file mode 100644 index 0000000..0cd78fc --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_username_struct_api.e @@ -0,0 +1,104 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_USERNAME_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + parent: detachable GIT_CRED_STRUCT_API + -- Access member `parent` + require + exists: exists + do + if attached c_parent (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_parent (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_parent (item) + end + + set_parent (a_value: GIT_CRED_STRUCT_API) + -- Set member `parent` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_parent (item, a_value.item) + ensure + parent_set: attached parent as l_value implies l_value.item = a_value.item + end + + username: POINTER + -- Access member `username` + require + exists: exists + do + Result := c_username (item) + ensure + result_correct: Result = c_username (item) + end + +feature {NONE} -- Implementation wrapper for struct struct git_cred_username + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_cred_username)" + end + + c_parent (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((struct git_cred_username*)$an_item)->parent + ]" + end + + set_c_parent (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_username*)$an_item)->parent = *(git_cred*)$a_value + ]" + end + + c_username (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_cred_username*)$an_item)->username + ]" + end + +end diff --git a/library/generated_wrapper/eiffel/git_cred_userpass_plaintext_struct_api.e b/library/generated_wrapper/eiffel/git_cred_userpass_plaintext_struct_api.e new file mode 100644 index 0000000..e48a608 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_cred_userpass_plaintext_struct_api.e @@ -0,0 +1,173 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_CRED_USERPASS_PLAINTEXT_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + parent: detachable GIT_CRED_STRUCT_API + -- Access member `parent` + require + exists: exists + do + if attached c_parent (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_parent (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_parent (item) + end + + set_parent (a_value: GIT_CRED_STRUCT_API) + -- Set member `parent` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_parent (item, a_value.item) + ensure + parent_set: attached parent as l_value implies l_value.item = a_value.item + end + + username: detachable STRING + -- Access member `username` + require + exists: exists + do + if attached c_username (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_username (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_username (a_value: STRING) + -- Change the value of member `username` to `a_value`. + require + exists: exists + do + set_c_username (item, (create {C_STRING}.make (a_value)).item ) + end + + password: detachable STRING + -- Access member `password` + require + exists: exists + do + if attached c_password (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_password (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_password (a_value: STRING) + -- Change the value of member `password` to `a_value`. + require + exists: exists + do + set_c_password (item, (create {C_STRING}.make (a_value)).item ) + end + +feature {NONE} -- Implementation wrapper for struct git_cred_userpass_plaintext + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(git_cred_userpass_plaintext)" + end + + c_parent (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((git_cred_userpass_plaintext*)$an_item)->parent + ]" + end + + set_c_parent (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_cred_userpass_plaintext*)$an_item)->parent = *(git_cred*)$a_value + ]" + end + + c_username (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_cred_userpass_plaintext*)$an_item)->username + ]" + end + + set_c_username (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_cred_userpass_plaintext*)$an_item)->username = (char*)$a_value + ]" + ensure + username_set: a_value = c_username (an_item) + end + + c_password (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_cred_userpass_plaintext*)$an_item)->password + ]" + end + + set_c_password (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_cred_userpass_plaintext*)$an_item)->password = (char*)$a_value + ]" + ensure + password_set: a_value = c_password (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_credentials_api.e b/library/generated_wrapper/eiffel/git_credentials_api.e new file mode 100644 index 0000000..0bdb959 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_credentials_api.e @@ -0,0 +1,193 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" +-- functions wrapper +class GIT_CREDENTIALS_API + + +feature -- Access + + git_cred_has_username (cred: GIT_CRED_STRUCT_API): INTEGER + do + Result := c_git_cred_has_username (cred.item) + end + + git_cred_userpass_plaintext_new (a_out: GIT_CRED_STRUCT_API; username: STRING; password: STRING): INTEGER + local + username_c_string: C_STRING + password_c_string: C_STRING + do + create username_c_string.make (username) + create password_c_string.make (password) + Result := c_git_cred_userpass_plaintext_new (a_out.item, username_c_string.item, password_c_string.item) + end + + git_cred_ssh_key_new (a_out: GIT_CRED_STRUCT_API; username: STRING; publickey: STRING; privatekey: STRING; passphrase: STRING): INTEGER + local + username_c_string: C_STRING + publickey_c_string: C_STRING + privatekey_c_string: C_STRING + passphrase_c_string: C_STRING + do + create username_c_string.make (username) + create publickey_c_string.make (publickey) + create privatekey_c_string.make (privatekey) + create passphrase_c_string.make (passphrase) + Result := c_git_cred_ssh_key_new (a_out.item, username_c_string.item, publickey_c_string.item, privatekey_c_string.item, passphrase_c_string.item) + end + + git_cred_ssh_interactive_new (a_out: GIT_CRED_STRUCT_API; username: STRING; prompt_callback: POINTER; payload: POINTER): INTEGER + local + username_c_string: C_STRING + do + create username_c_string.make (username) + Result := c_git_cred_ssh_interactive_new (a_out.item, username_c_string.item, prompt_callback, payload) + end + + git_cred_ssh_key_from_agent (a_out: GIT_CRED_STRUCT_API; username: STRING): INTEGER + local + username_c_string: C_STRING + do + create username_c_string.make (username) + Result := c_git_cred_ssh_key_from_agent (a_out.item, username_c_string.item) + end + + git_cred_ssh_custom_new (a_out: GIT_CRED_STRUCT_API; username: STRING; publickey: STRING; publickey_len: INTEGER; sign_callback: POINTER; payload: POINTER): INTEGER + local + username_c_string: C_STRING + publickey_c_string: C_STRING + do + create username_c_string.make (username) + create publickey_c_string.make (publickey) + Result := c_git_cred_ssh_custom_new (a_out.item, username_c_string.item, publickey_c_string.item, publickey_len, sign_callback, payload) + end + + git_cred_default_new (a_out: GIT_CRED_STRUCT_API): INTEGER + do + Result := c_git_cred_default_new (a_out.item) + end + + git_cred_username_new (cred: GIT_CRED_STRUCT_API; username: STRING): INTEGER + local + username_c_string: C_STRING + do + create username_c_string.make (username) + Result := c_git_cred_username_new (cred.item, username_c_string.item) + end + + git_cred_ssh_key_memory_new (a_out: GIT_CRED_STRUCT_API; username: STRING; publickey: STRING; privatekey: STRING; passphrase: STRING): INTEGER + local + username_c_string: C_STRING + publickey_c_string: C_STRING + privatekey_c_string: C_STRING + passphrase_c_string: C_STRING + do + create username_c_string.make (username) + create publickey_c_string.make (publickey) + create privatekey_c_string.make (privatekey) + create passphrase_c_string.make (passphrase) + Result := c_git_cred_ssh_key_memory_new (a_out.item, username_c_string.item, publickey_c_string.item, privatekey_c_string.item, passphrase_c_string.item) + end + + git_cred_free (cred: GIT_CRED_STRUCT_API) + do + c_git_cred_free (cred.item) + end + +feature -- Externals + + c_git_cred_has_username (cred: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_has_username ((git_cred*)$cred); + ]" + end + + c_git_cred_userpass_plaintext_new (a_out: POINTER; username: POINTER; password: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_userpass_plaintext_new ((git_cred**)$a_out, (char const*)$username, (char const*)$password); + ]" + end + + c_git_cred_ssh_key_new (a_out: POINTER; username: POINTER; publickey: POINTER; privatekey: POINTER; passphrase: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_ssh_key_new ((git_cred**)$a_out, (char const*)$username, (char const*)$publickey, (char const*)$privatekey, (char const*)$passphrase); + ]" + end + + c_git_cred_ssh_interactive_new (a_out: POINTER; username: POINTER; prompt_callback: POINTER; payload: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_ssh_interactive_new ((git_cred**)$a_out, (char const*)$username, (git_cred_ssh_interactive_callback)$prompt_callback, (void*)$payload); + ]" + end + + c_git_cred_ssh_key_from_agent (a_out: POINTER; username: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_ssh_key_from_agent ((git_cred**)$a_out, (char const*)$username); + ]" + end + + c_git_cred_ssh_custom_new (a_out: POINTER; username: POINTER; publickey: POINTER; publickey_len: INTEGER; sign_callback: POINTER; payload: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_ssh_custom_new ((git_cred**)$a_out, (char const*)$username, (char const*)$publickey, (size_t)$publickey_len, (git_cred_sign_callback)$sign_callback, (void*)$payload); + ]" + end + + c_git_cred_default_new (a_out: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_default_new ((git_cred**)$a_out); + ]" + end + + c_git_cred_username_new (cred: POINTER; username: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_username_new ((git_cred**)$cred, (char const*)$username); + ]" + end + + c_git_cred_ssh_key_memory_new (a_out: POINTER; username: POINTER; publickey: POINTER; privatekey: POINTER; passphrase: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_cred_ssh_key_memory_new ((git_cred**)$a_out, (char const*)$username, (char const*)$publickey, (char const*)$privatekey, (char const*)$passphrase); + ]" + end + + c_git_cred_free (cred: POINTER) + external + "C inline use " + alias + "[ + git_cred_free ((git_cred*)$cred); + ]" + end + +feature -- Externals Address + +end diff --git a/library/generated_wrapper/eiffel/git_credtype_t_enum_api.e b/library/generated_wrapper/eiffel/git_credtype_t_enum_api.e new file mode 100644 index 0000000..0ef4fa8 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_credtype_t_enum_api.e @@ -0,0 +1,61 @@ +-- enum wrapper +class GIT_CREDTYPE_T_ENUM_API + +feature {ANY} + + is_valid_enum (a_value: INTEGER): BOOLEAN + -- Is `a_value' a valid integer code for this enum ? + do + Result := a_value = git_credtype_userpass_plaintext or a_value = git_credtype_ssh_key or a_value = git_credtype_ssh_custom or a_value = git_credtype_default or a_value = git_credtype_ssh_interactive or a_value = git_credtype_username or a_value = git_credtype_ssh_memory + end + + git_credtype_userpass_plaintext: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_USERPASS_PLAINTEXT" + end + + git_credtype_ssh_key: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_SSH_KEY" + end + + git_credtype_ssh_custom: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_SSH_CUSTOM" + end + + git_credtype_default: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_DEFAULT" + end + + git_credtype_ssh_interactive: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_SSH_INTERACTIVE" + end + + git_credtype_username: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_USERNAME" + end + + git_credtype_ssh_memory: INTEGER + external + "C inline use " + alias + "GIT_CREDTYPE_SSH_MEMORY" + end + +end diff --git a/library/generated_wrapper/eiffel/git_direction_enum_api.e b/library/generated_wrapper/eiffel/git_direction_enum_api.e new file mode 100644 index 0000000..75499fc --- /dev/null +++ b/library/generated_wrapper/eiffel/git_direction_enum_api.e @@ -0,0 +1,26 @@ +-- enum wrapper +class GIT_DIRECTION_ENUM_API + +feature {ANY} + + is_valid_enum (a_value: INTEGER): BOOLEAN + -- Is `a_value' a valid integer code for this enum ? + do + Result := a_value = git_direction_fetch or a_value = git_direction_push + end + + git_direction_fetch: INTEGER + external + "C inline use " + alias + "GIT_DIRECTION_FETCH" + end + + git_direction_push: INTEGER + external + "C inline use " + alias + "GIT_DIRECTION_PUSH" + end + +end diff --git a/library/generated_wrapper/eiffel/git_push_options_struct_api.e b/library/generated_wrapper/eiffel/git_push_options_struct_api.e new file mode 100644 index 0000000..4d70e48 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_push_options_struct_api.e @@ -0,0 +1,263 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_PUSH_OPTIONS_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + version: INTEGER + -- Access member `version` + require + exists: exists + do + Result := c_version (item) + ensure + result_correct: Result = c_version (item) + end + + set_version (a_value: INTEGER) + -- Change the value of member `version` to `a_value`. + require + exists: exists + do + set_c_version (item, a_value) + ensure + version_set: a_value = version + end + + pb_parallelism: INTEGER + -- Access member `pb_parallelism` + require + exists: exists + do + Result := c_pb_parallelism (item) + ensure + result_correct: Result = c_pb_parallelism (item) + end + + set_pb_parallelism (a_value: INTEGER) + -- Change the value of member `pb_parallelism` to `a_value`. + require + exists: exists + do + set_c_pb_parallelism (item, a_value) + ensure + pb_parallelism_set: a_value = pb_parallelism + end + + callbacks: detachable GIT_REMOTE_CALLBACKS_STRUCT_API + -- Access member `callbacks` + require + exists: exists + do + if attached c_callbacks (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_callbacks (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_callbacks (item) + end + + set_callbacks (a_value: GIT_REMOTE_CALLBACKS_STRUCT_API) + -- Set member `callbacks` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_callbacks (item, a_value.item) + ensure + callbacks_set: attached callbacks as l_value implies l_value.item = a_value.item + end + + proxy_opts: detachable GIT_PROXY_OPTIONS_STRUCT_API + -- Access member `proxy_opts` + require + exists: exists + do + if attached c_proxy_opts (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_proxy_opts (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_proxy_opts (item) + end + + set_proxy_opts (a_value: GIT_PROXY_OPTIONS_STRUCT_API) + -- Set member `proxy_opts` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_proxy_opts (item, a_value.item) + ensure + proxy_opts_set: attached proxy_opts as l_value implies l_value.item = a_value.item + end + + custom_headers: detachable GIT_STRARRAY_STRUCT_API + -- Access member `custom_headers` + require + exists: exists + do + if attached c_custom_headers (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_custom_headers (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_custom_headers (item) + end + + set_custom_headers (a_value: GIT_STRARRAY_STRUCT_API) + -- Set member `custom_headers` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_custom_headers (item, a_value.item) + ensure + custom_headers_set: attached custom_headers as l_value implies l_value.item = a_value.item + end + +feature {NONE} -- Implementation wrapper for struct git_push_options + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(git_push_options)" + end + + c_version (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->version + ]" + end + + set_c_version (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->version = (unsigned int)$a_value + ]" + ensure + version_set: a_value = c_version (an_item) + end + + c_pb_parallelism (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->pb_parallelism + ]" + end + + set_c_pb_parallelism (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->pb_parallelism = (unsigned int)$a_value + ]" + ensure + pb_parallelism_set: a_value = c_pb_parallelism (an_item) + end + + c_callbacks (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((git_push_options*)$an_item)->callbacks + ]" + end + + set_c_callbacks (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->callbacks = *(git_remote_callbacks*)$a_value + ]" + end + + c_proxy_opts (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((git_push_options*)$an_item)->proxy_opts + ]" + end + + set_c_proxy_opts (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->proxy_opts = *(git_proxy_options*)$a_value + ]" + end + + c_custom_headers (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((git_push_options*)$an_item)->custom_headers + ]" + end + + set_c_custom_headers (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((git_push_options*)$an_item)->custom_headers = *(git_strarray*)$a_value + ]" + end + +end diff --git a/library/generated_wrapper/eiffel/git_remote_api.e b/library/generated_wrapper/eiffel/git_remote_api.e new file mode 100644 index 0000000..47f8935 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_remote_api.e @@ -0,0 +1,674 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" +-- functions wrapper +class GIT_REMOTE_API + + +feature -- Access + + git_remote_create (a_out: GIT_REMOTE_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API; name: STRING; url: STRING): INTEGER + local + name_c_string: C_STRING + url_c_string: C_STRING + do + create name_c_string.make (name) + create url_c_string.make (url) + Result := c_git_remote_create (a_out.item, repo.item, name_c_string.item, url_c_string.item) + end + + git_remote_create_init_options (opts: GIT_REMOTE_CREATE_OPTIONS_STRUCT_API; version: INTEGER): INTEGER + do + Result := c_git_remote_create_init_options (opts.item, version) + end + + git_remote_create_with_opts (a_out: GIT_REMOTE_STRUCT_API; url: STRING; opts: GIT_REMOTE_CREATE_OPTIONS_STRUCT_API): INTEGER + local + url_c_string: C_STRING + do + create url_c_string.make (url) + Result := c_git_remote_create_with_opts (a_out.item, url_c_string.item, opts.item) + end + + git_remote_create_with_fetchspec (a_out: GIT_REMOTE_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API; name: STRING; url: STRING; fetch: STRING): INTEGER + local + name_c_string: C_STRING + url_c_string: C_STRING + fetch_c_string: C_STRING + do + create name_c_string.make (name) + create url_c_string.make (url) + create fetch_c_string.make (fetch) + Result := c_git_remote_create_with_fetchspec (a_out.item, repo.item, name_c_string.item, url_c_string.item, fetch_c_string.item) + end + + git_remote_create_anonymous (a_out: GIT_REMOTE_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API; url: STRING): INTEGER + local + url_c_string: C_STRING + do + create url_c_string.make (url) + Result := c_git_remote_create_anonymous (a_out.item, repo.item, url_c_string.item) + end + + git_remote_create_detached (a_out: GIT_REMOTE_STRUCT_API; url: STRING): INTEGER + local + url_c_string: C_STRING + do + create url_c_string.make (url) + Result := c_git_remote_create_detached (a_out.item, url_c_string.item) + end + + git_remote_lookup (a_out: GIT_REMOTE_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API; name: STRING): INTEGER + local + name_c_string: C_STRING + do + create name_c_string.make (name) + Result := c_git_remote_lookup (a_out.item, repo.item, name_c_string.item) + end + + git_remote_dup (dest: GIT_REMOTE_STRUCT_API; source: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_dup (dest.item, source.item) + end + + git_remote_owner (remote: GIT_REMOTE_STRUCT_API): detachable GIT_REPOSITORY_STRUCT_API + do + if attached c_git_remote_owner (remote.item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer ( l_ptr ) + end + + end + + git_remote_name (remote: GIT_REMOTE_STRUCT_API): POINTER + do + Result := c_git_remote_name (remote.item) + end + + git_remote_url (remote: GIT_REMOTE_STRUCT_API): POINTER + do + Result := c_git_remote_url (remote.item) + end + + git_remote_pushurl (remote: GIT_REMOTE_STRUCT_API): POINTER + do + Result := c_git_remote_pushurl (remote.item) + end + + git_remote_set_url (repo: GIT_REPOSITORY_STRUCT_API; remote: STRING; url: STRING): INTEGER + local + remote_c_string: C_STRING + url_c_string: C_STRING + do + create remote_c_string.make (remote) + create url_c_string.make (url) + Result := c_git_remote_set_url (repo.item, remote_c_string.item, url_c_string.item) + end + + git_remote_set_pushurl (repo: GIT_REPOSITORY_STRUCT_API; remote: STRING; url: STRING): INTEGER + local + remote_c_string: C_STRING + url_c_string: C_STRING + do + create remote_c_string.make (remote) + create url_c_string.make (url) + Result := c_git_remote_set_pushurl (repo.item, remote_c_string.item, url_c_string.item) + end + + git_remote_add_fetch (repo: GIT_REPOSITORY_STRUCT_API; remote: STRING; refspec: STRING): INTEGER + local + remote_c_string: C_STRING + refspec_c_string: C_STRING + do + create remote_c_string.make (remote) + create refspec_c_string.make (refspec) + Result := c_git_remote_add_fetch (repo.item, remote_c_string.item, refspec_c_string.item) + end + + git_remote_get_fetch_refspecs (array: GIT_STRARRAY_STRUCT_API; remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_get_fetch_refspecs (array.item, remote.item) + end + + git_remote_add_push (repo: GIT_REPOSITORY_STRUCT_API; remote: STRING; refspec: STRING): INTEGER + local + remote_c_string: C_STRING + refspec_c_string: C_STRING + do + create remote_c_string.make (remote) + create refspec_c_string.make (refspec) + Result := c_git_remote_add_push (repo.item, remote_c_string.item, refspec_c_string.item) + end + + git_remote_get_push_refspecs (array: GIT_STRARRAY_STRUCT_API; remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_get_push_refspecs (array.item, remote.item) + end + + git_remote_refspec_count (remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_refspec_count (remote.item) + end + + git_remote_connect (remote: GIT_REMOTE_STRUCT_API; direction: INTEGER; callbacks: GIT_REMOTE_CALLBACKS_STRUCT_API; proxy_opts: GIT_PROXY_OPTIONS_STRUCT_API; custom_headers: GIT_STRARRAY_STRUCT_API): INTEGER + do + Result := c_git_remote_connect (remote.item, direction, callbacks.item, proxy_opts.item, custom_headers.item) + end + + git_remote_ls (a_out: GIT_REMOTE_HEAD_STRUCT_API; size: POINTER; remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_ls (a_out.item, size, remote.item) + end + + git_remote_connected (remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_connected (remote.item) + end + + git_remote_stop (remote: GIT_REMOTE_STRUCT_API) + do + c_git_remote_stop (remote.item) + end + + git_remote_disconnect (remote: GIT_REMOTE_STRUCT_API) + do + c_git_remote_disconnect (remote.item) + end + + git_remote_free (remote: GIT_REMOTE_STRUCT_API) + do + c_git_remote_free (remote.item) + end + + git_remote_list (a_out: GIT_STRARRAY_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API): INTEGER + do + Result := c_git_remote_list (a_out.item, repo.item) + end + + git_remote_init_callbacks (opts: GIT_REMOTE_CALLBACKS_STRUCT_API; version: INTEGER): INTEGER + do + Result := c_git_remote_init_callbacks (opts.item, version) + end + + git_push_init_options (opts: GIT_PUSH_OPTIONS_STRUCT_API; version: INTEGER): INTEGER + do + Result := c_git_push_init_options (opts.item, version) + end + + git_remote_download (remote: GIT_REMOTE_STRUCT_API; refspecs: GIT_STRARRAY_STRUCT_API; opts: GIT_FETCH_OPTIONS_STRUCT_API): INTEGER + do + Result := c_git_remote_download (remote.item, refspecs.item, opts.item) + end + + git_remote_upload (remote: GIT_REMOTE_STRUCT_API; refspecs: GIT_STRARRAY_STRUCT_API; opts: GIT_PUSH_OPTIONS_STRUCT_API): INTEGER + do + Result := c_git_remote_upload (remote.item, refspecs.item, opts.item) + end + + git_remote_update_tips (remote: GIT_REMOTE_STRUCT_API; callbacks: GIT_REMOTE_CALLBACKS_STRUCT_API; update_fetchhead: INTEGER; download_tags: INTEGER; reflog_message: STRING): INTEGER + local + reflog_message_c_string: C_STRING + do + create reflog_message_c_string.make (reflog_message) + Result := c_git_remote_update_tips (remote.item, callbacks.item, update_fetchhead, download_tags, reflog_message_c_string.item) + end + + git_remote_fetch (remote: GIT_REMOTE_STRUCT_API; refspecs: GIT_STRARRAY_STRUCT_API; opts: GIT_FETCH_OPTIONS_STRUCT_API; reflog_message: STRING): INTEGER + local + reflog_message_c_string: C_STRING + do + create reflog_message_c_string.make (reflog_message) + Result := c_git_remote_fetch (remote.item, refspecs.item, opts.item, reflog_message_c_string.item) + end + + git_remote_prune (remote: GIT_REMOTE_STRUCT_API; callbacks: GIT_REMOTE_CALLBACKS_STRUCT_API): INTEGER + do + Result := c_git_remote_prune (remote.item, callbacks.item) + end + + git_remote_push (remote: GIT_REMOTE_STRUCT_API; refspecs: GIT_STRARRAY_STRUCT_API; opts: GIT_PUSH_OPTIONS_STRUCT_API): INTEGER + do + Result := c_git_remote_push (remote.item, refspecs.item, opts.item) + end + + git_remote_stats (remote: GIT_REMOTE_STRUCT_API): detachable GIT_TRANSFER_PROGRESS_STRUCT_API + do + if attached c_git_remote_stats (remote.item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer ( l_ptr ) + end + + end + + git_remote_autotag (remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_autotag (remote.item) + end + + git_remote_set_autotag (repo: GIT_REPOSITORY_STRUCT_API; remote: STRING; value: INTEGER): INTEGER + local + remote_c_string: C_STRING + do + create remote_c_string.make (remote) + Result := c_git_remote_set_autotag (repo.item, remote_c_string.item, value) + end + + git_remote_prune_refs (remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_prune_refs (remote.item) + end + + git_remote_rename (problems: GIT_STRARRAY_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API; name: STRING; new_name: STRING): INTEGER + local + name_c_string: C_STRING + new_name_c_string: C_STRING + do + create name_c_string.make (name) + create new_name_c_string.make (new_name) + Result := c_git_remote_rename (problems.item, repo.item, name_c_string.item, new_name_c_string.item) + end + + git_remote_is_valid_name (remote_name: STRING): INTEGER + local + remote_name_c_string: C_STRING + do + create remote_name_c_string.make (remote_name) + Result := c_git_remote_is_valid_name (remote_name_c_string.item) + end + + git_remote_delete (repo: GIT_REPOSITORY_STRUCT_API; name: STRING): INTEGER + local + name_c_string: C_STRING + do + create name_c_string.make (name) + Result := c_git_remote_delete (repo.item, name_c_string.item) + end + + git_remote_default_branch (a_out: GIT_BUF_STRUCT_API; remote: GIT_REMOTE_STRUCT_API): INTEGER + do + Result := c_git_remote_default_branch (a_out.item, remote.item) + end + +feature -- Externals + + c_git_remote_create (a_out: POINTER; repo: POINTER; name: POINTER; url: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_create ((git_remote**)$a_out, (git_repository*)$repo, (char const*)$name, (char const*)$url); + ]" + end + + c_git_remote_create_init_options (opts: POINTER; version: INTEGER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_create_init_options ((git_remote_create_options*)$opts, (unsigned int)$version); + ]" + end + + c_git_remote_create_with_opts (a_out: POINTER; url: POINTER; opts: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_create_with_opts ((git_remote**)$a_out, (char const*)$url, (git_remote_create_options const*)$opts); + ]" + end + + c_git_remote_create_with_fetchspec (a_out: POINTER; repo: POINTER; name: POINTER; url: POINTER; fetch: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_create_with_fetchspec ((git_remote**)$a_out, (git_repository*)$repo, (char const*)$name, (char const*)$url, (char const*)$fetch); + ]" + end + + c_git_remote_create_anonymous (a_out: POINTER; repo: POINTER; url: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_create_anonymous ((git_remote**)$a_out, (git_repository*)$repo, (char const*)$url); + ]" + end + + c_git_remote_create_detached (a_out: POINTER; url: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_create_detached ((git_remote**)$a_out, (char const*)$url); + ]" + end + + c_git_remote_lookup (a_out: POINTER; repo: POINTER; name: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_lookup ((git_remote**)$a_out, (git_repository*)$repo, (char const*)$name); + ]" + end + + c_git_remote_dup (dest: POINTER; source: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_dup ((git_remote**)$dest, (git_remote*)$source); + ]" + end + + c_git_remote_owner (remote: POINTER): POINTER + external + "C inline use " + alias + "[ + return git_remote_owner ((git_remote const*)$remote); + ]" + end + + c_git_remote_name (remote: POINTER): POINTER + external + "C inline use " + alias + "[ + return git_remote_name ((git_remote const*)$remote); + ]" + end + + c_git_remote_url (remote: POINTER): POINTER + external + "C inline use " + alias + "[ + return git_remote_url ((git_remote const*)$remote); + ]" + end + + c_git_remote_pushurl (remote: POINTER): POINTER + external + "C inline use " + alias + "[ + return git_remote_pushurl ((git_remote const*)$remote); + ]" + end + + c_git_remote_set_url (repo: POINTER; remote: POINTER; url: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_set_url ((git_repository*)$repo, (char const*)$remote, (char const*)$url); + ]" + end + + c_git_remote_set_pushurl (repo: POINTER; remote: POINTER; url: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_set_pushurl ((git_repository*)$repo, (char const*)$remote, (char const*)$url); + ]" + end + + c_git_remote_add_fetch (repo: POINTER; remote: POINTER; refspec: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_add_fetch ((git_repository*)$repo, (char const*)$remote, (char const*)$refspec); + ]" + end + + c_git_remote_get_fetch_refspecs (array: POINTER; remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_get_fetch_refspecs ((git_strarray*)$array, (git_remote const*)$remote); + ]" + end + + c_git_remote_add_push (repo: POINTER; remote: POINTER; refspec: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_add_push ((git_repository*)$repo, (char const*)$remote, (char const*)$refspec); + ]" + end + + c_git_remote_get_push_refspecs (array: POINTER; remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_get_push_refspecs ((git_strarray*)$array, (git_remote const*)$remote); + ]" + end + + c_git_remote_refspec_count (remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_refspec_count ((git_remote const*)$remote); + ]" + end + + c_git_remote_connect (remote: POINTER; direction: INTEGER; callbacks: POINTER; proxy_opts: POINTER; custom_headers: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_connect ((git_remote*)$remote, (git_direction)$direction, (git_remote_callbacks const*)$callbacks, (git_proxy_options const*)$proxy_opts, (git_strarray const*)$custom_headers); + ]" + end + + c_git_remote_ls (a_out: POINTER; size: POINTER; remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_ls ((git_remote_head const***)$a_out, (size_t*)$size, (git_remote*)$remote); + ]" + end + + c_git_remote_connected (remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_connected ((git_remote const*)$remote); + ]" + end + + c_git_remote_stop (remote: POINTER) + external + "C inline use " + alias + "[ + git_remote_stop ((git_remote*)$remote); + ]" + end + + c_git_remote_disconnect (remote: POINTER) + external + "C inline use " + alias + "[ + git_remote_disconnect ((git_remote*)$remote); + ]" + end + + c_git_remote_free (remote: POINTER) + external + "C inline use " + alias + "[ + git_remote_free ((git_remote*)$remote); + ]" + end + + c_git_remote_list (a_out: POINTER; repo: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_list ((git_strarray*)$a_out, (git_repository*)$repo); + ]" + end + + c_git_remote_init_callbacks (opts: POINTER; version: INTEGER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_init_callbacks ((git_remote_callbacks*)$opts, (unsigned int)$version); + ]" + end + + c_git_push_init_options (opts: POINTER; version: INTEGER): INTEGER + external + "C inline use " + alias + "[ + return git_push_init_options ((git_push_options*)$opts, (unsigned int)$version); + ]" + end + + c_git_remote_download (remote: POINTER; refspecs: POINTER; opts: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_download ((git_remote*)$remote, (git_strarray const*)$refspecs, (git_fetch_options const*)$opts); + ]" + end + + c_git_remote_upload (remote: POINTER; refspecs: POINTER; opts: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_upload ((git_remote*)$remote, (git_strarray const*)$refspecs, (git_push_options const*)$opts); + ]" + end + + c_git_remote_update_tips (remote: POINTER; callbacks: POINTER; update_fetchhead: INTEGER; download_tags: INTEGER; reflog_message: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_update_tips ((git_remote*)$remote, (git_remote_callbacks const*)$callbacks, (int)$update_fetchhead, (git_remote_autotag_option_t)$download_tags, (char const*)$reflog_message); + ]" + end + + c_git_remote_fetch (remote: POINTER; refspecs: POINTER; opts: POINTER; reflog_message: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_fetch ((git_remote*)$remote, (git_strarray const*)$refspecs, (git_fetch_options const*)$opts, (char const*)$reflog_message); + ]" + end + + c_git_remote_prune (remote: POINTER; callbacks: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_prune ((git_remote*)$remote, (git_remote_callbacks const*)$callbacks); + ]" + end + + c_git_remote_push (remote: POINTER; refspecs: POINTER; opts: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_push ((git_remote*)$remote, (git_strarray const*)$refspecs, (git_push_options const*)$opts); + ]" + end + + c_git_remote_stats (remote: POINTER): POINTER + external + "C inline use " + alias + "[ + return git_remote_stats ((git_remote*)$remote); + ]" + end + + c_git_remote_autotag (remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_autotag ((git_remote const*)$remote); + ]" + end + + c_git_remote_set_autotag (repo: POINTER; remote: POINTER; value: INTEGER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_set_autotag ((git_repository*)$repo, (char const*)$remote, (git_remote_autotag_option_t)$value); + ]" + end + + c_git_remote_prune_refs (remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_prune_refs ((git_remote const*)$remote); + ]" + end + + c_git_remote_rename (problems: POINTER; repo: POINTER; name: POINTER; new_name: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_rename ((git_strarray*)$problems, (git_repository*)$repo, (char const*)$name, (char const*)$new_name); + ]" + end + + c_git_remote_is_valid_name (remote_name: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_is_valid_name ((char const*)$remote_name); + ]" + end + + c_git_remote_delete (repo: POINTER; name: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_delete ((git_repository*)$repo, (char const*)$name); + ]" + end + + c_git_remote_default_branch (a_out: POINTER; remote: POINTER): INTEGER + external + "C inline use " + alias + "[ + return git_remote_default_branch ((git_buf*)$a_out, (git_remote*)$remote); + ]" + end + +feature -- Externals Address + +end diff --git a/library/generated_wrapper/eiffel/git_remote_completion_type_enum_api.e b/library/generated_wrapper/eiffel/git_remote_completion_type_enum_api.e new file mode 100644 index 0000000..39e564f --- /dev/null +++ b/library/generated_wrapper/eiffel/git_remote_completion_type_enum_api.e @@ -0,0 +1,33 @@ +-- enum wrapper +class GIT_REMOTE_COMPLETION_TYPE_ENUM_API + +feature {ANY} + + is_valid_enum (a_value: INTEGER): BOOLEAN + -- Is `a_value' a valid integer code for this enum ? + do + Result := a_value = git_remote_completion_download or a_value = git_remote_completion_indexing or a_value = git_remote_completion_error + end + + git_remote_completion_download: INTEGER + external + "C inline use " + alias + "GIT_REMOTE_COMPLETION_DOWNLOAD" + end + + git_remote_completion_indexing: INTEGER + external + "C inline use " + alias + "GIT_REMOTE_COMPLETION_INDEXING" + end + + git_remote_completion_error: INTEGER + external + "C inline use " + alias + "GIT_REMOTE_COMPLETION_ERROR" + end + +end diff --git a/library/generated_wrapper/eiffel/git_remote_create_flags_enum_api.e b/library/generated_wrapper/eiffel/git_remote_create_flags_enum_api.e new file mode 100644 index 0000000..b32ea22 --- /dev/null +++ b/library/generated_wrapper/eiffel/git_remote_create_flags_enum_api.e @@ -0,0 +1,26 @@ +-- enum wrapper +class GIT_REMOTE_CREATE_FLAGS_ENUM_API + +feature {ANY} + + is_valid_enum (a_value: INTEGER): BOOLEAN + -- Is `a_value' a valid integer code for this enum ? + do + Result := a_value = git_remote_create_skip_insteadof or a_value = git_remote_create_skip_default_fetchspec + end + + git_remote_create_skip_insteadof: INTEGER + external + "C inline use " + alias + "GIT_REMOTE_CREATE_SKIP_INSTEADOF" + end + + git_remote_create_skip_default_fetchspec: INTEGER + external + "C inline use " + alias + "GIT_REMOTE_CREATE_SKIP_DEFAULT_FETCHSPEC" + end + +end diff --git a/library/generated_wrapper/eiffel/git_remote_create_options_struct_api.e b/library/generated_wrapper/eiffel/git_remote_create_options_struct_api.e new file mode 100644 index 0000000..652f53f --- /dev/null +++ b/library/generated_wrapper/eiffel/git_remote_create_options_struct_api.e @@ -0,0 +1,263 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_REMOTE_CREATE_OPTIONS_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + version: INTEGER + -- Access member `version` + require + exists: exists + do + Result := c_version (item) + ensure + result_correct: Result = c_version (item) + end + + set_version (a_value: INTEGER) + -- Change the value of member `version` to `a_value`. + require + exists: exists + do + set_c_version (item, a_value) + ensure + version_set: a_value = version + end + + repository: detachable GIT_REPOSITORY_STRUCT_API + -- Access member `repository` + require + exists: exists + do + if attached c_repository (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_repository (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_repository (item) + end + + set_repository (a_value: GIT_REPOSITORY_STRUCT_API) + -- Set member `repository` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_repository (item, a_value.item) + ensure + repository_set: attached repository as l_value implies l_value.item = a_value.item + end + + name: detachable STRING + -- Access member `name` + require + exists: exists + do + if attached c_name (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_name (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_name (a_value: STRING) + -- Change the value of member `name` to `a_value`. + require + exists: exists + do + set_c_name (item, (create {C_STRING}.make (a_value)).item ) + end + + fetchspec: detachable STRING + -- Access member `fetchspec` + require + exists: exists + do + if attached c_fetchspec (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_fetchspec (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_fetchspec (a_value: STRING) + -- Change the value of member `fetchspec` to `a_value`. + require + exists: exists + do + set_c_fetchspec (item, (create {C_STRING}.make (a_value)).item ) + end + + flags: INTEGER + -- Access member `flags` + require + exists: exists + do + Result := c_flags (item) + ensure + result_correct: Result = c_flags (item) + end + + set_flags (a_value: INTEGER) + -- Change the value of member `flags` to `a_value`. + require + exists: exists + do + set_c_flags (item, a_value) + ensure + flags_set: a_value = flags + end + +feature {NONE} -- Implementation wrapper for struct struct git_remote_create_options + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_remote_create_options)" + end + + c_version (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->version + ]" + end + + set_c_version (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->version = (unsigned int)$a_value + ]" + ensure + version_set: a_value = c_version (an_item) + end + + c_repository (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->repository + ]" + end + + set_c_repository (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->repository = (git_repository*)$a_value + ]" + ensure + repository_set: a_value = c_repository (an_item) + end + + c_name (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->name + ]" + end + + set_c_name (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->name = (char const*)$a_value + ]" + ensure + name_set: a_value = c_name (an_item) + end + + c_fetchspec (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->fetchspec + ]" + end + + set_c_fetchspec (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->fetchspec = (char const*)$a_value + ]" + ensure + fetchspec_set: a_value = c_fetchspec (an_item) + end + + c_flags (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->flags + ]" + end + + set_c_flags (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_create_options*)$an_item)->flags = (unsigned int)$a_value + ]" + ensure + flags_set: a_value = c_flags (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_remote_head_struct_api.e b/library/generated_wrapper/eiffel/git_remote_head_struct_api.e new file mode 100644 index 0000000..9f0203d --- /dev/null +++ b/library/generated_wrapper/eiffel/git_remote_head_struct_api.e @@ -0,0 +1,263 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_REMOTE_HEAD_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + + a_local: INTEGER + -- Access member `local` + require + exists: exists + do + Result := c_a_local (item) + ensure + result_correct: Result = c_a_local (item) + end + + set_a_local (a_value: INTEGER) + -- Change the value of member `local` to `a_value`. + require + exists: exists + do + set_c_a_local (item, a_value) + ensure + a_local_set: a_value = a_local + end + + oid: detachable GIT_OID_STRUCT_API + -- Access member `oid` + require + exists: exists + do + if attached c_oid (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_oid (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_oid (item) + end + + set_oid (a_value: GIT_OID_STRUCT_API) + -- Set member `oid` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_oid (item, a_value.item) + ensure + oid_set: attached oid as l_value implies l_value.item = a_value.item + end + + loid: detachable GIT_OID_STRUCT_API + -- Access member `loid` + require + exists: exists + do + if attached c_loid (item) as l_ptr and then not l_ptr.is_default_pointer then + create Result.make_by_pointer (l_ptr) + end + ensure + result_void: Result = Void implies c_loid (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.item = c_loid (item) + end + + set_loid (a_value: GIT_OID_STRUCT_API) + -- Set member `loid` + require + a_value_not_void: a_value /= Void + exists: exists + do + set_c_loid (item, a_value.item) + ensure + loid_set: attached loid as l_value implies l_value.item = a_value.item + end + + name: detachable STRING + -- Access member `name` + require + exists: exists + do + if attached c_name (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_name (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_name (a_value: STRING) + -- Change the value of member `name` to `a_value`. + require + exists: exists + do + set_c_name (item, (create {C_STRING}.make (a_value)).item ) + end + + symref_target: detachable STRING + -- Access member `symref_target` + require + exists: exists + do + if attached c_symref_target (item) as l_ptr then + Result := (create {C_STRING}.make_by_pointer (l_ptr)).string + end + ensure + result_void: Result = Void implies c_symref_target (item) = default_pointer + result_not_void: attached Result as l_result implies l_result.same_string ((create {C_STRING}.make_by_pointer (item)).string) + end + + set_symref_target (a_value: STRING) + -- Change the value of member `symref_target` to `a_value`. + require + exists: exists + do + set_c_symref_target (item, (create {C_STRING}.make (a_value)).item ) + end + +feature {NONE} -- Implementation wrapper for struct struct git_remote_head + + sizeof_external: INTEGER + external + "C inline use " + alias + "sizeof(struct git_remote_head)" + end + + c_a_local (an_item: POINTER): INTEGER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->local + ]" + end + + set_c_a_local (an_item: POINTER; a_value: INTEGER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->local = (int)$a_value + ]" + ensure + a_local_set: a_value = c_a_local (an_item) + end + + c_oid (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((struct git_remote_head*)$an_item)->oid + ]" + end + + set_c_oid (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->oid = *(git_oid*)$a_value + ]" + end + + c_loid (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + &((struct git_remote_head*)$an_item)->loid + ]" + end + + set_c_loid (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->loid = *(git_oid*)$a_value + ]" + end + + c_name (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->name + ]" + end + + set_c_name (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->name = (char*)$a_value + ]" + ensure + name_set: a_value = c_name (an_item) + end + + c_symref_target (an_item: POINTER): POINTER + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->symref_target + ]" + end + + set_c_symref_target (an_item: POINTER; a_value: POINTER) + require + an_item_not_null: an_item /= default_pointer + external + "C inline use " + alias + "[ + ((struct git_remote_head*)$an_item)->symref_target = (char*)$a_value + ]" + ensure + symref_target_set: a_value = c_symref_target (an_item) + end + +end diff --git a/library/generated_wrapper/eiffel/git_remote_struct_api.e b/library/generated_wrapper/eiffel/git_remote_struct_api.e new file mode 100644 index 0000000..ad8ccec --- /dev/null +++ b/library/generated_wrapper/eiffel/git_remote_struct_api.e @@ -0,0 +1,39 @@ +note + + description: "This file has been generated by EWG. Do not edit. Changes will be lost!" + + generator: "Eiffel Wrapper Generator" + +class GIT_REMOTE_STRUCT_API + +inherit + + MEMORY_STRUCTURE + + +create + + make, + make_by_pointer + +feature -- Measurement + + structure_size: INTEGER + do + Result := sizeof_external + end + +feature {ANY} -- Member Access + +feature {NONE} -- Implementation wrapper for struct struct git_remote + + sizeof_external: INTEGER + do + check + size_not_known: False + end + ensure + is_class: class + end + +end diff --git a/library/manual_wrapper/git_remote.e b/library/manual_wrapper/git_remote.e new file mode 100644 index 0000000..09e592e --- /dev/null +++ b/library/manual_wrapper/git_remote.e @@ -0,0 +1,51 @@ +note + description: "Summary description for {GIT_REMOTE}." + date: "$Date$" + revision: "$Revision$" + +class + GIT_REMOTE + +inherit + + GIT_REMOTE_API + rename + git_remote_lookup as git_remote_lookup_api, + git_remote_connect as git_remote_connect_api + end + + +feature -- Access + + git_remote_lookup (a_out: GIT_REMOTE_STRUCT_API; repo: GIT_REPOSITORY_STRUCT_API; name: STRING): INTEGER + local + name_c_string: C_STRING + l_ptr: POINTER + do + create name_c_string.make (name) + Result := c_git_remote_lookup ($l_ptr, repo.item, name_c_string.item) + if l_ptr /= default_pointer then + a_out.make_by_pointer (l_ptr) + end + end + + git_remote_connect (remote: GIT_REMOTE_STRUCT_API; direction: INTEGER; callbacks: detachable GIT_REMOTE_CALLBACKS_STRUCT_API; proxy_opts: detachable GIT_PROXY_OPTIONS_STRUCT_API; custom_headers: detachable GIT_STRARRAY_STRUCT_API): INTEGER + local + l_callbacks: POINTER + l_proxy_opts: POINTER + l_custom_header: POINTER + do + if attached callbacks then + l_callbacks := callbacks.item + end + if attached proxy_opts then + l_proxy_opts := proxy_opts.item + end + if attached custom_headers then + l_custom_header := custom_headers.item + end + Result := c_git_remote_connect (remote.item, direction, l_callbacks, l_proxy_opts, l_custom_header) + end + + +end