Ruby: include/ruby/internal/method.h Source File

Ruby 3.4.7p58 (2025-10-08 revision 7a5688e2a27668e48f8d6ff4af5b2208b98a2f5e)

method.h
Go to the documentation of this file.
1#ifndef RBIMPL_METHOD_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_METHOD_H
23#include "ruby/internal/attr/nonnull.h"
24#include "ruby/internal/dllexport.h"
25#include "ruby/internal/value.h"
26#include "ruby/backward/2/stdarg.h"
27
85
86 RBIMPL_SYMBOL_EXPORT_BEGIN()
87
88 RBIMPL_ATTR_NONNULL(())
99void rb_define_method(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
100
101 RBIMPL_ATTR_NONNULL(())
112void rb_define_module_function(VALUE klass, const char *mid, VALUE (*func)(ANYARGS), int arity);
113
114 RBIMPL_ATTR_NONNULL(())
124void rb_define_global_function(const char *mid, VALUE (*func)(ANYARGS), int arity);
125
126 RBIMPL_ATTR_NONNULL(())
164void rb_undef_method(VALUE klass, const char *name);
165
166 RBIMPL_ATTR_NONNULL(())
185void rb_define_alias(VALUE klass, const char *dst, const char *src);
186
187 RBIMPL_ATTR_NONNULL(())
199void rb_define_attr(VALUE klass, const char *name, int read, int write);
200
202
203 RBIMPL_SYMBOL_EXPORT_END()
204
205#endif /* RBIMPL_METHOD_H */
rb_define_method
#define rb_define_method(klass, mid, func, arity)
Defines klass#mid.
Definition cxxanyargs.hpp:670
rb_define_module_function
#define rb_define_module_function(klass, mid, func, arity)
Defines klass#mid and makes it a module function.
Definition cxxanyargs.hpp:689
rb_define_global_function
#define rb_define_global_function(mid, func, arity)
Defines rb_mKernel #mid.
Definition cxxanyargs.hpp:695
dllexport.h
Tweaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition dllexport.h:74
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:65
rb_define_alias
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
Definition class.c:2350
rb_define_attr
void rb_define_attr(VALUE klass, const char *name, int read, int write)
Defines public accessor method(s) for an attribute.
Definition class.c:2356
rb_undef_method
void rb_undef_method(VALUE klass, const char *name)
Defines an undef of a method.
Definition class.c:2171
nonnull.h
Defines RBIMPL_ATTR_NONNULL.
RBIMPL_ATTR_NONNULL
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition nonnull.h:30
stdarg.h
Defines old _.
ANYARGS
#define ANYARGS
Functions declared using this macro take arbitrary arguments, including void.
Definition stdarg.h:64
value.h
Defines VALUE and ID.
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40