Libgit2/FFI.pm

filter: Statementstmt 83.3% 10 / 12 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 87.5% 14 / 16 CC 1 SCAR 0.7
CC
1
Cov
83%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« Libgit2/Error.pm ↑ Summary Libgit2.pm »
1 # ABSTRACT: Internal FFI::Platypus instance for Git::Libgit2
2  
3 package Git::Libgit2::FFI;
4 our $VERSION = '0.006';
5 26 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 26 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 26 ▶use FFI::Platypus 2.00;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 26 ▶use Alien::Libgit2;
Subroutine BEGIN: called CC=1 SCAR=2.6
9  
10 my $ffi;
11  
12 sub ffi {
13 return $ffi if $ffi;
14 $ffi = FFI::Platypus->new( api => 2, lib => [ Alien::Libgit2->dynamic_libs ] );
15  
16 $ffi->type( 'opaque' => 'git_repository' );
17 $ffi->type( 'opaque' => 'git_reference' );
18 $ffi->type( 'opaque' => 'git_reference_iterator' );
19 $ffi->type( 'opaque' => 'git_config' );
20 $ffi->type( 'opaque' => 'git_object' );
21 $ffi->type( 'opaque' => 'git_blob' );
22 $ffi->type( 'opaque' => 'git_tree' );
23 $ffi->type( 'opaque' => 'git_treebuilder' );
24 $ffi->type( 'opaque' => 'git_commit' );
25 $ffi->type( 'opaque' => 'git_remote' );
26 $ffi->type( 'opaque' => 'git_signature' );
27 $ffi->type( 'opaque' => 'git_odb' );
28 $ffi->type( 'opaque' => 'git_credential' );
29 $ffi->type( 'opaque' => 'git_revwalk' );
30 $ffi->type( 'opaque' => 'git_branch_iterator' );
31 $ffi->type( 'opaque' => 'git_tag' );
32 $ffi->type( 'opaque' => 'git_diff' );
33 $ffi->type( 'opaque' => 'git_index' );
34 $ffi->type( 'opaque' => 'git_index_entry' );
35 $ffi->type( 'opaque' => 'git_annotated_commit' );
36 $ffi->type( 'opaque' => 'git_merge_head' );
37 $ffi->type( 'opaque' => 'git_reflog' );
38 $ffi->type( 'opaque' => 'git_reflog_entry' );
39 $ffi->type( 'opaque' => 'git_rebase' );
40 $ffi->type( 'opaque' => 'git_rebase_operation' );
41  
42 # git_credential_acquire_cb signature.
43 # libgit2: int (*)(git_credential **out, const char *url,
44 # const char *username_from_url,
45 # unsigned int allowed_types, void *payload)
46 # Closures in FFI::Platypus allow only native types — so the **out** is passed
47 # as a plain `opaque` (the pointer value). The Perl closure pokes the
48 # allocated credential pointer into that address itself.
49 $ffi->type( '(opaque, string, string, uint, opaque)->int' => 'git_credential_acquire_cb' );
50  
51 # git_transport_certificate_check_cb signature.
52 # libgit2: int (*)(git_cert *cert, int valid, const char *host, void *payload)
53 # `cert` is passed as a plain `opaque` (pointer value); the Perl closure
54 # peeks the git_cert / git_cert_hostkey fields out of it directly.
55 $ffi->type( '(opaque, int, string, opaque)->int' => 'git_transport_certificate_check_cb' );
56  
57 # git_oid is a 20-byte struct, but for our MVP we pass it as opaque
58 # buffer (string of 20 bytes) or as hex via _fromstr/_tostr.
59 $ffi->type( 'opaque' => 'git_oid_ptr' );
60  
61 _attach_all();
62 return $ffi;
63 }
64  
65  
66 sub _attach {
67 my ( $name, $args, $ret ) = @_;
68 $ffi->attach( $name => $args => $ret );
69 }
70  
71 sub _attach_all {
72  
73 # ========================
74 # Library init / shutdown
75 # ========================
76  
77 _attach git_libgit2_init => [] => 'int';
78 _attach git_libgit2_shutdown => [] => 'int';
79 _attach git_libgit2_version => [ 'int*', 'int*', 'int*' ] => 'int';
80  
81 # git_libgit2_opts is variadic (int option, ...). FFI::Platypus requires the
82 # variable-argument types to be fixed at attach time, so this single function
83 # object serves exactly the two-vararg (int, string) form — i.e. only
84 # GIT_OPT_SET_SEARCH_PATH. Every option with a different vararg signature
85 # needs its own function object via $ffi->function(...) at the call site;
86 # that explicitly includes the one-string options such as
87 # GIT_OPT_SET_TEMPLATE_PATH, not just obviously different ones like
88 # SET_MWINDOW_SIZE (size_t). A mismatched argument list is not reported as
89 # a return code — libgit2 va_arg's whatever is on the stack. Not wrapped via
90 # _attach because the helper takes one args array, not a fixed/var split.
91 $ffi->attach( 'git_libgit2_opts' => [ 'int' ] => [ 'int', 'string' ] => 'int' );
92  
93 # ========================
94 # Error
95 # ========================
96  
97 _attach git_error_last => [] => 'opaque';
98 _attach git_error_clear => [] => 'void';
99  
100 # ========================
101 # Repository
102 # ========================
103  
104 _attach git_repository_open => [ 'opaque*', 'string' ] => 'int';
105 _attach git_repository_open_ext => [ 'opaque*', 'string', 'uint32', 'string' ] => 'int';
106 _attach git_repository_init => [ 'opaque*', 'string', 'uint32' ] => 'int';
107 _attach git_repository_workdir => [ 'git_repository' ] => 'string';
108 _attach git_repository_path => [ 'git_repository' ] => 'string';
109 _attach git_repository_is_bare => [ 'git_repository' ] => 'int';
110 _attach git_repository_free => [ 'git_repository' ] => 'void';
111 _attach git_repository_index => [ 'opaque*', 'git_repository' ] => 'int';
112 _attach git_repository_config => [ 'opaque*', 'git_repository' ] => 'int';
113 _attach git_repository_config_snapshot => [ 'opaque*', 'git_repository' ] => 'int';
114 _attach git_repository_odb => [ 'opaque*', 'git_repository' ] => 'int';
115 _attach git_repository_set_head => [ 'git_repository', 'string' ] => 'int';
116 _attach git_repository_head => [ 'opaque*', 'git_repository' ] => 'int';
117 _attach git_repository_head_unborn => [ 'git_repository' ] => 'int';
118 _attach git_repository_head_detached => [ 'git_repository' ] => 'int';
119  
120 # ========================
121 # Config
122 # ========================
123  
124 _attach git_config_open_default => [ 'opaque*' ] => 'int';
125 _attach git_config_snapshot => [ 'opaque*', 'git_config' ] => 'int';
126 _attach git_config_get_string => [ 'string*', 'git_config', 'string' ] => 'int';
127 _attach git_config_get_bool => [ 'int*', 'git_config', 'string' ] => 'int';
128 _attach git_config_set_string => [ 'git_config', 'string', 'string' ] => 'int';
129 _attach git_config_free => [ 'git_config' ] => 'void';
130  
131 # ========================
132 # OID
133 # ========================
134  
135 _attach git_oid_fromstr => [ 'opaque', 'string' ] => 'int';
136 _attach git_oid_tostr => [ 'opaque', 'size_t', 'opaque' ] => 'string';
137 _attach git_oid_cmp => [ 'opaque', 'opaque' ] => 'int';
138  
139 # ========================
140 # Reference
141 # ========================
142  
143 _attach git_reference_lookup => [ 'opaque*', 'git_repository', 'string' ] => 'int';
144 _attach git_reference_name_to_id => [ 'opaque', 'git_repository', 'string' ] => 'int';
145 _attach git_reference_create => [ 'opaque*', 'git_repository', 'string', 'opaque', 'int', 'string' ] => 'int';
146 _attach git_reference_create_matching => [ 'opaque*', 'git_repository', 'string', 'opaque', 'int', 'opaque', 'string' ] => 'int';
147 _attach git_reference_delete => [ 'git_reference' ] => 'int';
148 _attach git_reference_remove => [ 'git_repository', 'string' ] => 'int';
149 _attach git_reference_target => [ 'git_reference' ] => 'opaque';
150 _attach git_reference_name => [ 'git_reference' ] => 'string';
151 _attach git_reference_type => [ 'git_reference' ] => 'int';
152 _attach git_reference_free => [ 'git_reference' ] => 'void';
153 _attach git_reference_iterator_new => [ 'opaque*', 'git_repository' ] => 'int';
154 _attach git_reference_iterator_glob_new => [ 'opaque*', 'git_repository', 'string' ] => 'int';
155 _attach git_reference_next => [ 'opaque*', 'git_reference_iterator' ] => 'int';
156 _attach git_reference_next_name => [ 'string*', 'git_reference_iterator' ] => 'int';
157 _attach git_reference_iterator_free => [ 'git_reference_iterator' ] => 'void';
158 _attach git_reference_name_is_valid => [ 'int*', 'string' ] => 'int';
159 _attach git_reference_peel => [ 'opaque*', 'git_reference', 'int' ] => 'int';
160 _attach git_reference_symbolic_create => [ 'opaque*', 'git_repository', 'string', 'string', 'int', 'string' ] => 'int';
161 _attach git_reference_symbolic_target => [ 'git_reference' ] => 'string';
162 _attach git_reference_symbolic_set_target => [ 'opaque*', 'git_reference', 'string', 'string' ] => 'int';
163 _attach git_reference_set_target => [ 'opaque*', 'git_reference', 'opaque', 'string' ] => 'int';
164 _attach git_reference_resolve => [ 'opaque*', 'git_reference' ] => 'int';
165 _attach git_reference_shorthand => [ 'git_reference' ] => 'string';
166 _attach git_reference_is_branch => [ 'git_reference' ] => 'int';
167 _attach git_reference_is_remote => [ 'git_reference' ] => 'int';
168 _attach git_reference_is_tag => [ 'git_reference' ] => 'int';
169  
170 # ========================
171 # Object
172 # ========================
173  
174 _attach git_object_lookup => [ 'opaque*', 'git_repository', 'opaque', 'int' ] => 'int';
175 _attach git_object_lookup_prefix => [ 'opaque*', 'git_repository', 'opaque', 'size_t', 'int' ] => 'int';
176 _attach git_object_id => [ 'git_object' ] => 'opaque';
177 _attach git_object_type => [ 'git_object' ] => 'int';
178 _attach git_object_free => [ 'git_object' ] => 'void';
179  
180 # ========================
181 # Blob
182 # ========================
183  
184 _attach git_blob_create_from_buffer => [ 'opaque', 'git_repository', 'opaque', 'size_t' ] => 'int';
185 _attach git_blob_lookup => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
186 _attach git_blob_rawcontent => [ 'git_blob' ] => 'opaque';
187 _attach git_blob_rawsize => [ 'git_blob' ] => 'sint64';
188 _attach git_blob_is_binary => [ 'git_blob' ] => 'int';
189 _attach git_blob_free => [ 'git_blob' ] => 'void';
190  
191 # ========================
192 # Tree
193 # ========================
194  
195 _attach git_tree_lookup => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
196 _attach git_tree_entrycount => [ 'git_tree' ] => 'size_t';
197 _attach git_tree_entry_byindex => [ 'git_tree', 'size_t' ] => 'opaque';
198 _attach git_tree_entry_byname => [ 'git_tree', 'string' ] => 'opaque';
199 _attach git_tree_entry_name => [ 'opaque' ] => 'string';
200 _attach git_tree_entry_id => [ 'opaque' ] => 'opaque';
201 _attach git_tree_entry_filemode => [ 'opaque' ] => 'int';
202 _attach git_tree_entry_type => [ 'opaque' ] => 'int';
203 _attach git_tree_free => [ 'git_tree' ] => 'void';
204  
205 # ========================
206 # TreeBuilder
207 # ========================
208  
209 _attach git_treebuilder_new => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
210 _attach git_treebuilder_insert => [ 'opaque*', 'git_treebuilder', 'string', 'opaque', 'int' ] => 'int';
211 _attach git_treebuilder_remove => [ 'git_treebuilder', 'string' ] => 'int';
212 _attach git_treebuilder_write => [ 'opaque', 'git_treebuilder' ] => 'int';
213 _attach git_treebuilder_free => [ 'git_treebuilder' ] => 'void';
214  
215 # ========================
216 # Commit
217 # ========================
218  
219 _attach git_commit_lookup => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
220 _attach git_commit_create => [ 'opaque', 'git_repository', 'string', 'git_signature', 'git_signature',
221 'string', 'string', 'git_tree', 'size_t', 'opaque' ] => 'int';
222 _attach git_commit_message => [ 'git_commit' ] => 'string';
223 _attach git_commit_tree => [ 'opaque*', 'git_commit' ] => 'int';
224 _attach git_commit_tree_id => [ 'git_commit' ] => 'opaque';
225 _attach git_commit_parentcount => [ 'git_commit' ] => 'uint';
226 _attach git_commit_parent_id => [ 'git_commit', 'uint' ] => 'opaque';
227 _attach git_commit_author => [ 'git_commit' ] => 'opaque';
228 _attach git_commit_committer => [ 'git_commit' ] => 'opaque';
229 _attach git_commit_id => [ 'git_commit' ] => 'opaque';
230 _attach git_commit_time => [ 'git_commit' ] => 'sint64';
231 _attach git_commit_time_offset => [ 'git_commit' ] => 'int';
232 _attach git_commit_summary => [ 'git_commit' ] => 'string';
233 _attach git_commit_free => [ 'git_commit' ] => 'void';
234  
235 # ========================
236 # Signature
237 # ========================
238  
239 _attach git_signature_new => [ 'opaque*', 'string', 'string', 'sint64', 'int' ] => 'int';
240 _attach git_signature_now => [ 'opaque*', 'string', 'string' ] => 'int';
241 _attach git_signature_default => [ 'opaque*', 'git_repository' ] => 'int';
242 _attach git_signature_free => [ 'git_signature' ] => 'void';
243  
244 # ========================
245 # Remote
246 # ========================
247  
248 _attach git_remote_lookup => [ 'opaque*', 'git_repository', 'string' ] => 'int';
249 _attach git_remote_create => [ 'opaque*', 'git_repository', 'string', 'string' ] => 'int';
250 _attach git_remote_create_anonymous => [ 'opaque*', 'git_repository', 'string' ] => 'int';
251 _attach git_remote_url => [ 'git_remote' ] => 'string';
252 _attach git_remote_name => [ 'git_remote' ] => 'string';
253 _attach git_remote_init_callbacks => [ 'opaque', 'uint' ] => 'int';
254 _attach git_fetch_options_init => [ 'opaque', 'uint' ] => 'int';
255 _attach git_push_options_init => [ 'opaque', 'uint' ] => 'int';
256 _attach git_remote_fetch => [ 'git_remote', 'opaque', 'opaque', 'string' ] => 'int';
257 _attach git_remote_push => [ 'git_remote', 'opaque', 'opaque' ] => 'int';
258 _attach git_remote_connect => [ 'git_remote', 'int', 'opaque', 'opaque', 'opaque' ] => 'int';
259 _attach git_remote_ls => [ 'opaque*', 'size_t*', 'git_remote' ] => 'int';
260 _attach git_remote_disconnect => [ 'git_remote' ] => 'int';
261 _attach git_remote_free => [ 'git_remote' ] => 'void';
262  
263 # ========================
264 # Credentials
265 # ========================
266  
267 _attach git_credential_userpass_plaintext_new => [ 'opaque*', 'string', 'string' ] => 'int';
268 _attach git_credential_ssh_key_new => [ 'opaque*', 'string', 'string', 'string', 'string' ] => 'int';
269 _attach git_credential_ssh_key_from_agent => [ 'opaque*', 'string' ] => 'int';
270 _attach git_credential_default_new => [ 'opaque*' ] => 'int';
271 _attach git_credential_username_new => [ 'opaque*', 'string' ] => 'int';
272 _attach git_credential_free => [ 'git_credential' ] => 'void';
273  
274 # ========================
275 # Clone
276 # ========================
277  
278 _attach git_clone_options_init => [ 'opaque', 'uint' ] => 'int';
279 _attach git_clone => [ 'opaque*', 'string', 'string', 'opaque' ] => 'int';
280  
281 # ========================
282 # Strarray
283 # ========================
284  
285 _attach git_strarray_free => [ 'opaque' ] => 'void';
286  
287 # ========================
288 # Revwalk
289 # ========================
290  
291 _attach git_revwalk_new => [ 'opaque*', 'git_repository' ] => 'int';
292 _attach git_revwalk_push => [ 'git_revwalk', 'opaque' ] => 'int';
293 _attach git_revwalk_push_head => [ 'git_revwalk' ] => 'int';
294 _attach git_revwalk_push_ref => [ 'git_revwalk', 'string' ] => 'int';
295 _attach git_revwalk_push_glob => [ 'git_revwalk', 'string' ] => 'int';
296 _attach git_revwalk_push_range => [ 'git_revwalk', 'string' ] => 'int';
297 _attach git_revwalk_hide => [ 'git_revwalk', 'opaque' ] => 'int';
298 _attach git_revwalk_hide_head => [ 'git_revwalk' ] => 'int';
299 _attach git_revwalk_hide_ref => [ 'git_revwalk', 'string' ] => 'int';
300 _attach git_revwalk_hide_glob => [ 'git_revwalk', 'string' ] => 'int';
301 _attach git_revwalk_next => [ 'opaque', 'git_revwalk' ] => 'int';
302 _attach git_revwalk_sorting => [ 'git_revwalk', 'uint' ] => 'int';
303 _attach git_revwalk_reset => [ 'git_revwalk' ] => 'int';
304 _attach git_revwalk_simplify_first_parent => [ 'git_revwalk' ] => 'int';
305 _attach git_revwalk_free => [ 'git_revwalk' ] => 'void';
306  
307 # ========================
308 # Branch
309 # ========================
310  
311 _attach git_branch_create => [ 'opaque*', 'git_repository', 'string', 'git_commit', 'int' ] => 'int';
312 _attach git_branch_lookup => [ 'opaque*', 'git_repository', 'string', 'int' ] => 'int';
313 _attach git_branch_delete => [ 'git_reference' ] => 'int';
314 _attach git_branch_iterator_new => [ 'opaque*', 'git_repository', 'int' ] => 'int';
315 _attach git_branch_next => [ 'opaque*', 'int*', 'git_branch_iterator' ] => 'int';
316 _attach git_branch_iterator_free => [ 'git_branch_iterator' ] => 'void';
317 _attach git_branch_name => [ 'string*', 'git_reference' ] => 'int';
318 _attach git_branch_is_head => [ 'git_reference' ] => 'int';
319 _attach git_branch_move => [ 'opaque*', 'git_reference', 'string', 'int' ] => 'int';
320  
321 # ========================
322 # Status
323 # ========================
324  
325 $ffi->type( '(string, uint, opaque)->int' => 'git_status_cb' );
326 _attach git_status_options_init => [ 'opaque', 'uint' ] => 'int';
327 _attach git_status_foreach => [ 'git_repository', 'git_status_cb', 'opaque' ] => 'int';
328 _attach git_status_foreach_ext => [ 'git_repository', 'opaque', 'git_status_cb', 'opaque' ] => 'int';
329 _attach git_status_file => [ 'uint*', 'git_repository', 'string' ] => 'int';
330  
331 # ========================
332 # Tag
333 # ========================
334  
335 # oid out-param is a caller-allocated git_oid buffer (opaque), not a
336 # pointer-to-pointer - same as the lightweight/from_buffer variants below.
337 _attach git_tag_create => [ 'opaque', 'git_repository', 'string', 'opaque', 'opaque', 'string', 'int' ] => 'int';
338 _attach git_tag_create_from_buffer => [ 'opaque', 'git_repository', 'string', 'int' ] => 'int';
339 _attach git_tag_create_lightweight => [ 'opaque', 'git_repository', 'string', 'git_object', 'int' ] => 'int';
340 _attach git_tag_lookup => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
341 _attach git_tag_delete => [ 'git_repository', 'string' ] => 'int';
342 _attach git_tag_list => [ 'opaque', 'git_repository' ] => 'int';
343 _attach git_tag_list_match => [ 'opaque', 'string', 'git_repository' ] => 'int';
344 _attach git_tag_target => [ 'opaque*', 'git_tag' ] => 'int';
345 _attach git_tag_target_id => [ 'git_tag' ] => 'opaque';
346 _attach git_tag_message => [ 'git_tag' ] => 'string';
347 _attach git_tag_name => [ 'git_tag' ] => 'string';
348 _attach git_tag_tagger => [ 'git_tag' ] => 'opaque';
349 _attach git_tag_free => [ 'git_tag' ] => 'void';
350  
351 # ========================
352 # Diff
353 # ========================
354  
355 _attach git_diff_options_init => [ 'opaque', 'uint' ] => 'int';
356 _attach git_diff_tree_to_tree => [ 'opaque*', 'git_repository', 'git_tree', 'git_tree', 'opaque' ] => 'int';
357 _attach git_diff_tree_to_workdir => [ 'opaque*', 'git_repository', 'git_tree', 'opaque' ] => 'int';
358 _attach git_diff_tree_to_index => [ 'opaque*', 'git_repository', 'git_tree', 'git_index', 'opaque' ] => 'int';
359 _attach git_diff_index_to_workdir => [ 'opaque*', 'git_repository', 'git_index', 'opaque' ] => 'int';
360 _attach git_diff_num_deltas => [ 'git_diff' ] => 'size_t';
361 _attach git_diff_get_delta => [ 'git_diff', 'size_t' ] => 'opaque';
362 _attach git_diff_free => [ 'git_diff' ] => 'void';
363  
364 # ========================
365 # Index
366 # ========================
367  
368 _attach git_index_open => [ 'opaque*', 'string' ] => 'int';
369 _attach git_index_read => [ 'git_index', 'int' ] => 'int';
370 _attach git_index_write => [ 'git_index' ] => 'int';
371 _attach git_index_read_tree => [ 'git_index', 'git_tree' ] => 'int';
372 _attach git_index_write_tree => [ 'opaque', 'git_index' ] => 'int';
373 _attach git_index_add_bypath => [ 'git_index', 'string' ] => 'int';
374 _attach git_index_add_all => [ 'git_index', 'opaque', 'uint', 'opaque', 'opaque' ] => 'int';
375 _attach git_index_remove_bypath => [ 'git_index', 'string' ] => 'int';
376 _attach git_index_clear => [ 'git_index' ] => 'int';
377 _attach git_index_entrycount => [ 'git_index' ] => 'size_t';
378 _attach git_index_get_byindex => [ 'git_index', 'size_t' ] => 'opaque';
379 _attach git_index_find => [ 'size_t*', 'git_index', 'string' ] => 'int';
380 _attach git_index_find_prefix => [ 'size_t*', 'git_index', 'string' ] => 'int';
381 _attach git_index_free => [ 'git_index' ] => 'void';
382  
383 # ========================
384 # Checkout
385 # ========================
386  
387 _attach git_checkout_options_init => [ 'opaque', 'uint' ] => 'int';
388 _attach git_checkout_head => [ 'git_repository', 'opaque' ] => 'int';
389 _attach git_checkout_index => [ 'git_repository', 'git_index', 'opaque' ] => 'int';
390 _attach git_checkout_tree => [ 'git_repository', 'git_object', 'opaque' ] => 'int';
391  
392 # ========================
393 # Revparse
394 # ========================
395  
396 _attach git_revparse_single => [ 'opaque*', 'git_repository', 'string' ] => 'int';
397 _attach git_revparse_ext => [ 'opaque*', 'opaque*', 'git_repository', 'string' ] => 'int';
398  
399 # ========================
400 # Reset
401 # ========================
402  
403 _attach git_reset => [ 'git_repository', 'git_object', 'int', 'opaque' ] => 'int';
404 _attach git_reset_default => [ 'git_repository', 'git_object', 'opaque' ] => 'int';
405  
406 # ========================
407 # Merge
408 # ========================
409  
410 _attach git_annotated_commit_lookup => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
411 _attach git_annotated_commit_from_ref => [ 'opaque*', 'git_repository', 'git_reference' ] => 'int';
412 _attach git_annotated_commit_id => [ 'git_annotated_commit' ] => 'opaque';
413 _attach git_annotated_commit_free => [ 'git_annotated_commit' ] => 'void';
414 _attach git_merge_base => [ 'opaque', 'git_repository', 'opaque', 'opaque' ] => 'int';
415 _attach git_merge_base_many => [ 'opaque', 'git_repository', 'uint', 'opaque' ] => 'int';
416 _attach git_merge_analysis => [ 'uint*', 'uint*', 'git_repository', 'opaque', 'uint' ] => 'int';
417 _attach git_merge_options_init => [ 'opaque', 'uint' ] => 'int';
418  
419 # ========================
420 # Graph
421 # ========================
422  
423 _attach git_graph_ahead_behind => [ 'size_t*', 'size_t*', 'git_repository', 'opaque', 'opaque' ] => 'int';
424 _attach git_graph_descendant_of => [ 'git_repository', 'opaque', 'opaque' ] => 'int';
425  
426 # ========================
427 # Stash
428 # ========================
429  
430 _attach git_stash_save => [ 'opaque*', 'git_repository', 'git_signature', 'string', 'uint' ] => 'int';
431 _attach git_stash_apply => [ 'git_repository', 'size_t', 'opaque' ] => 'int';
432 _attach git_stash_drop => [ 'git_repository', 'size_t' ] => 'int';
433  
434 # ========================
435 # Reflog
436 # ========================
437  
438 _attach git_reflog_read => [ 'opaque*', 'git_repository', 'string' ] => 'int';
439 _attach git_reflog_entrycount => [ 'git_reflog' ] => 'size_t';
440 _attach git_reflog_entry_byindex => [ 'git_reflog', 'size_t' ] => 'opaque';
441 _attach git_reflog_entry_id_new => [ 'git_reflog_entry' ] => 'opaque';
442 _attach git_reflog_entry_message => [ 'git_reflog_entry' ] => 'string';
443 _attach git_reflog_free => [ 'git_reflog' ] => 'void';
444  
445 # ========================
446 # Rebase
447 # ========================
448  
449 _attach git_rebase_init => [ 'opaque*', 'git_repository', 'git_annotated_commit', 'git_annotated_commit', 'git_annotated_commit', 'opaque' ] => 'int';
450 _attach git_rebase_open => [ 'opaque*', 'git_repository', 'opaque' ] => 'int';
451 _attach git_rebase_next => [ 'opaque*', 'git_rebase' ] => 'int';
452 _attach git_rebase_commit => [ 'opaque', 'git_rebase', 'git_signature', 'git_signature', 'string', 'string' ] => 'int';
453 _attach git_rebase_abort => [ 'git_rebase' ] => 'int';
454 _attach git_rebase_finish => [ 'git_rebase', 'git_signature' ] => 'int';
455 _attach git_rebase_free => [ 'git_rebase' ] => 'void';
456 _attach git_rebase_operation_entrycount => [ 'git_rebase' ] => 'size_t';
457 _attach git_rebase_operation_current => [ 'git_rebase' ] => 'size_t';
458 _attach git_rebase_operation_byindex => [ 'git_rebase', 'size_t' ] => 'opaque';
459 _attach git_rebase_options_init => [ 'opaque', 'uint' ] => 'int';
460 _attach git_rebase_orig_head_name => [ 'git_rebase' ] => 'string';
461 _attach git_rebase_orig_head_id => [ 'git_rebase' ] => 'opaque';
462 _attach git_rebase_onto_name => [ 'git_rebase' ] => 'string';
463 _attach git_rebase_onto_id => [ 'git_rebase' ] => 'opaque';
464  
465 # ========================
466 # Cherry-pick
467 # ========================
468  
469 _attach git_cherrypick => [ 'git_repository', 'git_commit', 'opaque' ] => 'int';
470 _attach git_cherrypick_commit => [ 'opaque*', 'git_repository', 'git_commit', 'git_commit', 'uint', 'opaque' ] => 'int';
471 _attach git_cherrypick_options_init => [ 'opaque', 'uint' ] => 'int';
472  
473 # ========================
474 # Revert
475 # ========================
476  
477 _attach git_revert => [ 'git_repository', 'git_commit', 'opaque' ] => 'int';
478 _attach git_revert_commit => [ 'opaque*', 'git_repository', 'git_commit', 'git_commit', 'uint', 'opaque' ] => 'int';
479 _attach git_revert_options_init => [ 'opaque', 'uint' ] => 'int';
480  
481 # ========================
482 # ODB
483 # ========================
484  
485 _attach git_odb_new => [ 'opaque*', 'git_repository' ] => 'int';
486 _attach git_odb_exists => [ 'git_odb', 'opaque' ] => 'int';
487 _attach git_odb_free => [ 'git_odb' ] => 'void';
488 }
489  
490 1;
491  
492 __END__
« Libgit2/Error.pm ↑ Summary Libgit2.pm »