mirror of
https://github.com/rwinkhart/cmutton.git
synced 2026-08-27 20:36:31 -04:00
Port GetCurrentDeviceID()
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
// DirInit returns:
|
||||
// r0: oldDeviceID (special case: see libmutton docs)
|
||||
// r0: oldDeviceID (FSMisc if none)
|
||||
//
|
||||
// r1: err
|
||||
//
|
||||
@@ -22,4 +22,18 @@ func DirInit(preserveOldCfgDir bool) (*C.char, *C.char) {
|
||||
return C.CString(oldDeviceID), nil
|
||||
}
|
||||
|
||||
// GetCurrentDeviceID returns:
|
||||
// r0: currentDeviceID (FSMisc if none)
|
||||
//
|
||||
// r1: err
|
||||
//
|
||||
//export GetCurrentDeviceID
|
||||
func GetCurrentDeviceID() (*C.char, *C.char) {
|
||||
currentDeviceID, err := global.GetCurrentDeviceID()
|
||||
if err != nil {
|
||||
return nil, C.CString(err.Error())
|
||||
}
|
||||
return C.CString(currentDeviceID), nil
|
||||
}
|
||||
|
||||
func main() {}
|
||||
|
||||
Reference in New Issue
Block a user