#include "config.h"#include "system.h"#include "cpplib.h"#include "internal.h"#include "ucnid.h"

Go to the source code of this file.
Data Types | |
| type | _cpp_strbuf |
| type | conversion |
Defines | |
| #define | iconv_open(x, y) (errno = EINVAL, (iconv_t)-1) |
| #define | iconv(a, b, c, d, e) (errno = EINVAL, (size_t)-1) |
| #define | iconv_close(x) (void)0 |
| #define | ICONV_CONST |
| #define | SOURCE_CHARSET "UTF-8" |
| #define | LAST_POSSIBLY_BASIC_SOURCE_CHAR 0x7e |
| #define | EILSEQ EINVAL |
| #define | OUTBUF_BLOCK_SIZE 256 |
| #define | convert_using_iconv 0 |
| #define | APPLY_CONVERSION(CONVERTER, FROM, FLEN, TO) CONVERTER.func (CONVERTER.cd, FROM, FLEN, TO) |
Enumerations | |
| enum | { C99 = 1, DIG = 2, CXX = 4, CID = 8, NFC = 16, NKC = 32, CTX = 64 } |
Functions/Subroutines | |
| static int | one_utf8_to_cppchar (const uchar **inbufp, size_t *inbytesleftp, cppchar_t *cp) |
| static int | one_cppchar_to_utf8 (cppchar_t c, uchar **outbufp, size_t *outbytesleftp) |
| static int | one_utf8_to_utf32 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, uchar **outbufp, size_t *outbytesleftp) |
| static int | one_utf32_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, uchar **outbufp, size_t *outbytesleftp) |
| static int | one_utf8_to_utf16 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, uchar **outbufp, size_t *outbytesleftp) |
| static int | one_utf16_to_utf8 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp, uchar **outbufp, size_t *outbytesleftp) |
| static bool | conversion_loop (int(*const one_conversion)(iconv_t, const uchar **, size_t *, uchar **, size_t *), iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to) |
| static bool | convert_utf8_utf16 (iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to) |
| static bool | convert_utf8_utf32 (iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to) |
| static bool | convert_utf16_utf8 (iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to) |
| static bool | convert_utf32_utf8 (iconv_t cd, const uchar *from, size_t flen, struct _cpp_strbuf *to) |
| static bool | convert_no_conversion (iconv_t cd ATTRIBUTE_UNUSED, const uchar *from, size_t flen, struct _cpp_strbuf *to) |
| static struct cset_converter | init_iconv_desc (cpp_reader *pfile, const char *to, const char *from) |
| void | cpp_init_iconv (cpp_reader *pfile) |
| void | _cpp_destroy_iconv (cpp_reader *pfile) |
| cppchar_t | cpp_host_to_exec_charset (cpp_reader *pfile, cppchar_t c) |
| static size_t | width_to_mask (size_t width) |
| static int | ucn_valid_in_identifier (cpp_reader *pfile, cppchar_t c, struct normalize_state *nst) |
| cppchar_t | _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr, const uchar *limit, int identifier_pos, struct normalize_state *nst) |
| static const uchar * | convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit, struct _cpp_strbuf *tbuf, bool wide) |
| static void | emit_numeric_escape (cpp_reader *pfile, cppchar_t n, struct _cpp_strbuf *tbuf, bool wide) |
| static const uchar * | convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, struct _cpp_strbuf *tbuf, bool wide) |
| static const uchar * | convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit, struct _cpp_strbuf *tbuf, bool wide) |
| static const uchar * | convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit, struct _cpp_strbuf *tbuf, bool wide) |
| bool | cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count, cpp_string *to, bool wide) |
| bool | cpp_interpret_string_notranslate (cpp_reader *pfile, const cpp_string *from, size_t count, cpp_string *to, bool wide) |
| static cppchar_t | narrow_str_to_charconst (cpp_reader *pfile, cpp_string str, unsigned int *pchars_seen, int *unsignedp) |
| static cppchar_t | wide_str_to_charconst (cpp_reader *pfile, cpp_string str, unsigned int *pchars_seen, int *unsignedp) |
| cppchar_t | cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token, unsigned int *pchars_seen, int *unsignedp) |
| cpp_hashnode * | _cpp_interpret_identifier (cpp_reader *pfile, const uchar *id, size_t len) |
| uchar * | _cpp_convert_input (cpp_reader *pfile, const char *input_charset, uchar *input, size_t size, size_t len, off_t *st_size) |
| const char * | _cpp_default_encoding (void) |
Variables | |
| static struct conversion | conversion_tab [] |
| type { | |
| unsigned char flags | |
| unsigned char combine | |
| unsigned short end | |
| } | ucnranges [] |
| #define APPLY_CONVERSION | ( | CONVERTER, | |||
| FROM, | |||||
| FLEN, | |||||
| TO | ) | CONVERTER.func (CONVERTER.cd, FROM, FLEN, TO) |
| uchar* _cpp_convert_input | ( | cpp_reader * | pfile, | |
| const char * | input_charset, | |||
| uchar * | input, | |||
| size_t | size, | |||
| size_t | len, | |||
| off_t * | st_size | |||
| ) |
Definition at line 1591 of file charset.c.
References APPLY_CONVERSION, _cpp_strbuf::asize, convert_no_conversion(), convert_using_iconv, CPP_DL_ERROR, cpp_error(), CPP_OPTION, free(), iconv_close, init_iconv_desc(), _cpp_strbuf::len, MAX, SOURCE_CHARSET, _cpp_strbuf::text, uchar, xmalloc(), XNEWVEC, xrealloc(), and XRESIZEVEC.
| const char* _cpp_default_encoding | ( | void | ) |
Definition at line 1642 of file charset.c.
References current_encoding, nl_langinfo(), NULL, setlocale, and SOURCE_CHARSET.
| void _cpp_destroy_iconv | ( | cpp_reader * | pfile | ) |
Definition at line 707 of file charset.c.
References cset_converter::cd, convert_using_iconv, cset_converter::func, HAVE_ICONV, iconv_close, cpp_reader::narrow_cset_desc, and cpp_reader::wide_cset_desc.
| cpp_hashnode* _cpp_interpret_identifier | ( | cpp_reader * | pfile, | |
| const uchar * | id, | |||
| size_t | len | |||
| ) |
Definition at line 1531 of file charset.c.
References alloca, buf, CPP_DL_ERROR, cpp_errno(), CPP_HASHNODE, errno, cpp_reader::hash_table, hex_value, HT_ALLOC, ht_lookup(), ISXDIGIT, length, one_cppchar_to_utf8(), and uchar.
Referenced by lex_identifier().
| cppchar_t _cpp_valid_ucn | ( | cpp_reader * | pfile, | |
| const uchar ** | pstr, | |||
| const uchar * | limit, | |||
| int | identifier_pos, | |||
| struct normalize_state * | nst | |||
| ) |
Definition at line 938 of file charset.c.
References base, c, CPP_DL_ERROR, CPP_DL_ICE, CPP_DL_PEDWARN, CPP_DL_WARNING, cpp_error(), CPP_OPTION, CPP_WTRADITIONAL, dollars_in_ident, hex_value, ISXDIGIT, length, NORMALIZE_STATE_UPDATE_IDNUM, result, lexer_state::skipping, cpp_reader::state, str, uchar, and ucn_valid_in_identifier().
| static bool conversion_loop | ( | int(*)(iconv_t, const uchar **, size_t *, uchar **, size_t *) | one_conversion, | |
| iconv_t | cd, | |||
| const uchar * | from, | |||
| size_t | flen, | |||
| struct _cpp_strbuf * | to | |||
| ) | [inline, static] |
Definition at line 455 of file charset.c.
References __builtin_expect, _cpp_strbuf::asize, errno, _cpp_strbuf::len, outbuf, OUTBUF_BLOCK_SIZE, _cpp_strbuf::text, uchar, and XRESIZEVEC.
| static const uchar* convert_escape | ( | cpp_reader * | pfile, | |
| const uchar * | from, | |||
| const uchar * | limit, | |||
| struct _cpp_strbuf * | tbuf, | |||
| bool | wide | |||
| ) | [static] |
Definition at line 1209 of file charset.c.
References APPLY_CONVERSION, buf, c, convert_hex(), convert_oct(), convert_ucn(), CPP_DL_ERROR, CPP_DL_PEDWARN, CPP_DL_WARNING, cpp_errno(), cpp_error(), CPP_PEDANTIC, CPP_WTRADITIONAL, ISGRAPH, cpp_reader::narrow_cset_desc, sprintf(), uchar, unknown, and cpp_reader::wide_cset_desc.
| static const uchar* convert_hex | ( | cpp_reader * | pfile, | |
| const uchar * | from, | |||
| const uchar * | limit, | |||
| struct _cpp_strbuf * | tbuf, | |||
| bool | wide | |||
| ) | [static] |
Definition at line 1121 of file charset.c.
References c, CPP_DL_ERROR, CPP_DL_PEDWARN, CPP_DL_WARNING, cpp_error(), CPP_OPTION, CPP_WTRADITIONAL, emit_numeric_escape(), hex_p, hex_value, n, overflow, and width_to_mask().
| static bool convert_no_conversion | ( | iconv_t cd | ATTRIBUTE_UNUSED, | |
| const uchar * | from, | |||
| size_t | flen, | |||
| struct _cpp_strbuf * | to | |||
| ) | [static] |
Definition at line 535 of file charset.c.
References _cpp_strbuf::asize, _cpp_strbuf::len, memcpy, _cpp_strbuf::text, uchar, and XRESIZEVEC.
| static const uchar* convert_oct | ( | cpp_reader * | pfile, | |
| const uchar * | from, | |||
| const uchar * | limit, | |||
| struct _cpp_strbuf * | tbuf, | |||
| bool | wide | |||
| ) | [static] |
Definition at line 1172 of file charset.c.
References c, count, CPP_DL_PEDWARN, cpp_error(), CPP_OPTION, emit_numeric_escape(), n, overflow, and width_to_mask().
| static const uchar* convert_ucn | ( | cpp_reader * | pfile, | |
| const uchar * | from, | |||
| const uchar * | limit, | |||
| struct _cpp_strbuf * | tbuf, | |||
| bool | wide | |||
| ) | [static] |
Definition at line 1036 of file charset.c.
References _cpp_valid_ucn(), APPLY_CONVERSION, buf, CPP_DL_ERROR, cpp_errno(), errno, INITIAL_NORMALIZE_STATE, cpp_reader::narrow_cset_desc, one_cppchar_to_utf8(), uchar, and cpp_reader::wide_cset_desc.
| cppchar_t cpp_host_to_exec_charset | ( | cpp_reader * | pfile, | |
| cppchar_t | c | |||
| ) |
Definition at line 731 of file charset.c.
References APPLY_CONVERSION, _cpp_strbuf::asize, CPP_DL_ICE, cpp_errno(), cpp_error(), free(), LAST_POSSIBLY_BASIC_SOURCE_CHAR, _cpp_strbuf::len, cpp_reader::narrow_cset_desc, sbuf, _cpp_strbuf::text, uchar, xmalloc(), and XNEWVEC.
| void cpp_init_iconv | ( | cpp_reader * | pfile | ) |
Definition at line 679 of file charset.c.
References CPP_OPTION, init_iconv_desc(), cpp_reader::narrow_cset_desc, SOURCE_CHARSET, and cpp_reader::wide_cset_desc.
| cppchar_t cpp_interpret_charconst | ( | cpp_reader * | pfile, | |
| const cpp_token * | token, | |||
| unsigned int * | pchars_seen, | |||
| int * | unsignedp | |||
| ) |
Definition at line 1500 of file charset.c.
References BITS_PER_CPPCHAR_T, CPP_DL_ERROR, cpp_error(), cpp_interpret_string(), CPP_OPTION, cpp_parse_escape(), DL_ERROR, DL_WARNING, free(), ISPRINT, cpp_string::len, narrow_str_to_charconst(), NULL, result, str, cpp_token::str, cpp_string::text, cpp_token::val, void, and wide_str_to_charconst().
| bool cpp_interpret_string | ( | cpp_reader * | pfile, | |
| const cpp_string * | from, | |||
| size_t | count, | |||
| cpp_string * | to, | |||
| bool | wide | |||
| ) |
Definition at line 1305 of file charset.c.
References APPLY_CONVERSION, _cpp_strbuf::asize, base, convert_escape(), CPP_DL_ERROR, cpp_errno(), emit_numeric_escape(), fail, free(), i, cpp_string::len, _cpp_strbuf::len, MAX, cpp_reader::narrow_cset_desc, OUTBUF_BLOCK_SIZE, p, _cpp_strbuf::text, cpp_string::text, uchar, cpp_reader::wide_cset_desc, xmalloc(), XNEWVEC, xrealloc(), and XRESIZEVEC.
| bool cpp_interpret_string_notranslate | ( | cpp_reader * | pfile, | |
| const cpp_string * | from, | |||
| size_t | count, | |||
| cpp_string * | to, | |||
| bool | wide | |||
| ) |
Definition at line 1360 of file charset.c.
References cset_converter::cd, convert_no_conversion(), cpp_interpret_string(), cset_converter::func, and cpp_reader::narrow_cset_desc.
| static void emit_numeric_escape | ( | cpp_reader * | pfile, | |
| cppchar_t | n, | |||
| struct _cpp_strbuf * | tbuf, | |||
| bool | wide | |||
| ) | [static] |
Definition at line 1071 of file charset.c.
References _cpp_strbuf::asize, c, cmask, CPP_OPTION, i, _cpp_strbuf::len, OUTBUF_BLOCK_SIZE, _cpp_strbuf::text, uchar, width_to_mask(), and XRESIZEVEC.
| static struct cset_converter init_iconv_desc | ( | cpp_reader * | pfile, | |
| const char * | to, | |||
| const char * | from | |||
| ) | [static, read] |
Definition at line 618 of file charset.c.
References alloca, ARRAY_SIZE, cset_converter::cd, convert_no_conversion(), convert_using_iconv, CPP_DL_ERROR, cpp_errno(), cpp_error(), errno, conversion::fake_cd, cset_converter::func, conversion::func, HAVE_ICONV, i, iconv_open, strcasecmp(), strcat(), strcpy, and strlen().
| static cppchar_t narrow_str_to_charconst | ( | cpp_reader * | pfile, | |
| cpp_string | str, | |||
| unsigned int * | pchars_seen, | |||
| int * | unsignedp | |||
| ) | [static] |
Definition at line 1381 of file charset.c.
References BITS_PER_CPPCHAR_T, c, CPP_DL_WARNING, cpp_error(), CPP_OPTION, i, cpp_string::len, result, cpp_string::text, and width_to_mask().
| static int ucn_valid_in_identifier | ( | cpp_reader * | pfile, | |
| cppchar_t | c, | |||
| struct normalize_state * | nst | |||
| ) | [static] |
Definition at line 825 of file charset.c.
References ARRAY_SIZE, C99, CID, combine, CPP_DL_ICE, cpp_error(), CPP_OPTION, CPP_PEDANTIC, CTX, CXX, DIG, end, ucnrange::flags, flags, normalize_state::level, MAX, NFC, NKC, normalized_C, normalized_identifier_C, normalized_none, p, normalize_state::prev_class, normalize_state::previous, and ucnranges.
| static cppchar_t wide_str_to_charconst | ( | cpp_reader * | pfile, | |
| cpp_string | str, | |||
| unsigned int * | pchars_seen, | |||
| int * | unsignedp | |||
| ) | [static] |
Definition at line 1450 of file charset.c.
References BITS_PER_CPPCHAR_T, c, cmask, CPP_DL_WARNING, cpp_error(), CPP_OPTION, i, cpp_string::len, result, cpp_string::text, and width_to_mask().
| unsigned char combine |
Definition at line 810 of file charset.c.
Referenced by coalesce(), Evaluate_Operand_Range(), sort_and_combine_web_pairs(), ucn_valid_in_identifier(), and vho_lower_combine_loads().
struct conversion conversion_tab[] [static] |
Initial value:
{
{ "UTF-8/UTF-32LE", convert_utf8_utf32, (iconv_t)0 },
{ "UTF-8/UTF-32BE", convert_utf8_utf32, (iconv_t)1 },
{ "UTF-8/UTF-16LE", convert_utf8_utf16, (iconv_t)0 },
{ "UTF-8/UTF-16BE", convert_utf8_utf16, (iconv_t)1 },
{ "UTF-32LE/UTF-8", convert_utf32_utf8, (iconv_t)0 },
{ "UTF-32BE/UTF-8", convert_utf32_utf8, (iconv_t)1 },
{ "UTF-16LE/UTF-8", convert_utf16_utf8, (iconv_t)0 },
{ "UTF-16BE/UTF-8", convert_utf16_utf8, (iconv_t)1 },
}
| unsigned short end |
Definition at line 812 of file charset.c.
Referenced by __frame_state_for(), _beautify(), _bfd_elf_discard_section_eh_frame(), _bfd_elf_write_section_eh_frame(), _bfd_elfcore_strndup(), _bfd_mips_elf_write_section(), _bfd_xcoff64_swap_aux_in(), _bfd_xcoff64_swap_aux_out(), _bfd_xcoff_swap_aux_in(), _bfd_xcoff_swap_aux_out(), _cpp_release_buff(), _dwarf_pro_encode_leb128_nm(), _dwarf_pro_encode_signed_leb128_nm(), _dwarf_string_valid(), _fwwd(), _get_value(), _INQIL(), _map_to_dv(), VN::_print_vn_to_exprid(), add_excluded_libs(), adjust_libcall_notes(), analyze_function(), apply_macro_to_string(), arc_opcode_lookup_suffix(), arm_gen_constant(), bfd_calc_gnu_debuglink_crc32(), bfd_ecoff_debug_accumulate(), bfd_elf_final_link(), bfd_mach_o_core_fetch_environment(), bfd_pef_parse_function_stubs(), bfd_pef_parse_symbols(), bfd_pef_scan_start_address(), bitstr(), block_jumps_and_fallthru_p(), build_automata(), build_new_1(), Build_Outgoing_Edges(), build_successor_graph(), c4x_rptb_valid_p(), can_copy_bbs_p(), check_cookies(), check_do_loop_for(), check_function_sentinel(), Check_Inline_Script(), coalesce_asm_operands(), coalesce_regs_in_copies(), compute_bb_for_insn(), KEY_SCH::Compute_Kmin(), DAG_BUILDER::Compute_OPs_In(), cond_exec_process_if_block(), constrain_operands(), construct_exit_block(), Copy_Array(), Copy_Array_Section(), count_insns_for_constant(), cpp_interpret_integer(), cpp_token_as_text(), create_doloop(), create_imp_do_loops(), create_loop_notes(), ARA_LOOP_INFO::Create_Old_IF_Clause(), cse_cc_succs(), cvrt_exp_to_pdg(), cwh_io_split_io_items(), d_print_java_identifier(), dead_or_predicable(), delete_insn_and_edges(), delete_insn_chain_and_edges(), df_lr_bb_local_compute(), df_ref_bitmap(), dfs_push_decls(), REGIONAL_CFG::Do_Selective_Add(), do_xifdef(), dwarf_formstring(), elf_bfd_final_link(), WN_TREE_CONTAINER< order >::empty(), EMT_Emit_PU(), erase(), expand_call(), expand_case(), expand_end_case_type(), expand_fixup(), expand_movstr(), expand_start_do_loop(), f_end_com(), fei_doloop(), ffecom_char_args_x_(), ffecom_intrinsic_len_(), ffedata_advance_(), ffeste_io_impdo_(), ffeste_R909_start(), ffeste_R910_start(), ffeste_R911_start(), find_basic_blocks_1(), find_bb_boundaries(), find_loop_var_in_simple_ub(), find_main_ent(), find_matches(), find_reloads(), REGIONAL_CFG::Find_SEME_Nodes(), find_string_ent(), fixup_newlines(), flow_delete_block_noexpunge(), force_new_group(), generate_bytecode_insns(), get_last_bb_insn(), get_section_anchor(), get_shift_alg(), ggc_collect(), gimplify_asm_expr(), hash_string(), ia64_override_options(), insert_gclist(), insert_string(), is_mask(), iv_analyze(), iv_analyze_biv(), java_demangle_v3(), layout_superblocks(), CFG::LMV_clone_BB_LOOP(), lookup_register(), lower_bit_field_id(), lower_eoshift(), mark_flags_life_zones(), member_of(), merge_tlist(), Callback::Node_Select(), number_of_iterations_in_loop(), oasys_write_end(), override_options(), pa_can_combine_p(), parse_args(), parse_input_constraint(), paste_tokens(), pp_base_format(), preprocess_constraints(), prescan_loop(), print_rtl_graph_with_bb(), print_rtl_with_bb(), process_esd(), process_note_prediction(), prologue_stack_adjust(), read_derived(), read_ucnid(), record_effective_endpoints(), record_section(), KEY_SCH::register_allocation_init(), register_class(), regmove_optimize(), remove_invalid_subreg_refs(), resolve_input_conflict(), rtl_create_basic_block(), rtl_delete_block(), rtl_verify_flow_info_1(), safe_concat(), scan_linker_output(), scan_prog_file(), set_multilib_dir(), set_nonincremental_init_from_string(), set_scripts_dir(), set_section_start(), set_segment_start(), sh_elf_relocate_section(), Simd_Align_UB_Variable(), WN_TREE_CONTAINER< order >::size(), SNL_Optimize_Bounds(), squeeze_notes(), ssa_ccp_df_delete_unreachable_insns(), ssa_eliminate_dead_code(), sweep_pages(), KEY_SCH::tn_renaming(), try_simplify_condjump(), ucn_valid_in_identifier(), uw_frame_state_for(), validate_arglist(), vconcat_copy(), verify_flow_info(), verify_wide_reg(), vho_lower_do_loop(), VPARAMS(), WN_LOOP_UpperBound(), and xstormy16_split_move().
struct { ... } ucnranges[] [static] |
1.5.6