diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-06-12 11:15:19 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-07-13 17:55:55 +0900 |
commit | 9c1fe9064c56cef3bde856d7fa1f907195af1003 (patch) | |
tree | a703b38cdb661ea4c72eb8d17b19f6c1566a0195 /include/ruby/internal/intern | |
parent | d426343418aab6148706860bd1678ac309dc12c0 (diff) | |
download | ruby-9c1fe9064c56cef3bde856d7fa1f907195af1003.tar.gz |
[Feature #19757] Add new API `rb_data_define`
Diffstat (limited to 'include/ruby/internal/intern')
-rw-r--r-- | include/ruby/internal/intern/struct.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/ruby/internal/intern/struct.h b/include/ruby/internal/intern/struct.h index 144aea8ecc..4510508d77 100644 --- a/include/ruby/internal/intern/struct.h +++ b/include/ruby/internal/intern/struct.h @@ -198,6 +198,20 @@ RBIMPL_ATTR_NONNULL((2)) */ VALUE rb_struct_define_without_accessor_under(VALUE outer, const char *class_name, VALUE super, rb_alloc_func_t alloc, ...); +/** + * Defines an anonymous data class. + * + * @endinternal + * + * @param[in] super Superclass of the defining class. Must be a + * descendant of ::rb_cData, or 0 as ::rb_cData. + * @param[in] ... Arbitrary number of `const char*`, terminated by + * NULL. Each of which are the name of fields. + * @exception rb_eArgError Duplicated field name. + * @return The defined class. + */ +VALUE rb_data_define(VALUE super, ...); + RBIMPL_SYMBOL_EXPORT_END() #endif /* RBIMPL_INTERN_STRUCT_H */ |