Ruby: internal/symbol.h Source File

Ruby 3.3.6p108 (2024-11-05 revision 75015d4c1f6965b5e85e96fb309f1f2129f933c0)

symbol.h
1#ifndef INTERNAL_SYMBOL_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_SYMBOL_H
11#include "ruby/ruby.h" /* for VALUE */
12#include "ruby/encoding.h" /* for rb_encoding */
13#include "internal/compilers.h" /* for __has_builtin */
14
15#ifdef rb_sym_intern_ascii_cstr
16# undef rb_sym_intern_ascii_cstr
17#endif
18
19/* symbol.c */
20 VALUE rb_to_symbol_type(VALUE obj);
21 VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
22 VALUE rb_sym_intern_ascii(const char *ptr, long len);
23 VALUE rb_sym_intern_ascii_cstr(const char *ptr);
24int rb_is_const_name(VALUE name);
25int rb_is_class_name(VALUE name);
26int rb_is_instance_name(VALUE name);
27int rb_is_local_name(VALUE name);
28PUREFUNC(int rb_is_const_sym(VALUE sym));
29PUREFUNC(int rb_is_attrset_sym(VALUE sym));
30 ID rb_make_internal_id(void);
31 ID rb_make_temporary_id(size_t n);
32void rb_gc_free_dsymbol(VALUE);
33int rb_static_id_valid_p(ID id);
34
35/* vm.c */
36void rb_free_static_symid_str(void);
37
38#if __has_builtin(__builtin_constant_p)
39#define rb_sym_intern_ascii_cstr(ptr) \
40 (__builtin_constant_p(ptr) ? \
41 rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
42 rb_sym_intern_ascii_cstr(ptr))
43#endif
44
45#endif /* INTERNAL_SYMBOL_H */
encoding.h
Encoding relates APIs.
len
int len
Length of the buffer.
Definition io.h:8
ruby.h
OnigEncodingTypeST
Definition onigmo.h:160
ID
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40