contrib/gdb-7/gdb/utils.c
static int
host_char_to_target (struct gdbarch *gdbarch, int c, int *target_c)
{
  struct obstack host_data;
  char the_char = c;
  struct cleanup *cleanups;
  int result = 0;

  obstack_init (&host_data);
  cleanups = make_cleanup_obstack_free (&host_data);

  convert_between_encodings (target_charset (gdbarch), host_charset (),
			     &the_char, 1, 1, &host_data, translit_none);

  if (obstack_object_size (&host_data) == 1)
    {
      result = 1;
      *target_c = *(char *) obstack_base (&host_data);
    }

  do_cleanups (cleanups);
  return result;
}
/* A helper for parse_escape that converts a host character to a
   target character.  C is the host character.  If conversion is
   possible, then the target character is stored in *TARGET_C and the
   function returns 1.  Otherwise, the function returns 0.  */
A helper for parse_escape that converts a host character to a
target character.  C is the host character.  If conversion is
possible, then the target character is stored in *TARGET_C and the
function returns 1.  Otherwise, the function returns 0.
A helper for parse_escape that converts a host character to a target character . C is the host character . If conversion is possible then the target character is stored in * TARGET_C and the function returns 1 . Otherwise the function returns 0 .
static int
host_char_to_target (struct gdbarch *gdbarch, int c, int *target_c)
{
  struct obstack host_data;
  char the_char = c;
  struct cleanup *cleanups;
  int result = 0;
  obstack_init (&host_data);
  cleanups = make_cleanup_obstack_free (&host_data);
  convert_between_encodings (target_charset (gdbarch), host_charset (),
			     &the_char, 1, 1, &host_data, translit_none);
  if (obstack_object_size (&host_data) == 1)
    {
      result = 1;
      *target_c = *(char *) obstack_base (&host_data);
    }
  do_cleanups (cleanups);
  return result;
}
static int host_char_to_target ( struct gdbarch * gdbarch , int c , int * target_c ) { struct obstack host_data ; char the_char = c ; struct cleanup * cleanups ; int result = 0 ; obstack_init ( & host_data ) ; cleanups = make_cleanup_obstack_free ( & host_data ) ; convert_between_encodings ( target_charset ( gdbarch ) , host_charset ( ) , & the_char , 1 , 1 , & host_data , translit_none ) ; if ( obstack_object_size ( & host_data ) == 1 ) { result = 1 ; * target_c = * ( char * ) obstack_base ( & host_data ) ; } do_cleanups ( cleanups ) ; return result ; }
A helper for parse_escape that converts a host character to a
target character.
A helper for parse_escape that converts a host character to a target character .