-
Notifications
You must be signed in to change notification settings - Fork 2
/
git.ml
1217 lines (998 loc) · 33.2 KB
/
git.ml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
open Ctypes
open Foreign
module Common = struct
let git_feature_t = typedef int64_t "git_feature_t"
let git_libgit_2_opt_t = typedef int64_t "git_libgit2_opt_t"
let git_libgit2_version =
foreign
"git_libgit2_version"
(ptr int @-> ptr int @-> ptr int @-> returning void)
let git_libgit2_features =
foreign
"git_libgit2_features"
(void @-> returning int)
(* This needs a second varidic argument *)
let git_libgit2_opts =
foreign
"git_libgit2_opts"
(int @-> returning int)
end
module Buffer = struct
type git_buf
let struc = structure ""
let ptr_ = field struc "ptr" (ptr char)
let size_ = field struc "size" size_t
let git_buf =
let _ = field struc "asize" size_t in
let _ = field struc "size" size_t in
seal struc;
typedef
(struc : git_buf structure typ)
"git_buf"
let git_buf_free =
foreign
"git_buf_free"
(ptr git_buf @-> returning void)
let git_buf_grow =
foreign
"git_buf_grow"
(ptr git_buf @-> size_t @-> returning int)
let git_buf_set =
foreign
"git_buf_set"
(ptr git_buf @-> ptr void @-> size_t @-> returning int)
let git_buf_is_binary =
foreign
"git_buf_is_binary"
(ptr git_buf @-> returning int)
let git_buf_contains_nul =
foreign
"git_buf_contains_nul"
(ptr git_buf @-> returning int)
end
module Types = struct
type git_odb
type git_odb_backend
type git_odb_object
type git_odb_stream
type git_odb_writepack
type git_refdb
type git_refdb_backend
type git_repository
type git_object
type git_revwalk
type git_tag
type git_blob
type git_commit
type git_tree_entry
type git_tree
type git_treebuilder
type git_index
type git_index_conflict_iterator
type git_config
type git_config_backend
type git_reflog_entry
type git_reflog
type git_note
type git_packbuilder
type git_time
type git_time_t
type git_signature
type git_reference
type git_reference_iterator
type git_transaction
type git_annotated_commit
type git_merge_result
type git_status_list
type git_rebase
type git_refspec
type git_remote
type git_transport
type git_push
type git_remote_head
type git_remote_callbacks
type git_transfer_progress
let git_off_t = typedef int64_t "git_off_t"
let git_time_t = typedef int64_t "git_time_t"
let git_ref_t = typedef int64_t "git_ref_t"
let git_branch_t = typedef int64_t "git_branch_t"
let git_filemode_t = typedef int64_t "git_filemode_t"
let git_cert_t = typedef int64_t "git_cert_t"
let git_otype = typedef int64_t "git_otype"
let git_odb =
typedef
(structure "git_odb" : git_odb structure typ)
"git_odb"
let git_odb_backend =
typedef
(structure "git_odb_backend" : git_odb_backend structure typ)
"git_odb_backend"
let git_odb_object =
typedef
(structure "git_odb_object" : git_odb_object structure typ)
"git_odb_object"
let git_odb_stream =
typedef
(structure "git_odb_stream" : git_odb_stream structure typ)
"git_odb_stream"
let git_odb_writepack =
typedef
(structure "git_odb_writepack" : git_odb_writepack structure typ)
"git_odb_writepack"
let git_refdb =
typedef
(structure "git_refdb" : git_refdb structure typ)
"git_refdb"
let git_refdb_backend =
typedef
(structure "git_refdb_backend" : git_refdb_backend structure typ)
"git_refdb_backend"
let git_repository =
typedef
(structure "git_repository" : git_repository structure typ)
"git_repository"
let git_object =
typedef
(structure "git_object" : git_object structure typ)
"git_object"
let git_revwalk =
typedef
(structure "git_revwalk" : git_revwalk structure typ)
"git_revwalk"
let git_tag =
typedef
(structure "git_tag" : git_tag structure typ)
"git_tag"
let git_blob =
typedef
(structure "git_blob" : git_blob structure typ)
"git_blob"
let git_commit =
typedef
(structure "git_commit" : git_commit structure typ)
"git_commit"
let git_tree_entry =
typedef
(structure "git_tree_entry" : git_tree_entry structure typ)
"git_tree_entry"
(* Stopped, please continue *)
let git_tree =
typedef
(structure "git_tree" : git_tree structure typ)
"git_tree"
let git_treebuilder =
typedef
(structure "git_treebuilder" : git_treebuilder structure typ)
"git_treebuilder"
let git_index =
typedef
(structure "git_index" : git_index structure typ)
"git_index"
let git_index_conflict_iterator =
typedef
(structure "git_index_conflict_iterator"
: git_index_conflict_iterator structure typ)
"git_index_conflict_iterator"
let git_config =
typedef
(structure "git_config" : git_config structure typ)
"git_config"
let git_config_backend =
typedef
(structure "git_config_backend" : git_config_backend structure typ)
"git_config_backend"
let git_reflog_entry =
typedef
(structure "git_reflog_entry" : git_reflog_entry structure typ)
"git_reflog_entry"
let git_reflog =
typedef
(structure "git_reflog" : git_reflog structure typ)
"git_reflog"
let git_note =
typedef
(structure "git_note" : git_note structure typ)
"git_note"
let git_packbuilder =
typedef
(structure "git_packbuilder" : git_packbuilder structure typ)
"git_packbuilder"
let git_time =
typedef
(structure "git_time" : git_time structure typ)
"git_time"
let git_signature =
typedef
(structure "git_signature" : git_signature structure typ)
"git_signature"
let git_reference =
typedef
(structure "git_reference" : git_reference structure typ)
"git_reference"
let git_reference_iterator =
typedef
(structure "git_reference_iterator" : git_reference_iterator structure typ)
"git_reference_iterator"
let git_transaction =
typedef
(structure "git_transaction" : git_transaction structure typ)
"git_transaction"
let git_transfer_progress =
typedef
(structure "git_transfer_progress" : git_transfer_progress structure typ)
"git_transfer_progress"
let git_annotated_commit =
typedef
(structure "git_annotated_commit" : git_annotated_commit structure typ)
"git_annotated_commit"
let git_merge_result =
typedef
(structure "git_merge_result" : git_merge_result structure typ)
"git_merge_result"
let git_status_list =
typedef
(structure "git_status_list" : git_status_list structure typ)
"git_status_list"
let git_rebase =
typedef
(structure "git_rebase" : git_rebase structure typ)
"git_rebase"
let git_refspec =
typedef
(structure "git_refspec" : git_refspec structure typ)
"git_refspec"
let git_remote =
typedef
(structure "git_remote" : git_remote structure typ)
"git_remote"
let git_transport =
typedef
(structure "git_transport" : git_transport structure typ)
"git_transport"
let git_push =
typedef
(structure "git_push" : git_push structure typ)
"git_push"
let git_remote_head =
typedef
(structure "git_remote_head" : git_remote_head structure typ)
"git_remote_head"
let git_remote_callbacks =
typedef
(structure "git_remote_callbacks" : git_remote_callbacks structure typ)
"git_remote_callbacks"
let git_transfer_progress =
typedef
(structure "git_transfer_progress" : git_transfer_progress structure typ)
"git_transfer_progress"
let git_transfer_progress_cb =
(ptr git_transfer_progress @-> ptr void @-> returning int)
let git_transport_message_cb =
(string @-> int @-> ptr void @-> returning int)
end
module Oid = struct
type git_oid
type git_oid_shorten
let git_oid_shorten =
typedef
(structure "git_oid_shorten" : git_oid_shorten structure typ)
"git_oid_shorten"
let git_oid =
typedef
(structure "git_oid" : git_oid structure typ)
"git_oid"
let git_oid_fromstr =
foreign
"git_oid_fromstr"
(ptr git_oid @-> string @-> returning int)
let git_oid_fromstrp =
foreign
"git_oid_fromstrp"
(ptr git_oid @-> string @-> returning int)
let git_oid_fromstrn =
foreign
"git_oid_fromstrn"
(ptr git_oid @-> string @-> returning size_t)
let git_oid_fmt =
foreign
"git_oid_fmt"
(string @-> ptr git_oid @-> returning void)
let git_oid_nfmt =
foreign
"git_oid_nfmt"
(string @-> size_t @-> ptr git_oid @-> returning void)
let git_oid_pathfmt =
foreign
"git_oid_pathfmt"
(string @-> ptr git_oid @-> returning void)
let git_oid_tostr_s =
foreign
"git_oid_tostr_s"
(ptr git_oid @-> returning string)
let git_oid_tostr =
foreign
"git_oid_tostr"
(string @-> size_t @-> ptr git_oid @-> returning string)
let git_oid_cpy =
foreign
"git_oid_cpy"
(ptr git_oid @-> ptr git_oid @-> returning void)
let git_oid_cmp =
foreign
"git_oid_cmp"
(ptr git_oid @-> ptr git_oid @-> returning int)
let git_oid_equal =
foreign
"git_oid_equal"
(ptr git_oid @-> ptr git_oid @-> returning int)
let git_oid_ncmp =
foreign
"git_oid_ncmp"
(ptr git_oid @-> ptr git_oid @-> size_t @-> returning int)
let git_oid_streq =
foreign
"git_oid_streq"
(ptr git_oid @-> string @-> returning int)
let git_oid_strcmp =
foreign
"git_oid_strcmp"
(ptr git_oid @-> string @-> returning int)
let git_oid_iszero =
foreign
"git_oid_iszero"
(ptr git_oid @-> returning int)
let git_oid_shorten_new =
foreign
"git_oid_shorten_new"
(size_t @-> returning (ptr git_oid_shorten))
let git_oid_shorten_add =
foreign
"git_oid_shorten_add"
(ptr git_oid_shorten @-> string @-> returning int)
let git_oid_shorten_free =
foreign
"git_oid_shorten_free"
(ptr git_oid_shorten @-> returning void)
end
module Blame = struct
type git_blame_options
type git_blame_hunk
type git_blame
let git_blame_flag_t = typedef int64_t "git_blame_flag_t"
let git_blame_options =
typedef
(structure "git_blame_options" : git_blame_options structure typ)
"git_blame_options"
let git_blame_hunk =
typedef
(structure "git_blame_hunk" : git_blame_hunk structure typ)
"git_blame_hunk"
let git_blame =
typedef
(structure "git_blame" : git_blame structure typ)
"git_blame"
let git_blame_init_options =
foreign
"git_blame_init_options"
(ptr git_blame_options @-> uint @-> returning int)
let git_blame_get_hunk_count =
foreign
"git_blame_get_hunk_count"
(ptr git_blame @-> returning uint32_t)
let git_blame_get_hunk_byindex =
foreign
"git_blame_get_hunk_byindex"
(ptr git_blame @-> uint32_t @-> returning (ptr git_blame_hunk))
let git_blame_get_hunk_byline =
foreign
"git_blame_get_hunk_byline"
(ptr git_blame @-> uint32_t @-> returning (ptr git_blame_hunk))
let git_blame_file =
foreign
"git_blame_file"
(ptr (ptr git_blame) @->
ptr Types.git_repository @->
string @->
ptr git_blame_options @-> returning int)
let git_blame_buffer =
foreign
"git_blame_buffer"
(ptr (ptr git_blame) @->
ptr git_blame @->
string @->
size_t @-> returning int)
let git_blame_free =
foreign
"git_blame_free"
(ptr git_blame @-> returning void)
end
module Indexer = struct
end
module Checkout = struct
end
module Remote = struct
let git_remote_rename_problem_cb =
string @-> ptr void @-> returning int
end
module Transport = struct
end
module Repository = struct
type git_repository_init_options
let git_repository_open_flag_t = typedef int64_t "git_repository_open_flag_t"
let git_repository_init_flag_t = typedef int64_t "git_repository_init_flag_t"
let git_repository_init_mode_t = typedef int64_t "git_repository_init_mode_t"
let git_repository_state_t = typedef int64_t "git_repository_state_t"
let git_repository_fetchhead_foreach_cb =
string @-> string @-> string @-> uint @-> ptr void @-> returning int
let git_repository_mergehead_foreach_cb =
string @-> ptr void @-> returning int
let git_repository_init_options =
typedef
(structure "git_repository_init_options" :
git_repository_init_options structure typ)
"git_repository_init_options"
let git_repository_open =
foreign
"git_repository_open"
(ptr (ptr Types.git_repository) @-> string @-> returning int)
let git_repository_wrap_odb =
foreign
"git_repository_wrap_odb"
(ptr (ptr Types.git_repository) @-> ptr Types.git_odb @-> returning int)
let git_repository_discover =
foreign
"git_repository_discover"
(ptr Buffer.git_buf @-> string @-> int @-> string_opt @-> returning int)
let git_repository_open_ext =
foreign
"git_repository_open_ext"
((ptr_opt (ptr Types.git_repository)) @->
string @-> int @-> string_opt @-> returning int)
let git_repository_open_bare =
foreign
"git_repository_open_bare"
(ptr (ptr Types.git_repository) @-> string @-> returning int)
let git_repository_free =
foreign
"git_repository_free"
(ptr Types.git_repository @-> returning void)
let git_repository_init =
foreign
"git_repository_init"
(ptr (ptr Types.git_repository) @-> string @-> uint @-> returning int)
let git_repository_init_init_options =
foreign
"git_repository_init_init_options"
(ptr git_repository_init_options @-> uint @-> returning int)
let git_repository_init_ext =
foreign
"git_repository_init_ext"
(ptr (ptr Types.git_repository) @->
string @-> ptr git_repository_init_options @-> returning int)
let git_repository_head =
foreign
"git_repository_head"
(ptr (ptr Types.git_reference) @-> ptr Types.git_repository @-> returning int)
let git_repository_head_detached =
foreign
"git_repository_head"
(ptr Types.git_repository @-> returning int)
let git_repository_head_unborn =
foreign
"git_repository_head_unborn"
(ptr Types.git_repository @-> returning int)
let git_repository_is_empty =
foreign
"git_repository_is_empty"
(ptr Types.git_repository @-> returning int)
let git_repository_path =
foreign
"git_repository_path"
(ptr Types.git_repository @-> returning string)
let git_repository_workdir =
foreign
"git_repository_workdir"
(ptr Types.git_repository @-> returning string)
let git_repository_set_workdir =
foreign
"git_repository_set_workdir"
(ptr Types.git_repository @-> string @-> int @-> returning int)
let git_repository_is_bare =
foreign
"git_repository_is_bare"
(ptr Types.git_repository @-> returning int)
let git_repository_config =
foreign
"git_repository_config"
(ptr (ptr Types.git_config) @-> ptr Types.git_repository @-> returning int)
let git_repository_config_snapshot =
foreign
"git_repository_config_snapshot"
(ptr (ptr Types.git_config) @-> ptr Types.git_repository @-> returning int)
let git_repository_odb =
foreign
"git_repository_odb"
(ptr (ptr Types.git_odb) @-> ptr Types.git_repository @-> returning int)
let git_repository_refdb =
foreign
"git_repository_refdb"
(ptr (ptr Types.git_index) @-> ptr Types.git_repository @-> returning int)
let git_repository_index =
foreign
"git_repository_index"
(ptr (ptr Types.git_index) @-> ptr Types.git_repository @-> returning int)
let git_repository_message =
foreign
"git_repository_message"
(ptr Buffer.git_buf @-> ptr Types.git_repository @-> returning int)
let git_repository_message_remove =
foreign
"git_repository_message_remove"
(ptr Types.git_repository @-> returning int)
let git_repository_state_cleanup =
foreign
"git_repository_state_cleanup"
(ptr Types.git_repository @-> returning int)
let git_repository_fetchhead_foreach =
foreign
"git_repository_fetchhead_foreach"
(ptr Types.git_repository @->
funptr git_repository_fetchhead_foreach_cb @->
ptr void @-> returning int)
let git_repository_mergehead_foreach =
foreign
"git_repository_mergehead_foreach"
(ptr Types.git_repository @->
funptr git_repository_mergehead_foreach_cb @->
ptr void @-> returning int)
let git_repository_hashfile =
foreign
"git_repository_hashfile"
(ptr Oid.git_oid @->
ptr Types.git_repository @->
string @->
Types.git_otype @->
string @-> returning int)
let git_repository_set_head =
foreign
"git_repository_set_head"
(ptr Types.git_repository @-> string @-> returning int)
let git_repository_set_head_detached =
foreign
"git_repository_set_head_detached"
(ptr Types.git_repository @-> ptr Oid.git_oid @-> returning int)
let git_repository_set_head_detached_from_annotated =
foreign
"git_repository_set_head_detached_from_annotated"
(ptr Types.git_repository @->
ptr Types.git_annotated_commit @->
returning int)
let git_repository_detach_head =
foreign
"git_repository_detach_head"
(ptr Types.git_repository @-> returning int)
let git_repository_state =
foreign
"git_repository_state"
(ptr Types.git_repository @-> returning int)
let git_repository_set_namespace =
foreign
"git_repository_set_namespace"
(ptr Types.git_repository @-> string @-> returning int)
let git_repository_get_namespace =
foreign
"git_repository_get_namespace"
(ptr Types.git_repository @-> returning string)
let git_repository_is_shallow =
foreign
"git_repository_is_shallow"
(ptr Types.git_repository @-> returning int)
let git_repository_ident =
foreign
"git_repository_ident"
(ptr string @-> ptr string @-> ptr Types.git_repository @-> returning int)
let git_repository_set_ident =
foreign
"git_repository_set_ident"
(ptr Types.git_repository @-> string @-> string @-> returning int)
end
module Annotated_commit = struct
let git_annotated_commit_from_ref =
foreign
"git_annotated_commit_from_ref"
(ptr (ptr Types.git_annotated_commit) @->
ptr Types.git_repository @->
ptr Types.git_reference @-> returning int)
let git_annotated_commit_from_fetchhead =
foreign
"git_annotated_commit_from_fetchhead"
(ptr (ptr Types.git_annotated_commit) @->
ptr Types.git_repository @->
string @->
string @->
ptr Oid.git_oid @-> returning int)
let git_annotated_commit_lookup =
foreign
"git_annotated_commit_lookup"
(ptr (ptr Types.git_annotated_commit) @->
ptr Types.git_repository @->
ptr Oid.git_oid @-> returning int)
let git_annotated_commit_from_revspec =
foreign
"git_annotated_commit_from_revspec"
(ptr (ptr Types.git_annotated_commit) @->
ptr Types.git_repository @->
string @-> returning int)
let git_annotated_commit_id =
foreign
"git_annotated_commit_id"
(ptr Types.git_annotated_commit @-> returning (ptr Oid.git_oid))
let git_annotated_commit_free =
foreign
"git_annotated_commit_free"
(ptr Types.git_annotated_commit @-> returning void)
end
module Clone = struct
type git_clone_options
let git_remote_create_cb =
(ptr @@ ptr Types.git_remote) @->
ptr Types.git_repository @->
string @->
string @->
ptr void @-> returning int
let git_repository_create_cb =
(ptr (ptr Types.git_repository) @->
string @-> int @-> ptr void @-> returning int)
let git_clone_options =
typedef
(structure "git_clone_options" : git_clone_options structure typ)
"git_clone_options"
let git_clone_init_options =
foreign
"git_clone_init_options"
(ptr git_clone_options @-> int64_t @-> returning int)
let git_clone =
foreign
"git_clone"
(ptr (ptr Types.git_repository) @->
string @->
string @->
ptr git_clone_options @-> returning int)
end
module Attr = struct
let git_attr_for_each_cb = string @-> string @-> ptr void @-> returning int
let git_attr_value = foreign "git_attr_value" (string @-> returning int)
let git_attr_get =
foreign
"git_attr_get"
((ptr string) @->
(ptr Types.git_repository) @->
uint32_t @->
string @->
string @-> returning int)
let git_attr_get_many =
foreign
"git_attr_get_many"
(ptr string @->
(ptr Types.git_repository) @->
uint32_t @->
string @->
size_t @->
ptr string @->
returning int)
let git_attr_for_each =
foreign
"git_attr_foreach"
(ptr Types.git_repository @->
uint32_t @->
string @->
funptr git_attr_for_each_cb @->
ptr void @->
returning int)
let git_attr_add_macro =
foreign
"git_attr_cache_flush"
(ptr Types.git_repository @-> returning void)
let git_attr_add_macro =
foreign
"git_attr_add_macro"
(ptr Types.git_repository @-> string @-> string @-> returning int)
end
module Blob = struct
let git_blob_chunk_cb =
string @-> size_t @-> ptr void @-> returning int
let git_blob_lookup =
foreign
"git_blob_lookup"
(ptr (ptr Types.git_blob) @->
ptr Types.git_repository @->
ptr Oid.git_oid @-> returning int)
let git_blob_lookup_prefix =
foreign
"git_blob_lookup_prefix"
(ptr (ptr Types.git_blob) @->
ptr Types.git_repository @->
ptr Oid.git_oid @->
size_t @->
returning int)
let git_blob_free =
foreign
"git_blob_free"
(ptr Types.git_blob @-> returning void)
let git_blob_id =
foreign
"git_blob_id"
(ptr Types.git_blob @-> returning (ptr Oid.git_oid))
let git_blob_owner =
foreign
"git_blob_owner"
(ptr Types.git_blob @-> returning (ptr Types.git_repository))
let git_blob_rawcontent =
foreign
"git_blob_rawcontent"
(ptr Types.git_blob @-> returning (ptr void))
let git_blob_rawsize =
foreign
"git_blob_rawsize"
(ptr Types.git_blob @-> returning Types.git_off_t)
let git_blob_filtered_content =
foreign
"git_blob_filtered_content"
(ptr Buffer.git_buf @->
ptr Types.git_blob @->
string @->
int @-> returning int)
let git_blob_create_fromworkdir =
foreign
"git_blob_create_fromworkdir"
(ptr Oid.git_oid @-> ptr Types.git_repository @-> string @-> returning int)
let git_blob_create_fromdisk =
foreign
"git_blob_create_fromdisk"
(ptr Oid.git_oid @-> ptr Types.git_repository @-> string @-> returning int)
let git_blob_create_fromchunks =
foreign
"git_blob_create_fromchunks"
(ptr Oid.git_oid @->
ptr Types.git_repository @->
string @->
funptr git_blob_chunk_cb @->
ptr void @-> returning int)
let git_blob_create_frombuffer =
foreign
"git_blob_create_frombuffer"
(ptr Oid.git_oid @->
ptr Types.git_repository @->
ptr void @->
size_t @-> returning int)
let git_blob_is_binary =
foreign
"git_blob_is_binary"
(ptr Types.git_blob @-> returning int)
end
module Global = struct
let git_libgit2_init =
foreign
"git_libgit2_init"
(void @-> returning int)
let git_libgit2_shutdown =
foreign
"git_libgit2_shutdown"
(void @-> returning int)
end
module Commit = struct
let git_commit_lookup =
foreign
"git_commit_lookup"
(ptr (ptr Types.git_commit) @->
ptr Types.git_repository @->
ptr Oid.git_oid @->
returning int)
let git_commit_lookup_prefix =
foreign
"git_commit_lookup_prefix"
(ptr (ptr Types.git_commit) @->
ptr Types.git_repository @->
ptr Oid.git_oid @->
size_t @->
returning int)
let git_commit_id =
foreign
"git_commit_id"
(ptr Types.git_commit @-> returning (ptr Oid.git_oid))
let git_commit_owner =
foreign
"git_commit_owner"
(ptr Types.git_commit @-> returning (ptr Types.git_repository))
let git_commit_message_encoding =
foreign
"git_commit_message_encoding"
(ptr Types.git_commit @-> returning string_opt)
let git_commit_message =
foreign
"git_commit_message"
(ptr Types.git_commit @-> returning string)