Exemplo n.º 1
0
Arquivo: snd.c Projeto: huangjs/cl
void mus_error_to_snd(int type, char *msg)
{
  /* it's possible to get here outside any catch, and in Guile a throw in that case
   *   kills the main program!
   */
  if (!ss)
    {
      fprintf(stderr, msg);
      return;
    }
  if (!(ignore_mus_error(type, msg)))
    {
      if (ss->catch_exists)
	{
	  if (msg == NULL)
	    XEN_ERROR(XEN_ERROR_TYPE("mus-error"),
		      XEN_LIST_1(C_TO_XEN_STRING((char *)mus_error_type_to_string(type))));
	  else XEN_ERROR(XEN_ERROR_TYPE("mus-error"),
			 XEN_LIST_1(C_TO_XEN_STRING(msg)));
	}
      else
	{
	  snd_error("%s: %s", mus_error_type_to_string(type), msg);
#if HAVE_SETJMP_H
	  ss->jump_ok = true;
	  top_level_catch(1); /* sigh -- try to keep going */
#endif
	}
    }
}
Exemplo n.º 2
0
int snd_file_open_descriptors(int fd, const char *name, int format, mus_long_t location, int chans, int type)
{
  int sl_err = MUS_NO_ERROR;
  sl_err = mus_file_open_descriptors(fd, name, format, mus_bytes_per_sample(format), location, chans, type);
  if (sl_err != MUS_NO_ERROR)
    snd_warning("%s: open file descriptors: %s", name, mus_error_type_to_string(sl_err));
  return(sl_err);
}
Exemplo n.º 3
0
static Xen g_mus_error_type_to_string(Xen err)
{
  #define H_mus_error_type_to_string "(" S_mus_error_type_to_string " err): string description of err (a sndlib error type)"
  Xen_check_type(Xen_is_integer(err), err, 1, S_mus_error_type_to_string, "an integer");
  return(C_string_to_Xen_string((char *)mus_error_type_to_string(Xen_integer_to_C_int(err))));
}