#include "file-name.hh"
#include "string-convert.hh"
+LY_DEFINE (ly_start_environment, "ly:start-environment",
+ 0, 0, 0, (),
+ "Return the environment, a list of strings, that was in effect at program start")
+{
+ SCM l = SCM_EOL;
+ SCM *tail = &l;
+
+ for (vsize i = 0; i < start_environment_global.size (); i++)
+ {
+ *tail = scm_cons (ly_string2scm (start_environment_global[i]),
+ SCM_EOL);
+ tail = SCM_CDRLOC(*tail);
+ }
+
+ return l;
+}
+
+
LY_DEFINE (ly_find_file, "ly:find-file",
1, 0, 0, (SCM name),
"Return the absolute file name of @var{name}, "
"Return value if KEY in ALIST, else DEFAULT-VALUE "
"(or #f if not specified).")
{
+ LY_ASSERT_TYPE(ly_cheap_is_list, alist, 2);
+
SCM handle = scm_assoc (key, alist);
if (scm_is_pair (handle))
return scm_cdr (handle);
LY_DEFINE (ly_string_substitute, "ly:string-substitute",
3, 0, 0, (SCM a, SCM b, SCM s),
- "Replace @var{a} by @var{b} in @var{s}.")
+ "Replace string @var{a} by string @var{b} in string @var{s}.")
{
LY_ASSERT_TYPE (scm_is_string, s, 1);
LY_ASSERT_TYPE (scm_is_string, b, 2);
return ly_string2scm (_ (scm_i_string_chars (string)));
}
-LY_DEFINE (ly_output_backend, "ly:output-backend",
- 0, 0, 0, (),
- "Return name of output backend.")
-{
- return ly_string2scm (output_backend_global);
-}
-
LY_DEFINE (ly_output_formats, "ly:output-formats",
0, 0, 0, (),
"Formats passed to --format as a list of strings, "
0, 0, 0, (),
"Return effective prefix.")
{
- return ly_string2scm (prefix_directory);
+ return ly_string2scm (lilypond_datadir);
}
LY_DEFINE (ly_chain_assoc_get, "ly:chain-assoc-get",