* mu-guile-common.[ch]: add support for showing GErrors
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
@ -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__*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user