Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
Macros | Functions | Variables
escape.c File Reference
#include "ruby.h"
#include "ruby/encoding.h"

Go to the source code of this file.

Macros

#define lower_hexdigits   (ruby_hexdigits+0)
 
#define upper_hexdigits   (ruby_hexdigits+16)
 
#define char_to_number(c)   ruby_digit36_to_number_table[(unsigned char)(c)]
 
#define HTML_ESCAPE_MAX_LEN   6
 
#define HTML_ESCAPE(c, str)   [c] = {rb_strlen_lit(str), str}
 
#define MATCH(s)
 

Functions

unsigned long ruby_scan_digits (const char *str, ssize_t len, int base, size_t *retlen, int *overflow)
 
void Init_escape (void)
 
void InitVM_escape (void)
 

Variables

const char ruby_hexdigits []
 
const signed char ruby_digit36_to_number_table []
 

Macro Definition Documentation

◆ char_to_number

#define char_to_number (   c)    ruby_digit36_to_number_table[(unsigned char)(c)]

Definition at line 9 of file escape.c.

◆ HTML_ESCAPE

#define HTML_ESCAPE (   c,
  str 
)    [c] = {rb_strlen_lit(str), str}

◆ HTML_ESCAPE_MAX_LEN

#define HTML_ESCAPE_MAX_LEN   6

Definition at line 14 of file escape.c.

◆ lower_hexdigits

#define lower_hexdigits   (ruby_hexdigits+0)

Definition at line 7 of file escape.c.

◆ MATCH

