diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-23 10:42:49 +0100 |
|---|---|---|
| committer | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2022-03-23 10:42:49 +0100 |
| commit | ed6073f2c2c6600063f2e5062937b7a2a1162eb2 (patch) | |
| tree | d43109bb55546fc4815824579c4879b51e4c3605 /exports | |
| parent | e9597dc652e8ca99141b0d66bfca3e24f233d430 (diff) | |
Python: Implement state callbacks using decorators
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/exports.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/exports/exports.go b/exports/exports.go index c6a6a91..8236977 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -32,9 +32,10 @@ func StateCallback(old_state string, new_state string, data string) { } //export Register -func Register(name *C.char, config_directory *C.char, stateCallback C.PythonCB) { +func Register(name *C.char, config_directory *C.char, stateCallback C.PythonCB) *C.char { P_StateCallback = stateCallback - eduvpn.Register(eduvpn.GetVPNState(), C.GoString(name), C.GoString(config_directory), StateCallback) + registerErr := eduvpn.Register(eduvpn.GetVPNState(), C.GoString(name), C.GoString(config_directory), StateCallback) + return C.CString(ErrorToString(registerErr)) } func ErrorToString(error error) string { |
