Exemplo n.º 1
0
Arquivo: git.go Projeto: fsouza/gogit
// GetInt64 is used to get int64 config values.
//
// The format of the configuration parameter is the same as in GetBool.
func (c *Config) GetInt64(name string) (int64, error) {
	var v C.int64_t
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	if C.git_config_get_int64(&v, c.config, cname) != C.GIT_OK {
		return 0, lastErr()
	}
	return int64(v), nil
}
Exemplo n.º 2
0
func (cfg *Config) GetInt64(name string) (int64, error) {
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))
	var cval C.int64_t
	ecode := C.git_config_get_int64(&cval, cfg.git_config, cname)
	if ecode != git_SUCCESS {
		return 0, gitError()
	}
	return int64(cval), nil
}
Exemplo n.º 3
0
func (c *Config) LookupInt64(name string) (v int64, err error) {
	var out C.int64_t
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	ret := C.git_config_get_int64(&out, c.ptr, cname)
	if ret < 0 {
		return 0, LastError()
	}

	return int64(out), nil
}
Exemplo n.º 4
0
Arquivo: config.go Projeto: wid/git2go
func (c *Config) LookupInt64(name string) (int64, error) {
	var out C.int64_t
	cname := C.CString(name)
	defer C.free(unsafe.Pointer(cname))

	runtime.LockOSThread()
	defer runtime.UnlockOSThread()

	ret := C.git_config_get_int64(&out, c.ptr, cname)
	if ret < 0 {
		return 0, MakeGitError(ret)
	}

	return int64(out), nil
}