EVMC
|
Example implementation of the EVMC VM interface. More...
#include "example_vm.h"
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Go to the source code of this file.
Classes | |
struct | example_vm |
The example VM instance struct extending the evmc_vm. More... | |
Functions | |
static void | destroy (struct evmc_vm *vm) |
The implementation of the evmc_vm::destroy() method. | |
static evmc_capabilities_flagset | get_capabilities (struct evmc_vm *vm) |
The example implementation of the evmc_vm::get_capabilities() method. | |
static enum evmc_set_option_result | set_option (struct evmc_vm *instance, const char *name, const char *value) |
Example VM options. More... | |
static void | free_result_output_data (const struct evmc_result *result) |
The implementation of the evmc_result::release() method that frees the output buffer attached to the result object. More... | |
static struct evmc_result | execute (struct evmc_vm *instance, const struct evmc_host_interface *host, struct evmc_host_context *context, enum evmc_revision rev, const struct evmc_message *msg, const uint8_t *code, size_t code_size) |
The example implementation of the evmc_vm::execute() method. | |
struct evmc_vm * | evmc_create_example_vm () |
Example of a function creating an instance of an example EVM implementation. More... | |
Example implementation of the EVMC VM interface.
This VM does not do anything useful except for showing how EVMC VM API should be implemented. The implementation is done in C only, but could be done in C++ in very similar way.
Definition in file example_vm.c.
|
static |
The implementation of the evmc_result::release() method that frees the output buffer attached to the result object.
Definition at line 71 of file example_vm.c.
|
static |
Example VM options.
The implementation of the evmc_vm::set_option() method. VMs are allowed to omit this method implementation.
Definition at line 46 of file example_vm.c.