aboutsummaryrefslogtreecommitdiffstats
path: root/cshared/blame_cshared.go
blob: 939000a33975933a00c65abc1901a7dd24cf43dc (plain) (blame)
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
// +build ignore
package main

import (
	"C"

	"gopkg.in/src-d/go-git.v4"
)

//export c_Blame_get_Path
func c_Blame_get_Path(b uint64) *C.char {
	obj, ok := GetObject(Handle(b))
	if !ok {
		return nil
	}
	blame := obj.(*git.Blame)
	return C.CString(blame.Path)
}

//export c_Blame_get_Rev
func c_Blame_get_Rev(b uint64) *C.char {
	obj, ok := GetObject(Handle(b))
	if !ok {
		return nil
	}
	blame := obj.(*git.Blame)
	return CBytes(blame.Rev[:])
}


//export c_Blame_get_Lines_len
func c_Blame_get_Lines_len(b uint64) int {
	obj, ok := GetObject(Handle(b))
	if !ok {
		return 0
	}
	blame := obj.(*git.Blame)
	return len(blame.Lines)
}

//export c_Blame_get_Lines_item
func c_Blame_get_Lines_item(b uint64, i int) {
	obj, ok := GetObject(Handle(b))
	if !ok {
		return
	}
	blame := obj.(*git.Blame)
	line := blame.Lines[i]
	_ = line
}