Ruby: internal/symbol.h File Reference

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

Macros | Functions
symbol.h File Reference

Internal header for Symbol. More...

`#include "ruby/ruby.h"`
`#include "ruby/encoding.h"`
`#include "internal/compilers.h"`

Go to the source code of this file.

## Macros
#define | rb_sym_intern_ascii_cstr(ptr)

## Functions
VALUE | rb_to_symbol_type (VALUE obj)
VALUE | rb_sym_intern (const char *ptr, long len, rb_encoding *enc)
VALUE | rb_sym_intern_ascii (const char *ptr, long len)
VALUE | rb_sym_intern_ascii_cstr (const char *ptr)
int | rb_is_const_name (VALUE name)
int | rb_is_class_name (VALUE name)
int | rb_is_instance_name (VALUE name)
int | rb_is_local_name (VALUE name)
int | rb_is_const_sym (VALUE sym)
int | rb_is_attrset_sym (VALUE sym)
ID | rb_make_internal_id (void)
void | rb_gc_free_dsymbol (VALUE)

## Detailed Description

Internal header for Symbol.

Author
  Ruby developers ruby-.nosp@m.core.nosp@m.@ruby.nosp@m.-lan.nosp@m.g.org

Copyright
  This file is a part of the programming language Ruby. Permission is hereby granted, to either redistribute and/or modify this file, provided that the conditions mentioned in the file COPYING are met. Consult the file for details.

Definition in file symbol.h.

## Macro Definition Documentation

## ◆ rb_sym_intern_ascii_cstr

#define rb_sym_intern_ascii_cstr | ( |  | ptr | ) |

Value:
(__builtin_constant_p(ptr) ? \
rb_sym_intern_ascii((ptr), (long)strlen(ptr)) : \
rb_sym_intern_ascii_cstr(ptr))
ptr
struct RIMemo * ptr
Definition: debug.c:88
rb_sym_intern_ascii_cstr
#define rb_sym_intern_ascii_cstr(ptr)
Definition: symbol.h:35
strlen
size_t strlen(const char *)

Definition at line 35 of file symbol.h.

## Function Documentation

## ◆ rb_gc_free_dsymbol()

void rb_gc_free_dsymbol | ( | VALUE | sym | ) |

Definition at line 803 of file symbol.c.

References rb_symbols_t::dsymbol_fstr_hash, GLOBAL_SYMBOLS_ENTER, GLOBAL_SYMBOLS_LEAVE, rb_hash_delete_entry(), RSYMBOL, str, and sym.

## ◆ rb_is_attrset_sym()

int rb_is_attrset_sym | ( | VALUE | sym | ) |

Definition at line 1052 of file symbol.c.

References is_attrset_sym, and sym.

## ◆ rb_is_class_name()

int rb_is_class_name | ( | VALUE | name | ) |

Definition at line 1223 of file symbol.c.

References ID_CLASS, and name.

## ◆ rb_is_const_name()

int rb_is_const_name | ( | VALUE | name | ) |

Definition at line 1217 of file symbol.c.

References ID_CONST, and name.

## ◆ rb_is_const_sym()

int rb_is_const_sym | ( | VALUE | sym | ) |

Definition at line 1046 of file symbol.c.

References is_const_sym, and sym.

## ◆ rb_is_instance_name()

int rb_is_instance_name | ( | VALUE | name | ) |

Definition at line 1229 of file symbol.c.

References ID_INSTANCE, and name.

## ◆ rb_is_local_name()

int rb_is_local_name | ( | VALUE | name | ) |

Definition at line 1235 of file symbol.c.

References ID_LOCAL, and name.

## ◆ rb_make_internal_id()

ID rb_make_internal_id | ( | void |  | ) |

Definition at line 953 of file symbol.c.

References ID_INTERNAL, and ID_STATIC_SYM.

Referenced by Init_Exception(), Init_Hash(), and Init_pack().

## ◆ rb_sym_intern()

VALUE rb_sym_intern | ( | const char * | ptr,
|  | long | len,
|  | rb_encoding * | enc
| ) |  |

Definition at line 1191 of file symbol.c.

References len, name, ptr, rb_setup_fake_str(), and rb_str_intern().

Referenced by rb_str_format(), and rb_sym_intern_ascii().

## ◆ rb_sym_intern_ascii()

VALUE rb_sym_intern_ascii | ( | const char * | ptr,
|  | long | len
| ) |  |

Definition at line 1199 of file symbol.c.

References len, ptr, rb_sym_intern(), and rb_usascii_encoding().

Referenced by rb_sym_intern_ascii_cstr().

## ◆ rb_sym_intern_ascii_cstr()

VALUE rb_sym_intern_ascii_cstr | ( | const char * | ptr | ) |

Definition at line 1205 of file symbol.c.

References ptr, rb_sym_intern_ascii(), and strlen().

## ◆ rb_to_symbol_type()

VALUE rb_to_symbol_type | ( | VALUE | obj | ) |

Definition at line 1211 of file symbol.c.

References rb_convert_type_with_id(), and T_SYMBOL.