Ruby: internal/encoding.h File Reference

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

Macros | Functions
encoding.h File Reference

Internal header for Encoding. More...

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

Go to the source code of this file.

## Macros
#define | rb_enc_autoload_p(enc) (!rb_enc_mbmaxlen(enc))

## Functions
ID | rb_id_encoding (void)
rb_encoding * | rb_enc_get_from_index (int index)
rb_encoding * | rb_enc_check_str (VALUE str1, VALUE str2)
int | rb_encdb_replicate (const char *alias, const char *orig)
int | rb_encdb_alias (const char *alias, const char *orig)
int | rb_enc_autoload (rb_encoding *enc)
int | rb_encdb_dummy (const char *name)
void | rb_encdb_declare (const char *name)
void | rb_enc_set_base (const char *name, const char *orig)
int | rb_enc_set_dummy (int index)
void | rb_encdb_set_unicode (int index)
int | rb_data_is_encoding (VALUE obj)

## Detailed Description

Internal header for Encoding.

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 encoding.h.

## Macro Definition Documentation

## ◆ rb_enc_autoload_p

#define rb_enc_autoload_p | ( |  | enc | ) | (!rb_enc_mbmaxlen(enc))

Definition at line 15 of file encoding.h.

## Function Documentation

## ◆ rb_data_is_encoding()

int rb_data_is_encoding | ( | VALUE | obj | ) |

Definition at line 114 of file encoding.c.

References is_data_encoding.

## ◆ rb_enc_autoload()

int rb_enc_autoload | ( | rb_encoding * | enc | ) |

Definition at line 867 of file encoding.c.

References rb_encoding_entry::enc, GLOBAL_ENC_TABLE_EVAL, and rb_enc_name.

Referenced by rb_enc_find_index(), and rb_enc_interned_str().

## ◆ rb_enc_check_str()

rb_encoding * rb_enc_check_str | ( | VALUE | str1,
|  | VALUE | str2
| ) |  |

Definition at line 1078 of file encoding.c.

References rb_encoding_entry::enc, MUST_STRING, rb_eEncCompatError, rb_enc_get(), rb_enc_name, and rb_raise().

Referenced by rb_str_plus().

## ◆ rb_enc_get_from_index()

rb_encoding * rb_enc_get_from_index | ( | int | index | ) |

Definition at line 795 of file encoding.c.

## ◆ rb_enc_set_base()

void rb_enc_set_base | ( | const char * | name,
|  | const char * | orig
| ) |  |

Definition at line 509 of file encoding.c.

References GLOBAL_ENC_TABLE_ENTER, GLOBAL_ENC_TABLE_LEAVE, name, and rb_enc_from_index().

## ◆ rb_enc_set_dummy()

int rb_enc_set_dummy | ( | int | index | ) |

Definition at line 524 of file encoding.c.

References rb_encoding_entry::enc, ENC_SET_DUMMY, and GLOBAL_ENC_TABLE_EVAL.

## ◆ rb_encdb_alias()

int rb_encdb_alias | ( | const char * | alias,
|  | const char * | orig
| ) |  |

Definition at line 740 of file encoding.c.

## ◆ rb_encdb_declare()

void rb_encdb_declare | ( | const char * | name | ) |

Definition at line 473 of file encoding.c.

## ◆ rb_encdb_dummy()

int rb_encdb_dummy | ( | const char * | name | ) |

Definition at line 632 of file encoding.c.

References rb_encoding_entry::enc, ENC_SET_DUMMY, GLOBAL_ENC_TABLE_ENTER, GLOBAL_ENC_TABLE_LEAVE, name, and rb_ascii8bit_encoding().

## ◆ rb_encdb_replicate()

int rb_encdb_replicate | ( | const char * | alias,
|  | const char * | orig
| ) |  |

Definition at line 596 of file encoding.c.

References GLOBAL_ENC_TABLE_ENTER, GLOBAL_ENC_TABLE_LEAVE, name, and rb_enc_from_index().

## ◆ rb_encdb_set_unicode()

void rb_encdb_set_unicode | ( | int | index | ) |

Definition at line 759 of file encoding.c.

References ONIGENC_FLAG_UNICODE, and rb_enc_from_index().

## ◆ rb_id_encoding()

ID rb_id_encoding | ( | void |  | ) |

Definition at line 947 of file encoding.c.

References CONST_ID.

Referenced by Init_IO().