Welcome to mirror list, hosted at ThFree Co, Russian Federation.

GitOdbBackendStream.cs « Core « LibGit2Sharp - github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 82f6ce89c5c2945b84bd7076bcec3cf6e35c541e (plain)
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
using System;
using System.Runtime.InteropServices;

namespace LibGit2Sharp.Core
{
    [Flags]
    internal enum GitOdbBackendStreamMode
    {
        Read = 2,
        Write = 4
    }

    [StructLayout(LayoutKind.Sequential)]
    internal class GitOdbBackendStream
    {
        static GitOdbBackendStream()
        {
            GCHandleOffset = Marshal.OffsetOf(typeof(GitOdbBackendStream), "GCHandle").ToInt32();
        }

        public IntPtr Backend;
        public GitOdbBackendStreamMode Mode;
        public IntPtr HashCtx;

        public UIntPtr DeclaredSize;
        public UIntPtr ReceivedBytes;

        public read_callback Read;
        public write_callback Write;
        public finalize_write_callback FinalizeWrite;
        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;

        public delegate int read_callback(
            IntPtr stream,
            IntPtr buffer,
            UIntPtr len);

        public delegate int write_callback(
            IntPtr stream,
            IntPtr buffer,
            UIntPtr len);

        public delegate int finalize_write_callback(
            IntPtr stream,
            ref GitOid oid);

        public delegate void free_callback(
            IntPtr stream);
    }
}