/* Outputs a formatted message via the error message handler. The default handler simply outputs the message to stderr, without appending a trailing new-line character. Typically, @format should end with its own new-line character. */
void g_printerr(const gchar *format,...)
/* Outputs a formatted message via the error message handler. The default handler simply outputs the message to stderr, without appending a trailing new-line character. Typically, @format should end with its own new-line character. */
void g_printerr(const gchar *format,...)
{
  va_list args;
  gchar *string;
  GPrintFunc local_glib_printerr_func;
  g_return_if_fail (format != NULL);
  va_start (args, format);
  string = g_strdup_vprintf (format, args);
  va_end (args);
  g_mutex_lock (&g_messages_lock);
  local_glib_printerr_func = glib_printerr_func;
  g_mutex_unlock (&g_messages_lock);
  if (local_glib_printerr_func)
    local_glib_printerr_func (string);
  else
    {
      const gchar *charset;
      if (g_get_charset (&charset))
        fputs (string, stderr);
      else
        {
          gchar *lstring = strdup_convert (string, charset);
          fputs (lstring, stderr);
          g_free (lstring);
        }
      fflush (stderr);
    }
  g_free (string);
}