go: Add bindings for has_capability()

This commit is contained in:
Paweł Bylica 2018-09-08 23:07:25 +02:00
parent 6eb118c354
commit 180b191965
No known key found for this signature in database
GPG Key ID: 7A0C037434FE77EF
1 changed files with 11 additions and 0 deletions

View File

@ -185,6 +185,17 @@ func (instance *Instance) Version() string {
return C.GoString(instance.handle.version)
}
type Capability uint32
const (
CapabilityEVM1 Capability = C.EVMC_CAPABILITY_EVM1
CapabilityEWASM Capability = C.EVMC_CAPABILITY_EWASM
)
func (instance *Instance) HasCapability(capability Capability) bool {
return bool(C.evmc_vm_has_capability(instance.handle, uint32(capability)))
}
func (instance *Instance) SetOption(name string, value string) (err error) {
r := C.set_option(instance.handle, C.CString(name), C.CString(value))