Finish port of functions from "global" package

This commit is contained in:
2026-01-21 00:39:22 -05:00
parent 52cb51dd75
commit 868db8c038
2 changed files with 28 additions and 4 deletions
+4 -4
View File
@@ -37,10 +37,10 @@ Build the C library + headers w/`go build -buildmode=c-archive`.
- [X] DirInit(preserveOldCfgDir bool) (string, error)
- [ ] ~~GenDeviceIDList() ([]fs.DirEntry, error)~~
- [X] GetCurrentDeviceID() (string, error)
- [ ] GetRealAgePath(vanityPath string) string
- [ ] GetRealPath(vanityPath string) string
- [ ] GetSysProcAttr() *syscall.SysProcAttr
- [ ] GetVanityPath(realPath string) string
- [X] GetRealAgePath(vanityPath string) string
- [X] GetRealPath(vanityPath string) string
- [ ] ~~GetSysProcAttr() *syscall.SysProcAttr~~
- [X] GetVanityPath(realPath string) string
- [ ] syncclient
- [ ] AddFolderRemote(vanityPath string) error
- [ ] GenDeviceID(oldDeviceID, prefix string) (string, string, bool, error)
+24
View File
@@ -36,4 +36,28 @@ func GetCurrentDeviceID() (*C.char, *C.char) {
return C.CString(currentDeviceID), nil
}
// GetRealAgePath returns:
// realAgePath
//
//export GetRealAgePath
func GetRealAgePath(vanityPath *C.char) *C.char {
return C.CString(global.GetRealAgePath(C.GoString(vanityPath)))
}
// GetRealPath returns:
// realPath
//
//export GetRealPath
func GetRealPath(vanityPath *C.char) *C.char {
return C.CString(global.GetRealPath(C.GoString(vanityPath)))
}
// GetVanityPath returns:
// vanityPath
//
//export GetVanityPath
func GetVanityPath(realPath *C.char) *C.char {
return C.CString(global.GetVanityPath(C.GoString(realPath)))
}
func main() {}