forked from libgit2/libgit2sharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGitRefdbBackend.cs
More file actions
215 lines (184 loc) · 9.02 KB
/
Copy pathGitRefdbBackend.cs
File metadata and controls
215 lines (184 loc) · 9.02 KB
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
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using System.Text;
namespace LibGit2Sharp.Core
{
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GitRefdbIterator
{
static GitRefdbIterator()
{
GCHandleOffset = Marshal.OffsetOf<GitRefdbIterator>(nameof(GCHandle)).ToInt32();
}
public IntPtr Refdb;
public next_callback Next;
public next_name_callback NextName;
public free_callback Free;
/* The libgit2 structure definition ends here. Subsequent fields are for libgit2sharp bookkeeping. */
public IntPtr GCHandle;
/* The following static fields are not part of the structure definition. */
public static int GCHandleOffset;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int next_callback(
out IntPtr referencePtr,
IntPtr iterator);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int next_name_callback(
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(StrictUtf8Marshaler))]
out string refName,
IntPtr iterator);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void free_callback(
IntPtr iterator);
}
[StructLayout(LayoutKind.Sequential)]
internal unsafe struct GitRefdbBackend
{
static GitRefdbBackend()
{
GCHandleOffset = Marshal.OffsetOf<GitRefdbBackend>(nameof(GCHandle)).ToInt32();
}
public uint Version;
public exists_callback Exists;
public lookup_callback Lookup;
public iterator_callback Iterator;
public write_callback Write;
public rename_callback Rename;
public del_callback Del;
public compress_callback Compress;
public has_log_callback HasLog;
public ensure_log_callback EnsureLog;
public free_callback Free;
public reflog_read_callback ReflogRead;
public reflog_write_callback ReflogWrite;
public reflog_rename_callback ReflogRename;
public reflog_delete_callback ReflogDelete;
public lock_callback Lock;
public unlock_callback Unlock;
/* The libgit2 structure definition ends here. Subsequent fields are for libgit2sharp bookkeeping. */
public IntPtr GCHandle;
/* The following static fields are not part of the structure definition. */
public static int GCHandleOffset;
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int exists_callback(
[MarshalAs(UnmanagedType.Bool)] ref bool exists,
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string refNamePtr);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int lookup_callback(
out IntPtr referencePtr,
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string refName);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int iterator_callback(
out IntPtr iteratorPtr,
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string glob);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int write_callback(
IntPtr backend,
git_reference* reference,
[MarshalAs(UnmanagedType.Bool)] bool force,
git_signature* who,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string message,
IntPtr oid,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string oldTarget);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int rename_callback(
out IntPtr reference,
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string oldName,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string newName,
[MarshalAs(UnmanagedType.Bool)] bool force,
git_signature* who,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string message);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int del_callback(
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string refName,
IntPtr oldId,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string oldTarget);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int compress_callback(IntPtr backend);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int has_log_callback(
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string refName);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int ensure_log_callback(
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string refName);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate void free_callback(IntPtr backend);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int reflog_read_callback(
out git_reflog* reflog,
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string name);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int reflog_write_callback(
IntPtr backend,
git_reflog* reflog);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int reflog_rename_callback(
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string oldName,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string newName);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int reflog_delete_callback(
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string name);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int lock_callback(
out IntPtr payloadOut,
IntPtr backend,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string refName);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public delegate int unlock_callback(
IntPtr backend,
IntPtr payload,
[MarshalAs(UnmanagedType.Bool)] bool success,
[MarshalAs(UnmanagedType.Bool)] bool updateRefLog,
git_reference* reference,
git_signature* who,
[MarshalAs(UnmanagedType.CustomMarshaler, MarshalCookie = UniqueId.UniqueIdentifier,
MarshalTypeRef = typeof(LaxUtf8NoCleanupMarshaler))]
string message);
}
}