X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsources.cc;h=5d865fe706e565e1fa03365a24daa3ee3174a8a3;hb=926115ff42def8bc1ce767029e4f03c8072994ba;hp=9201010b120ea900a81e352d70d595238f84ffde;hpb=1de3d397c18622b6061402fef18e625701712bc5;p=lilypond.git diff --git a/lily/sources.cc b/lily/sources.cc index 9201010b12..5d865fe706 100644 --- a/lily/sources.cc +++ b/lily/sources.cc @@ -24,8 +24,6 @@ #include "file-name.hh" #include "file-path.hh" -using std::string; - Sources::Sources () { path_ = 0; @@ -88,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); +}