2016-06-15 13:54:07 +00:00
|
|
|
package main
|
|
|
|
|
2016-06-15 19:50:35 +00:00
|
|
|
import "C"
|
2016-06-15 13:54:07 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
2016-06-15 19:50:35 +00:00
|
|
|
"os"
|
2016-06-15 13:54:07 +00:00
|
|
|
)
|
|
|
|
|
2016-06-20 02:01:28 +00:00
|
|
|
//export doCreateAccount
|
|
|
|
func doCreateAccount(password, keydir *C.char) C.int {
|
2016-06-20 01:46:13 +00:00
|
|
|
// This is equivalent to creating an account from the command line,
|
|
|
|
// just modified to handle the function arg passing
|
2016-06-20 02:01:28 +00:00
|
|
|
if err := createAccount(C.GoString(password), C.GoString(keydir)); err != nil {
|
2016-06-15 19:50:35 +00:00
|
|
|
fmt.Fprintln(os.Stderr, err)
|
|
|
|
return -1
|
2016-06-15 13:54:07 +00:00
|
|
|
}
|
2016-06-15 19:50:35 +00:00
|
|
|
return 0
|
2016-06-15 13:54:07 +00:00
|
|
|
}
|