2 source.cc -- implement Sources
4 source file of the LilyPond music typesetter
6 (c) 1997--2003 Han-Wen Nienhuys <hanwen@cs.uu.nl>
12 #include "killing-cons.tcc"
14 #include "flower-proto.hh"
15 #include "source-file.hh"
17 #include "file-path.hh"
21 sourcefile_p_list_
= 0;
27 Sources::set_binary (bool bo
)
33 Sources::set_path (File_path
*f
)
41 @param file_string the file to be opened, name might be changed if it
42 is found in a search path. UGH!
44 @return 0 if no file found
47 Sources::get_file (String
&file_string
) //UGH
49 if ((file_string
!= "-") && path_C_
)
51 String file_string_o
= path_C_
->find (file_string
);
52 if ((file_string_o
== "") && (file_string
!= ""))
54 file_string
= file_string_o
;
56 Source_file
* f
= new Source_file (file_string
) ;
62 Sources::add (Source_file
* sourcefile
)
64 sourcefile_p_list_
= new Killing_cons
<Source_file
> (sourcefile
, sourcefile_p_list_
);
69 delete sourcefile_p_list_
;
72 search the list for file whose map contains pointer #str0#
74 @return 0 if not found.
77 Sources::get_sourcefile (char const* str0
)
80 for (Cons
<Source_file
> *i
= sourcefile_p_list_
; i
; i
= i
->next_
)
81 if (i
->car_
->in_b (str0
))