The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Name

SPVM::Document::NativeAPI::BasicType - Basic Type Native APIs

Description

The basic type native APIs are the APIs to manipulate information of basic types.

Usage

  SPVM_API_BASIC_TYPE* api_basic_type = env->api->basic_type;
  
  const char* basic_type_name = api_basic_type->get_name(runtime, basic_type);

The class_var is got by the get_basic_type_by_id and the get_basic_type_by_name runtime native API.

Native APIs

get_name

  const void* (*get_name)(void* runtime, void* basic_type);

Returns the name of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_id

  int32_t (*get_id)(void* runtime, void* basic_type);

Returns the ID of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_category

  int32_t (*get_category)(void* runtime, void* basic_type);

Returns the category of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_parent

  void* (*get_parent)(void* runtime, void* basic_type);

Returns the parent basic type object of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_version_string

  const void* (*get_version_string)(void* runtime, void* basic_type);

Returns the version string of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_class_dir

  const void* (*get_class_dir)(void* runtime, void* basic_type);

Returns the module directory of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_class_rel_file

  const void* (*get_class_rel_file)(void* runtime, void* basic_type);

Returns the module relative file of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

is_pointer

  int32_t (*is_pointer)(void* runtime, void* basic_type);

If the basic type is a pointer class, returns 1. Otherwise returns 0.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

is_anon

  int32_t (*is_anon)(void* runtime, void* basic_type);

If the basic type is an anon class, returns 1. Otherwise returns 0.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_class_var_by_index

  void* (*get_class_var_by_index)(void* runtime, void* basic_type, int32_t class_var_index);

Gets a class variable by a class variable index, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_class_var_by_name

  void* (*get_class_var_by_name)(void* runtime, void* basic_type, const void* class_var_name);

Gets a class variable by a class variable name, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_class_vars_length

  int32_t (*get_class_vars_length)(void* runtime, void* basic_type);

Returns the length of the class variables of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_field_by_index

  void* (*get_field_by_index)(void* runtime, void* basic_type, int32_t field_index);

Gets a field by a field index, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_field_by_name

  void* (*get_field_by_name)(void* runtime, void* basic_type, const void* field_name);

Gets a field by a field name, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_fields_length

  int32_t (*get_fields_length)(void* runtime, void* basic_type);

Returns the length of the fields of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_method_by_index

  void* (*get_method_by_index)(void* runtime, void* basic_type, int32_t method_index);

Gets a method by a method index, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_method_by_name

  void* (*get_method_by_name)(void* runtime, void* basic_type, const void* method_name);

Gets a method by a method name, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_methods_length

  int32_t (*get_methods_length)(void* runtime, void* basic_type);

Returns the length of the methods of the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_anon_basic_type_by_index

  void* (*get_anon_basic_type_by_index)(void* runtime, void* basic_type, int32_t anon_basic_type_index);

Gets a anon basic type used by the basic type by an anon basic type index, and returns it.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

get_anon_basic_types_length

    int32_t (*get_anon_basic_types_length)(void* runtime, void* basic_type);

Returns the length of the anon basic types used by the basic type.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

has_interface

  int32_t (*has_interface)(void* runtime, void* basic_type, void* interface_basic_type);

If a basic type basic_type has an interface interface_basic_type, returns 1. Otherwise returns 0.

The runtime argument is a runtime object.

The basic_type argument is a basic type object.

The interface_basic_type argument is a basic type object.

is_super_class

  int32_t (*is_super_class)(void* runtime, void* super_basic_type, void* child_basic_type);

If a basic type super_basic_type is a super class of a basic type child_basic_type, returns 1. Otherwise returns 0.

The runtime argument is a runtime object.

The super_basic_type argument is a basic type object.

The child_basic_type argument is a basic type object.

Native API IDs

  0 get_name
  1 get_index
  2 get_return_basic_type
  3 get_return_type_dimension
  4 get_return_type_flag
  5 get_arg_by_index
  6 get_args_length
  7 get_required_args_length
  8 get_current_basic_type
  9 get_opcodes
  10 get_opcodes_length
  11 is_class_method
  12 is_anon
  13 is_native
  14 is_precompile
  15 is_enum
  16 get_byte_vars_width
  17 get_short_vars_width
  18 get_int_vars_width
  19 get_long_vars_width
  20 get_float_vars_width
  21 get_double_vars_width
  22 get_object_vars_width
  23 get_ref_vars_width
  24 get_mortal_stack_length
  25 has_interface
  26 is_super_class

Copyright & License

Copyright (c) 2023 Yuki Kimoto

MIT License