From 868db8c038fcadcf2e3f0f1f5f790bebac43141a Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 21 Jan 2026 00:39:22 -0500 Subject: [PATCH] Finish port of functions from "global" package --- README.md | 8 ++++---- global.go | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7121af7..86b1d2c 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/global.go b/global.go index fbaaa86..a0527eb 100644 --- a/global.go +++ b/global.go @@ -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() {}