+/** Same as libFileSearch(), but tries first to find a preferred
+ version of the file by appending the icon set name to the dir
+ */
+FileName const
+imageLibFileSearch(std::string & dir, std::string const & name,
+ std::string const & ext = std::string(),
+ search_mode mode = must_exist);
+
+/// How to quote a filename
+enum quote_style {
+ /** Quote for the (OS dependant) shell. This is needed for command
+ line arguments of subprocesses. */
+ quote_shell,
+ /** Quote a file name for the (OS dependant) shell. This is needed
+ for file names as command line arguments of subprocesses. */
+ quote_shell_filename,
+ /** Quote for python. Use this if you want to store a filename in a
+ python script. Example: \code
+ os << "infile = " << quoteName(filename) << '\\n';
+ \endcode This uses double quotes, so that you can also use this
+ to quote filenames as part of a string if the string is quoted
+ with single quotes. */
+ quote_python
+};
+
+/** Takes a command such as "python $$s/scripts/convertDefault.py file.in file.out"
+ * and replaces "$$s/" with the path to the LyX support directory containing
+ * this script. If the script is not found, "$$s/" is removed. Executing the
+ * command will still fail, but the error message will make some sort of
+ * sense ;-)
+ */
+std::string const commandPrep(std::string const & command);
+
+enum latex_path_extension {
+ PROTECT_EXTENSION,
+ EXCLUDE_EXTENSION
+};
+
+enum latex_path_dots {
+ LEAVE_DOTS,
+ ESCAPE_DOTS
+};
+
+/** @param path a file path in internal_path format. Ie, directories
+ * are indicated by '/', not by '\'.
+ *
+ * Manipulates @c path into a form suitable for inclusion in a LaTeX
+ * document.
+ * If @c path contains LaTeX special characters, these are escaped.
+ * Eg, '~' -> '\\string~'
+ * If @c path contains spaces, then the returned path is enclosed in
+ * "-quotes. This last fix will lead to successful compiliation of the
+ * LaTeX file only if a sufficiently modern LaTeX compiler is used.
+ * If @c ext == EXCLUDE_EXTENSION the extension is left outside the quotes.
+ * This is needed for pdfeTeX, Version 3.141592-1.21a-2.2 (Web2C 7.5.4)
+ * (format=pdflatex 2005.4.11) in combination with
+ * pdftex.def 2002/06/19 v0.03k graphics/color for pdftex:
+ * It does not recognize the file extension if it is inside the quotes.
+ * If @c dots == ESCAPE_DOTS dots in the filename are replaced by
+ * "\\lyxdot ". This is needed for the \\includegraphics command if the
+ * automatic format selection is used.
+ */
+std::string const latex_path(std::string const & path,
+ latex_path_extension extension = PROTECT_EXTENSION,
+ latex_path_dots dots = LEAVE_DOTS);