#include "version.hh"
#include "dimensions.hh"
#include "main.hh"
+#include "file-path.hh"
/* MacOS S fix:
source-file.hh includes cmath which undefines isinf and isnan
#endif
+
+LY_DEFINE (ly_find_file, "ly:find-file",
+ 1, 0, 0, (SCM name),
+ "Return the absolute file name of @var{name}, "
+ "or @code{#f} if not found.")
+{
+ SCM_ASSERT_TYPE (scm_is_string (name), name, SCM_ARG1, __FUNCTION__, "string");
+
+ String nm = ly_scm2string (name);
+ String file_name = global_path.find (nm);
+ if (file_name.is_empty ())
+ return SCM_BOOL_F;
+
+ return scm_makfrom0str (file_name.to_str0 ());
+}
+
/*
Ugh. Gulped file is copied twice. (maybe thrice if you count stdio
buffering.)
{
SCM_ASSERT_TYPE (scm_is_string (string), string, SCM_ARG1,
__FUNCTION__, "string");
- return scm_makfrom0str (gettext (scm_i_string_chars (string)));
+ return scm_makfrom0str (_ (scm_i_string_chars (string)).to_str0 ());
}
LY_DEFINE (ly_output_backend, "ly:output-backend",