SPVM::D...::Field(3)

πŸ“¦ version 0.990125, in alpine 3.24

πŸ’… SPVM::Document::NativeAPI::Field

okay so the manual name is SPVM::Document::NativeAPI::Field and honestly? it's giving "the field native API cheat sheet" and I'm obsessed. πŸŽ€ this is the SPVM::D...::Field(3) page, bestie, so buckle up.


✨ Name ✨

SPVM::Document::NativeAPI::Field β€” Field Native APIs πŸ’–


🌸 Description 🌸

The field native APIs in SPVM are, literally, the APIs you use to get definition information for fields. that's it, that's the vibe. πŸ¦‹


🧚 Usage 🧚

here's what it looks like in the wild, no cap:

  SPVM_API_FIELD* api_field = env->api->field;

  void* basic_type = env->get_basic_type(env, stack, "Foo");

  void* field = env->api->basic_type->get_field_by_name(env->runtime, basic_type, "value");

  const char* field_name = api_field->get_name(env->runtime, field);

like… look at her go. main character energy fr fr. πŸ‘‘


πŸ’… Native APIs πŸ’…

okay this is the good part. every single one of these takes a void* runtime and a void* field, and they all return something with a very specific type. do not mix them up. πŸ™ˆ

⭐ get_name

const char* (*get_name)(void* runtime, void* field);

Returns the name of the field field. yup. just the name. she's simple like that. πŸŽ€

⭐ get_index

int32_t (*get_index)(void* runtime, void* field);

Returns the index of the field field. πŸ”’

⭐ get_offset

int32_t (*get_offset)(void* runtime, void* field);

Returns the byte offset of the field field. and like, quick PSA β€” the byte offset is the position in bytes where the field is allocated in its belonging class. that's the whole definition, so don't come for me. πŸ’€

⭐ get_basic_type

void* (*get_basic_type)(void* runtime, void* field);

Returns the basic type of the field field. πŸ¦‹

⭐ get_type_dimension

int32_t (*get_type_dimension)(void* runtime, void* field);

Returns the type dimension of the field field. like how many layers of array vibe it's got. ✨

⭐ get_type_flag

int32_t (*get_type_flag)(void* runtime, void* field);

Returns the type flag ID of the field field. 🚩

⭐ get_current_basic_type

void* (*get_current_basic_type)(void* runtime, void* field);

Returns the basic type that owns the field field. she's the one holding the leash. πŸ‘‘

⭐ get_exists_offset

int32_t (*get_exists_offset)(void* runtime, void* field);

Returns the byte offset of the exists flag of the field field. πŸ“

⭐ get_exists_bit

int32_t (*get_exists_bit)(void* runtime, void* field);

Return the bit shift of the exists flag of the field field. (yes, singular "return", that's how the page says it, I'm just the messenger 😭)


πŸ”₯ Native API IDs πŸ”₯

like the group chat roster β€” here's who's who, index by index:

  • 0 β€” get_name
  • 1 β€” get_index
  • 2 β€” get_offset
  • 3 β€” get_basic_type
  • 4 β€” get_type_dimension
  • 5 β€” get_type_flag
  • 6 β€” get_current_basic_type
  • 7 β€” get_exists_offset
  • 8 β€” get_exists_bit

πŸ¦‹ See Also πŸ¦‹

  • SPVM::Document::NativeAPI
  • SPVM::Document::NativeClass
  • SPVM::Document

go read them. all of them. iykyk. πŸ’œ


Copyright (c) 2023 Yuki Kimoto

MIT License 🌈


okay bestie that's the whole page, go forth and get those field definitions πŸ’–

mwah πŸ’‹ β€” this was perl v5.42.2, dated 2026-02-03, signing off from the SPVM::D...::Field(3) page. periodt. ✨

πŸ“¦ where this page comes from