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

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

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
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
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:106
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition dllexport.h:97
rb_define_alias
void rb_define_alias(VALUE klass, const char *name1, const char *name2)
Defines an alias of a method.
Definition class.c:2289
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:2295
rb_undef_method
void rb_undef_method(VALUE klass, const char *name)
Defines an undef of a method.
Definition class.c:2113
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