Ruby: internal/encoding.h Source File

Ruby 3.4.7p58 (2025-10-08 revision 7a5688e2a27668e48f8d6ff4af5b2208b98a2f5e)

encoding.h
1#ifndef INTERNAL_ENCODING_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_ENCODING_H
11#include "ruby/ruby.h" /* for ID */
12#include "ruby/encoding.h" /* for rb_encoding */
13
14#define rb_enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc))
15#define rb_is_usascii_enc(enc) ((enc) == rb_usascii_encoding())
16#define rb_is_ascii8bit_enc(enc) ((enc) == rb_ascii8bit_encoding())
17#define rb_is_locale_enc(enc) ((enc) == rb_locale_encoding())
18
19/* encoding.c */
20 ID rb_id_encoding(void);
21const char * rb_enc_inspect_name(rb_encoding *enc);
22rb_encoding *rb_enc_get_from_index(int index);
23rb_encoding *rb_enc_check_str(VALUE str1, VALUE str2);
24int rb_encdb_replicate(const char *alias, const char *orig);
25int rb_encdb_alias(const char *alias, const char *orig);
26int rb_enc_autoload(rb_encoding *enc);
27int rb_encdb_dummy(const char *name);
28void rb_encdb_declare(const char *name);
29void rb_enc_set_base(const char *name, const char *orig);
30int rb_enc_set_dummy(int index);
31void rb_enc_raw_set(VALUE obj, rb_encoding *enc);
32
33PUREFUNC(int rb_data_is_encoding(VALUE obj));
34
35/* vm.c */
36void rb_free_global_enc_table(void);
37
38#endif /* INTERNAL_ENCODING_H */
encoding.h
Encoding relates APIs.
ruby.h
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