SPVM::Document::NativeAPI::Runtime - Runtime Native APIs
The runtime native APIs of SPVM are the APIs for SPVM runtimes.
SPVM_API_RUNTIME* api_runtime = env->api->runtime; int32_t basic_types_length = api_runtime->get_basic_types_length(env->runtime);
int32_t (*get_object_data_offset)(void* runtime);
Returns the offset of data area in the native data structure SPVM_OBJECT.
SPVM_OBJECT
Elements in an array or fields or a pointer in a pointer class is stored into the data area.
int32_t (*get_object_ref_count_offset)(void* runtime);
Returns the offset of the ref_count field in the native data structure SPVM_OBJECT.
ref_count
int32_t (*get_object_length_offset)(void* runtime);
Returns the offset of the length field in the native data structure SPVM_OBJECT.
length
void* (*get_basic_type_by_id)(void* runtime, int32_t basic_type_id);
Searches a basic type given the basic type ID basic_type_id.
If it is found, returns it. Otherwise, returns NULL.
NULL
void* (*get_basic_type_by_name)(void* runtime, const char* basic_type_name);
Searches a basic type given the basic type name basic_type_name.
int32_t (*get_basic_types_length)(void* runtime);
Returns the length of the basic types owned by the SPVM runtime runtime.
void (*build_precompile_class_source)(void* runtime, void* string_buffer, void* basic_type);
Creates a C source code for methods with the precompile attribute defined in the class given by the its basic type basic_type, and saves it to the string buffer string_buffer.
precompile
void (*build_precompile_method_source)(void* runtime, void* string_buffer, void* method);
Creates a C source code for the method method, and saves it to the string buffer string_buffer.
void* (*get_compiler)(void* runtime);
Returns the value of the compiler field. The compiler that build the runtime runtime is stored to this field.
compiler
void (*set_compiler)(void* runtime, void* compiler);
Sets compiler to the compiler field.
FILE* (*get_spvm_stdin)(void* runtime);
Returns SPVM's standard input.
FILE* (*get_spvm_stdout)(void* runtime);
Returns SPVM's standard output.
FILE* (*get_spvm_stderr)(void* runtime);
Returns SPVM's standard error.
0 get_object_data_offset 1 get_object_ref_count_offset 2 get_object_length_offset 3 get_basic_type_by_id 4 get_basic_type_by_name 5 get_basic_types_length 6 build_precompile_class_source 7 build_precompile_method_source 8 get_compiler 9 set_compiler 10 get_spvm_stdin 11 get_spvm_stdout 12 get_spvm_stderr
SPVM::Document::NativeAPI
SPVM::Document::NativeAPI::BasicType
SPVM::Document::NativeAPI::Method
SPVM::Document::NativeAPI::StringBuffer
SPVM::Document::NativeAPI::Compiler
SPVM::Document::NativeClass
SPVM::Document
Copyright (c) 2023 Yuki Kimoto
MIT License
To install SPVM, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SPVM
CPAN shell
perl -MCPAN -e shell install SPVM
For more information on module installation, please visit the detailed CPAN module installation guide.