SPVM::Document::NativeAPI::Runtime - Runtime Native APIs
The runtime native APIs of SPVM are the APIs to manipulate information of runtime.
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 the data of the SPVM_OBJECT type.
SPVM_OBJECT
The runtime argument is a runtime object.
runtime
int32_t (*get_object_ref_count_offset)(void* runtime);
Returns the offset of the ref_count member variable of the SPVM_OBJECT type.
ref_count
int32_t (*get_object_length_offset)(void* runtime);
Returns the offset of the length member variable of the SPVM_OBJECT type.
length
void* (*get_basic_type_by_id)(void* runtime, int32_t basic_type_id);
Gets a basic type object by a basic type ID and returns it.
void* (*get_basic_type_by_name)(void* runtime, const char* basic_type_name);
Gets a basic type object by a basic type name and returns it.
int32_t (*get_basic_types_length)(void* runtime);
Gets the length of the basic types.
void (*build_precompile_class_source)(void* runtime, void* string_buffer, void* module_basic_type);
Builds the C source code of a precompiled module, and saves it to the string buffer.
The string_buffer argument is a string buffer object.
string_buffer
The module_basic_type argument is a basic type object.
module_basic_type
void (*build_precompile_method_source)(void* runtime, void* string_buffer, void* method);
Builds the C source code of a precompiled method, and saves it to the string buffer.
The method argument is a method object.
method
void* (*get_compiler)(void* runtime);
void (*set_compiler)(void* runtime, void* compiler);
FILE* (*get_spvm_stdin)(void* runtime);
FILE* (*get_spvm_stdout)(void* runtime);
FILE* (*get_spvm_stderr)(void* runtime);
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
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.