#define MATCH (   s)
Value:
(len - i >= (int)rb_strlen_lit(s) && \
memcmp(&cstr[i], s, rb_strlen_lit(s)) == 0 && \
(i += rb_strlen_lit(s) - 1, 1))
uint8_t len
Definition: escape.c:17
#define rb_strlen_lit(str)
Definition: string.h:286
typedef int(ZCALLBACK *close_file_func) OF((voidpf opaque

◆ upper_hexdigits

#define upper_hexdigits   (ruby_hexdigits+16)

Definition at line 8 of file escape.c.

Function Documentation

◆ Init_escape()

void Init_escape ( void  )

Definition at line 390 of file escape.c.

References InitVM, and rb_ext_ractor_safe().

◆ InitVM_escape()

void InitVM_escape ( void  )

◆ ruby_scan_digits()

unsigned long ruby_scan_digits ( const char *  str,
ssize_t  len,
int  base,
size_t *  retlen,
int overflow 
)

Definition at line 101 of file util.c.

References len, long(), ruby_digit36_to_number_table, and str.

Referenced by rb_int_parse_cstr().

Variable Documentation

◆ len

uint8_t len

Definition at line 17 of file escape.c.

Referenced by add_data_in_datablock(), adler32(), adler32_z(), aprintf(), been_here(), bi_reverse(), bload(), codes(), construct(), count(), crc32(), crc32_z(), decode(), decomp(), deflate_index_extract(), deflate_stored(), deflateGetDictionary(), dynamic(), examine(), explicit_bzero(), ffi_prep_args_pa32(), flush_pending(), gen_codes(), getnameinfo(), gunpipe(), gz_load(), gz_open(), gz_read(), gz_skip(), gz_write(), gz_zero(), gzcopy(), gzfread(), gzfwrite(), gzgets(), gzhead(), gzip_normalize(), gzlog_compress(), gzlog_write(), gzputs(), gzread(), gztack(), gzvprintf(), gzwrite(), in(), inflate(), inflate_fast(), inflate_table(), inflate_table9(), inflateBack(), inflateBack9(), inflateSync(), load(), log_append(), log_compress(), log_last(), log_recover(), longest_match(), main(), makedir(), map(), memcmp(), nan(), onig_error_code_to_str(), onig_is_code_in_cc(), onig_node_str_cat(), onig_strcpy(), onig_vsnprintf_with_pattern(), onigenc_mbn_mbc_case_fold(), onigenc_mbn_mbc_to_code(), onigenc_minimum_property_name_to_ctype(), onigenc_str_bytelen_null(), onigenc_strlen_null(), operator<(), operator>(), ossl_buf2str(), ossl_pem_passwd_cb(), ossl_str_new(), out(), PACKED_STRUCT_UNALIGNED(), rb_alloc_tmp_buffer(), rb_arithmetic_sequence_beg_len_step(), rb_ary_aref1(), rb_ary_cancel_sharing(), rb_ary_cat(), rb_ary_cmp(), rb_ary_delete_at(), rb_ary_dup(), rb_ary_join(), rb_ary_last(), rb_ary_plus(), rb_ary_resize(), rb_ary_reverse(), rb_ary_rotate(), rb_ary_set_len(), rb_ary_shift(), rb_ary_sort_bang(), rb_ary_store(), rb_ary_subseq(), rb_ary_subseq_step(), rb_backref_set_string(), rb_big_clone(), rb_big_isqrt(), rb_big_new(), rb_big_resize(), rb_check_id_cstr(), rb_check_symbol_cstr(), rb_deprecate_constant(), rb_econv_append(), rb_econv_insert_output(), rb_econv_set_replacement(), rb_econv_substr_append(), rb_enc_ascget(), rb_enc_find_index2(), rb_enc_interned_str(), rb_enc_reg_new(), rb_enc_str_buf_cat(), rb_enc_str_new(), rb_enc_str_new_static(), rb_enc_symname2_p(), rb_enc_symname_type(), rb_error_write(), rb_exc_new(), rb_external_str_new(), rb_external_str_new_with_enc(), rb_file_expand_path_internal(), rb_file_load_ok(), rb_filesystem_str_new(), rb_freopen(), rb_fstring_enc_new(), rb_fstring_new(), rb_get_values_at(), rb_init_iv_list(), rb_insn_operand_intern(), rb_int_parse_cstr(), rb_intern2(), rb_intern3(), rb_interned_str(), rb_io_popen(), rb_io_ungetc(), rb_iseq_build_from_ary(), rb_iseq_disasm_insn(), rb_iseq_new_top(), rb_ivar_lookup(), rb_keyword_error_new(), rb_locale_str_new(), rb_memcicmp(), rb_memhash(), rb_memory_view_init_as_byte_array(), rb_memory_view_parse_item_format(), rb_obj_copy_ivar(), rb_ractor_receive_parameters(), rb_ractor_send_parameters(), rb_range_beg_len(), rb_range_component_beg_len(), rb_raw_obj_info(), rb_readlink(), rb_reg_match_p(), rb_reg_new(), rb_reg_nth_match(), rb_reg_prepare_re0(), rb_reg_start_with_p(), rb_reserved_word(), rb_setup_fake_str(), rb_str2big_karatsuba(), rb_str2big_normal(), rb_str2big_poweroftwo(), rb_str_buf_cat_ascii(), rb_str_buf_new_cstr(), rb_str_cat(), rb_str_cat_conv_enc_opts(), rb_str_change_terminator_length(), rb_str_chomp_string(), rb_str_concat(), rb_str_concat_literals(), rb_str_conv_enc_opts(), rb_str_convert_to_inum(), rb_str_drop_bytes(), rb_str_dump(), rb_str_ellipsize(), rb_str_end_with_asciichar(), rb_str_fill_terminator(), rb_str_format(), rb_str_initialize(), rb_str_modify_expand(), rb_str_new(), rb_str_new_static(), rb_str_new_with_class(), rb_str_quote_unprintable(), rb_str_resize(), rb_str_set_len(), rb_str_subpos(), rb_str_subseq(), rb_str_substr(), rb_str_symname_p(), rb_str_times(), rb_str_tmp_new(), rb_str_update(), rb_struct_init_copy(), rb_sym_intern(), rb_sym_intern_ascii(), rb_tainted_str_new(), rb_usascii_str_new(), rb_usascii_str_new_static(), rb_utf8_str_new(), rb_utf8_str_new_static(), rb_vm_bugreport(), rb_vm_mark(), rb_w32_conv_from_wchar(), rb_w32_conv_from_wstr(), rb_w32_gethostbyaddr(), rb_w32_gethostname(), rb_w32_getppid(), rb_w32_home_dir(), rb_w32_mbstr_to_wstr(), rb_w32_read(), rb_w32_read_reparse_point(), rb_w32_recv(), rb_w32_recvfrom(), rb_w32_reparse_symlink_p(), rb_w32_send(), rb_w32_sendto(), rb_w32_start_process(), rb_w32_system_tmpdir(), rb_w32_wrap_io_handle(), rb_w32_write(), rb_w32_write_console(), rb_w32_wstr_to_mbstr(), rb_write_error2(), rb_write_error_str(), izstream::read(), read_buf(), read_string(), readin(), recvmsg(), reg_get_val(), rmpd_parse_special_string(), rotate(), rsock_addrinfo_new(), rsock_connect(), rsock_family_to_int(), rsock_fd_socket_addrinfo(), rsock_inspect_sockaddr(), rsock_io_socket_addrinfo(), rsock_ip_level_to_int(), rsock_ip_optname_to_int(), rsock_ipproto_to_int(), rsock_s_accept(), rsock_s_accept_nonblock(), rsock_s_recvfrom(), rsock_s_recvfrom_nonblock(), rsock_scm_optname_to_int(), rsock_shutdown_how_to_int(), rsock_so_optname_to_int(), rsock_socktype_to_int(), rsock_sys_fail_sockaddr(), rsock_syserr_fail_sockaddr(), rsock_tcp_optname_to_int(), rsock_udp_optname_to_int(), rsock_unknown_level_to_int(), RUBY_ALIAS_FUNCTION(), ruby_each_words(), ruby_enc_find_extname(), ruby_env_debug_option(), ruby_init_loadpath(), ruby_require_internal(), ruby_scan_digits(), ruby_scan_hex(), ruby_scan_oct(), ruby_setenv(), ruby_sized_xrealloc2(), ruby_strdup(), ruby_strtoul(), sendmsg(), setproctitle(), SHA1_Update(), SHA256_Data(), SHA256_Update(), SHA384_Data(), SHA384_Update(), SHA512_Data(), SHA512_Update(), sip_hash13(), st_hash(), stored(), string_printf(), syncsearch(), tar(), uncompress2(), unzGetLocalExtrafield(), unzReadCurrentFile(), ozstream::write(), and zipWriteInFileInZip().

◆ ruby_digit36_to_number_table

const signed char ruby_digit36_to_number_table[]
extern

Definition at line 79 of file util.c.

◆ ruby_hexdigits

const char ruby_hexdigits[]
extern

Definition at line 34 of file util.c.

◆ str

char str[HTML_ESCAPE_MAX_LEN+1]

Definition at line 18 of file escape.c.

Referenced by aprintf(), asn1str_to_str(), date__httpdate(), date__iso8601(), date__jisx0301(), date__parse(), date__rfc2822(), date__rfc3339(), date__strptime(), date__xmlschema(), date_zone_to_diff(), deflateBound(), deflateSetDictionary(), DupConfigPtr(), fill_window(), gzgets(), make_inspect(), ole_typedesc2val(), onig_match(), onig_scan(), onig_search(), onig_search_gpos(), ossl_buf2str(), ossl_str_new(), procstat_vm(), rb_any_to_s(), rb_block_to_s(), rb_category_compile_warn(), rb_check_string_type(), rb_compile_warn(), rb_compile_warning(), rb_cstr2inum(), rb_cstr_to_inum(), rb_dump_literal(), rb_ec_str_resurrect(), rb_econv_insert_output(), rb_econv_set_replacement(), rb_enc_str_asciionly_p(), rb_enc_str_buf_cat(), rb_enc_str_coderange(), rb_enc_str_coderange_scan(), rb_enc_str_new(), rb_enc_str_scrub(), rb_enc_uint_chr(), rb_error_write(), rb_eval_string(), rb_eval_string_protect(), rb_eval_string_wrap(), rb_exc_new_str(), rb_execarg_commandline(), rb_external_str_new_with_enc(), rb_external_str_with_enc(), rb_f_kill(), rb_find_file(), rb_find_file_ext(), rb_fstring(), rb_gc_free_dsymbol(), rb_id2name(), rb_id_attrset(), rb_id_quote_unprintable(), rb_inspect(), rb_int_parse_cstr(), rb_intern3(), rb_intern_str(), rb_invalid_str(), rb_io_addstr(), rb_io_write(), rb_iseq_defined_string(), rb_iseq_disasm(), rb_iseq_disasm_insn(), rb_iseq_ibf_dump(), rb_iseq_ibf_load(), rb_iseq_ibf_load_extra_data(), rb_method_name_error(), rb_must_asciicompat(), rb_name_error_str(), rb_num_get_rounding_option(), rb_obj_as_string(), rb_obj_as_string_result(), rb_parser_reg_compile(), rb_proc_exec(), rb_proc_isolate_bang(), rb_proc_ractor_make_shareable(), rb_readlink(), rb_reg_adjust_startpos(), rb_reg_check_preprocess(), rb_reg_compile(), rb_reg_eqq(), rb_reg_fragment_setenc(), rb_reg_match(), rb_reg_match_p(), rb_reg_match_post(), rb_reg_match_pre(), rb_reg_nth_match(), rb_reg_prepare_re(), rb_reg_prepare_re0(), rb_reg_quote(), rb_reg_regcomp(), rb_reg_regsub(), rb_reg_search(), rb_reg_search0(), rb_reg_start_with_p(), rb_reserved_word(), rb_set_class_path(), rb_set_class_path_string(), rb_str2big_karatsuba(), rb_str2big_normal(), rb_str2big_poweroftwo(), rb_str2inum(), rb_str_append(), rb_str_buf_append(), rb_str_buf_cat_ascii(), rb_str_buf_new(), rb_str_buf_new_cstr(), rb_str_capacity(), rb_str_cat(), rb_str_cat_cstr(), rb_str_catf(), rb_str_change_terminator_length(), rb_str_chomp_string(), rb_str_concat_literals(), rb_str_conv_enc(), rb_str_conv_enc_opts(), rb_str_convert_to_inum(), rb_str_drop_bytes(), rb_str_dump(), rb_str_dup(), rb_str_ellipsize(), rb_str_encode(), rb_str_end_with_asciichar(), rb_str_escape(), rb_str_export(), rb_str_export_locale(), rb_str_export_to_enc(), rb_str_fill_terminator(), rb_str_format(), rb_str_free(), rb_str_freeze(), rb_str_hash(), rb_str_initialize(), rb_str_inspect(), rb_str_intern(), rb_str_length(), rb_str_locktmp_ensure(), rb_str_make_independent(), rb_str_memsize(), rb_str_modify(), rb_str_modify_expand(), rb_str_new_shared(), rb_str_offset(), rb_str_quote_unprintable(), rb_str_replace(), rb_str_resize(), rb_str_resurrect(), rb_str_scrub(), rb_str_set_len(), rb_str_shared_replace(), rb_str_split(), rb_str_strlen(), rb_str_sublen(), rb_str_subpos(), rb_str_subseq(), rb_str_substr(), rb_str_succ(), rb_str_times(), rb_str_to_cstr(), rb_str_to_dbl(), rb_str_to_interned_str(), rb_str_to_inum(), rb_str_to_str(), rb_str_unlocktmp(), rb_str_update(), rb_str_vcatf(), rb_string_value_cstr(), rb_string_value_ptr(), rb_usascii_str_new(), rb_usascii_str_new_cstr(), rb_utf8_str_new(), rb_utf8_str_new_cstr(), rb_w32_conv_from_wstr(), rb_w32_mbstr_to_wstr(), rb_w32_write_console(), rmpd_parse_special_string(), rsock_family_to_int(), rsock_ip_level_to_int(), rsock_ip_optname_to_int(), rsock_ipproto_to_int(), rsock_s_recvfrom(), rsock_s_recvfrom_nonblock(), rsock_scm_optname_to_int(), rsock_shutdown_how_to_int(), rsock_so_optname_to_int(), rsock_socktype_to_int(), rsock_syserr_fail_raddrinfo(), rsock_tcp_optname_to_int(), rsock_udp_optname_to_int(), rsock_unknown_level_to_int(), RUBY_ALIAS_FUNCTION(), ruby_brace_glob(), ruby_brace_glob_with_enc(), ruby_each_words(), ruby_eval_string_from_file(), ruby_require_internal(), ruby_scan_digits(), ruby_set_debug_option(), ruby_setenv(), ruby_snprintf(), ruby_strdup(), ruby_strtoul(), ruby_vsnprintf(), VpAlloc(), VpCreateRbObject(), VpException(), and VpNewRbClass().