Ruby: include/ruby/internal/intern/object.h Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

object.h
Go to the documentation of this file.
1#ifndef RBIMPL_INTERN_OBJECT_H /*-*-C++-*-vi:se ft=cpp:*/
2#define RBIMPL_INTERN_OBJECT_H
23#include "ruby/internal/attr/pure.h"
24#include "ruby/internal/dllexport.h"
25#include "ruby/internal/value.h"
26
27 RBIMPL_SYMBOL_EXPORT_BEGIN()
28
29#define RB_OBJ_INIT_COPY(obj, orig) \
30 ((obj) != (orig) && (rb_obj_init_copy((obj), (orig)), 1))
31#define OBJ_INIT_COPY(obj, orig) RB_OBJ_INIT_COPY(obj, orig)
32
33 VALUE rb_class_new_instance_pass_kw(int, const VALUE *, VALUE);
34 VALUE rb_class_new_instance(int, const VALUE*, VALUE);
35 VALUE rb_class_new_instance_kw(int, const VALUE*, VALUE, int);
36
37/* object.c */
38int rb_eql(VALUE, VALUE);
39 VALUE rb_any_to_s(VALUE);
40 VALUE rb_inspect(VALUE);
41 VALUE rb_obj_is_instance_of(VALUE, VALUE);
42 VALUE rb_obj_is_kind_of(VALUE, VALUE);
43 VALUE rb_obj_alloc(VALUE);
44 VALUE rb_obj_clone(VALUE);
45 VALUE rb_obj_dup(VALUE);
46 VALUE rb_obj_init_copy(VALUE,VALUE);
47 VALUE rb_obj_taint(VALUE);
48
49 RBIMPL_ATTR_PURE()
50 VALUE rb_obj_tainted(VALUE);
51 VALUE rb_obj_untaint(VALUE);
52 VALUE rb_obj_untrust(VALUE);
53
54 RBIMPL_ATTR_PURE()
55 VALUE rb_obj_untrusted(VALUE);
56 VALUE rb_obj_trust(VALUE);
57 VALUE rb_obj_freeze(VALUE);
58
59 RBIMPL_ATTR_PURE()
60 VALUE rb_obj_frozen_p(VALUE);
61
62 VALUE rb_obj_id(VALUE);
63 VALUE rb_memory_id(VALUE);
64 VALUE rb_obj_class(VALUE);
65
66 RBIMPL_ATTR_PURE()
67 VALUE rb_class_real(VALUE);
68
69 RBIMPL_ATTR_PURE()
70 VALUE rb_class_inherited_p(VALUE, VALUE);
71 VALUE rb_class_superclass(VALUE);
72 VALUE rb_class_get_superclass(VALUE);
73 VALUE rb_convert_type(VALUE,int,const char*,const char*);
74 VALUE rb_check_convert_type(VALUE,int,const char*,const char*);
75 VALUE rb_check_to_integer(VALUE, const char *);
76 VALUE rb_check_to_float(VALUE);
77 VALUE rb_to_int(VALUE);
78 VALUE rb_check_to_int(VALUE);
79 VALUE rb_Integer(VALUE);
80 VALUE rb_to_float(VALUE);
81 VALUE rb_Float(VALUE);
82 VALUE rb_String(VALUE);
83 VALUE rb_Array(VALUE);
84 VALUE rb_Hash(VALUE);
85double rb_cstr_to_dbl(const char*, int);
86double rb_str_to_dbl(VALUE, int);
87
88 RBIMPL_SYMBOL_EXPORT_END()
89
90#endif /* RBIMPL_INTERN_OBJECT_H */
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
rb_class_superclass
VALUE rb_class_superclass(VALUE)
Returns the superclass of klass.
Definition: object.c:1974
rb_obj_taint
VALUE rb_obj_taint(VALUE)
call-seq: obj.taint -> obj
Definition: object.c:1020
rb_obj_trust
VALUE rb_obj_trust(VALUE)
call-seq: obj.trust -> obj
Definition: object.c:1078
rb_class_get_superclass
VALUE rb_class_get_superclass(VALUE)
Returns the superclass of klass The return value might be an iclass of a module, unlike rb_class_supe...
Definition: object.c:1999
rb_convert_type
VALUE rb_convert_type(VALUE, int, const char *, const char *)
Converts an object into another type.
Definition: object.c:2930
rb_Float
VALUE rb_Float(VALUE)
Equivalent to Kernel#Float in Ruby.
Definition: object.c:3531
rb_check_to_int
VALUE rb_check_to_int(VALUE)
Tries to convert val into Integer.
Definition: object.c:3066
rb_check_convert_type
VALUE rb_check_convert_type(VALUE, int, const char *, const char *)
Tries to convert an object into another type.
Definition: object.c:2971
rb_any_to_s
VALUE rb_any_to_s(VALUE)
Default implementation of #to_s.
Definition: object.c:561
rb_obj_alloc
VALUE rb_obj_alloc(VALUE)
Allocates an instance of klass.
Definition: object.c:1900
rb_class_new_instance
VALUE rb_class_new_instance(int, const VALUE *, VALUE)
Allocates and initializes an instance of klass.
Definition: object.c:1953
rb_class_new_instance_kw
VALUE rb_class_new_instance_kw(int, const VALUE *, VALUE, int)
Definition: object.c:1929
rb_class_new_instance_pass_kw
VALUE rb_class_new_instance_pass_kw(int, const VALUE *, VALUE)
Definition: object.c:1918
rb_check_to_float
VALUE rb_check_to_float(VALUE)
Tries to convert an object into Float.
Definition: object.c:3576
rb_Hash
VALUE rb_Hash(VALUE)
Equivalent to Kernel#Hash in Ruby.
Definition: object.c:3748
rb_obj_frozen_p
VALUE rb_obj_frozen_p(VALUE)
Definition: object.c:1113
rb_obj_init_copy
VALUE rb_obj_init_copy(VALUE, VALUE)
Default implementation of #initialize_copy.
Definition: object.c:516
rb_eql
int rb_eql(VALUE, VALUE)
Determines if obj1 and obj2 are equal in terms of Object::eql?.
Definition: object.c:180
rb_str_to_dbl
double rb_str_to_dbl(VALUE, int)
Parses a string representation of a floating point number.
Definition: object.c:3409
rb_Integer
VALUE rb_Integer(VALUE)
Equivalent to Kernel#Integer in Ruby.
Definition: object.c:3138
rb_Array
VALUE rb_Array(VALUE)
Equivalent to Kernel#Array in Ruby.
Definition: object.c:3705
rb_obj_class
VALUE rb_obj_class(VALUE)
Definition: object.c:245
rb_obj_dup
VALUE rb_obj_dup(VALUE)
Equivalent to Object#dup in Ruby.
Definition: object.c:467
rb_inspect
VALUE rb_inspect(VALUE)
Convenient wrapper of Object::inspect.
Definition: object.c:585
rb_obj_untrust
VALUE rb_obj_untrust(VALUE)
call-seq: obj.untrust -> obj
Definition: object.c:1063
rb_class_inherited_p
VALUE rb_class_inherited_p(VALUE, VALUE)
Determines if mod inherits arg.
Definition: object.c:1578
rb_obj_is_instance_of
VALUE rb_obj_is_instance_of(VALUE, VALUE)
Determines if obj is an instance of c.
Definition: object.c:707
rb_class_real
VALUE rb_class_real(VALUE)
Looks up the nearest ancestor of cl, skipping singleton classes or module inclusions.
Definition: object.c:235
rb_to_float
VALUE rb_to_float(VALUE)
Converts a Numeric object into Float.
Definition: object.c:3559
rb_obj_clone
VALUE rb_obj_clone(VALUE)
Almost same as Object::clone.
Definition: object.c:457
rb_obj_is_kind_of
VALUE rb_obj_is_kind_of(VALUE, VALUE)
Determines if obj is a kind of c.
Definition: object.c:724
rb_cstr_to_dbl
double rb_cstr_to_dbl(const char *, int)
Parses a string representation of a floating point number.
Definition: object.c:3357
rb_obj_freeze
VALUE rb_obj_freeze(VALUE)
Make the object unmodifiable.
Definition: object.c:1101
rb_check_to_integer
VALUE rb_check_to_integer(VALUE, const char *)
Tries to convert val into Integer.
Definition: object.c:3029
rb_obj_untrusted
VALUE rb_obj_untrusted(VALUE)
call-seq: obj.untrusted? -> false
Definition: object.c:1049
rb_String
VALUE rb_String(VALUE)
Equivalent to Kernel#String in Ruby.
Definition: object.c:3673
rb_obj_untaint
VALUE rb_obj_untaint(VALUE)
call-seq: obj.untaint -> obj
Definition: object.c:1035
rb_obj_tainted
VALUE rb_obj_tainted(VALUE)
call-seq: obj.tainted? -> false
Definition: object.c:1006
rb_to_int
VALUE rb_to_int(VALUE)
Converts val into Integer.
Definition: object.c:3051
rb_memory_id
VALUE rb_memory_id(VALUE)
Definition: gc.c:4077
rb_obj_id
VALUE rb_obj_id(VALUE)
Definition: gc.c:4110
pure.h
Defines RBIMPL_ATTR_PURE.
RBIMPL_ATTR_PURE
#define RBIMPL_ATTR_PURE()
Wraps (or simulates) __attribute__((pure))
Definition: pure.h:33
const
#define const
Definition: strftime.c:108
value.h
Defines VALUE and ID.
VALUE
unsigned long VALUE
Definition: value.h:38