diff options
| author | Aidan Nulman <[email protected]> | 2013-12-20 14:11:24 -0500 |
|---|---|---|
| committer | Aidan Nulman <[email protected]> | 2013-12-20 14:11:24 -0500 |
| commit | 59c7bd5ce462f243ff04c35214152837f1baec67 (patch) | |
| tree | cf8d8c8ef18a359757c0cad653ce393913206c55 /odb.go | |
| parent | 507a204249fbfe528b8d3caae7a64b35beab5d14 (diff) | |
Add OdbBackend constructor
Diffstat (limited to 'odb.go')
| -rw-r--r-- | odb.go | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -19,7 +19,7 @@ type Odb struct { // OdbBackends need public Ptrs: client apps init the backend type OdbBackend struct { - Ptr *C.git_odb_backend + ptr *C.git_odb_backend } func NewOdb() (odb *Odb, err error) { @@ -34,8 +34,14 @@ func NewOdb() (odb *Odb, err error) { return } +func NewOdbBackendFromC(ptr *C.git_odb_backend) (backend *OdbBackend) { + backend = &OdbBackend{ptr} + return +} + + func (v *Odb) AddBackend(backend *OdbBackend, priority int) (err error) { - ret := C.git_odb_add_backend(v.ptr, backend.Ptr, C.int(priority)) + ret := C.git_odb_add_backend(v.ptr, backend.ptr, C.int(priority)) if ret < 0 { err = LastError() } |
