Ruby: internal/symbol.h Source File

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

symbol.h
Go to the documentation of this file.
1#ifndef INTERNAL_SYMBOL_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_SYMBOL_H
12#include "ruby/ruby.h" /* for VALUE */
13#include "ruby/encoding.h" /* for rb_encoding */
14#include "internal/compilers.h" /* for __has_builtin */
15
16#ifdef rb_sym_intern_ascii_cstr
17# undef rb_sym_intern_ascii_cstr
18#endif
19
20/* symbol.c */
21 VALUE rb_to_symbol_type(VALUE obj);
22 VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc);
23 VALUE rb_sym_intern_ascii(const char *ptr, long len);
24 VALUE rb_sym_intern_ascii_cstr(const char *ptr);
25int rb_is_const_name(VALUE name);
26int rb_is_class_name(VALUE name);
27int rb_is_instance_name(VALUE name);
28int rb_is_local_name(VALUE name);
29 PUREFUNC(int rb_is_const_sym(VALUE sym));
30 PUREFUNC(int rb_is_attrset_sym(VALUE sym));
31 ID rb_make_internal_id(void);
32void rb_gc_free_dsymbol(VALUE);
33
34#if __has_builtin(__builtin_constant_p)
35#define rb_sym_intern_ascii_cstr(ptr) \
36 (__builtin_constant_p(ptr) ? \
37 rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
38 rb_sym_intern_ascii_cstr(ptr))
39#endif
40
41#endif /* INTERNAL_SYMBOL_H */
PUREFUNC
#define PUREFUNC(x)
Definition: attributes.h:54
compilers.h
Internal header absorbing C compipler differences.
ptr
struct RIMemo * ptr
Definition: debug.c:88
sym
#define sym(name)
Definition: enumerator.c:4007
len
uint8_t len
Definition: escape.c:17
encoding.h
rb_sym_intern
VALUE rb_sym_intern(const char *ptr, long len, rb_encoding *enc)
Definition: symbol.c:1191
rb_is_instance_name
int rb_is_instance_name(VALUE name)
Definition: symbol.c:1229
rb_sym_intern_ascii_cstr
#define rb_sym_intern_ascii_cstr(ptr)
Definition: symbol.h:35
rb_gc_free_dsymbol
void rb_gc_free_dsymbol(VALUE)
Definition: symbol.c:803
rb_to_symbol_type
VALUE rb_to_symbol_type(VALUE obj)
Definition: symbol.c:1211
rb_is_class_name
int rb_is_class_name(VALUE name)
Definition: symbol.c:1223
rb_make_internal_id
ID rb_make_internal_id(void)
Definition: symbol.c:953
rb_is_attrset_sym
int rb_is_attrset_sym(VALUE sym)
Definition: symbol.c:1052
rb_is_const_name
int rb_is_const_name(VALUE name)
Definition: symbol.c:1217
rb_is_const_sym
int rb_is_const_sym(VALUE sym)
Definition: symbol.c:1046
rb_sym_intern_ascii
VALUE rb_sym_intern_ascii(const char *ptr, long len)
Definition: symbol.c:1199
rb_is_local_name
int rb_is_local_name(VALUE name)
Definition: symbol.c:1235
name
const char * name
Definition: nkf.c:208
ruby.h
OnigEncodingTypeST
Definition: onigmo.h:160
VALUE
unsigned long VALUE
Definition: value.h:38
ID
unsigned long ID
Definition: value.h:39