diff --git a/lib/cgo/api.client.go b/lib/cgo/api.client.go index 2edcfd90a..dee5ff66d 100644 --- a/lib/cgo/api.client.go +++ b/lib/cgo/api.client.go @@ -27,7 +27,7 @@ func SKY_api_NewClient(_addr string, _arg1 *C.Client__Handle) (____error_code ui } //export SKY_api_Client_CSRF -func SKY_api_Client_CSRF(_c C.Client__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_api_Client_CSRF(_c C.Client__Handle, _arg0 *string) (____error_code uint32) { c, okc := lookupClientHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE @@ -36,7 +36,7 @@ func SKY_api_Client_CSRF(_c C.Client__Handle, _arg0 *C.GoString_) (____error_cod __arg0, ____return_err := c.CSRF() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg0, _arg0) + *_arg0 = __arg0 } return } @@ -376,7 +376,7 @@ func SKY_api_Client_WalletFolderName(_c C.Client__Handle, _arg0 *C.Handle) (____ } //export SKY_api_Client_NewSeed -func SKY_api_Client_NewSeed(_c C.Client__Handle, _entropy int, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_api_Client_NewSeed(_c C.Client__Handle, _entropy int, _arg1 *string) (____error_code uint32) { c, okc := lookupClientHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE @@ -386,7 +386,7 @@ func SKY_api_Client_NewSeed(_c C.Client__Handle, _entropy int, _arg1 *C.GoString __arg1, ____return_err := c.NewSeed(entropy) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } @@ -581,7 +581,7 @@ func SKY_api_Client_UnconfirmedTransactions(_c C.Client__Handle, _addrs []string } //export SKY_api_Client_InjectTransaction -func SKY_api_Client_InjectTransaction(_c C.Client__Handle, _rawTx C.Transaction__Handle, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_api_Client_InjectTransaction(_c C.Client__Handle, _rawTx C.Transaction__Handle, _arg1 *string) (____error_code uint32) { c, okc := lookupClientHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE @@ -596,7 +596,7 @@ func SKY_api_Client_InjectTransaction(_c C.Client__Handle, _rawTx C.Transaction_ __arg1, ____return_err := c.InjectTransaction(rawTx) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } @@ -617,7 +617,7 @@ func SKY_api_Client_ResendUnconfirmedTransactions(_c C.Client__Handle, _arg0 *C. } //export SKY_api_Client_RawTransaction -func SKY_api_Client_RawTransaction(_c C.Client__Handle, _txid string, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_api_Client_RawTransaction(_c C.Client__Handle, _txid string, _arg1 *string) (____error_code uint32) { c, okc := lookupClientHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE @@ -627,7 +627,7 @@ func SKY_api_Client_RawTransaction(_c C.Client__Handle, _txid string, _arg1 *C.G __arg1, ____return_err := c.RawTransaction(txid) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } @@ -748,7 +748,7 @@ func SKY_api_Client_CreateWallet(_c C.Client__Handle, _cwo C.CreateWalletOptions } //export SKY_api_Client_InjectTransactionNoBroadcast -func SKY_api_Client_InjectTransactionNoBroadcast(_c C.Client__Handle, _txn C.Transaction__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_api_Client_InjectTransactionNoBroadcast(_c C.Client__Handle, _txn C.Transaction__Handle, _arg0 *string) (____error_code uint32) { c, okc := lookupClientHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE @@ -763,13 +763,13 @@ func SKY_api_Client_InjectTransactionNoBroadcast(_c C.Client__Handle, _txn C.Tra ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(arg0, _arg0) + *_arg0 = arg0 } return } //export SKY_api_Client_InjectEncodedTransactionNoBroadcast -func SKY_api_Client_InjectEncodedTransactionNoBroadcast(_c C.Client__Handle, rawtx string, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_api_Client_InjectEncodedTransactionNoBroadcast(_c C.Client__Handle, rawtx string, _arg0 *string) (____error_code uint32) { c, okc := lookupClientHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE @@ -780,7 +780,7 @@ func SKY_api_Client_InjectEncodedTransactionNoBroadcast(_c C.Client__Handle, raw ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(arg0, _arg0) + *_arg0 = arg0 } return } diff --git a/lib/cgo/cipher.address.go b/lib/cgo/cipher.address.go index 843cb8f5c..d3d44ea74 100644 --- a/lib/cgo/cipher.address.go +++ b/lib/cgo/cipher.address.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" cipher "github.com/skycoin/skycoin/src/cipher" @@ -65,10 +64,9 @@ func SKY_cipher_Address_Null(_addr *C.cipher__Address, _arg0 *bool) (____error_c } //export SKY_cipher_Address_Bytes -func SKY_cipher_Address_Bytes(_addr *C.cipher__Address, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_cipher_Address_Bytes(_addr *C.cipher__Address, _arg0 *[]byte) (____error_code uint32) { addr := (*cipher.Address)(unsafe.Pointer(_addr)) - bytes := addr.Bytes() - copyToGoSlice(reflect.ValueOf(bytes), _arg0) + *_arg0 = addr.Bytes() return } @@ -82,10 +80,9 @@ func SKY_cipher_Address_Verify(_addr *C.cipher__Address, _key *C.cipher__PubKey) } //export SKY_cipher_Address_String -func SKY_cipher_Address_String(_addr *C.cipher__Address, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cipher_Address_String(_addr *C.cipher__Address, _arg1 *string) (____error_code uint32) { addr := (*cipher.Address)(unsafe.Pointer(_addr)) - s := addr.String() - copyString(s, _arg1) + *_arg1 = addr.String() return } diff --git a/lib/cgo/cipher.bip32.bip32.go b/lib/cgo/cipher.bip32.bip32.go index d579c8b44..20c3ab0b0 100644 --- a/lib/cgo/cipher.bip32.bip32.go +++ b/lib/cgo/cipher.bip32.bip32.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" "github.com/skycoin/skycoin/src/cipher/bip32" @@ -171,15 +170,14 @@ func SKY_bip32_PrivateKey_Serialize(_pk C.PrivateKey__Handle, _arg0 *[]byte) (__ } //export SKY_bip32_PublicKey_Serialize -func SKY_bip32_PublicKey_Serialize(_pk C.PublicKey__Handle, _arg0 *C.GoSlice_) (___error_code uint32) { +func SKY_bip32_PublicKey_Serialize(_pk C.PublicKey__Handle, _arg0 *[]byte) (___error_code uint32) { pk, okpk := lookupPublicKeyHandle(_pk) if !okpk { ___error_code = SKY_BAD_HANDLE return } - arg0 := pk.Serialize() - copyToGoSlice(reflect.ValueOf(arg0), _arg0) + *_arg0 = pk.Serialize() return } diff --git a/lib/cgo/cipher.bip39.bip39.go b/lib/cgo/cipher.bip39.bip39.go index 0f714dbe5..ede495c7c 100644 --- a/lib/cgo/cipher.bip39.bip39.go +++ b/lib/cgo/cipher.bip39.bip39.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" "github.com/skycoin/skycoin/src/cipher/bip39" @@ -17,33 +16,33 @@ import ( import "C" //export SKY_bip39_NewDefaultMnemomic -func SKY_bip39_NewDefaultMnemomic(_arg0 *C.GoString_) (____error_code uint32) { +func SKY_bip39_NewDefaultMnemomic(_arg0 *string) (____error_code uint32) { __arg0, ____return_err := bip39.NewDefaultMnemonic() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg0, _arg0) + *_arg0 = __arg0 } return } //export SKY_bip39_NewEntropy -func SKY_bip39_NewEntropy(_bitSize int, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_bip39_NewEntropy(_bitSize int, _arg1 *[]byte) (____error_code uint32) { bitSize := _bitSize __arg1, ____return_err := bip39.NewEntropy(bitSize) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) + *_arg1 = __arg1 } return } //export SKY_bip39_NewMnemonic -func SKY_bip39_NewMnemonic(_entropy []byte, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_bip39_NewMnemonic(_entropy []byte, _arg1 *string) (____error_code uint32) { entropy := *(*[]byte)(unsafe.Pointer(&_entropy)) __arg1, ____return_err := bip39.NewMnemonic(entropy) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } @@ -57,13 +56,13 @@ func SKY_bip39_ValidateMnemonic(_mnemonic string) (____error_code uint32) { } //export SKY_bip39_NewSeed -func SKY_bip39_NewSeed(_mnemonic string, _password string, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_bip39_NewSeed(_mnemonic string, _password string, _arg1 *[]byte) (____error_code uint32) { mnemonic := _mnemonic password := _password __arg1, ____return_err := bip39.NewSeed(mnemonic, password) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) + *_arg1 = __arg1 } return } diff --git a/lib/cgo/cipher.bitcoin.go b/lib/cgo/cipher.bitcoin.go index 5aed147d2..7070d4c74 100644 --- a/lib/cgo/cipher.bitcoin.go +++ b/lib/cgo/cipher.bitcoin.go @@ -10,7 +10,6 @@ package main import "C" import ( - "reflect" "unsafe" cipher "github.com/skycoin/skycoin/src/cipher" @@ -83,10 +82,9 @@ func SKY_cipher_BitcoinAddress_Null(_addr *C.cipher__BitcoinAddress) bool { } //export SKY_cipher_BitcoinAddress_Bytes -func SKY_cipher_BitcoinAddress_Bytes(_addr *C.cipher__BitcoinAddress, _arg0 *C.GoSlice_) { +func SKY_cipher_BitcoinAddress_Bytes(_addr *C.cipher__BitcoinAddress, _arg0 *[]byte) { addr := (*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) - bytes := addr.Bytes() - copyToGoSlice(reflect.ValueOf(bytes), _arg0) + *_arg0 = addr.Bytes() } //export SKY_cipher_BitcoinAddress_Verify @@ -98,10 +96,9 @@ func SKY_cipher_BitcoinAddress_Verify(_addr *C.cipher__BitcoinAddress, _key *C.c } //export SKY_cipher_BitcoinAddress_String -func SKY_cipher_BitcoinAddress_String(_addr *C.cipher__BitcoinAddress, _arg1 *C.GoString_) { +func SKY_cipher_BitcoinAddress_String(_addr *C.cipher__BitcoinAddress, _arg1 *string) { addr := (*cipher.BitcoinAddress)(unsafe.Pointer(_addr)) - s := addr.String() - copyString(s, _arg1) + *_arg1 = addr.String() } //export SKY_cipher_BitcoinAddress_Checksum diff --git a/lib/cgo/cipher.crypto.go b/lib/cgo/cipher.crypto.go index 1e3da199d..20eefc6fa 100644 --- a/lib/cgo/cipher.crypto.go +++ b/lib/cgo/cipher.crypto.go @@ -17,9 +17,8 @@ import ( import "C" //export SKY_cipher_RandByte -func SKY_cipher_RandByte(_n int, _arg1 *C.GoSlice_) (____error_code uint32) { - b := cipher.RandByte(_n) - copyToGoSlice(reflect.ValueOf(b), _arg1) +func SKY_cipher_RandByte(_n int, _arg1 *[]byte) (____error_code uint32) { + *_arg1 = cipher.RandByte(_n) return } @@ -84,10 +83,9 @@ func SKY_cipher_PubKey_Verify(_pk *C.cipher__PubKey) (____error_code uint32) { } //export SKY_cipher_PubKey_Hex -func SKY_cipher_PubKey_Hex(_pk *C.cipher__PubKey, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cipher_PubKey_Hex(_pk *C.cipher__PubKey, _arg1 *string) (____error_code uint32) { pk := (*cipher.PubKey)(unsafe.Pointer(_pk)) - s := pk.Hex() - copyString(s, _arg1) + *_arg1 = pk.Hex() return SKY_OK } @@ -130,21 +128,20 @@ func SKY_cipher_SecKey_Verify(_sk *C.cipher__SecKey) (____error_code uint32) { } //export SKY_cipher_SecKey_Hex -func SKY_cipher_SecKey_Hex(_sk *C.cipher__SecKey, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cipher_SecKey_Hex(_sk *C.cipher__SecKey, _arg1 *string) (____error_code uint32) { sk := (*cipher.SecKey)(unsafe.Pointer(_sk)) - s := sk.Hex() - copyString(s, _arg1) + *_arg1 = sk.Hex() return } //export SKY_cipher_ECDH -func SKY_cipher_ECDH(_pub *C.cipher__PubKey, _sec *C.cipher__SecKey, _arg2 *C.GoSlice_) (____error_code uint32) { +func SKY_cipher_ECDH(_pub *C.cipher__PubKey, _sec *C.cipher__SecKey, _arg2 *[]byte) (____error_code uint32) { pub := (*cipher.PubKey)(unsafe.Pointer(_pub)) sec := (*cipher.SecKey)(unsafe.Pointer(_sec)) b, err := cipher.ECDH(*pub, *sec) ____error_code = libErrorCode(err) if err == nil { - copyToGoSlice(reflect.ValueOf(b), _arg2) + *_arg2 = b } return } @@ -171,9 +168,9 @@ func SKY_cipher_SigFromHex(_s string, _arg1 *C.cipher__Sig) (____error_code uint } //export SKY_cipher_Sig_Hex -func SKY_cipher_Sig_Hex(_s *C.cipher__Sig, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cipher_Sig_Hex(_s *C.cipher__Sig, _arg1 *string) (____error_code uint32) { s := (*cipher.Sig)(unsafe.Pointer(_s)) - copyString(s.Hex(), _arg1) + *_arg1 = s.Hex() return } @@ -257,10 +254,10 @@ func SKY_cipher_GenerateDeterministicKeyPairs(_seed []byte, _n int, _arg2 *C.GoS } //export SKY_cipher_GenerateDeterministicKeyPairsSeed -func SKY_cipher_GenerateDeterministicKeyPairsSeed(_seed []byte, _n int, _arg2 *C.GoSlice_, _arg3 *C.GoSlice_) (____error_code uint32) { +func SKY_cipher_GenerateDeterministicKeyPairsSeed(_seed []byte, _n int, _arg2 *[]byte, _arg3 *C.GoSlice_) (____error_code uint32) { h, sks, err := cipher.GenerateDeterministicKeyPairsSeed(_seed, _n) if err == nil { - copyToGoSlice(reflect.ValueOf(h), _arg2) + *_arg2 = h copyToGoSlice(reflect.ValueOf(sks), _arg3) } @@ -287,9 +284,9 @@ func SKY_cipher_CheckSecKeyHash(_seckey *C.cipher__SecKey, _hash *C.cipher__SHA2 } //export SKY_cipher_Sig_String -func SKY_cipher_Sig_String(_s *C.cipher__Sig, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cipher_Sig_String(_s *C.cipher__Sig, _arg1 *string) (____error_code uint32) { s := (*cipher.Sig)(unsafe.Pointer(_s)) - copyString(s.String(), _arg1) + *_arg1 = s.String() return } diff --git a/lib/cgo/cipher.encrypt.scrypt_chacha20poly1305.go b/lib/cgo/cipher.encrypt.scrypt_chacha20poly1305.go index 6141b8401..4798dc0b8 100644 --- a/lib/cgo/cipher.encrypt.scrypt_chacha20poly1305.go +++ b/lib/cgo/cipher.encrypt.scrypt_chacha20poly1305.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" encrypt "github.com/skycoin/skycoin/src/cipher/encrypt" @@ -17,7 +16,7 @@ import ( import "C" //export SKY_encrypt_ScryptChacha20poly1305_Encrypt -func SKY_encrypt_ScryptChacha20poly1305_Encrypt(_s *C.encrypt__ScryptChacha20poly1305, _data []byte, _password []byte, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_encrypt_ScryptChacha20poly1305_Encrypt(_s *C.encrypt__ScryptChacha20poly1305, _data []byte, _password []byte, _arg1 *[]byte) (____error_code uint32) { s := *(*encrypt.ScryptChacha20poly1305)(unsafe.Pointer(_s)) data := *(*[]byte)(unsafe.Pointer(&_data)) @@ -25,20 +24,20 @@ func SKY_encrypt_ScryptChacha20poly1305_Encrypt(_s *C.encrypt__ScryptChacha20pol __arg1, ____return_err := s.Encrypt(data, password) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) + *_arg1 = __arg1 } return } //export SKY_encrypt_ScryptChacha20poly1305_Decrypt -func SKY_encrypt_ScryptChacha20poly1305_Decrypt(_s *C.encrypt__ScryptChacha20poly1305, _data []byte, _password []byte, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_encrypt_ScryptChacha20poly1305_Decrypt(_s *C.encrypt__ScryptChacha20poly1305, _data []byte, _password []byte, _arg1 *[]byte) (____error_code uint32) { s := *(*encrypt.ScryptChacha20poly1305)(unsafe.Pointer(_s)) data := *(*[]byte)(unsafe.Pointer(&_data)) password := *(*[]byte)(unsafe.Pointer(&_password)) __arg1, ____return_err := s.Decrypt(data, password) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) + *_arg1 = __arg1 } return } diff --git a/lib/cgo/cipher.hash.go b/lib/cgo/cipher.hash.go index 3509e2e15..f724c2bb0 100644 --- a/lib/cgo/cipher.hash.go +++ b/lib/cgo/cipher.hash.go @@ -43,9 +43,9 @@ func SKY_cipher_SHA256_Set(_g *C.cipher__SHA256, _b []byte) (____error_code uint } //export SKY_cipher_SHA256_Hex -func SKY_cipher_SHA256_Hex(_g *C.cipher__SHA256, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cipher_SHA256_Hex(_g *C.cipher__SHA256, _arg1 *string) (____error_code uint32) { g := (*cipher.SHA256)(unsafe.Pointer(_g)) - copyString(g.Hex(), _arg1) + *_arg1 = g.Hex() return } diff --git a/lib/cgo/cipher.secp256k1-go.secp256k1.go b/lib/cgo/cipher.secp256k1-go.secp256k1.go index 87968cb93..d04f86cfa 100644 --- a/lib/cgo/cipher.secp256k1-go.secp256k1.go +++ b/lib/cgo/cipher.secp256k1-go.secp256k1.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" "github.com/skycoin/skycoin/src/cipher/secp256k1-go" @@ -16,14 +15,16 @@ import ( import "C" //export SKY_secp256k1_PubkeyFromSeckey -func SKY_secp256k1_PubkeyFromSeckey(__seckey []byte, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_secp256k1_PubkeyFromSeckey(__seckey []byte, _arg1 *[]byte) (____error_code uint32) { seckey := *(*[]byte)(unsafe.Pointer(&__seckey)) __arg1 := secp256k1.PubkeyFromSeckey(seckey) if __arg1 != nil { - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) - return SKY_OK + *_arg1 = __arg1 + ____error_code = SKY_OK + return } - return SKY_ERROR + ____error_code = SKY_ERROR + return } //export SKY_secp256k1_VerifyPubkey @@ -41,13 +42,15 @@ func SKY_secp256k1_VerifySecKey(__seckey []byte) (____error_code int) { } //export SKY_secp256k1_ECDH -func SKY_secp256k1_ECDH(_pub []byte, _sec []byte, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_secp256k1_ECDH(_pub []byte, _sec []byte, _arg1 *[]byte) (____error_code uint32) { pubkey := *(*[]byte)(unsafe.Pointer(&_pub)) seckey := *(*[]byte)(unsafe.Pointer(&_sec)) __arg1 := secp256k1.ECDH(pubkey, seckey) if __arg1 != nil { - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) - return SKY_OK + *_arg1 = __arg1 + ____error_code = SKY_OK + return } - return SKY_ERROR + ____error_code = SKY_ERROR + return } diff --git a/lib/cgo/cli.check_balance.go b/lib/cgo/cli.check_balance.go index bfca6865e..4273d6bbe 100644 --- a/lib/cgo/cli.check_balance.go +++ b/lib/cgo/cli.check_balance.go @@ -1,5 +1,11 @@ package main +import ( + "unsafe" + + cli "github.com/skycoin/skycoin/src/cli" +) + /* #include @@ -9,18 +15,18 @@ package main */ import "C" -// //export SKY_cli_GetBalanceOfAddresses -// func SKY_cli_GetBalanceOfAddresses(_c C.WebRpcClient__Handle, _addrs []string, _arg2 *C.BalanceResult_Handle) (____error_code uint32) { -// c, okc := lookupWebRpcClientHandle(_c) -// if !okc { -// ____error_code = SKY_BAD_HANDLE -// return -// } -// addrs := *(*[]string)(unsafe.Pointer(&_addrs)) -// __arg2, ____return_err := cli.GetBalanceOfAddresses(c, addrs) -// ____error_code = libErrorCode(____return_err) -// if ____return_err == nil { -// *_arg2 = registerBalanceResultHandle(__arg2) -// } -// return -// } +//export SKY_cli_GetBalanceOfAddresses +func SKY_cli_GetBalanceOfAddresses(_c C.GetOutputser__Handle, _addrs []string, _arg2 *C.BalanceResult_Handle) (____error_code uint32) { + c, okc := lookupGetOutputserHandle(_c) + if !okc { + ____error_code = SKY_BAD_HANDLE + return + } + addrs := *(*[]string)(unsafe.Pointer(&_addrs)) + __arg2, ____return_err := cli.GetBalanceOfAddresses(*c, addrs) + ____error_code = libErrorCode(____return_err) + if ____return_err == nil { + *_arg2 = registerBalanceResultHandle(__arg2) + } + return +} diff --git a/lib/cgo/cli.cli.go b/lib/cgo/cli.cli.go index daf8bdf96..c43bf5a8b 100644 --- a/lib/cgo/cli.cli.go +++ b/lib/cgo/cli.cli.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" "github.com/skycoin/skycoin/src/cli" @@ -27,15 +26,14 @@ func SKY_cli_LoadConfig(_arg0 *C.Config__Handle) (____error_code uint32) { } //export SKY_cli_Config_FullDBPath -func SKY_cli_Config_FullDBPath(_c C.Config__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_cli_Config_FullDBPath(_c C.Config__Handle, _arg0 *string) (____error_code uint32) { __c, okc := lookupConfigHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE return } c := *__c - __arg0 := c.FullDBPath() - copyString(__arg0, _arg0) + *_arg0 = c.FullDBPath() return } @@ -67,23 +65,23 @@ func SKY_cli_NewPasswordReader(_password []byte, passwordReader *C.PasswordReade } //export SKY_cli_PasswordFromBytes_Password -func SKY_cli_PasswordFromBytes_Password(_p *C.cli__PasswordFromBytes, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_cli_PasswordFromBytes_Password(_p *C.cli__PasswordFromBytes, _arg0 *[]byte) (____error_code uint32) { p := *(*cli.PasswordFromBytes)(unsafe.Pointer(_p)) __arg0, ____return_err := p.Password() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 } return } //export SKY_cli_PasswordFromTerm_Password -func SKY_cli_PasswordFromTerm_Password(_arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_cli_PasswordFromTerm_Password(_arg0 *[]byte) (____error_code uint32) { p := cli.PasswordFromTerm{} __arg0, ____return_err := p.Password() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 } return } diff --git a/lib/cgo/cli.generate_addrs.go b/lib/cgo/cli.generate_addrs.go index da13765e6..0c8b26852 100644 --- a/lib/cgo/cli.generate_addrs.go +++ b/lib/cgo/cli.generate_addrs.go @@ -35,31 +35,31 @@ func SKY_cli_GenerateAddressesInFile(_walletFile string, _num uint64, pwd C.Pass } //export SKY_cli_FormatAddressesAsJSON -func SKY_cli_FormatAddressesAsJSON(_addrs []C.cipher__Address, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cli_FormatAddressesAsJSON(_addrs []C.cipher__Address, _arg1 *string) (____error_code uint32) { addrs := *(*[]cipher.Address)(unsafe.Pointer(&_addrs)) __addrs := toAddresserArray(addrs) __arg1, ____return_err := cli.FormatAddressesAsJSON(__addrs) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } //export SKY_cli_FormatAddressesAsJoinedArray -func SKY_cli_FormatAddressesAsJoinedArray(_addrs []C.cipher__Address, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_cli_FormatAddressesAsJoinedArray(_addrs []C.cipher__Address, _arg1 *string) (____error_code uint32) { addrs := *(*[]cipher.Address)(unsafe.Pointer(&_addrs)) __addrs := toAddresserArray(addrs) __arg1 := cli.FormatAddressesAsJoinedArray(__addrs) - copyString(__arg1, _arg1) + *_arg1 = __arg1 return } //export SKY_cli_AddressesToStrings -func SKY_cli_AddressesToStrings(_addrs []C.cipher__Address, _arg1 *C.GoSlice_) (____error_code uint32) { +func SKY_cli_AddressesToStrings(_addrs []C.cipher__Address, _arg1 *C.Strings__Handle) (____error_code uint32) { addrs := *(*[]cipher.Address)(unsafe.Pointer(&_addrs)) __addrs := toAddresserArray(addrs) __arg1 := cli.AddressesToStrings(__addrs) - copyToGoSlice(reflect.ValueOf(__arg1), _arg1) + *_arg1 = registerStringsHandle(__arg1) return } diff --git a/lib/cgo/cli_helper.go b/lib/cgo/cli_helper.go index 9c0d97b73..062cb369d 100644 --- a/lib/cgo/cli_helper.go +++ b/lib/cgo/cli_helper.go @@ -29,35 +29,32 @@ func SKY_cli_CLI_Run(_app C.CLI__Handle) (____error_code uint32) { } //export SKY_cli_Config_GetCoin -func SKY_cli_Config_GetCoin(_c C.Config__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_cli_Config_GetCoin(_c C.Config__Handle, _arg0 *string) (____error_code uint32) { __c, okc := lookupConfigHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE return } c := *__c - __arg0 := c.Coin - copyString(__arg0, _arg0) + *_arg0 = c.Coin return } //export SKY_cli_Config_GetRPCAddress -func SKY_cli_Config_GetRPCAddress(_c C.Config__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_cli_Config_GetRPCAddress(_c C.Config__Handle, _arg0 *string) (____error_code uint32) { __c, okc := lookupConfigHandle(_c) if !okc { ____error_code = SKY_BAD_HANDLE return } c := *__c - __arg0 := c.RPCAddress - copyString(__arg0, _arg0) + *_arg0 = c.RPCAddress return } //export SKY_cli_Getenv -func SKY_cli_Getenv(varname string, _arg0 *C.GoString_) (____error_code uint32) { - __arg0 := os.Getenv(varname) - copyString(__arg0, _arg0) +func SKY_cli_Getenv(varname string, _arg0 *string) (____error_code uint32) { + *_arg0 = os.Getenv(varname) return } diff --git a/lib/cgo/coin.block.go b/lib/cgo/coin.block.go index 7e712132f..992d0b6eb 100644 --- a/lib/cgo/coin.block.go +++ b/lib/cgo/coin.block.go @@ -175,10 +175,10 @@ func SKY_coin_BlockHeader_Hash(_bh C.BlockHeader__Handle, _arg0 *C.cipher__SHA25 } //export SKY_coin_BlockHeader_Bytes -func SKY_coin_BlockHeader_Bytes(_bh *C.coin__BlockHeader, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_coin_BlockHeader_Bytes(_bh *C.coin__BlockHeader, _arg0 *[]byte) (____error_code uint32) { bh := *(*coin.BlockHeader)(unsafe.Pointer(_bh)) __arg0 := bh.Bytes() - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 return } @@ -210,14 +210,13 @@ func SKY_coin_BlockBody_Size(_bb *C.BlockBody__Handle, _arg0 *uint32) (____error } //export SKY_coin_BlockBody_Bytes -func SKY_coin_BlockBody_Bytes(_bb C.BlockBody__Handle, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_coin_BlockBody_Bytes(_bb C.BlockBody__Handle, _arg0 *[]byte) (____error_code uint32) { bb, ok := lookupBlockBodyHandle(_bb) if !ok { ____error_code = SKY_BAD_HANDLE return } - __arg0 := bb.Bytes() - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = bb.Bytes() return } diff --git a/lib/cgo/coin.transactions.go b/lib/cgo/coin.transactions.go index bf22a7bd2..2f92fecc8 100644 --- a/lib/cgo/coin.transactions.go +++ b/lib/cgo/coin.transactions.go @@ -345,7 +345,7 @@ func SKY_coin_Transaction_HashInner(handle C.Transaction__Handle, _arg0 *C.ciphe } //export SKY_coin_Transaction_Serialize -func SKY_coin_Transaction_Serialize(handle C.Transaction__Handle, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_coin_Transaction_Serialize(handle C.Transaction__Handle, _arg0 *[]byte) (____error_code uint32) { txn, ok := lookupTransactionHandle(handle) if !ok { ____error_code = SKY_BAD_HANDLE @@ -354,7 +354,7 @@ func SKY_coin_Transaction_Serialize(handle C.Transaction__Handle, _arg0 *C.GoSli __arg0, ____return_err := txn.Serialize() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 } return } diff --git a/lib/cgo/testutil.testutil.go b/lib/cgo/testutil.testutil.go index 50073be8f..15c13b7e9 100644 --- a/lib/cgo/testutil.testutil.go +++ b/lib/cgo/testutil.testutil.go @@ -33,7 +33,7 @@ func SKY_testutil_MakePubKey(_arg0 *C.cipher__PubKey) (____error_code uint32) { //export SKY_testutil_RandXPub func SKY_testutil_RandXPub(_arg0 *C.PublicKey__Handle) (____error_code uint32) { - m := bip39.MustNewDefaultMnemonic() + m, _ := bip39.NewDefaultMnemonic() s, err := bip39.NewSeed(m, "") ____error_code = libErrorCode(err) if err != nil { diff --git a/lib/cgo/transaction.hours.go b/lib/cgo/transaction.hours.go index cdad9b0f6..c3043a900 100644 --- a/lib/cgo/transaction.hours.go +++ b/lib/cgo/transaction.hours.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" "github.com/skycoin/skycoin/src/transaction" @@ -18,25 +17,25 @@ import ( import "C" //export SKY_transaction_DistributeCoinHoursProportional -func SKY_transaction_DistributeCoinHoursProportional(_coins []uint64, _hours uint64, _arg2 *C.GoSlice_) (____error_code uint32) { +func SKY_transaction_DistributeCoinHoursProportional(_coins []uint64, _hours uint64, _arg2 *[]uint64) (____error_code uint32) { coins := *(*[]uint64)(unsafe.Pointer(&_coins)) hours := _hours __arg2, ____return_err := transaction.DistributeCoinHoursProportional(coins, hours) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg2), _arg2) + *_arg2 = __arg2 } return } //export SKY_transaction_DistributeSpendHours -func SKY_transaction_DistributeSpendHours(_inputHours, _nAddrs uint64, _haveChange bool, _arg2 *uint64, _arg3 *C.GoSlice_, _arg4 *uint64) (____error_code uint32) { +func SKY_transaction_DistributeSpendHours(_inputHours, _nAddrs uint64, _haveChange bool, _arg2 *uint64, _arg3 *[]uint64, _arg4 *uint64) (____error_code uint32) { inputHours := _inputHours nAddrs := _nAddrs haveChange := _haveChange __arg2, __arg3, __arg4 := transaction.DistributeSpendHours(inputHours, nAddrs, haveChange) *_arg2 = __arg2 - copyToGoSlice(reflect.ValueOf(__arg3), _arg3) + *_arg3 = __arg3 *_arg4 = __arg4 return } diff --git a/lib/cgo/util.cert.cert.go b/lib/cgo/util.cert.cert.go index 23943a2f5..82065fa28 100644 --- a/lib/cgo/util.cert.cert.go +++ b/lib/cgo/util.cert.cert.go @@ -1,8 +1,6 @@ package main import ( - "reflect" - cert "github.com/skycoin/skycoin/src/util/certutil" ) @@ -16,13 +14,13 @@ import ( import "C" //export SKY_certutil_NewTLSCertPair -func SKY_certutil_NewTLSCertPair(organization string, validUntil string, extraHosts []string, _cert *C.GoSlice_, _key *C.GoSlice_) (____error_code uint32) { +func SKY_certutil_NewTLSCertPair(organization string, validUntil string, extraHosts []string, _cert *[]byte, _key *[]byte) (____error_code uint32) { ____time_validUntil, ____return_err := parseTimeValue(validUntil) if ____return_err == nil { cert, key, ____return_err := cert.NewTLSCertPair(organization, ____time_validUntil, extraHosts) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(cert), _cert) - copyToGoSlice(reflect.ValueOf(key), _key) + *_cert = cert + *_key = key } } ____error_code = libErrorCode(____return_err) diff --git a/lib/cgo/util.droplet.droplet.go b/lib/cgo/util.droplet.droplet.go index 4693a8453..33dea608d 100644 --- a/lib/cgo/util.droplet.droplet.go +++ b/lib/cgo/util.droplet.droplet.go @@ -23,12 +23,12 @@ func SKY_droplet_FromString(_b string, _arg1 *uint64) (____error_code uint32) { } //export SKY_droplet_ToString -func SKY_droplet_ToString(_n uint64, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_droplet_ToString(_n uint64, _arg1 *string) (____error_code uint32) { n := _n __arg1, ____return_err := droplet.ToString(n) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } diff --git a/lib/cgo/util.file.file.go b/lib/cgo/util.file.file.go index 5b7d6c295..841deeeef 100644 --- a/lib/cgo/util.file.file.go +++ b/lib/cgo/util.file.file.go @@ -12,40 +12,38 @@ import file "github.com/skycoin/skycoin/src/util/file" import "C" //export SKY_file_InitDataDir -func SKY_file_InitDataDir(_dir string, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_file_InitDataDir(_dir string, _arg1 *string) (____error_code uint32) { dir := _dir __arg1, ____return_err := file.InitDataDir(dir) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 } return } //export SKY_file_UserHome -func SKY_file_UserHome(_arg0 *C.GoString_) (____error_code uint32) { - __arg0 := file.UserHome() - copyString(__arg0, _arg0) +func SKY_file_UserHome(_arg0 *string) (____error_code uint32) { + *_arg0 = file.UserHome() return } //export SKY_file_ResolveResourceDirectory -func SKY_file_ResolveResourceDirectory(_path string, _arg1 *C.GoString_) (____error_code uint32) { +func SKY_file_ResolveResourceDirectory(_path string, _arg1 *string) (____error_code uint32) { path := _path - __arg1 := file.ResolveResourceDirectory(path) - copyString(__arg1, _arg1) + *_arg1 = file.ResolveResourceDirectory(path) return } //export SKY_file_DetermineResourcePath -func SKY_file_DetermineResourcePath(_staticDir string, _resourceDir string, _devDir string, _arg3 *C.GoString_) (____error_code uint32) { +func SKY_file_DetermineResourcePath(_staticDir string, _resourceDir string, _devDir string, _arg3 *string) (____error_code uint32) { staticDir := _staticDir resourceDir := _resourceDir devDir := _devDir __arg3, ____return_err := file.DetermineResourcePath(staticDir, resourceDir, devDir) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg3, _arg3) + *_arg3 = __arg3 } return } diff --git a/lib/cgo/util.http.json.go b/lib/cgo/util.http.json.go index d311d1965..2fcc1ce1c 100644 --- a/lib/cgo/util.http.json.go +++ b/lib/cgo/util.http.json.go @@ -1,7 +1,6 @@ package main import ( - "reflect" "unsafe" http "github.com/skycoin/skycoin/src/util/http" @@ -28,12 +27,12 @@ func SKY_httphelper_Address_UnmarshalJSON(_a *C.httphelper__Address, _b []byte) } //export SKY_httphelper_Address_MarshalJSON -func SKY_httphelper_Address_MarshalJSON(_a *C.httphelper__Address, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_httphelper_Address_MarshalJSON(_a *C.httphelper__Address, _arg0 *[]byte) (____error_code uint32) { a := *inplaceHttpHelperAddress(_a) __arg0, ____return_err := a.MarshalJSON() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 } return } @@ -50,12 +49,12 @@ func SKY_httphelper_Coins_UnmarshalJSON(_c *C.httphelper__Coins, _b []byte) (___ } //export SKY_httphelper_Coins_MarshalJSON -func SKY_httphelper_Coins_MarshalJSON(_c *C.httphelper__Coins, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_httphelper_Coins_MarshalJSON(_c *C.httphelper__Coins, _arg0 *[]byte) (____error_code uint32) { c := *(*http.Coins)(unsafe.Pointer(_c)) __arg0, ____return_err := c.MarshalJSON() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 } return } @@ -80,12 +79,12 @@ func SKY_httphelper_Hours_UnmarshalJSON(_h *C.httphelper__Hours, _b []byte) (___ } //export SKY_httphelper_Hours_MarshalJSON -func SKY_httphelper_Hours_MarshalJSON(_h *C.httphelper__Hours, _arg0 *C.GoSlice_) (____error_code uint32) { +func SKY_httphelper_Hours_MarshalJSON(_h *C.httphelper__Hours, _arg0 *[]byte) (____error_code uint32) { h := *(*http.Hours)(unsafe.Pointer(_h)) __arg0, ____return_err := h.MarshalJSON() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyToGoSlice(reflect.ValueOf(__arg0), _arg0) + *_arg0 = __arg0 } return } diff --git a/lib/cgo/util.iputil.iputil.go b/lib/cgo/util.iputil.iputil.go index f3906de38..5d51c8f7d 100644 --- a/lib/cgo/util.iputil.iputil.go +++ b/lib/cgo/util.iputil.iputil.go @@ -12,11 +12,11 @@ import iputil "github.com/skycoin/skycoin/src/util/iputil" import "C" //export SKY_iputil_LocalhostIP -func SKY_iputil_LocalhostIP(_arg0 *C.GoString_) (____error_code uint32) { +func SKY_iputil_LocalhostIP(_arg0 *string) (____error_code uint32) { __arg0, ____return_err := iputil.LocalhostIP() ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg0, _arg0) + *_arg0 = __arg0 } return } @@ -30,12 +30,12 @@ func SKY_iputil_IsLocalhost(_addr string, _arg1 *bool) (____error_code uint32) { } //export SKY_iputil_SplitAddr -func SKY_iputil_SplitAddr(_addr string, _arg1 *C.GoString_, _arg2 *uint16) (____error_code uint32) { +func SKY_iputil_SplitAddr(_addr string, _arg1 *string, _arg2 *uint16) (____error_code uint32) { addr := _addr __arg1, __arg2, ____return_err := iputil.SplitAddr(addr) ____error_code = libErrorCode(____return_err) if ____return_err == nil { - copyString(__arg1, _arg1) + *_arg1 = __arg1 *_arg2 = __arg2 } return diff --git a/lib/cgo/wallet.meta.go b/lib/cgo/wallet.meta.go index abe4ec21c..7dca73a95 100644 --- a/lib/cgo/wallet.meta.go +++ b/lib/cgo/wallet.meta.go @@ -22,49 +22,46 @@ func SKY_wallet_MetaWallet_IsEncrypted(_w C.MetaWallet__Handle, _arg0 *bool) (__ } //export SKY_wallet_MetaWallet_Label -func SKY_wallet_MetaWallet_Label(_w C.MetaWallet__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_wallet_MetaWallet_Label(_w C.MetaWallet__Handle, _arg0 *string) (____error_code uint32) { w, okw := lookupMetaWalletHandle(_w) if !okw { ____error_code = SKY_BAD_HANDLE return } - __arg0 := w.Label() - copyString(__arg0, _arg0) + *_arg0 = w.Label() return } //export SKY_wallet_MetaWallet_Filename -func SKY_wallet_MetaWallet_Filename(_w C.MetaWallet__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_wallet_MetaWallet_Filename(_w C.MetaWallet__Handle, _arg0 *string) (____error_code uint32) { w, okw := lookupMetaWalletHandle(_w) if !okw { ____error_code = SKY_BAD_HANDLE return } - __arg0 := w.Filename() - copyString(__arg0, _arg0) + *_arg0 = w.Filename() return } //export SKY_wallet_MetaWallet_Version -func SKY_wallet_MetaWallet_Version(_w C.MetaWallet__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_wallet_MetaWallet_Version(_w C.MetaWallet__Handle, _arg0 *string) (____error_code uint32) { w, okw := lookupMetaWalletHandle(_w) if !okw { ____error_code = SKY_BAD_HANDLE return } - __arg0 := w.Version() - copyString(__arg0, _arg0) + *_arg0 = w.Version() + return } //export SKY_wallet_MetaWallet_Type -func SKY_wallet_MetaWallet_Type(_w C.MetaWallet__Handle, _arg0 *C.GoString_) (____error_code uint32) { +func SKY_wallet_MetaWallet_Type(_w C.MetaWallet__Handle, _arg0 *string) (____error_code uint32) { w, okw := lookupMetaWalletHandle(_w) if !okw { ____error_code = SKY_BAD_HANDLE return } - __arg0 := w.Type() - copyString(__arg0, _arg0) + *_arg0 = w.Type() return -} \ No newline at end of file +}