osprey-gcc-4.2.0/libcpp/charset.c File Reference

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

Include dependency graph for charset.c:

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 ucharconvert_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 ucharconvert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit, struct _cpp_strbuf *tbuf, bool wide)
static const ucharconvert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit, struct _cpp_strbuf *tbuf, bool wide)
static const ucharconvert_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 Documentation

#define APPLY_CONVERSION ( CONVERTER,
FROM,
FLEN,
TO   )     CONVERTER.func (CONVERTER.cd, FROM, FLEN, TO)

Definition at line 592 of file charset.c.

#define convert_using_iconv   0

Definition at line 586 of file charset.c.

#define EILSEQ   EINVAL

Definition at line 92 of file charset.c.

#define iconv ( a,
b,
c,
d,
 )     (errno = EINVAL, (size_t)-1)

Definition at line 76 of file charset.c.

#define iconv_close (  )     (void)0

Definition at line 77 of file charset.c.

#define ICONV_CONST

Definition at line 78 of file charset.c.

#define iconv_open ( x,
 )     (errno = EINVAL, (iconv_t)-1)

Definition at line 75 of file charset.c.

#define LAST_POSSIBLY_BASIC_SOURCE_CHAR   0x7e

Definition at line 83 of file charset.c.

#define OUTBUF_BLOCK_SIZE   256

Definition at line 108 of file charset.c.

#define SOURCE_CHARSET   "UTF-8"

Definition at line 82 of file charset.c.


Enumeration Type Documentation

anonymous enum

Enumerator:
C99 
DIG 
CXX 
CID 
NFC 
NKC 
CTX 

Definition at line 789 of file charset.c.


Function Documentation

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   ) 

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  ) 

cpp_hashnode* _cpp_interpret_identifier ( cpp_reader pfile,
const uchar id,
size_t  len 
)

cppchar_t _cpp_valid_ucn ( cpp_reader pfile,
const uchar **  pstr,
const uchar limit,
int  identifier_pos,
struct normalize_state nst 
)

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]

static const uchar* convert_escape ( cpp_reader pfile,
const uchar from,
const uchar limit,
struct _cpp_strbuf tbuf,
bool  wide 
) [static]

static const uchar* convert_hex ( cpp_reader pfile,
const uchar from,
const uchar limit,
struct _cpp_strbuf tbuf,
bool  wide 
) [static]

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]

static const uchar* convert_ucn ( cpp_reader pfile,
const uchar from,
const uchar limit,
struct _cpp_strbuf tbuf,
bool  wide 
) [static]

static bool convert_utf16_utf8 ( iconv_t  cd,
const uchar from,
size_t  flen,
struct _cpp_strbuf to 
) [static]

Definition at line 520 of file charset.c.

References conversion_loop(), and one_utf16_to_utf8().

static bool convert_utf32_utf8 ( iconv_t  cd,
const uchar from,
size_t  flen,
struct _cpp_strbuf to 
) [static]

Definition at line 527 of file charset.c.

References conversion_loop(), and one_utf32_to_utf8().

static bool convert_utf8_utf16 ( iconv_t  cd,
const uchar from,
size_t  flen,
struct _cpp_strbuf to 
) [static]

Definition at line 506 of file charset.c.

References conversion_loop(), and one_utf8_to_utf16().

static bool convert_utf8_utf32 ( iconv_t  cd,
const uchar from,
size_t  flen,
struct _cpp_strbuf to 
) [static]

Definition at line 513 of file charset.c.

References conversion_loop(), and one_utf8_to_utf32().

cppchar_t cpp_host_to_exec_charset ( cpp_reader pfile,
cppchar_t  c 
)

void cpp_init_iconv ( cpp_reader pfile  ) 

cppchar_t cpp_interpret_charconst ( cpp_reader pfile,
const cpp_token token,
unsigned int *  pchars_seen,
int *  unsignedp 
)

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 void emit_numeric_escape ( cpp_reader pfile,
cppchar_t  n,
struct _cpp_strbuf tbuf,
bool  wide 
) [static]

static struct cset_converter init_iconv_desc ( cpp_reader pfile,
const char *  to,
const char *  from 
) [static, read]

static cppchar_t narrow_str_to_charconst ( cpp_reader pfile,
cpp_string  str,
unsigned int *  pchars_seen,
int *  unsignedp 
) [static]

static int one_cppchar_to_utf8 ( cppchar_t  c,
uchar **  outbufp,
size_t outbytesleftp 
) [inline, static]

Definition at line 229 of file charset.c.

References buf, outbuf, p, and uchar.

static int one_utf16_to_utf8 ( iconv_t  bigend,
const uchar **  inbufp,
size_t inbytesleftp,
uchar **  outbufp,
size_t outbytesleftp 
) [inline, static]

Definition at line 400 of file charset.c.

References EILSEQ, lo, one_cppchar_to_utf8(), s, and uchar.

static int one_utf32_to_utf8 ( iconv_t  bigend,
const uchar **  inbufp,
size_t inbytesleftp,
uchar **  outbufp,
size_t outbytesleftp 
) [inline, static]

Definition at line 307 of file charset.c.

References EILSEQ, one_cppchar_to_utf8(), s, and uchar.

static int one_utf8_to_cppchar ( const uchar **  inbufp,
size_t inbytesleftp,
cppchar_t cp 
) [inline, static]

Definition at line 169 of file charset.c.

References c, EILSEQ, i, n, and uchar.

static int one_utf8_to_utf16 ( iconv_t  bigend,
const uchar **  inbufp,
size_t inbytesleftp,
uchar **  outbufp,
size_t outbytesleftp 
) [inline, static]

Definition at line 337 of file charset.c.

References EILSEQ, lo, one_utf8_to_cppchar(), outbuf, s, and uchar.

static int one_utf8_to_utf32 ( iconv_t  bigend,
const uchar **  inbufp,
size_t inbytesleftp,
uchar **  outbufp,
size_t outbytesleftp 
) [inline, static]

Definition at line 280 of file charset.c.

References one_utf8_to_cppchar(), outbuf, s, and uchar.

static int ucn_valid_in_identifier ( cpp_reader pfile,
cppchar_t  c,
struct normalize_state nst 
) [static]

static cppchar_t wide_str_to_charconst ( cpp_reader pfile,
cpp_string  str,
unsigned int *  pchars_seen,
int *  unsignedp 
) [static]

static size_t width_to_mask ( size_t  width  )  [inline, static]

Definition at line 779 of file charset.c.

References BITS_PER_CPPCHAR_T, CHAR_BIT, MIN, and size_t.


Variable Documentation

unsigned char combine

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 },
}

Definition at line 601 of file charset.c.

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().

unsigned char flags

Definition at line 808 of file charset.c.

struct { ... } ucnranges[] [static]


Generated on Wed Apr 8 14:23:16 2009 for Open64 by  doxygen 1.5.6