]> git.donarmstrong.com Git - lilypond.git/blob - lily/file-name-map.cc
* lily/lily-parser-scheme.cc: print mapped file name for progress
[lilypond.git] / lily / file-name-map.cc
1 /*
2   file-name-map.cc --  implement map_file_name()
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #include <map>
11
12 #include "file-name-map.hh"
13 #include "lily-guile.hh"
14
15 std::map<String, String> file_name_map_global;
16
17 String
18 map_file_name (String s)
19 {
20   if  (file_name_map_global.find (s) != file_name_map_global.end ())
21     {
22       s = file_name_map_global[s];
23     }
24   return s;
25 }
26
27 LY_DEFINE (ly_add_file_name_alist, "ly:add-file-name-alist",
28            1, 0, 0, (SCM alist),
29            "Add mappings for error messages from specified alist")
30 {
31   for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
32     {
33       SCM key = scm_caar (s);
34       SCM val = scm_cdar (s);
35
36       file_name_map_global[ly_scm2string (key)] = ly_scm2string (val);
37     }
38   return SCM_UNSPECIFIED;
39 }
40