mirror of
https://github.com/ruby/ruby.git
synced 2025-08-23 21:14:23 +02:00

This is a C API for extensions to resolve and get function symbols of other extensions. Extensions can check the expected symbol is correctly loaded and accessible, and use it if it is available. Otherwise, extensions can raise their own error to guide users to setup their environments correctly and what's missing.
15 lines
291 B
C
15 lines
291 B
C
#include <ruby.h>
|
|
#include "stringify_target.h"
|
|
|
|
VALUE
|
|
stt_any_method(VALUE klass)
|
|
{
|
|
return rb_str_new_cstr("from target");
|
|
}
|
|
|
|
void
|
|
Init_stringify_target(void)
|
|
{
|
|
VALUE mod = rb_define_module("StringifyTarget");
|
|
rb_define_singleton_method(mod, "any_method", stt_any_method, 0);
|
|
}
|