helpers.h File Reference
#include <evmc/evmc.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.


union  evmc_result_optional_storage
 The union representing evmc_result "optional storage". More...


static bool evmc_is_abi_compatible (struct evmc_vm *vm)
 Returns true if the VM has a compatible ABI version.
static const char * evmc_vm_name (struct evmc_vm *vm)
 Returns the name of the VM.
static const char * evmc_vm_version (struct evmc_vm *vm)
 Returns the version of the VM.
static bool evmc_vm_has_capability (struct evmc_vm *vm, enum evmc_capabilities capability)
 Checks if the VM has the given capability.
static void evmc_destroy (struct evmc_vm *vm)
 Destroys the VM instance.
static enum evmc_set_option_result evmc_set_option (struct evmc_vm *vm, char const *name, char const *value)
 Sets the option for the VM, if the feature is supported by the VM.
static struct evmc_result evmc_execute (struct evmc_vm *vm, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, uint8_t const *code, size_t code_size)
 Executes code in the VM instance.
static void evmc_free_result_memory (const struct evmc_result *result)
 The evmc_result release function using free() for releasing the memory.
static struct evmc_result evmc_make_result (enum evmc_status_code status_code, int64_t gas_left, int64_t gas_refund, const uint8_t *output_data, size_t output_size)
 Creates the result from the provided arguments.
static void evmc_release_result (struct evmc_result *result)
 Releases the resources allocated to the execution result.
static union evmc_result_optional_storageevmc_get_optional_storage (struct evmc_result *result)
 Provides read-write access to evmc_result "optional storage".
static const union evmc_result_optional_storageevmc_get_const_optional_storage (const struct evmc_result *result)
 Provides read-only access to evmc_result "optional storage".
static const char * evmc_status_code_to_string (enum evmc_status_code status_code)
 Returns text representation of the evmc_status_code.
static const char * evmc_revision_to_string (enum evmc_revision rev)
 Returns the name of the evmc_revision.

Detailed Description

EVMC Helpers.

A collection of C helper functions for invoking a VM instance methods. These are convenient for languages where invoking function pointers is "ugly" or impossible (such as Go).

Definition in file helpers.h.