+/* guile-irrlicht --- GNU Guile bindings for Irrlicht Engine
+
+ Copyright (C) 2020 Javier Sancho <jsf@jsancho.org>
+
+ This file is part of guile-irrlicht.
+
+ guile-irrlicht is free software; you can redistribute it and/or modify
+ it under the terms of the GNU Lesser General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
+
+ guile-irrlicht is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with guile-irrlicht. If not, see
+ <http://www.gnu.org/licenses/>.
+*/
+
+#include <irrlicht/irrlicht.h>
+#include <libguile.h>
+#include "misc.h"
+#include "video-driver.h"
+#include "wchar.h"
+
+extern "C" {
+
+ void
+ init_misc (void)
+ {
+ scm_c_define_gsubr ("get-name", 1, 0, 0, (scm_t_subr)irr_getName);
+ scm_c_export ("get-name", NULL);
+ }
+
+ SCM
+ irr_getName (SCM wrapped_obj)
+ {
+ if (video_driver_p (wrapped_obj))
+ {
+ return scm_from_wide_char_string (unwrap_video_driver (wrapped_obj)->getName ());
+ }
+ else
+ {
+ scm_error (scm_arg_type_key, NULL, "Cannot get name from object: ~S",
+ scm_list_1 (wrapped_obj), scm_list_1 (wrapped_obj));
+ }
+ }
+
+}