X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsources.cc;h=5d865fe706e565e1fa03365a24daa3ee3174a8a3;hb=97a0169312a260933246ab224e4f8b0969871dd5;hp=b42300f47a7efc081ec34686f533088d7b1cc9bc;hpb=c054eb280fd9953596eb164f67b0f9d5555c5a32;p=lilypond.git diff --git a/lily/sources.cc b/lily/sources.cc index b42300f47a..5d865fe706 100644 --- a/lily/sources.cc +++ b/lily/sources.cc @@ -86,3 +86,28 @@ Sources::~Sources () } } +#include "lily-parser.hh" +#include "lily-lexer.hh" +#include "lily-imports.hh" +#include "fluid.hh" + +LY_DEFINE (ly_source_files, "ly:source-files", 0, 1, 0, + (SCM parser_smob), + "A list of LilyPond files being processed;" + "a PARSER may optionally be specified.") +{ + + if (SCM_UNBNDP (parser_smob)) + parser_smob = scm_fluid_ref (Lily::f_parser); + Lily_parser *parser = LY_ASSERT_SMOB (Lily_parser, parser_smob, 1); + Includable_lexer *lex = parser->lexer_; + + SCM lst = SCM_EOL; + for (vector::const_iterator + i = lex->file_name_strings_.begin(); + i != lex->file_name_strings_.end(); ++i) + { + lst = scm_cons (ly_string2scm (*i), lst); + } + return scm_reverse_x (lst, SCM_EOL); +}