* mu-guile-common.[ch]: add support for showing GErrors

This commit is contained in:
Dirk-Jan C. Binnema
2011-07-15 23:50:37 +03:00
parent aeff372157
commit 68eb63e0c6
2 changed files with 22 additions and 7 deletions

View File

@ -28,3 +28,14 @@ mu_guile_error (const char *func_name, int status,
scm_from_utf8_string (fmt), args,
scm_list_1 (scm_from_int (status)));
}
void
mu_guile_g_error (const char *func_name, GError *err)
{
scm_error_scm (scm_from_locale_symbol ("MuError"),
scm_from_utf8_string (func_name),
scm_from_utf8_string (err->message),
SCM_UNDEFINED, SCM_UNDEFINED);
}

View File

@ -21,11 +21,9 @@
#define __MU_GUILE_UTILS_H__
#include <libguile.h>
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif /*__cplusplus*/
G_BEGIN_DECLS
/**
*
@ -38,10 +36,16 @@ extern "C" {
void mu_guile_error (const char *func_name, int status,
const char *fmt, SCM args);
#ifdef __cplusplus
}
#endif /*__cplusplus*/
/**
* display a GError as a Guile error
*
* @param func_name function name
* @param err Gerror
*/
void mu_guile_g_error (const char *func_name, GError *err);
G_END_DECLS
#endif /*__MU_GUILE_UTILS_H__*/