Port GetCurrentDeviceID()

This commit is contained in:
2026-01-21 00:26:42 -05:00
parent 65252fd353
commit 52cb51dd75
3 changed files with 17 additions and 3 deletions
+15 -1
View File
@@ -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() {}