]> git.donarmstrong.com Git - lilypond.git/blob - lily/file-name-map.cc
Nitpick run.
[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 #include <map>
10
11 #include "file-name-map.hh"
12 #include "lily-guile.hh"
13
14 std::map<String, String> file_name_map_global;
15
16 String
17 map_file_name (String s)
18 {
19   if (file_name_map_global.find (s) != file_name_map_global.end ())
20     s = file_name_map_global[s];
21   return s;
22 }
23
24 LY_DEFINE (ly_add_file_name_alist, "ly:add-file-name-alist",
25            1, 0, 0, (SCM alist),
26            "Add mappings for error messages from specified alist")
27 {
28   for (SCM s = alist; scm_is_pair (s); s = scm_cdr (s))
29     {
30       SCM key = scm_caar (s);
31       SCM val = scm_cdar (s);
32
33       file_name_map_global[ly_scm2string (key)] = ly_scm2string (val);
34     }
35   return SCM_UNSPECIFIED;
36 }
37