Skip to content

Commit

Permalink
[cgo] refs fibercrypto#5 Added util.util
Browse files Browse the repository at this point in the history
  • Loading branch information
Maykel Arias Torres committed Feb 4, 2020
1 parent 0d89afd commit 0555508
Showing 1 changed file with 46 additions and 36 deletions.
82 changes: 46 additions & 36 deletions lib/cgo/util.util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package main

import "github.com/fibercrypto/fibercryptowallet/src/util"
import (
"unsafe"

util "github.com/fibercrypto/fibercryptowallet/src/util"
)

/*
Expand All @@ -12,62 +16,68 @@ import "github.com/fibercrypto/fibercryptowallet/src/util"
import "C"

//export FC_util_Min
func FC_util_Min(_arg0 int, _arg1 int, _arg2 *int) (____error_code uint32) {
arg2 := util.Min(_arg0, _arg1)
*_arg2 = arg2
func FC_util_Min(_a, _b int, _arg1 *int) (____error_code uint32) {
a := _a
b := _b
__arg1 := util.Min(a, b)
*_arg1 = __arg1
return
}

//export FC_util_GetCoinValue
func FC_util_GetCoinValue(_arg0 string, _arg1 string, _arg2 *uint64) (____error_code uint32) {
arg0 := _arg0
arg1 := _arg1

arg2, err := util.GetCoinValue(arg0, arg1)
____error_code = libErrorCode(err)
if err == nil {
*_arg2 = arg2
return
func FC_util_GetCoinValue(_value string, _ticker string, _arg2 *uint64) (____error_code uint32) {
value := _value
ticker := _ticker
__arg2, ____return_err := util.GetCoinValue(value, ticker)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
*_arg2 = __arg2
}
return
}

//export FC_util_FormatUint64
func FC_util_FormatUint64(_arg0 uint64, _arg1 *C.GoString_) (____error_code uint32) {
arg0 := uint64(_arg0)
arg1 := util.FormatUint64(arg0)
copyString(arg1, _arg1)
func FC_util_FormatUint64(_n uint64, _arg1 *C.GoString_) (____error_code uint32) {
n := _n
__arg1 := util.FormatUint64(n)
copyString(__arg1, _arg1)
return
}

//export FC_util_FormatCoins
func FC_util_FormatCoins(_arg0 uint64, _arg1 uint64, _arg2 *C.GoString_) (____error_code uint32) {
arg0 := uint64(_arg0)
arg1 := uint64(_arg1)
arg2 := util.FormatCoins(arg0, arg1)
copyString(arg2, _arg2)
func FC_util_FormatCoins(_n uint64, _quotient uint64, _arg2 *C.GoString_) (____error_code uint32) {
n := _n
quotient := _quotient
__arg2 := util.FormatCoins(n, quotient)
copyString(__arg2, _arg2)
return
}

//export FC_util_RemoveZeros
func FC_util_RemoveZeros(_arg0 string, _arg1 *C.GoString_) (____error_code uint32) {
arg0 := string(_arg0)
arg1 := util.RemoveZeros(arg0)
copyString(arg1, _arg1)
func FC_util_RemoveZeros(_s string, _arg1 *C.GoString_) (____error_code uint32) {
s := _s
__arg1 := util.RemoveZeros(s)
copyString(__arg1, _arg1)
return
}

//export FC_util_StringInList
func FC_util_StringInList(_arg0 string, _arg1 C.Strings__Handle, _arg2 *bool) (____error_code uint32) {
arg0 := string(_arg0)
arg1, ok := lookupStringsHandle(_arg1)
if ok != true {
____error_code = FC_BAD_HANDLE
return
}

arg2 := util.StringInList(arg0, arg1)
*_arg2 = arg2
func FC_util_StringInList(_s string, _list []string, _arg2 *bool) (____error_code uint32) {
s := _s
list := *(*[]string)(unsafe.Pointer(&_list))
__arg2 := util.StringInList(s, list)
*_arg2 = __arg2
return
}

//export FC_util_AddressFromString
func FC_util_AddressFromString(_addrs, _coinTicket string, _arg1 *C.core__Address) (____error_code uint32) {
addrs := _addrs
coinTicket := _coinTicket
__arg1, ____return_err := util.AddressFromString(addrs, coinTicket)
____error_code = libErrorCode(____return_err)
if ____return_err == nil {
*_arg1 = *(*C.core__Address)(unsafe.Pointer(&__arg1))
}
return
}

0 comments on commit 0555508

Please sign in to comment.