Exemplo n.º 1
0
Arquivo: glib.go Projeto: vvanpo/gotk3
// GetUserSpecialDir is a wrapper around g_get_user_special_dir().  A
// non-nil error is returned in the case that g_get_user_special_dir()
// returns NULL to differentiate between NULL and an empty string.
func GetUserSpecialDir(directory UserDirectory) (string, error) {
	c := C.g_get_user_special_dir(C.GUserDirectory(directory))
	if c == nil {
		return "", errNilPtr
	}
	return C.GoString((*C.char)(c)), nil
}
Exemplo n.º 2
0
func GetUserSpecialDir(directory UserDirectory) string {
	result := C.g_get_user_special_dir(C.GUserDirectory(directory))
	return C.GoString(C.to_charptr(result))
}